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
public class OffloadingBrowserClient extends CQClient
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.adobe.cq.testing.client.CQClient
CQClient.Builder, CQClient.InternalBuilder<T extends CQClient>
-
-
Field Summary
Fields Modifier and Type Field Description static String
CLUSTER_KEY
static String
IP_KEY
static org.slf4j.Logger
LOG
static String
OFFLOADING_BROWSER_JSON_LIST_URL
static String
OFFLOADING_CONFIG_URL
static String
OFFLOADING_TOPIC
static String
PORT_KEY
static String
SLING_ID_KEY
-
Fields inherited from class com.adobe.cq.testing.client.CQClient
STATISTICS_ROOT, wcmCommands
-
-
Constructor Summary
Constructors Constructor Description OffloadingBrowserClient(URI serverUrl, String user, String password)
OffloadingBrowserClient(org.apache.http.impl.client.CloseableHttpClient http, org.apache.sling.testing.clients.SlingClientConfig config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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.Set<OffloadingInstanceConfiguration>
getAllInstances()
Returns a set of the instance descriptors of all the existing instancesOffloadingInstanceConfiguration
getInstance(String slingId)
Returns the instance descriptor for the given Sling ID, or null if it doesn't exist-
Methods 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 Detail
-
LOG
public static final org.slf4j.Logger LOG
-
OFFLOADING_BROWSER_JSON_LIST_URL
public static final String OFFLOADING_BROWSER_JSON_LIST_URL
- See Also:
- Constant Field Values
-
OFFLOADING_CONFIG_URL
public static final String OFFLOADING_CONFIG_URL
- See Also:
- Constant Field Values
-
SLING_ID_KEY
public static final String SLING_ID_KEY
- See Also:
- Constant Field Values
-
IP_KEY
public static final String IP_KEY
- See Also:
- Constant Field Values
-
PORT_KEY
public static final String PORT_KEY
- See Also:
- Constant Field Values
-
CLUSTER_KEY
public static final String CLUSTER_KEY
- See Also:
- Constant Field Values
-
OFFLOADING_TOPIC
public static final String OFFLOADING_TOPIC
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
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
-
-
Method Detail
-
getAllInstances
public Set<OffloadingInstanceConfiguration> getAllInstances() throws org.apache.sling.testing.clients.ClientException
Returns 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
-
-