|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.amazonaws.DefaultRequest<T>
public class DefaultRequest<T>
Default implementation of the Request interface.
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 Summary | |
---|---|
DefaultRequest(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 | |
---|---|
void |
addHeader(String name,
String value)
Adds the specified header to this request. |
void |
addParameter(String name,
String value)
Adds the specified request parameter to this request. |
InputStream |
getContent()
Returns the optional stream containing the payload data to include for this request. |
URI |
getEndpoint()
Returns the service endpoint (ex: "https://ec2.amazonaws.com") to which this request should be sent. |
Map<String,String> |
getHeaders()
Returns a map of all the headers included in this request. |
com.amazonaws.http.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. |
Map<String,String> |
getParameters()
Returns a map of all parameters in this request. |
String |
getResourcePath()
Returns the path to the resource being requested. |
String |
getServiceName()
Returns the name of the Amazon service this request is for. |
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(com.amazonaws.http.HttpMethodName httpMethod)
Sets the HTTP method (GET, POST, etc) to use when sending this request. |
void |
setParameters(Map<String,String> parameters)
Sets all parameters, clearing any existing values. |
void |
setResourcePath(String resourcePath)
Sets the path to the resource being requested. |
String |
toString()
|
Request<T> |
withParameter(String name,
String value)
Adds the specified request parameter to this request, and returns the updated request object. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
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.Method Detail |
---|
public AmazonWebServiceRequest getOriginalRequest()
getOriginalRequest
in interface Request<T>
public void addHeader(String name, String value)
Request
addHeader
in interface Request<T>
name
- The name of the header to add.value
- The header's value.Request.addHeader(java.lang.String, java.lang.String)
public Map<String,String> getHeaders()
Request
getHeaders
in interface Request<T>
Request.getHeaders()
public void setResourcePath(String resourcePath)
Request
setResourcePath
in interface Request<T>
resourcePath
- The path to the resource being requested.Request.setResourcePath(java.lang.String)
public String getResourcePath()
Request
getResourcePath
in interface Request<T>
Request.getResourcePath()
public void addParameter(String name, String value)
Request
addParameter
in interface Request<T>
name
- The name of the request parameter.value
- The value of the request parameter.Request.addParameter(java.lang.String, java.lang.String)
public Map<String,String> getParameters()
Request
getParameters
in interface Request<T>
Request.getParameters()
public Request<T> withParameter(String name, String value)
Request
withParameter
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 com.amazonaws.http.HttpMethodName getHttpMethod()
Request
getHttpMethod
in interface Request<T>
Request.getHttpMethod()
public void setHttpMethod(com.amazonaws.http.HttpMethodName httpMethod)
Request
setHttpMethod
in interface Request<T>
httpMethod
- The HTTP method to use when sending this request.Request.setHttpMethod(com.amazonaws.http.HttpMethodName)
public void setEndpoint(URI endpoint)
Request
setEndpoint
in interface Request<T>
endpoint
- The service endpoint to which this request should be sent.Request.setEndpoint(java.net.URI)
public URI getEndpoint()
Request
getEndpoint
in interface Request<T>
Request.getEndpoint()
public String getServiceName()
Request
getServiceName
in interface Request<T>
Request.getServiceName()
public InputStream getContent()
Request
getContent
in interface Request<T>
Request.getContent()
public void setContent(InputStream content)
Request
setContent
in interface Request<T>
content
- The optional stream containing the payload data to include for
this request.Request.setContent(java.io.InputStream)
public void setHeaders(Map<String,String> headers)
Request
setHeaders
in interface Request<T>
Request.setHeaders(java.util.Map)
public void setParameters(Map<String,String> parameters)
Request
setParameters
in interface Request<T>
Request.setParameters(java.util.Map)
public String toString()
toString
in class Object
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |