public class WebServicesClient
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected connector.common.http.client.HttpClient |
_client |
| Constructor and Description |
|---|
WebServicesClient() |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(java.util.Map args)
Configure connection parameters.
|
java.lang.String |
executeDelete(java.lang.String url,
java.util.List<java.lang.String> allowedStatuses)
Use this method to execute a DELETE call specifying the url and allowed statuses.
|
java.lang.String |
executeDelete(java.lang.String url,
java.util.Map headers,
java.util.List<java.lang.String> allowedStatuses)
Use this method to execute a DELETE call specifying the url, header values and allowed statuses.
|
java.lang.String |
executeDelete(java.lang.String url,
java.lang.Object payload,
java.util.Map headers,
java.util.List<java.lang.String> allowedStatuses)
Use this method to execute a DELETE call specifying the url, header values and allowed statuses.
|
java.lang.String |
executeGet(java.util.Map headers,
java.util.List<java.lang.String> allowedStatuses)
Use this method to execute a GET call with specifying header values and allowed statuses.
|
java.lang.String |
executeGet(java.lang.String url,
java.util.Map headers,
java.util.List<java.lang.String> allowedStatuses)
Use this method to execute a GET call with specifying the url, header values and allowed statuses.
|
java.lang.String |
executePatch(java.lang.String url,
java.lang.Object payload,
java.util.List<java.lang.String> allowedStatuses)
Use this method to execute a PATCH call with specifying the url, payload and allowed statuses.
|
java.lang.String |
executePatch(java.lang.String url,
java.lang.Object payload,
java.util.Map headers,
java.util.List<java.lang.String> allowedStatuses)
Use this method to execute a PATCH call with specifying the url, payload, header values and allowed statuses.
|
java.lang.String |
executePost(java.lang.String url,
java.lang.Object payload,
java.util.List<java.lang.String> allowedStatuses)
Use this method to execute a POST call with specifying the url, payload, and allowed statuses.
|
java.lang.String |
executePost(java.lang.String url,
java.lang.Object payload,
java.util.Map headers,
java.util.List<java.lang.String> allowedStatuses)
Use this method to execute a POST call with specifying the url, payload, header values and allowed statuses.
|
java.lang.String |
executePut(java.lang.String url,
java.lang.Object payload,
java.util.List<java.lang.String> allowedStatuses)
Use this method to execute a PUT call with specifying the url, payload, and allowed statuses.
|
java.lang.String |
executePut(java.lang.String url,
java.lang.Object payload,
java.util.Map headers,
java.util.List<java.lang.String> allowedStatuses)
Use this method to execute a PUT call with specifying the url, payload, header values and allowed statuses.
|
java.util.List |
getCookies()
Use this method to get a list of cookies associated with the request
|
java.util.Map<java.lang.String,java.lang.String> |
getResponseHeaders()
Get the last executed request's response headers.
|
public void configure(java.util.Map args)
throws java.lang.Exception
public static final String ARG_URL = "url"; public static final String ARG_USERNAME = "username"; public static final String ARG_PASSWORD = "password"; public static final String ARG_TIMEOUT = "timeoutInSeconds";
args - map of the available configuration parameters, ARG_URL, ARG_USERNAME, ARG_PASSWORD, ARG_TIMEOUTjava.lang.Exception - The exception thrown by the clientpublic java.util.List getCookies()
public java.lang.String executeGet(java.util.Map headers,
java.util.List<java.lang.String> allowedStatuses)
throws java.lang.Exception
headers - Any headers needed to authenticate or specify a content-typeallowedStatuses - Allowed response statuses, ie: 200, 201, 400, etc...java.lang.Exception - The exception thrown by the clientpublic java.lang.String executeGet(java.lang.String url,
java.util.Map headers,
java.util.List<java.lang.String> allowedStatuses)
throws java.lang.Exception
url - The url to execute the request againstheaders - Any headers needed to authenticate or specify a content-typeallowedStatuses - Allowed response statuses, ie: 200, 201, 400, etc...java.lang.Exception - The exception thrown by the clientpublic java.lang.String executePost(java.lang.String url,
java.lang.Object payload,
java.util.List<java.lang.String> allowedStatuses)
throws java.lang.Exception
url - The url to execute the request againstpayload - The payload to send to the request endpointallowedStatuses - Allowed response statuses, ie: 200, 201, 400, etc...java.lang.Exception - The exception thrown by the clientpublic java.lang.String executePost(java.lang.String url,
java.lang.Object payload,
java.util.Map headers,
java.util.List<java.lang.String> allowedStatuses)
throws java.lang.Exception
url - The url to execute the request againstpayload - The payload to send to the request endpointheaders - Any headers needed to authenticate or specify a content-typeallowedStatuses - Allowed response statuses, ie: 200, 201, 400, etc...java.lang.Exception - The exception thrown by the clientpublic java.lang.String executePut(java.lang.String url,
java.lang.Object payload,
java.util.List<java.lang.String> allowedStatuses)
throws java.lang.Exception
url - The url to execute the request againstpayload - The payload to send to the request endpointallowedStatuses - Allowed response statuses, ie: 200, 201, 400, etc...java.lang.Exception - The exception thrown by the clientpublic java.lang.String executePut(java.lang.String url,
java.lang.Object payload,
java.util.Map headers,
java.util.List<java.lang.String> allowedStatuses)
throws java.lang.Exception
url - The url to execute the request againstpayload - The payload to send to the request endpointheaders - Any headers needed to authenticate or specify a content-typeallowedStatuses - Allowed response statuses, ie: 200, 201, 400, etc...java.lang.Exception - The exception thrown by the clientpublic java.lang.String executePatch(java.lang.String url,
java.lang.Object payload,
java.util.List<java.lang.String> allowedStatuses)
throws java.lang.Exception
url - The url to execute the request againstpayload - The payload to send to the request endpointallowedStatuses - Allowed response statuses, ie: 200, 201, 400, etc...java.lang.Exception - The exception thrown by the clientpublic java.lang.String executePatch(java.lang.String url,
java.lang.Object payload,
java.util.Map headers,
java.util.List<java.lang.String> allowedStatuses)
throws java.lang.Exception
url - The url to execute the request againstpayload - The payload to send to the request endpointheaders - Any headers needed to authenticate or specify a content-typeallowedStatuses - Allowed response statuses, ie: 200, 201, 400, etc...java.lang.Exception - The exception thrown by the clientpublic java.util.Map<java.lang.String,java.lang.String> getResponseHeaders()
public java.lang.String executeDelete(java.lang.String url,
java.util.List<java.lang.String> allowedStatuses)
throws java.lang.Exception
url - The url to execute the request againstallowedStatuses - Allowed response statuses, ie: 200, 201, 400, etc...java.lang.Exception - The exception thrown by the clientpublic java.lang.String executeDelete(java.lang.String url,
java.util.Map headers,
java.util.List<java.lang.String> allowedStatuses)
throws java.lang.Exception
url - The url to execute the request againstheaders - Any headers needed to authenticate or specify a content-typeallowedStatuses - Allowed response statuses, ie: 200, 201, 400, etc...java.lang.Exception - The exception thrown by the clientpublic java.lang.String executeDelete(java.lang.String url,
java.lang.Object payload,
java.util.Map headers,
java.util.List<java.lang.String> allowedStatuses)
throws java.lang.Exception
url - The url to execute the request againstpayload - The payload to send to the request endpointheaders - Any headers needed to authenticate or specify a content-typeallowedStatuses - Allowed response statuses, ie: 200, 201, 400, etc...java.lang.Exception - The exception thrown by the client