Class OffloadingBrowserClient
java.lang.Object
org.apache.sling.testing.clients.AbstractSlingClient
org.apache.sling.testing.clients.SlingClient
com.adobe.cq.testing.client.CQClient
com.adobe.cq.testing.client.offloading.OffloadingBrowserClient
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.apache.http.client.HttpClient
-
Nested Class Summary
Nested classes/interfaces inherited from class com.adobe.cq.testing.client.CQClient
CQClient.Builder, CQClient.InternalBuilder<T extends CQClient>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final org.slf4j.Logger
static final String
static final String
static final String
static final String
static final String
Fields inherited from class com.adobe.cq.testing.client.CQClient
STATISTICS_ROOT, wcmCommands
Fields inherited from class org.apache.sling.testing.clients.SlingClient
CLIENT_CONNECTION_TIMEOUT_PROP, DEFAULT_NODE_TYPE, SUDO_COOKIE_NAME
-
Constructor Summary
ConstructorDescriptionOffloadingBrowserClient
(URI serverUrl, String user, String password) OffloadingBrowserClient
(org.apache.http.impl.client.CloseableHttpClient http, org.apache.sling.testing.clients.SlingClientConfig config) -
Method Summary
Modifier and TypeMethodDescriptionvoid
enableDisableTopic
(String slingId, String topic, boolean enable) Enables/ disables a topic for the given slingId.void
enableDisableTopicWithWait
(String slingId, String topic, boolean enable, long timeout) Enables/ disables a topic for the given slingId.Returns a set of the instance descriptors of all the existing instancesgetInstance
(String slingId) Returns the instance descriptor for the given Sling ID, or null if it doesn't existMethods inherited from class com.adobe.cq.testing.client.CQClient
copyLanguages, copyPage, createPage, createPageWithRetry, createVersion, deletePage, deletePageWithRetry, getAuthorSitesPage, lockPage, movePage, movePage, pageExists, pageExistsWithRetry, pageExistsWithRetry, resetPageStatistics, restoreTree, restoreVersion, rolloutPage, searchAndReplaceInPages, searchInPages, setPageProperties, setPageProperty, setPagePropertyImage, unlockPage, uploadFileCQStyle
Methods inherited from class org.apache.sling.testing.clients.SlingClient
createFolder, createNode, createNodeRecursive, deletePath, doGetJson, endImpersonation, exists, getJsonNode, getJsonNode, getNodeNameFromPath, getParentPath, getUser, getUUId, getUUID, impersonate, importContent, importContent, importJson, move, setPropertiesString, setPropertyString, setPropertyStringArray, upload, waitExists, waitUntilExists
Methods inherited from class org.apache.sling.testing.clients.AbstractSlingClient
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, getValue, getValues, hasValue
-
Field Details
-
LOG
public static final org.slf4j.Logger LOG -
OFFLOADING_BROWSER_JSON_LIST_URL
- See Also:
-
OFFLOADING_CONFIG_URL
- See Also:
-
SLING_ID_KEY
- See Also:
-
IP_KEY
- See Also:
-
PORT_KEY
- See Also:
-
CLUSTER_KEY
- See Also:
-
OFFLOADING_TOPIC
- See Also:
-
-
Constructor Details
-
OffloadingBrowserClient
public OffloadingBrowserClient(org.apache.http.impl.client.CloseableHttpClient http, org.apache.sling.testing.clients.SlingClientConfig config) throws org.apache.sling.testing.clients.ClientException - Throws:
org.apache.sling.testing.clients.ClientException
-
OffloadingBrowserClient
public OffloadingBrowserClient(URI serverUrl, String user, String password) throws org.apache.sling.testing.clients.ClientException - Throws:
org.apache.sling.testing.clients.ClientException
-
-
Method Details
-
getAllInstances
public Set<OffloadingInstanceConfiguration> getAllInstances() throws org.apache.sling.testing.clients.ClientExceptionReturns a set of the instance descriptors of all the existing instances- Returns:
- all the existing instances
- Throws:
org.apache.sling.testing.clients.ClientException
- if the call to the backend fails
-
getInstance
public OffloadingInstanceConfiguration getInstance(String slingId) throws org.apache.sling.testing.clients.ClientException Returns the instance descriptor for the given Sling ID, or null if it doesn't exist- Parameters:
slingId
- id of the instance- Returns:
- the instance descriptor
- Throws:
org.apache.sling.testing.clients.ClientException
- if the call to the backend fails
-
enableDisableTopic
public void enableDisableTopic(String slingId, String topic, boolean enable) throws org.apache.sling.testing.clients.ClientException Enables/ disables a topic for the given slingId. This method is asynchronous, it does not wait for the configuration change to be applied.- Parameters:
slingId
- id of the instancetopic
- topic to enable/disableenable
- enable or disable- Throws:
org.apache.sling.testing.clients.ClientException
- if the HTTP call to the backend fails
-
enableDisableTopicWithWait
public void enableDisableTopicWithWait(String slingId, String topic, boolean enable, long timeout) throws org.apache.sling.testing.clients.ClientException, InterruptedException Enables/ disables a topic for the given slingId. This method checks periodically until the topic was enabled/disabled in the OffloadingBrowser with timeout. If the change was not visible after timeout, throws ClientException- Parameters:
slingId
- id of the instancetopic
- topic to enable/disableenable
- enable or disabletimeout
- number of milliseconds to wait for the topic configuration to be updated- Throws:
org.apache.sling.testing.clients.ClientException
- if the action did not register with the OffloadingBrowser before timeoutInterruptedException
- if the method was interrupted
-