Class HTTPClientWrapper
- java.lang.Object
-
- com.dkfqs.measuringagent.javascript.executor.HTTPClientWrapper
-
public class HTTPClientWrapper extends java.lang.ObjectA wrapper to support instances of com.dkfqs.tools.http.HTTPClient.
-
-
Constructor Summary
Constructors Constructor Description HTTPClientWrapper(com.dkfqs.measuringagent.javascript.JavaScriptRhinoTestJobExecutorContext testJobExecutorContext, com.dkfqs.measuringagent.javascript.executor.ExecutorConsoleLog executorConsoleLog)Create a new instance of this wrapper.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose(HTTPClient httpClient)Free all internal resources and close all connections of the HTTPClient.voidcloseAbortAllClients()Free all internal resources and close all connections of the HTTPClients.static javax.net.ssl.KeyManager[]getClientAuthKeyManagers(java.lang.String clientCertificateContentB64, java.lang.String clientCertificatePasswordB64)Get the key managers of a PKCS12 client certificatestatic HTTPRequestContentnewHTTPRequestContent()Create a new (empty) instance of an HTTP request content.static HTTPRequestContentnewHTTPRequestContent(java.lang.String content)Create an initialized instance of an HTTP request content.HTTPClientnewInstance()Create a new instance of an HTTP client with 2 processing threads and a default processing timeout of 30 seconds.HTTPClientnewInstance(int processingTimeout, int numProcessingThreads)Create a new instance of an HTTP client.
-
-
-
Constructor Detail
-
HTTPClientWrapper
public HTTPClientWrapper(com.dkfqs.measuringagent.javascript.JavaScriptRhinoTestJobExecutorContext testJobExecutorContext, com.dkfqs.measuringagent.javascript.executor.ExecutorConsoleLog executorConsoleLog)Create a new instance of this wrapper.- Parameters:
testJobExecutorContext- the test job executor contextexecutorConsoleLog- the console log
-
-
Method Detail
-
newInstance
public HTTPClient newInstance()
Create a new instance of an HTTP client with 2 processing threads and a default processing timeout of 30 seconds.- Returns:
- the new instance of an HTTP client
- See Also:
JavaScriptRhinoTestJobExecutorContext.getJavaScriptHTTPClientMaxInstances()
-
newInstance
public HTTPClient newInstance(int processingTimeout, int numProcessingThreads)
Create a new instance of an HTTP client.- Parameters:
processingTimeout- the processing timeout per URL at HTTP level in millisecondnumProcessingThreads- the number processing threads, valid range is = 1..64- Returns:
- the new instance of an HTTP client
-
getClientAuthKeyManagers
public static javax.net.ssl.KeyManager[] getClientAuthKeyManagers(java.lang.String clientCertificateContentB64, java.lang.String clientCertificatePasswordB64) throws java.lang.ExceptionGet the key managers of a PKCS12 client certificate- Parameters:
clientCertificateContentB64- the binary content of the PKCS12 client certificate in base64 formatclientCertificatePasswordB64- the password of the PKCS12 client certificate in base64 format- Returns:
- the key managers of thr PKCS12 client certificate
- Throws:
java.lang.Exception- if the PKCS12 client certificate cannot be loaded
-
newHTTPRequestContent
public static HTTPRequestContent newHTTPRequestContent()
Create a new (empty) instance of an HTTP request content.- Returns:
- the new (empty) instance of an HTTP request content
-
newHTTPRequestContent
public static HTTPRequestContent newHTTPRequestContent(java.lang.String content)
Create an initialized instance of an HTTP request content.- Parameters:
content- the HTTP request content in UTF-8 text format.- Returns:
- the initialized instance of an HTTP request content.
-
close
public void close(HTTPClient httpClient)
Free all internal resources and close all connections of the HTTPClient.- Parameters:
httpClient- the HTTP client
-
closeAbortAllClients
public void closeAbortAllClients()
Free all internal resources and close all connections of the HTTPClients. This will also abort any pending HTTP requests.
-
-