Class WaitForHttpResource
java.lang.Object
org.elasticsearch.gradle.testclusters.WaitForHttpResource
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
ConstructorsConstructorDescriptionWaitForHttpResource(String protocol, String host, int numberOfNodes) WaitForHttpResource(URL url) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckResource(SSLContext ssl) voidsetCertificateAuthorities(File... certificateAuthorities) voidsetPassword(String password) voidsetServerCertificate(File serverCertificate) voidsetServerKeystoreFile(File keyStoreFile) voidsetServerKeystorePassword(String keyStorePassword) voidsetTrustStoreFile(File trustStoreFile) voidsetTrustStorePassword(String trustStorePassword) voidsetUsername(String username) voidsetValidResponseCodes(int... validResponseCodes) booleanwait(int durationInMs)
-
Constructor Details
-
WaitForHttpResource
public WaitForHttpResource(String protocol, String host, int numberOfNodes) throws MalformedURLException - Throws:
MalformedURLException
-
WaitForHttpResource
-
-
Method Details
-
setValidResponseCodes
public void setValidResponseCodes(int... validResponseCodes) -
setCertificateAuthorities
-
setTrustStoreFile
-
setTrustStorePassword
-
setServerCertificate
-
setServerKeystoreFile
-
setServerKeystorePassword
-
setUsername
-
setPassword
-
wait
public boolean wait(int durationInMs) throws GeneralSecurityException, InterruptedException, IOException -
checkResource
- Throws:
IOException
-