Class WaitForHttpResource


  • public class WaitForHttpResource
    extends java.lang.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 Summary

      Constructors 
      Constructor Description
      WaitForHttpResource​(java.lang.String protocol, java.lang.String host, int numberOfNodes)  
      WaitForHttpResource​(java.net.URL url)  
    • Method Summary

      Modifier and Type Method Description
      protected void checkResource​(javax.net.ssl.SSLContext ssl)  
      void setCertificateAuthorities​(java.io.File... certificateAuthorities)  
      void setPassword​(java.lang.String password)  
      void setTrustStoreFile​(java.io.File trustStoreFile)  
      void setTrustStorePassword​(java.lang.String trustStorePassword)  
      void setUsername​(java.lang.String username)  
      void setValidResponseCodes​(int... validResponseCodes)  
      boolean wait​(int durationInMs)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WaitForHttpResource

        public WaitForHttpResource​(java.lang.String protocol,
                                   java.lang.String host,
                                   int numberOfNodes)
                            throws java.net.MalformedURLException
        Throws:
        java.net.MalformedURLException
      • WaitForHttpResource

        public WaitForHttpResource​(java.net.URL url)
    • Method Detail

      • setValidResponseCodes

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

        public void setCertificateAuthorities​(java.io.File... certificateAuthorities)
      • setTrustStoreFile

        public void setTrustStoreFile​(java.io.File trustStoreFile)
      • setTrustStorePassword

        public void setTrustStorePassword​(java.lang.String trustStorePassword)
      • setUsername

        public void setUsername​(java.lang.String username)
      • setPassword

        public void setPassword​(java.lang.String password)
      • wait

        public boolean wait​(int durationInMs)
                     throws java.security.GeneralSecurityException,
                            java.lang.InterruptedException,
                            java.io.IOException
        Throws:
        java.security.GeneralSecurityException
        java.lang.InterruptedException
        java.io.IOException
      • checkResource

        protected void checkResource​(javax.net.ssl.SSLContext ssl)
                              throws java.io.IOException
        Throws:
        java.io.IOException