Class DefaultRequest<T>
java.lang.Object
com.amazonaws.DefaultRequest<T>
- All Implemented Interfaces:
Request<T>, SignableRequest<T>
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultRequest(AmazonWebServiceRequest originalRequest, String serviceName) Constructs a new DefaultRequest with the specified service name and the original, user facing request object.DefaultRequest(String serviceName) Constructs a new DefaultRequest with the specified service name and no specified original, user facing request object. -
Method Summary
Modifier and TypeMethodDescription<X> voidaddHandlerContext(HandlerContextKey<X> key, X value) Adds a context to the request object that is visible to allRequestHandler2.voidSets the specified header for this request.voidaddParameter(String name, String value) Adds the specified request parameter to this request.voidaddParameters(String name, List<String> values) Adds the specified request parameter and list of values to this request.Returns the request metrics.Returns the optional stream containing the payload data to include for this request.Returns the optional raw stream containing the payload data to include for this request, with all progress stream wrappers.Returns the service endpoint (ex: "https://ec2.amazonaws.com") to which this request should be sent.<X> XgetHandlerContext(HandlerContextKey<X> key) Return the context for the given key if present; else return null.Returns a map of all the headers included in this request.Returns the HTTP method (GET, POST, etc) to use when sending this request.Returns the original, user facing request object which this internal request object is representing.Returns the original, user facing request object which this internal request object is representing.Returns a map of all parameters in this request.Returns the read limit info about the original request.Returns the path to the resource being requested.intReturns the optional value for time offset for this request.voidsetAWSRequestMetrics(AWSRequestMetrics metrics) Bind the request metrics to the request.voidsetContent(InputStream content) Sets the optional stream containing the payload data to include for this request.voidsetEndpoint(URI endpoint) Sets the service endpoint (ex: "https://ec2.amazonaws.com") to which this request should be sent.voidsetHeaders(Map<String, String> headers) Sets all headers, clearing any existing ones.voidsetHttpMethod(HttpMethodName httpMethod) Sets the HTTP method (GET, POST, etc) to use when sending this request.voidsetParameters(Map<String, List<String>> parameters) Sets all parameters, clearing any existing values.voidsetResourcePath(String resourcePath) Sets the path to the resource being requested.voidsetTimeOffset(int timeOffset) Sets the optional value for time offset for this request.toString()withParameter(String name, String value) Adds the specified request parameter to this request, and returns the updated request object.withTimeOffset(int timeOffset) Sets the optional value for time offset for this request.
-
Constructor Details
-
DefaultRequest
Constructs a new DefaultRequest with the specified service name and the original, user facing request object.- Parameters:
originalRequest- The original, user facing, AWS request being represented by this internal request object.serviceName- The name of the service to which this request is being sent.
-
DefaultRequest
Constructs a new DefaultRequest with the specified service name and no specified original, user facing request object.- Parameters:
serviceName- The name of the service to which this request is being sent.
-
-
Method Details
-
getOriginalRequest
Returns the original, user facing request object which this internal request object is representing.- Specified by:
getOriginalRequestin interfaceRequest<T>- Returns:
- The original, user facing request object which this request object is representing.
-
addHeader
Description copied from interface:SignableRequestSets the specified header for this request.- Specified by:
addHeaderin interfaceSignableRequest<T>- Parameters:
name- The name of the header to set.value- The header's value.- See Also:
-
getHeaders
Description copied from interface:SignableRequestReturns a map of all the headers included in this request.- Specified by:
getHeadersin interfaceSignableRequest<T>- Returns:
- A map of all the headers included in this request.
- See Also:
-
setResourcePath
Description copied from interface:RequestSets the path to the resource being requested.- Specified by:
setResourcePathin interfaceRequest<T>- Parameters:
resourcePath- The path to the resource being requested.- See Also:
-
getResourcePath
Description copied from interface:SignableRequestReturns the path to the resource being requested.- Specified by:
getResourcePathin interfaceSignableRequest<T>- Returns:
- The path to the resource being requested.
- See Also:
-
addParameter
Description copied from interface:SignableRequestAdds the specified request parameter to this request.- Specified by:
addParameterin interfaceSignableRequest<T>- Parameters:
name- The name of the request parameter.value- The value of the request parameter.- See Also:
-
addParameters
Description copied from interface:RequestAdds the specified request parameter and list of values to this request.- Specified by:
addParametersin interfaceRequest<T>- Parameters:
name- The name of the request parameter.values- The value of the request parameter.- See Also:
-
getParameters
Description copied from interface:SignableRequestReturns a map of all parameters in this request.- Specified by:
getParametersin interfaceSignableRequest<T>- Returns:
- A map of all parameters in this request.
- See Also:
-
withParameter
Description copied from interface:RequestAdds the specified request parameter to this request, and returns the updated request object.- Specified by:
withParameterin interfaceRequest<T>- Parameters:
name- The name of the request parameter.value- The value of the request parameter.- Returns:
- The updated request object.
- See Also:
-
getHttpMethod
Description copied from interface:SignableRequestReturns the HTTP method (GET, POST, etc) to use when sending this request.- Specified by:
getHttpMethodin interfaceSignableRequest<T>- Returns:
- The HTTP method to use when sending this request.
- See Also:
-
setHttpMethod
Description copied from interface:RequestSets the HTTP method (GET, POST, etc) to use when sending this request.- Specified by:
setHttpMethodin interfaceRequest<T>- Parameters:
httpMethod- The HTTP method to use when sending this request.- See Also:
-
setEndpoint
Description copied from interface:RequestSets the service endpoint (ex: "https://ec2.amazonaws.com") to which this request should be sent.- Specified by:
setEndpointin interfaceRequest<T>- Parameters:
endpoint- The service endpoint to which this request should be sent.- See Also:
-
getEndpoint
Description copied from interface:SignableRequestReturns the service endpoint (ex: "https://ec2.amazonaws.com") to which this request should be sent.- Specified by:
getEndpointin interfaceSignableRequest<T>- Returns:
- The service endpoint to which this request should be sent.
- See Also:
-
getServiceName
- Specified by:
getServiceNamein interfaceRequest<T>- Returns:
- The name of the Amazon service this request is for. This is used
as the service name set in request metrics and service
exceptions. This is NOT the same as the service name returned by
AmazonWebServiceClient.getServiceName()which is used for signing purpose. - See Also:
-
getContent
Description copied from interface:SignableRequestReturns the optional stream containing the payload data to include for this request. Not all requests will contain payload data.- Specified by:
getContentin interfaceSignableRequest<T>- Returns:
- The optional stream containing the payload data to include for this request.
- See Also:
-
setContent
Description copied from interface:SignableRequestSets the optional stream containing the payload data to include for this request. This is used, for example, for S3 chunk encoding.- Specified by:
setContentin interfaceSignableRequest<T>- Parameters:
content- The optional stream containing the payload data to include for this request.- See Also:
-
setHeaders
-
setParameters
Description copied from interface:RequestSets all parameters, clearing any existing values. Note that List values within the parameters Map must use an implementation that supports null values.- Specified by:
setParametersin interfaceRequest<T>- See Also:
-
getTimeOffset
public int getTimeOffset()Description copied from interface:SignableRequestReturns the optional value for time offset for this request. This will be used by the signer to adjust for potential clock skew. Value is in seconds, positive values imply the current clock is "fast", negative values imply clock is slow.- Specified by:
getTimeOffsetin interfaceSignableRequest<T>- Returns:
- The optional value for time offset (in seconds) for this request.
- See Also:
-
setTimeOffset
public void setTimeOffset(int timeOffset) Description copied from interface:RequestSets the optional value for time offset for this request. This will be used by the signer to adjust for potential clock skew. Value is in seconds, positive values imply the current clock is "fast", negative values imply clock is slow.- Specified by:
setTimeOffsetin interfaceRequest<T>- Parameters:
timeOffset- The optional value for time offset (in seconds) for this request.- See Also:
-
withTimeOffset
Description copied from interface:RequestSets the optional value for time offset for this request. This will be used by the signer to adjust for potential clock skew. Value is in seconds, positive values imply the current clock is "fast", negative values imply clock is slow.- Specified by:
withTimeOffsetin interfaceRequest<T>- Returns:
- The updated request object.
- See Also:
-
toString
-
getAWSRequestMetrics
Description copied from interface:RequestReturns the request metrics.- Specified by:
getAWSRequestMetricsin interfaceRequest<T>
-
setAWSRequestMetrics
Description copied from interface:RequestBind the request metrics to the request. Note metrics can be captured before the request is created.- Specified by:
setAWSRequestMetricsin interfaceRequest<T>
-
addHandlerContext
Description copied from interface:RequestAdds a context to the request object that is visible to allRequestHandler2. Note that, context added here will available only for the scope of the request execution and will not be marshalled over the wire.- Specified by:
addHandlerContextin interfaceRequest<T>- Parameters:
key- the key for the property being set in the request.value- the value for the property being set in the request.
-
getHandlerContext
Description copied from interface:RequestReturn the context for the given key if present; else return null.- Specified by:
getHandlerContextin interfaceRequest<T>- Parameters:
key- the key for the context- Returns:
- the context if present else null.
-
getContentUnwrapped
Description copied from interface:SignableRequestReturns the optional raw stream containing the payload data to include for this request, with all progress stream wrappers. Not all requests contain payload data.- Specified by:
getContentUnwrappedin interfaceSignableRequest<T>- Returns:
- The optional raw stream containing the payload data to include for this request, with all progress stream wrappers removed.
-
getReadLimitInfo
Description copied from interface:SignableRequestReturns the read limit info about the original request.- Specified by:
getReadLimitInfoin interfaceSignableRequest<T>
-
getOriginalRequestObject
Description copied from interface:SignableRequestReturns the original, user facing request object which this internal request object is representing.- Specified by:
getOriginalRequestObjectin interfaceSignableRequest<T>- Returns:
- an instance of request as an
Object.
-