com.amazonaws
Interface Request<T>

Type Parameters:
T - The type of original, user facing request represented by this request.
All Known Implementing Classes:
DefaultRequest

public interface Request<T>

Represents a request being sent to an Amazon Web Service, including the parameters being sent as part of the request, the endpoint to which the request should be sent, etc.

This class is only intended for internal use inside the AWS client libraries. Callers shouldn't ever interact directly with objects of this class.


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 path)
          Sets the path to the resource being requested.
 Request<T> withParameter(String name, String value)
          Adds the specified request parameter to this request, and returns the updated request object.
 

Method Detail

addHeader

void addHeader(String name,
               String value)
Adds the specified header to this request.

Parameters:
name - The name of the header to add.
value - The header's value.

getHeaders

Map<String,String> getHeaders()
Returns a map of all the headers included in this request.

Returns:
A map of all the headers included in this request.

setHeaders

void setHeaders(Map<String,String> headers)
Sets all headers, clearing any existing ones.


setResourcePath

void setResourcePath(String path)
Sets the path to the resource being requested.

Parameters:
path - The path to the resource being requested.

getResourcePath

String getResourcePath()
Returns the path to the resource being requested.

Returns:
The path to the resource being requested.

addParameter

void addParameter(String name,
                  String value)
Adds the specified request parameter to this request.

Parameters:
name - The name of the request parameter.
value - The value of the request parameter.

withParameter

Request<T> withParameter(String name,
                         String value)
Adds the specified request parameter to this request, and returns the updated request object.

Parameters:
name - The name of the request parameter.
value - The value of the request parameter.
Returns:
The updated request object.

getParameters

Map<String,String> getParameters()
Returns a map of all parameters in this request.

Returns:
A map of all parameters in this request.

setParameters

void setParameters(Map<String,String> parameters)
Sets all parameters, clearing any existing values.


getEndpoint

URI getEndpoint()
Returns the service endpoint (ex: "https://ec2.amazonaws.com") to which this request should be sent.

Returns:
The service endpoint to which this request should be sent.

setEndpoint

void setEndpoint(URI endpoint)
Sets the service endpoint (ex: "https://ec2.amazonaws.com") to which this request should be sent.

Parameters:
endpoint - The service endpoint to which this request should be sent.

getHttpMethod

com.amazonaws.http.HttpMethodName getHttpMethod()
Returns the HTTP method (GET, POST, etc) to use when sending this request.

Returns:
The HTTP method to use when sending this request.

setHttpMethod

void setHttpMethod(com.amazonaws.http.HttpMethodName httpMethod)
Sets the HTTP method (GET, POST, etc) to use when sending this request.

Parameters:
httpMethod - The HTTP method to use when sending this request.

getContent

InputStream getContent()
Returns the optional stream containing the payload data to include for this request. Not all requests will contain payload data.

Returns:
The optional stream containing the payload data to include for this request.

setContent

void setContent(InputStream content)
Sets the optional stream containing the payload data to include for this request. Not all requests will contain payload data.

Parameters:
content - The optional stream containing the payload data to include for this request.

getServiceName

String getServiceName()
Returns the name of the Amazon service this request is for.

Returns:
The name of the Amazon service this request is for.

getOriginalRequest

AmazonWebServiceRequest getOriginalRequest()
Returns the original, user facing request object which this internal request object is representing.

Returns:
The original, user facing request object which this request object is representing.


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.