ImmutableRequest<T>, Request<T>, SignableRequest<T>@NotThreadSafe public class DefaultRequest<T> extends Object implements Request<T>
This class is only intended for internal use inside the AWS client libraries. Callers shouldn't ever interact directly with objects of this class.
| Constructor | Description |
|---|---|
DefaultRequest(String serviceName) |
Constructs a new DefaultRequest with the specified service name and no
specified original, user facing request object.
|
DefaultRequest(AmazonWebServiceRequest originalRequest,
String serviceName) |
Constructs a new DefaultRequest with the specified service name and the
original, user facing request object.
|
| Modifier and Type | Method | Description |
|---|---|---|
<X> void |
addHandlerContext(HandlerContextKey<X> key,
X value) |
Adds a context to the request object that is visible
to all
RequestHandler . |
void |
addHeader(String name,
String value) |
Sets the specified header for this request.
|
void |
addParameter(String name,
String value) |
Adds the specified request parameter to this request.
|
void |
addParameters(String name,
List<String> values) |
Adds the specified request parameter and list of values to this request.
|
AwsRequestMetrics |
getAwsRequestMetrics() |
Returns the request metrics.
|
InputStream |
getContent() |
Returns the optional stream containing the payload data to include for
this request.
|
InputStream |
getContentUnwrapped() |
Returns the optional raw stream containing the payload data to include
for this request, with all progress stream wrappers.
|
URI |
getEndpoint() |
Returns the service endpoint (ex: "https://ec2.amazonaws.com") to which
this request should be sent.
|
<X> X |
getHandlerContext(HandlerContextKey<X> key) |
Return the context for the given key if present; else return null.
|
Map<String,String> |
getHeaders() |
Returns a map of all the headers included in this request.
|
HttpMethodName |
getHttpMethod() |
Returns the HTTP method (GET, POST, etc) to use when sending this
request.
|
AmazonWebServiceRequest |
getOriginalRequest() |
Returns the original, user facing request object which this internal
request object is representing.
|
Object |
getOriginalRequestObject() |
Returns the original, user facing request object which this internal
request object is representing.
|
Map<String,List<String>> |
getParameters() |
Returns a map of all parameters in this request.
|
ReadLimitInfo |
getReadLimitInfo() |
Returns the read limit info about the original request.
|
String |
getResourcePath() |
Returns the path to the resource being requested.
|
String |
getServiceName() |
|
int |
getTimeOffset() |
Returns the optional value for time offset for this request.
|
void |
setAwsRequestMetrics(AwsRequestMetrics metrics) |
Bind the request metrics to the request.
|
void |
setContent(InputStream content) |
Sets the optional stream containing the payload data to include for this
request.
|
void |
setEndpoint(URI endpoint) |
Sets the service endpoint (ex: "https://ec2.amazonaws.com") to which this
request should be sent.
|
void |
setHeaders(Map<String,String> headers) |
Sets all headers, clearing any existing ones.
|
void |
setHttpMethod(HttpMethodName httpMethod) |
Sets the HTTP method (GET, POST, etc) to use when sending this request.
|
void |
setParameters(Map<String,List<String>> parameters) |
Sets all parameters, clearing any existing values.
|
void |
setResourcePath(String resourcePath) |
Sets the path to the resource being requested.
|
void |
setTimeOffset(int timeOffset) |
Sets the optional value for time offset for this request.
|
String |
toString() |
|
Request<T> |
withParameter(String name,
String value) |
Adds the specified request parameter to this request, and returns the
updated request object.
|
Request<T> |
withTimeOffset(int timeOffset) |
Sets the optional value for time offset for this request.
|
public DefaultRequest(AmazonWebServiceRequest originalRequest, String serviceName)
serviceName - The name of the service to which this request is being sent.originalRequest - The original, user facing, AWS request being represented by
this internal request object.public DefaultRequest(String serviceName)
serviceName - The name of the service to which this request is being sent.public AmazonWebServiceRequest getOriginalRequest()
getOriginalRequest in interface Request<T>public void addHeader(String name, String value)
SignableRequestaddHeader in interface SignableRequest<T>name - The name of the header to set.value - The header's value.SignableRequest.addHeader(java.lang.String, java.lang.String)public Map<String,String> getHeaders()
ImmutableRequestgetHeaders in interface ImmutableRequest<T>ImmutableRequest.getHeaders()public void setHeaders(Map<String,String> headers)
RequestsetHeaders in interface Request<T>Request.setHeaders(java.util.Map)public String getResourcePath()
ImmutableRequestgetResourcePath in interface ImmutableRequest<T>ImmutableRequest.getResourcePath()public void setResourcePath(String resourcePath)
RequestsetResourcePath in interface Request<T>resourcePath - The path to the resource being requested.Request.setResourcePath(java.lang.String)public void addParameter(String name, String value)
SignableRequestaddParameter in interface SignableRequest<T>name - The name of the request parameter.value - The value of the request parameter.SignableRequest.addParameter(java.lang.String, java.lang.String)public void addParameters(String name, List<String> values)
RequestaddParameters in interface Request<T>name - The name of the request parameter.values - The value of the request parameter.Request.addParameters(java.lang.String, java.util.List)public Map<String,List<String>> getParameters()
ImmutableRequestgetParameters in interface ImmutableRequest<T>ImmutableRequest.getParameters()public void setParameters(Map<String,List<String>> parameters)
RequestsetParameters in interface Request<T>Request.setParameters(java.util.Map)public Request<T> withParameter(String name, String value)
RequestwithParameter in interface Request<T>name - The name of the request parameter.value - The value of the request parameter.Request.withParameter(java.lang.String, java.lang.String)public HttpMethodName getHttpMethod()
ImmutableRequestgetHttpMethod in interface ImmutableRequest<T>ImmutableRequest.getHttpMethod()public void setHttpMethod(HttpMethodName httpMethod)
RequestsetHttpMethod in interface Request<T>httpMethod - The HTTP method to use when sending this request.Request.setHttpMethod(HttpMethodName)public URI getEndpoint()
ImmutableRequestgetEndpoint in interface ImmutableRequest<T>ImmutableRequest.getEndpoint()public void setEndpoint(URI endpoint)
RequestsetEndpoint in interface Request<T>endpoint - The service endpoint to which this request should be sent.Request.setEndpoint(java.net.URI)public String getServiceName()
getServiceName in interface Request<T>AmazonWebServiceClient.getServiceName() which is used for
signing purpose.Request.getServiceName()public InputStream getContent()
ImmutableRequestgetContent in interface ImmutableRequest<T>ImmutableRequest.getContent()public void setContent(InputStream content)
SignableRequestsetContent in interface SignableRequest<T>content - The optional stream containing the payload data to include for
this request.SignableRequest.setContent(java.io.InputStream)public int getTimeOffset()
ImmutableRequestgetTimeOffset in interface ImmutableRequest<T>ImmutableRequest.getTimeOffset()public void setTimeOffset(int timeOffset)
RequestsetTimeOffset in interface Request<T>timeOffset - The optional value for time offset (in seconds) for this request.Request.setTimeOffset(int)public Request<T> withTimeOffset(int timeOffset)
RequestwithTimeOffset in interface Request<T>Request.setTimeOffset(int)public AwsRequestMetrics getAwsRequestMetrics()
RequestgetAwsRequestMetrics in interface Request<T>public void setAwsRequestMetrics(AwsRequestMetrics metrics)
RequestsetAwsRequestMetrics in interface Request<T>public <X> void addHandlerContext(HandlerContextKey<X> key, X value)
RequestRequestHandler .
Note that, context added here will available only for the scope of
the request execution and will not be marshalled over the wire.addHandlerContext in interface Request<T>key - the key for the property being set in the request.value - the value for the property being set in the request.public <X> X getHandlerContext(HandlerContextKey<X> key)
RequestgetHandlerContext in interface Request<T>key - the key for the contextpublic InputStream getContentUnwrapped()
ImmutableRequestgetContentUnwrapped in interface ImmutableRequest<T>public ReadLimitInfo getReadLimitInfo()
ImmutableRequestgetReadLimitInfo in interface ImmutableRequest<T>public Object getOriginalRequestObject()
ImmutableRequestgetOriginalRequestObject in interface ImmutableRequest<T>Object.Copyright © 2017 Amazon Web Services, Inc. All Rights Reserved.