public class J4pRequestHandler extends Object
| Constructor and Description |
|---|
J4pRequestHandler(String pJ4pServerUrl,
J4pTargetConfig pTargetConfig)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
org.json.simple.JSONAware |
extractJsonResponse(org.apache.http.HttpResponse pHttpResponse)
Extract the complete JSON response out of a HTTP response
|
<R extends J4pResponse<T>,T extends J4pRequest> |
extractResponse(T pRequest,
org.json.simple.JSONObject pJsonResponse)
Extract a
J4pResponse out of a JSON object |
org.apache.http.client.methods.HttpUriRequest |
getHttpRequest(J4pRequest pRequest,
String pPreferredMethod,
Map<J4pQueryParameter,String> pProcessingOptions)
Get the HttpRequest for executing the given single request
|
<T extends J4pRequest> |
getHttpRequest(List<T> pRequests,
Map<J4pQueryParameter,String> pProcessingOptions)
Get an HTTP Request for requesting multiples requests at once
|
URI |
getJ4pServerUrl()
Get the J4p Server URL
|
public J4pRequestHandler(String pJ4pServerUrl, J4pTargetConfig pTargetConfig)
pJ4pServerUrl - URL to remote agentpTargetConfig - optional default target configuration for proxy requestspublic org.apache.http.client.methods.HttpUriRequest getHttpRequest(J4pRequest pRequest, String pPreferredMethod, Map<J4pQueryParameter,String> pProcessingOptions) throws UnsupportedEncodingException, URISyntaxException
pRequest - request to convertpPreferredMethod - HTTP method preferredpProcessingOptions - optional map of processiong optionsUnsupportedEncodingExceptionURISyntaxExceptionpublic <T extends J4pRequest> org.apache.http.client.methods.HttpUriRequest getHttpRequest(List<T> pRequests, Map<J4pQueryParameter,String> pProcessingOptions) throws UnsupportedEncodingException, URISyntaxException
pRequests - requests to put into a HTTP requestUnsupportedEncodingExceptionURISyntaxExceptionpublic org.json.simple.JSONAware extractJsonResponse(org.apache.http.HttpResponse pHttpResponse)
throws IOException,
org.json.simple.parser.ParseException
pHttpResponse - the resulting http responseIOExceptionorg.json.simple.parser.ParseExceptionpublic <R extends J4pResponse<T>,T extends J4pRequest> R extractResponse(T pRequest, org.json.simple.JSONObject pJsonResponse)
J4pResponse out of a JSON objectT - request type.R - response typepRequest - request which lead to the responsepJsonResponse - JSON responsepublic URI getJ4pServerUrl()
Copyright © 2014. All rights reserved.