T
- The type of original, user facing request represented by this
request.ImmutableRequest<T>
, SignableRequest<T>
DefaultRequest
public interface Request<T> extends SignableRequest<T>
This class is only intended for use inside the AWS client libraries and request handlers. Users of the AWS SDK for Java should not implement this interface.
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 |
addParameters(String name,
List<String> values) |
Adds the specified request parameter and list of values to this request.
|
AwsRequestMetrics |
getAwsRequestMetrics() |
Returns the request metrics.
|
<X> X |
getHandlerContext(HandlerContextKey<X> key) |
Return the context for the given key if present; else return null.
|
AmazonWebServiceRequest |
getOriginalRequest() |
Returns the original, user facing request object which this internal
request object is representing.
|
String |
getServiceName() |
|
void |
setAwsRequestMetrics(AwsRequestMetrics metrics) |
Bind the request metrics to the 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 path) |
Sets the path to the resource being requested.
|
void |
setTimeOffset(int timeOffset) |
Sets the optional value for time offset for this request.
|
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.
|
getContent, getContentUnwrapped, getEndpoint, getHeaders, getHttpMethod, getOriginalRequestObject, getParameters, getReadLimitInfo, getResourcePath, getTimeOffset
addHeader, addParameter, setContent
void setHeaders(Map<String,String> headers)
void setResourcePath(String path)
path
- The path to the resource being requested.Request<T> withParameter(String name, String value)
name
- The name of the request parameter.value
- The value of the request parameter.void setParameters(Map<String,List<String>> parameters)
void addParameters(String name, List<String> values)
name
- The name of the request parameter.values
- The value of the request parameter.void setEndpoint(URI endpoint)
endpoint
- The service endpoint to which this request should be sent.void setHttpMethod(HttpMethodName httpMethod)
httpMethod
- The HTTP method to use when sending this request.String getServiceName()
AmazonWebServiceClient.getServiceName()
which is used for
signing purpose.AmazonWebServiceRequest getOriginalRequest()
void setTimeOffset(int timeOffset)
timeOffset
- The optional value for time offset (in seconds) for this request.Request<T> withTimeOffset(int timeOffset)
AwsRequestMetrics getAwsRequestMetrics()
void setAwsRequestMetrics(AwsRequestMetrics metrics)
IllegalStateException
- if the binding has already occurred<X> void addHandlerContext(HandlerContextKey<X> key, X value)
RequestHandler
.
Note that, context added here will available only for the scope of
the request execution and will not be marshalled over the wire.key
- the key for the property being set in the request.value
- the value for the property being set in the request.<X> X getHandlerContext(HandlerContextKey<X> key)
key
- the key for the contextCopyright © 2017 Amazon Web Services, Inc. All Rights Reserved.