T
- class type.public class DefaultRequest<T> extends java.lang.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 and Description |
---|
DefaultRequest(AmazonWebServiceRequest originalRequest,
java.lang.String serviceName)
Constructs a new DefaultRequest with the specified service name and the
original, user facing request object.
|
DefaultRequest(java.lang.String serviceName)
Constructs a new DefaultRequest with the specified service name and no
specified original, user facing request object.
|
Modifier and Type | Method and Description |
---|---|
void |
addHeader(java.lang.String name,
java.lang.String value)
Sets the specified header for this request.
|
void |
addParameter(java.lang.String name,
java.lang.String value)
Adds the specified request parameter to this request.
|
com.amazonaws.util.AWSRequestMetrics |
getAWSRequestMetrics()
Deprecated.
|
java.io.InputStream |
getContent()
Returns the optional stream containing the payload data to include for
this request.
|
java.net.URI |
getEndpoint()
Returns the service endpoint (ex: "https://ec2.amazonaws.com") to which
this request should be sent.
|
java.util.Map<java.lang.String,java.lang.String> |
getHeaders()
Returns a map of all the headers included in this request.
|
java.lang.String |
getHostPrefix()
Returns the optional prefix to prepend to the request endpoint's host
before sending 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.
|
java.util.Map<java.lang.String,java.lang.String> |
getParameters()
Returns a map of all parameters in this request.
|
java.lang.String |
getResourcePath()
Returns the path to the resource being requested.
|
java.lang.String |
getServiceName()
Returns the name of the Amazon service this request is for.
|
int |
getTimeOffset()
Returns the optional value for time offset for this request.
|
boolean |
isStreaming()
Flag that indicates that request is streaming request
|
void |
setAWSRequestMetrics(com.amazonaws.util.AWSRequestMetrics metrics)
Deprecated.
|
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 (ex: "https://ec2.amazonaws.com") to which this
request should be sent.
|
void |
setHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
Sets all headers, clearing any existing ones.
|
void |
setHostPrefix(java.lang.String hostPrefix)
Sets the optional prefix to prepend to the request endpoint's host before
sending this request.
|
void |
setHttpMethod(HttpMethodName httpMethod)
Sets the HTTP method (GET, POST, etc) 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 |
setStreaming(boolean streaming)
Set streaming flag
|
void |
setTimeOffset(int timeOffset)
Sets the optional value for time offset for this request.
|
java.lang.String |
toString() |
Request<T> |
withParameter(java.lang.String name,
java.lang.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, java.lang.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(java.lang.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(java.lang.String name, java.lang.String value)
public java.util.Map<java.lang.String,java.lang.String> getHeaders()
getHeaders
in interface Request<T>
public void setResourcePath(java.lang.String resourcePath)
setResourcePath
in interface Request<T>
resourcePath
- The path to the resource being requested.public java.lang.String getResourcePath()
getResourcePath
in interface Request<T>
public void addParameter(java.lang.String name, java.lang.String value)
addParameter
in interface Request<T>
name
- The name of the request parameter.value
- The value of the request parameter.public java.util.Map<java.lang.String,java.lang.String> getParameters()
getParameters
in interface Request<T>
public Request<T> withParameter(java.lang.String name, java.lang.String value)
withParameter
in interface Request<T>
name
- The name of the request parameter.value
- The value of the request parameter.public HttpMethodName getHttpMethod()
getHttpMethod
in interface Request<T>
public void setHttpMethod(HttpMethodName httpMethod)
setHttpMethod
in interface Request<T>
httpMethod
- The HTTP method to use when sending this request.public void setEndpoint(java.net.URI endpoint)
setEndpoint
in interface Request<T>
endpoint
- The service endpoint to which this request should be
sent.public java.net.URI getEndpoint()
getEndpoint
in interface Request<T>
public java.lang.String getServiceName()
getServiceName
in interface Request<T>
public java.io.InputStream getContent()
getContent
in interface Request<T>
public void setContent(java.io.InputStream content)
setContent
in interface Request<T>
content
- The optional stream containing the payload data to include
for this request.public void setHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
setHeaders
in interface Request<T>
headers
- the headers.public void setParameters(java.util.Map<java.lang.String,java.lang.String> parameters)
setParameters
in interface Request<T>
parameters
- the parameters.public java.lang.String getHostPrefix()
getHostPrefix
in interface Request<T>
public void setHostPrefix(java.lang.String hostPrefix)
setHostPrefix
in interface Request<T>
hostPrefix
- The optional prefix to prepend to the request endpoint
host.public int getTimeOffset()
getTimeOffset
in interface Request<T>
public void setTimeOffset(int timeOffset)
setTimeOffset
in interface Request<T>
timeOffset
- The optional value for time offset (in seconds) for
this request.public Request<T> withTimeOffset(int timeOffset)
withTimeOffset
in interface Request<T>
timeOffset
- the time offset for the request.public java.lang.String toString()
toString
in class java.lang.Object
@Deprecated public com.amazonaws.util.AWSRequestMetrics getAWSRequestMetrics()
getAWSRequestMetrics
in interface Request<T>
@Deprecated public void setAWSRequestMetrics(com.amazonaws.util.AWSRequestMetrics metrics)
Request
setAWSRequestMetrics
in interface Request<T>
metrics
- the request metrics.public boolean isStreaming()
Request
isStreaming
in interface Request<T>
public void setStreaming(boolean streaming)
Request
setStreaming
in interface Request<T>
streaming
- the streaming flag.Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.