com.stackmob.core.rest
Class ProcessedAPIRequest

java.lang.Object
  extended by com.stackmob.core.rest.ProcessedAPIRequest

public class ProcessedAPIRequest
extends Object

Represents an API request.


Constructor Summary
ProcessedAPIRequest(MethodVerb verb, String url, String loggedInUser, Map<String,String> params, Map<String,String> headers, String appName, int apiVersion, String methodName, long counter)
          Create a new processed API request with an empty body
ProcessedAPIRequest(MethodVerb verb, String url, String loggedInUser, Map<String,String> params, Map<String,String> headers, String body, String appName, int apiVersion, String methodName, long counter)
          Create a new processed API request.
ProcessedAPIRequest(MethodVerb verb, String url, String loggedInUser, Map<String,String> params, String appName, int apiVersion, String methodName, long counter)
          Create a new processed API request with an empty body and no header.
ProcessedAPIRequest(MethodVerb verb, String url, String loggedInUser, Map<String,String> params, String body, String appName, int apiVersion, String methodName, long counter)
          Create a new processed API request with no header.
 
Method Summary
 int getApiVersion()
          Returns the API version number.
 String getAppName()
          Returns the application name.
 String getAppUrlSafeName()
          Deprecated. 
 String getBody()
          Returns the body of this request
 String getContentType()
          Returns the content-type associated with request
 long getCounter()
          Returns the request count.
 Map<String,String> getHeaders()
          Returns the headers associated with request
 String getLoggedInUser()
          Returns the logged in user.
 String getMethodName()
          Returns the method name.
 Map<String,String> getParams()
          The query parameters.
 String getUrl()
          Returns the URL representing the request.
 MethodVerb getVerb()
          Returns the the HTTP verb.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProcessedAPIRequest

public ProcessedAPIRequest(MethodVerb verb,
                           String url,
                           String loggedInUser,
                           Map<String,String> params,
                           Map<String,String> headers,
                           String body,
                           String appName,
                           int apiVersion,
                           String methodName,
                           long counter)
Create a new processed API request.

Parameters:
verb - the HTTP verb specified
url - the url which represents the request
apiVersion - the api version number associated with this request
params - the query parameters of the request
headers - the headers associated with the request
body - the body of the request, or empty if there was no body in the request (ie: an empty POST request, or a GET)
appName - the name of the app this request refers to
methodName - the name of the method being called by the request
loggedInUser - if a logged in user sent the request, their username is represented here
counter - the number of requests this particular JVM instance has handled up until this request

ProcessedAPIRequest

public ProcessedAPIRequest(MethodVerb verb,
                           String url,
                           String loggedInUser,
                           Map<String,String> params,
                           Map<String,String> headers,
                           String appName,
                           int apiVersion,
                           String methodName,
                           long counter)
Create a new processed API request with an empty body

Parameters:
verb - the HTTP verb specified
url - the url which represents the request
apiVersion - the api version number associated with this request
params - the query parameters of the request
headers - the headers associated with the request
appName - the name of the app this request refers to
methodName - the name of the method being called by the request
loggedInUser - if a logged in user sent the request, their username is represented here
counter - the number of requests this particular JVM instance has handled up until this request

ProcessedAPIRequest

public ProcessedAPIRequest(MethodVerb verb,
                           String url,
                           String loggedInUser,
                           Map<String,String> params,
                           String body,
                           String appName,
                           int apiVersion,
                           String methodName,
                           long counter)
Create a new processed API request with no header.

Parameters:
verb - the HTTP verb specified
url - the url which represents the request
apiVersion - the api version number associated with this request
params - the query parameters of the request
body - the body of the request, or empty if there was no body in the request (ie: an empty POST request, or a GET)
appName - the name of the app this request refers to
methodName - the name of the method being called by the request
loggedInUser - if a logged in user sent the request, their username is represented here
counter - the number of requests this particular JVM instance has handled up until this request

ProcessedAPIRequest

public ProcessedAPIRequest(MethodVerb verb,
                           String url,
                           String loggedInUser,
                           Map<String,String> params,
                           String appName,
                           int apiVersion,
                           String methodName,
                           long counter)
Create a new processed API request with an empty body and no header.

Parameters:
verb - the HTTP verb specified
url - the url which represents the request
apiVersion - the api version number associated with this request
params - the query parameters of the request
appName - the name of the app this request refers to
methodName - the name of the method being called by the request
loggedInUser - if a logged in user sent the request, their username is represented here
counter - the number of requests this particular JVM instance has handled up until this request
Method Detail

getVerb

public MethodVerb getVerb()
Returns the the HTTP verb.

Returns:
the HTTP verb associated with the request
See Also:
MethodVerb

getUrl

public String getUrl()
Returns the URL representing the request.

Returns:
the URL representing this request

getLoggedInUser

public String getLoggedInUser()
Returns the logged in user.

Returns:
the loggedInUser, or null if the user performing the request has not logged in

getParams

public Map<String,String> getParams()
The query parameters.

Returns:
the query parameters

getContentType

public String getContentType()
Returns the content-type associated with request

Returns:
headers

getHeaders

public Map<String,String> getHeaders()
Returns the headers associated with request

Returns:
headers

getMethodName

public String getMethodName()
Returns the method name.

Returns:
the method name

toString

public String toString()
Overrides:
toString in class Object

getAppUrlSafeName

@Deprecated
public String getAppUrlSafeName()
Deprecated. 

Returns the application name.

Returns:
the application name

getAppName

public String getAppName()
Returns the application name.

Returns:
the application name

getApiVersion

public int getApiVersion()
Returns the API version number.

Returns:
the API version number for the request

getCounter

public long getCounter()
Returns the request count.

Returns:
the total number of requests across all apps for a particular client during the life of the current JVM

getBody

public String getBody()
Returns the body of this request

Returns:
the body of this request, or an empty string if the request has no body, for example a GET request or a POST request with no body submitted


Copyright © 2013 StackMob. All Rights Reserved.