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
|
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 optionsUnsupportedEncodingException
URISyntaxException
public <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 requestUnsupportedEncodingException
URISyntaxException
public org.json.simple.JSONAware extractJsonResponse(org.apache.http.HttpResponse pHttpResponse) throws IOException, org.json.simple.parser.ParseException
pHttpResponse
- the resulting http responseIOException
org.json.simple.parser.ParseException
public URI getJ4pServerUrl()
Copyright © 2019. All rights reserved.