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
  • Field Details

  • 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.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 instance
      topic - topic to enable/disable
      enable - 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 instance
      topic - topic to enable/disable
      enable - enable or disable
      timeout - 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 timeout
      InterruptedException - if the method was interrupted