public class J4pClient extends J4pClientBuilderFactory
Constructor and Description |
---|
J4pClient(String pJ4pServerUrl)
Construct a new client for a given server url
|
J4pClient(String pJ4pServerUrl,
org.apache.http.client.HttpClient pHttpClient)
Constructor for a given agent URl and a given HttpClient
|
J4pClient(String pJ4pServerUrl,
org.apache.http.client.HttpClient pHttpClient,
J4pTargetConfig pTargetConfig)
Constructor using a given Agent URL, HttpClient and a proxy target config.
|
J4pClient(String pJ4pServerUrl,
org.apache.http.client.HttpClient pHttpClient,
J4pTargetConfig pTargetConfig,
J4pResponseExtractor pExtractor)
Constructor using a given Agent URL, HttpClient and a proxy target config.
|
Modifier and Type | Method and Description |
---|---|
<RESP extends J4pResponse<REQ>,REQ extends J4pRequest> |
execute(List<REQ> pRequests)
Execute multiple requests at once.
|
<RESP extends J4pResponse<REQ>,REQ extends J4pRequest> |
execute(List<REQ> pRequests,
Map<J4pQueryParameter,String> pProcessingOptions)
Execute multiple requests at once.
|
<RESP extends J4pResponse<REQ>,REQ extends J4pRequest> |
execute(List<REQ> pRequests,
Map<J4pQueryParameter,String> pProcessingOptions,
J4pResponseExtractor pResponseExtractor)
Execute multiple requests at once.
|
<RESP extends J4pResponse<REQ>,REQ extends J4pRequest> |
execute(REQ pRequest)
Execute a single J4pRequest returning a single response.
|
<RESP extends J4pResponse<REQ>,REQ extends J4pRequest> |
execute(REQ pRequest,
Map<J4pQueryParameter,String> pProcessingOptions)
Execute a single J4pRequest returning a single response.
|
<RESP extends J4pResponse<REQ>,REQ extends J4pRequest> |
execute(REQ pRequest,
String pMethod)
Execute a single J4pRequest which returns a single response.
|
<RESP extends J4pResponse<REQ>,REQ extends J4pRequest> |
execute(REQ pRequest,
String pMethod,
Map<J4pQueryParameter,String> pProcessingOptions)
Execute a single J4pRequest which returns a single response.
|
<RESP extends J4pResponse<REQ>,REQ extends J4pRequest> |
execute(REQ pRequest,
String pMethod,
Map<J4pQueryParameter,String> pProcessingOptions,
J4pResponseExtractor pExtractor)
Execute a single J4pRequest which returns a single response.
|
<R extends J4pResponse<T>,T extends J4pRequest> |
execute(T... pRequests)
Execute multiple requests at once.
|
org.apache.http.client.HttpClient |
getHttpClient()
Expose the embedded
HttpClient for tuning connection parameters. |
URI |
getUri()
Get base URL for Jolokia requests
|
authenticator, connectionTimeout, contentCharset, cookieStore, defaultMaxConnectionsPerRoute, expectContinue, maxConnectionPoolTimeout, maxTotalConnections, password, pooledConnections, responseExtractor, singleConnection, socketBufferSize, socketTimeout, tcpNoDelay, url, user
public J4pClient(String pJ4pServerUrl)
pJ4pServerUrl
- the agent URL for how to contact the server.public J4pClient(String pJ4pServerUrl, org.apache.http.client.HttpClient pHttpClient)
pJ4pServerUrl
- the agent URL for how to contact the server.pHttpClient
- HTTP client to use for the connecting to the agentpublic J4pClient(String pJ4pServerUrl, org.apache.http.client.HttpClient pHttpClient, J4pTargetConfig pTargetConfig)
pJ4pServerUrl
- the agent URL for how to contact the server.pHttpClient
- HTTP client to use for the connecting to the agentpTargetConfig
- optional targetpublic J4pClient(String pJ4pServerUrl, org.apache.http.client.HttpClient pHttpClient, J4pTargetConfig pTargetConfig, J4pResponseExtractor pExtractor)
pJ4pServerUrl
- the agent URL for how to contact the server.pHttpClient
- HTTP client to use for the connecting to the agentpTargetConfig
- optional targetpExtractor
- response extractor to usepublic <RESP extends J4pResponse<REQ>,REQ extends J4pRequest> RESP execute(REQ pRequest) throws J4pException
RESP
- response typeREQ
- request typepRequest
- request to executeJ4pException
public <RESP extends J4pResponse<REQ>,REQ extends J4pRequest> RESP execute(REQ pRequest, Map<J4pQueryParameter,String> pProcessingOptions) throws J4pException
RESP
- response typeREQ
- request typepRequest
- request to executepProcessingOptions
- optional map of processing optionsIOException
- when the execution failsorg.json.simple.parser.ParseException
- if parsing of the JSON answer failsJ4pException
public <RESP extends J4pResponse<REQ>,REQ extends J4pRequest> RESP execute(REQ pRequest, String pMethod) throws J4pException
RESP
- response typeREQ
- request typepRequest
- request to executepMethod
- method to use which should be either "GET" or "POST"J4pException
- if something's wrong (e.g. connection failed or read timeout)public <RESP extends J4pResponse<REQ>,REQ extends J4pRequest> RESP execute(REQ pRequest, String pMethod, Map<J4pQueryParameter,String> pProcessingOptions) throws J4pException
RESP
- response typeREQ
- request typepRequest
- request to executepMethod
- method to use which should be either "GET" or "POST"pProcessingOptions
- optional map of processing optionsJ4pException
- if something's wrong (e.g. connection failed or read timeout)public <RESP extends J4pResponse<REQ>,REQ extends J4pRequest> RESP execute(REQ pRequest, String pMethod, Map<J4pQueryParameter,String> pProcessingOptions, J4pResponseExtractor pExtractor) throws J4pException
RESP
- response typeREQ
- request typepRequest
- request to executepMethod
- method to use which should be either "GET" or "POST"pProcessingOptions
- optional map of processing optionspExtractor
- extractor for actually creating the responseJ4pException
- if something's wrong (e.g. connection failed or read timeout)public <RESP extends J4pResponse<REQ>,REQ extends J4pRequest> List<RESP> execute(List<REQ> pRequests) throws J4pException
RESP
- response typeREQ
- request typepRequests
- requests to executeJ4pException
- when an communication error occurspublic <RESP extends J4pResponse<REQ>,REQ extends J4pRequest> List<RESP> execute(List<REQ> pRequests, Map<J4pQueryParameter,String> pProcessingOptions) throws J4pException
RESP
- response typeREQ
- request typepRequests
- requests to executepProcessingOptions
- processing options to useJ4pException
- when an communication error occurspublic <RESP extends J4pResponse<REQ>,REQ extends J4pRequest> List<RESP> execute(List<REQ> pRequests, Map<J4pQueryParameter,String> pProcessingOptions, J4pResponseExtractor pResponseExtractor) throws J4pException
RESP
- response typeREQ
- request typepRequests
- requests to executepProcessingOptions
- processing options to usepResponseExtractor
- use this for custom extraction handlingJ4pException
- when an communication error occurspublic <R extends J4pResponse<T>,T extends J4pRequest> List<R> execute(T... pRequests) throws J4pException
R
- response typexT
- request typepRequests
- requests to executeJ4pException
- when an communication error occurspublic org.apache.http.client.HttpClient getHttpClient()
HttpClient
for tuning connection parameters.public URI getUri()
Copyright © 2019. All rights reserved.