public class NotificationClient extends CQClient
CQClient
which in turn provides a core set of
commonly used website and page functionality.CQClient.Builder, CQClient.InternalBuilder<T extends CQClient>
Modifier and Type | Field and Description |
---|---|
static String |
NOTIFICATION_ACTION_ACTIVATE |
static String |
NOTIFICATION_ACTION_DEACTIVATE |
static String |
NOTIFICATION_ACTION_DELETE |
static String |
NOTIFICATION_ACTION_PAGE_CREATED |
static String |
NOTIFICATION_ACTION_PAGE_DELETED |
static String |
NOTIFICATION_ACTION_PAGE_MODIFIED |
static String |
NOTIFICATION_ACTION_PAGE_ROLLED_OUT |
static String |
NOTIFICATION_CHANNEL_EMAIL |
static String |
NOTIFICATION_CHANNEL_INBOX |
static String |
NOTIFICATION_CONFIG_PATH |
static String |
NOTIFICATION_INBOX_PATH |
static String |
NOTIFICATION_MESSAGES_PATH |
static String |
NOTIFICATIONS_SUBSCRIPTIONS_PATH |
LOG, STATISTICS_ROOT, wcmCommands
Constructor and Description |
---|
NotificationClient(org.apache.http.impl.client.CloseableHttpClient http,
org.apache.sling.testing.clients.SlingClientConfig config) |
NotificationClient(URI serverUrl,
String user,
String password) |
Modifier and Type | Method and Description |
---|---|
org.apache.sling.testing.clients.SlingHttpResponse |
approveNotification(Notification notification,
int... expectedStatus)
Approve a notification message (mark it as read)
|
org.apache.sling.testing.clients.SlingHttpResponse |
configNotifications(String channel,
String[] actions,
String packages,
int... expectedStatus)
Set a notification subscription
|
void |
deleteAllNotifications()
Delete all the notification messages
|
org.apache.sling.testing.clients.SlingHttpResponse |
deleteNotification(Notification notification,
int... expectedStatus)
Delete a notification message
|
void |
deleteNotifications(ArrayList<Notification> notifications,
int... expectedStatus)
Delete a list notification messages
|
ArrayList<String> |
getAvailableNotificationAction()
Get the list of available action to be notified for.
|
org.apache.sling.testing.clients.SlingHttpResponse |
getNotificationInboxPage(int... expectedStatus)
Get the notification inbox html page
|
ArrayList<Notification> |
getNotificationMessages()
Get all the existing notification messages.
|
ArrayList<Notification> |
getNotificationMessages(int start,
int limit)
Get all the existing notification messages.
|
org.apache.sling.testing.clients.SlingHttpResponse |
performAction(Notification notification,
String action,
int... expectedStatus)
Do an action on a notification message (delete/approve)
|
void |
resetConfig()
Delete any existing subscription
|
copyLanguages, copyPage, createPage, createPageWithRetry, createVersion, deletePage, deletePageWithRetry, lockPage, movePage, movePage, resetPageStatistics, restoreTree, restoreVersion, rolloutPage, searchAndReplaceInPages, searchInPages, setPageProperties, setPageProperty, setPagePropertyImage, unlockPage, uploadAsset, uploadFileCQStyle
createFolder, createNode, createNodeRecursive, deletePath, doGetJson, exists, getJsonNode, getJsonNode, getNodeNameFromPath, getParentPath, getUUId, getUUID, importContent, importContent, importJson, move, setPropertiesString, setPropertyString, setPropertyStringArray, upload, waitExists, waitUntilExists
adaptTo, addValue, close, doDelete, doGet, doGet, doGet, doHead, doPatch, doPost, doPost, doPut, doRawRequest, doRequest, doStreamGet, doStreamPost, doStreamRequest, execute, execute, execute, execute, execute, execute, execute, execute, getClientId, getConnectionManager, getCookieStore, getCredentialsProvider, getParams, getPassword, getPath, getPath, getUrl, getUrl, getUrl, getUser, getValue, getValues, hasValue
public static final String NOTIFICATION_INBOX_PATH
public static final String NOTIFICATION_CHANNEL_INBOX
public static final String NOTIFICATION_CHANNEL_EMAIL
public static final String NOTIFICATION_CONFIG_PATH
public static final String NOTIFICATIONS_SUBSCRIPTIONS_PATH
public static final String NOTIFICATION_MESSAGES_PATH
public static final String NOTIFICATION_ACTION_ACTIVATE
public static final String NOTIFICATION_ACTION_DEACTIVATE
public static final String NOTIFICATION_ACTION_DELETE
public static final String NOTIFICATION_ACTION_PAGE_MODIFIED
public static final String NOTIFICATION_ACTION_PAGE_CREATED
public static final String NOTIFICATION_ACTION_PAGE_DELETED
public static final String NOTIFICATION_ACTION_PAGE_ROLLED_OUT
public NotificationClient(org.apache.http.impl.client.CloseableHttpClient http, org.apache.sling.testing.clients.SlingClientConfig config) throws org.apache.sling.testing.clients.ClientException
org.apache.sling.testing.clients.ClientException
public ArrayList<String> getAvailableNotificationAction() throws org.apache.sling.testing.clients.ClientException
org.apache.sling.testing.clients.ClientException
- If something fails during request/response cyclepublic ArrayList<Notification> getNotificationMessages() throws org.apache.sling.testing.clients.ClientException
org.apache.sling.testing.clients.ClientException
- If something fails during request/response cyclepublic ArrayList<Notification> getNotificationMessages(int start, int limit) throws org.apache.sling.testing.clients.ClientException
start
- first notificationlimit
- max notificationsorg.apache.sling.testing.clients.ClientException
- If something fails during request/response cyclepublic void resetConfig() throws org.apache.sling.testing.clients.ClientException
org.apache.sling.testing.clients.ClientException
- If something fails during request/response cyclepublic org.apache.sling.testing.clients.SlingHttpResponse configNotifications(String channel, String[] actions, String packages, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
channel
- The type of notification (for now only "inbox")actions
- The list of actions to be notified forpackages
- The paths to surveyexpectedStatus
- list of allowed HTTP Status to be returned. If not set, http status 200 (OK) is assumed.org.apache.sling.testing.clients.ClientException
- If something fails during request/response cyclepublic org.apache.sling.testing.clients.SlingHttpResponse getNotificationInboxPage(int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
expectedStatus
- list of allowed HTTP Status to be returned. If not set,
http status 200 (OK) is assumed.org.apache.sling.testing.clients.ClientException
- If something fails during request/response cyclepublic org.apache.sling.testing.clients.SlingHttpResponse approveNotification(Notification notification, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
notification
- The notification message to approveexpectedStatus
- list of allowed HTTP Status to be returned. If not set,
http status 200 (OK) is assumed.org.apache.sling.testing.clients.ClientException
- If something fails during request/response cyclepublic org.apache.sling.testing.clients.SlingHttpResponse deleteNotification(Notification notification, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
notification
- The notification message to deleteexpectedStatus
- list of allowed HTTP Status to be returned. If not set,
http status 200 (OK) is assumed.org.apache.sling.testing.clients.ClientException
- If something fails during request/response cyclepublic void deleteNotifications(ArrayList<Notification> notifications, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
notifications
- The notification messages to deleteexpectedStatus
- list of allowed HTTP Status to be returned. If not set,
http status 200 (OK) is assumed.org.apache.sling.testing.clients.ClientException
- If something fails during request/response cyclepublic void deleteAllNotifications() throws org.apache.sling.testing.clients.ClientException
org.apache.sling.testing.clients.ClientException
- If something fails during request/response cyclepublic org.apache.sling.testing.clients.SlingHttpResponse performAction(Notification notification, String action, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
notification
- The notification message to apply the action toaction
- Action to perform (for now delete/approve)expectedStatus
- list of allowed HTTP Status to be returned. If not set,
http status 200 (OK) is assumed.org.apache.sling.testing.clients.ClientException
- If something fails during request/response cycleCopyright © 2018. All rights reserved.