Class WaitForHttpResource

java.lang.Object
org.elasticsearch.gradle.testclusters.WaitForHttpResource

public class WaitForHttpResource extends Object
A utility to wait for a specific HTTP resource to be available, optionally with customized TLS trusted CAs. This is logically similar to using the Ant Get task to retrieve a resource, but with the difference that it can access resources that do not use the JRE's default trusted CAs.
  • Constructor Details

  • Method Details

    • setValidResponseCodes

      public void setValidResponseCodes(int... validResponseCodes)
    • setCertificateAuthorities

      public void setCertificateAuthorities(File... certificateAuthorities)
    • setTrustStoreFile

      public void setTrustStoreFile(File trustStoreFile)
    • setTrustStorePassword

      public void setTrustStorePassword(String trustStorePassword)
    • setServerCertificate

      public void setServerCertificate(File serverCertificate)
    • setServerKeystoreFile

      public void setServerKeystoreFile(File keyStoreFile)
    • setServerKeystorePassword

      public void setServerKeystorePassword(String keyStorePassword)
    • setUsername

      public void setUsername(String username)
    • setPassword

      public void setPassword(String password)
    • wait

      public boolean wait(int durationInMs) throws GeneralSecurityException, InterruptedException, IOException
      Throws:
      GeneralSecurityException
      InterruptedException
      IOException
    • checkResource

      protected void checkResource(SSLContext ssl) throws IOException
      Throws:
      IOException