| Constructor and Description |
|---|
RequestSupport(ApiServiceRequest originalRequest,
java.lang.String serviceName)
Creates the
RequestSupport object from the given service name. |
| Modifier and Type | Method and Description |
|---|---|
void |
addParameter(java.lang.String name,
java.lang.String value)
Adds the specified request parameter to this request.
|
java.io.InputStream |
getContent() |
java.net.URI |
getEndpoint() |
java.util.Map<java.lang.String,java.lang.String> |
getHeaders() |
HttpMethod |
getHttpMethod() |
ApiServiceRequest |
getOriginalRequest()
Returns the original, user facing request object which this basic
request object is representing.
|
java.util.Map<java.lang.String,java.lang.String> |
getParameters() |
java.lang.String |
getResourcePath() |
java.lang.String |
getServiceName() |
int |
getTimeOffset() |
void |
setContent(java.io.InputStream content)
Sets the optional stream containing the payload data to include for this
request.
|
void |
setEndpoint(java.net.URI endpoint)
Sets the service endpoint to which this request should be sent.
|
void |
setHeader(java.lang.String name,
java.lang.String value)
Adds the specified header to this request.
|
void |
setHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
Sets all headers, clearing any existing ones.
|
void |
setHttpMethod(HttpMethod httpMethod)
Sets the HTTP method to use when sending this request.
|
void |
setParameters(java.util.Map<java.lang.String,java.lang.String> parameters)
Sets all parameters, clearing any existing values.
|
void |
setResourcePath(java.lang.String resourcePath)
Sets the path to the resource being requested.
|
void |
setTimeOffset(int timeOffset)
Sets the optional value for time offset for this request.
|
java.lang.String |
toString() |
Request |
withContent(java.io.InputStream content)
Sets the optional stream containing the payload data to include for this
request.
|
Request |
withEndpoint(java.net.URI endpoint)
Sets the service endpoint to which this request should be sent, and
returns the updated
Request object. |
Request |
withHeader(java.lang.String name,
java.lang.String value)
Adds the specified header to this request and returns the updated
Request object. |
Request |
withHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
Sets all headers, clearing any existing ones and returns the updated
Request object. |
Request |
withHttpMethod(HttpMethod httpMethod)
Sets the HTTP method to use when sending this request and returns the
updated
Request object. |
Request |
withParameter(java.lang.String name,
java.lang.String value)
Adds the specified request parameter to this request and returns the
updated
Request object. |
Request |
withParameters(java.util.Map<java.lang.String,java.lang.String> parameters)
Sets all parameters, clearing any existing values and return the updated
Request object. |
Request |
withResourcePath(java.lang.String resourcePath)
Sets the path to the resource being requested and returns the updated
Request object. |
Request |
withTimeOffset(int timeOffset)
Sets the optional value for time offset for this request.
|
public RequestSupport(ApiServiceRequest originalRequest, java.lang.String serviceName)
RequestSupport object from the given service name.serviceName - the given service name.public java.lang.String getServiceName()
getServiceName in interface Requestpublic java.lang.String getResourcePath()
getResourcePath in interface Requestpublic void setResourcePath(java.lang.String resourcePath)
RequestsetResourcePath in interface RequestresourcePath - the path to the resource being requested.public Request withResourcePath(java.lang.String resourcePath)
RequestRequest object.withResourcePath in interface RequestresourcePath - the path to the resource being requested.Request object with a new resource path.public HttpMethod getHttpMethod()
getHttpMethod in interface Requestpublic void setHttpMethod(HttpMethod httpMethod)
RequestsetHttpMethod in interface RequesthttpMethod - the HTTP method to use when sending this request.public Request withHttpMethod(HttpMethod httpMethod)
RequestRequest object.withHttpMethod in interface RequesthttpMethod - the HTTP method to use when sending this request.Request object with a new http method.public void setEndpoint(java.net.URI endpoint)
RequestsetEndpoint in interface Requestendpoint - The service endpoint to which this request should be sent.public java.net.URI getEndpoint()
getEndpoint in interface Requestpublic Request withEndpoint(java.net.URI endpoint)
RequestRequest object.withEndpoint in interface Requestendpoint - the service endpoint to which this request should be sent.Request object with a new endpoint.public void setTimeOffset(int timeOffset)
RequestsetTimeOffset in interface RequesttimeOffset - The optional value for time offset for this request.public int getTimeOffset()
getTimeOffset in interface Requestpublic Request withTimeOffset(int timeOffset)
RequestRequest object.withTimeOffset in interface RequesttimeOffset - The optional value for time offset for this request.Request object with a new time offset.public void setContent(java.io.InputStream content)
RequestsetContent in interface Requestcontent - the optional stream containing the payload data to include
for request.public java.io.InputStream getContent()
getContent in interface Requestpublic Request withContent(java.io.InputStream content)
RequestRequest object.withContent in interface Requestcontent - the optional stream containing the payload data to include
for request.Request object with a new content.public void setHeader(java.lang.String name,
java.lang.String value)
Requestpublic void setHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
RequestsetHeaders in interface Requestheaders - the given map of headers to set.public Request withHeader(java.lang.String name, java.lang.String value)
RequestRequest object.withHeader in interface Requestname - the name of the header to add.value - the header's value.Request object with a new header.public Request withHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
RequestRequest object.withHeaders in interface Requestheaders - the given map of headers to set.Request object with a new headers.public java.util.Map<java.lang.String,java.lang.String> getHeaders()
getHeaders in interface Requestpublic void addParameter(java.lang.String name,
java.lang.String value)
RequestaddParameter in interface Requestname - the name of the request parameter.value - the value of the request parameter.public Request withParameter(java.lang.String name, java.lang.String value)
RequestRequest object.withParameter in interface Requestname - the name of the request parameter.value - the value of the request parameter.Request object with a new parameter.public void setParameters(java.util.Map<java.lang.String,java.lang.String> parameters)
RequestsetParameters in interface Requestparameters - the map of parameters to set.public Request withParameters(java.util.Map<java.lang.String,java.lang.String> parameters)
RequestRequest object.withParameters in interface Requestparameters - the map of parameters to set.Request object with new map of parameters.public java.util.Map<java.lang.String,java.lang.String> getParameters()
getParameters in interface Requestpublic ApiServiceRequest getOriginalRequest()
RequestgetOriginalRequest in interface Requestpublic java.lang.String toString()
toString in class java.lang.Object