public class TopologyClient extends CQClient
CQClient.Builder, CQClient.InternalBuilder<T extends CQClient>
Modifier and Type | Field and Description |
---|---|
static String |
CLUSTER_VIEW_PATH |
static String |
CONNECTOR_URLS_PATH |
static String |
DEFAULT_CONNECTOR_PATH |
static String |
QE_SLINGSETTINGS_SERVLET_PATH |
static String |
QE_TOPOLOGY_SERVLET_PATH |
static String |
UTF_8 |
STATISTICS_ROOT, wcmCommands
Constructor and Description |
---|
TopologyClient(org.apache.http.impl.client.CloseableHttpClient http,
org.apache.sling.testing.clients.SlingClientConfig config) |
TopologyClient(URI serverUrl,
String user,
String password) |
Modifier and Type | Method and Description |
---|---|
Set<String> |
getConnectorUrls()
Get the set of connector URLs configured for the discovery service
|
Set<String> |
getConnectorUrlsWithWait(long timeout)
Get the set of connector URLs configured for the discovery service.
|
String |
getSlingId() |
boolean |
joinTopology(String baseUrl)
Join a topology by adding the connector url to the discovery configuration
|
boolean |
joinTopology(String baseUrl,
String connectorPath)
Join a topology by adding the connector url to the discovery configuration
|
boolean |
joinTopologyWithWait(String baseUrl,
long timeout)
Join a topology by adding the connector url to the discovery configuration.
|
boolean |
joinTopologyWithWait(String baseUrl,
String connectorPath,
long timeout)
Join a topology by adding the connector url to the discovery configuration.
|
boolean |
leaveTopology(String baseUrl)
Leave a topology by removing a connector URL from the discovery configuration
|
boolean |
leaveTopology(String baseUrl,
String connectorPath)
Leave a topology by removing a connector URL from the discovery configuration
|
boolean |
leaveTopologyWithWait(String baseUrl,
long timeout)
Leave a topology by removing a connector URL from the discovery configuration
This method waits and retries until the topology is current
|
boolean |
leaveTopologyWithWait(String baseUrl,
String connectorPath,
long timeout)
Leave a topology by removing a connector URL from the discovery configuration
This method waits and retries until the topology is current
|
void |
setConnectorUrls(Set<String> connectorUrlsList)
Write the discovery service configuration with a set of connector URLs
|
void |
setConnectorUrlsWithWait(Set<String> connectorUrlsList,
long timeout)
Write the discovery service configuration with a set of connector URLs
The method retries until the configuration was saved and the topology is current
|
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 DEFAULT_CONNECTOR_PATH
public static final String QE_TOPOLOGY_SERVLET_PATH
public static final String CONNECTOR_URLS_PATH
public static final String CLUSTER_VIEW_PATH
public static final String UTF_8
public static final String QE_SLINGSETTINGS_SERVLET_PATH
public TopologyClient(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 boolean joinTopology(String baseUrl) throws org.apache.sling.testing.clients.ClientException
baseUrl
- The base url of the instance about to be joined; uses the DEFAULT_CONNECTOR_PATH
to build the full connector URLorg.apache.sling.testing.clients.ClientException
- if the request failedpublic boolean joinTopology(String baseUrl, String connectorPath) throws org.apache.sling.testing.clients.ClientException
baseUrl
- The full connector URL to be added to the discovery configurationconnectorPath
- path to the connectororg.apache.sling.testing.clients.ClientException
- if the request failedpublic boolean joinTopologyWithWait(String baseUrl, String connectorPath, long timeout) throws org.apache.sling.testing.clients.ClientException, InterruptedException
baseUrl
- base urlconnectorPath
- connector pathtimeout
- time (in milliseconds) to wait before throwing an exceptionorg.apache.sling.testing.clients.ClientException
- if the topology could not be joinedInterruptedException
- if interrupted while waiting for the serverpublic boolean joinTopologyWithWait(String baseUrl, long timeout) throws org.apache.sling.testing.clients.ClientException, InterruptedException
baseUrl
- base urltimeout
- time (in milliseconds) to wait before throwing an exceptionorg.apache.sling.testing.clients.ClientException
- if the topology could not be joinedInterruptedException
- if interrupted while waiting for the serverpublic boolean leaveTopology(String baseUrl) throws org.apache.sling.testing.clients.ClientException
baseUrl
- the base URL of the instance about to be left; uses the DEFAULT_CONNECTOR_PATH
to build the full connector URLorg.apache.sling.testing.clients.ClientException
- in case of errorpublic boolean leaveTopology(String baseUrl, String connectorPath) throws org.apache.sling.testing.clients.ClientException
baseUrl
- the full connector URL to be removedconnectorPath
- path to the connectororg.apache.sling.testing.clients.ClientException
- if the request failedpublic boolean leaveTopologyWithWait(String baseUrl, String connectorPath, long timeout) throws org.apache.sling.testing.clients.ClientException, InterruptedException
baseUrl
- base urlconnectorPath
- connector pathtimeout
- time (in milliseconds) to wait before throwing an exceptionorg.apache.sling.testing.clients.ClientException
- if it could not leave the topologyInterruptedException
- if interrupted while waiting for the serverpublic boolean leaveTopologyWithWait(String baseUrl, long timeout) throws org.apache.sling.testing.clients.ClientException, InterruptedException
baseUrl
- base urltimeout
- time (in milliseconds) to wait before throwing an exceptionorg.apache.sling.testing.clients.ClientException
- if it could not leave the topologyInterruptedException
- if interrupted while waiting for the serverpublic Set<String> getConnectorUrls() throws org.apache.sling.testing.clients.ClientException
org.apache.sling.testing.clients.ClientException
- if the request failedpublic Set<String> getConnectorUrlsWithWait(long timeout) throws org.apache.sling.testing.clients.ClientException, InterruptedException
timeout
- time to wait (in milliseconds) before giving uporg.apache.sling.testing.clients.ClientException
- if the topology could not be joinedInterruptedException
- if interrupted while waiting for the serverpublic void setConnectorUrls(Set<String> connectorUrlsList) throws org.apache.sling.testing.clients.ClientException
connectorUrlsList
- the set of connector URLs to be writtenorg.apache.sling.testing.clients.ClientException
- if the request failedpublic void setConnectorUrlsWithWait(Set<String> connectorUrlsList, long timeout) throws org.apache.sling.testing.clients.ClientException, InterruptedException
connectorUrlsList
- list of connector urlstimeout
- time (in milliseconds) to wait before throwing an exceptionorg.apache.sling.testing.clients.ClientException
- if the request failedInterruptedException
- to mark this method as "waiting"public String getSlingId() throws org.apache.sling.testing.clients.ClientException
org.apache.sling.testing.clients.ClientException
- if call to instance failsCopyright © 2018. All rights reserved.