org.apache.shindig.protocol
Interface RequestItem

All Known Implementing Classes:
BaseRequestItem

public interface RequestItem

A request to pass to a bound service handler


Field Summary
static String APP_ID
           
static String APP_SUBSTITUTION_TOKEN
           
static String COUNT
           
static int DEFAULT_COUNT
           
static int DEFAULT_START_INDEX
           
static String FIELDS
           
static String FILTER_BY
           
static String FILTER_OPERATION
           
static String FILTER_VALUE
           
static String SORT_BY
           
static String SORT_ORDER
           
static String START_INDEX
           
 
Method Summary
 String getAppId()
          Gets the Opensocial App ID for this request
 Object getAttribute(String val)
          Gets an attribute for this request.
 int getCount()
          Gets the value of the count parameter
 Set<String> getFields()
          Gets the unique set of fields from the request
 Set<String> getFields(Set<String> defaultValue)
          Get the unique set of fields from the request with defaults
 String getFilterBy()
          Gets the value of the filterBy parameter
 FilterOperation getFilterOperation()
          Gets the value of the filterOperation parameter
 String getFilterValue()
          Gets the value of the filterValue parameter
 FormDataItem getFormMimePart(String partName)
          Returns MIME content data for multipart/mixed form submissions
 List<String> getListParameter(String paramName)
          Tries to get a list of values for a specified parameter.
 String getParameter(String paramName)
          Gets the specified parameter as a string
 String getParameter(String paramName, String defaultValue)
          Gets the specified parameter as a string, with a default value
 String getSortBy()
          Gets the value of the sortBy parameter
 SortOrder getSortOrder()
          Gets the value of the sortOrder parameter
 int getStartIndex()
          Gets the value of the startIndex parameter
 SecurityToken getToken()
          Returns the security token of this request
<T> T
getTypedParameter(String parameterName, Class<T> dataTypeClass)
          Converts a parameter into an object using a converter
<T> T
getTypedRequest(Class<T> dataTypeClass)
          Assume that all the parameters in the request belong to single aggregate type and convert to it.
 Date getUpdatedSince()
          Gets the value of the updatedSince parameter
 void setAttribute(String val, Object obj)
          Sets an attribute on this request object
 

Field Detail

APP_ID

static final String APP_ID
See Also:
Constant Field Values

START_INDEX

static final String START_INDEX
See Also:
Constant Field Values

COUNT

static final String COUNT
See Also:
Constant Field Values

SORT_BY

static final String SORT_BY
See Also:
Constant Field Values

SORT_ORDER

static final String SORT_ORDER
See Also:
Constant Field Values

FILTER_BY

static final String FILTER_BY
See Also:
Constant Field Values

FILTER_OPERATION

static final String FILTER_OPERATION
See Also:
Constant Field Values

FILTER_VALUE

static final String FILTER_VALUE
See Also:
Constant Field Values

FIELDS

static final String FIELDS
See Also:
Constant Field Values

DEFAULT_START_INDEX

static final int DEFAULT_START_INDEX
See Also:
Constant Field Values

DEFAULT_COUNT

static final int DEFAULT_COUNT
See Also:
Constant Field Values

APP_SUBSTITUTION_TOKEN

static final String APP_SUBSTITUTION_TOKEN
See Also:
Constant Field Values
Method Detail

getAppId

String getAppId()
Gets the Opensocial App ID for this request

Returns:
an app ID

getUpdatedSince

Date getUpdatedSince()
Gets the value of the updatedSince parameter

Returns:
A Date representing the updatedSince value

getStartIndex

int getStartIndex()
Gets the value of the startIndex parameter

Returns:
An integer containing the value of startIndex

getCount

int getCount()
Gets the value of the count parameter

Returns:
An integer containing the value of count

getSortBy

String getSortBy()
Gets the value of the sortBy parameter

Returns:
the value of the sortBy parameter

getSortOrder

SortOrder getSortOrder()
Gets the value of the sortOrder parameter

Returns:
a SortOrder enum value representing the sortOrder parameter

getFilterBy

String getFilterBy()
Gets the value of the filterBy parameter

Returns:
the value of the filterBy parameter

getFilterOperation

FilterOperation getFilterOperation()
Gets the value of the filterOperation parameter

Returns:
a SortOrder enum value representing the filterOperation parameter

getFilterValue

String getFilterValue()
Gets the value of the filterValue parameter

Returns:
the value of the filterValue parameter

getFields

Set<String> getFields()
Gets the unique set of fields from the request

Returns:
Set of field names, empty if no fields specified.

getFields

Set<String> getFields(Set<String> defaultValue)
Get the unique set of fields from the request with defaults

Parameters:
defaultValue - returned if no fields are specified in the request.
Returns:
specified set of fields or default value

getToken

SecurityToken getToken()
Returns the security token of this request

Returns:
the token

getTypedParameter

<T> T getTypedParameter(String parameterName,
                        Class<T> dataTypeClass)
Converts a parameter into an object using a converter

Type Parameters:
T - The type of this object
Parameters:
parameterName - the name of the parameter with data to convert
dataTypeClass - The class to make
Returns:
A Valid Object of the given type

getTypedRequest

<T> T getTypedRequest(Class<T> dataTypeClass)
Assume that all the parameters in the request belong to single aggregate type and convert to it.

Parameters:
dataTypeClass - the class to convert to
Returns:
Typed request object

getParameter

String getParameter(String paramName)
Gets the specified parameter as a string

Parameters:
paramName - the param name to get
Returns:
the paramName value or null if the parameter is not found

getParameter

String getParameter(String paramName,
                    String defaultValue)
Gets the specified parameter as a string, with a default value

Parameters:
paramName - the param name to get
defaultValue - the default value of the parameter
Returns:
the paramName value or defaultValue if the parameter is not found

getListParameter

List<String> getListParameter(String paramName)
Tries to get a list of values for a specified parameter. This can include splitting text on commas, dereferencing a json array and more.

Parameters:
paramName - The parameter
Returns:
A list of strings for the given parameter

getFormMimePart

FormDataItem getFormMimePart(String partName)
Returns MIME content data for multipart/mixed form submissions

Parameters:
partName - the part name to retrieve
Returns:
The FormDataItem for this part.

getAttribute

Object getAttribute(String val)
Gets an attribute for this request. Attributes are a place to store per-request values that persist across the life cycle.

Parameters:
val - the localized string variable for this request
Returns:
the object associated with this requested string value or null if not found

setAttribute

void setAttribute(String val,
                  Object obj)
Sets an attribute on this request object

Parameters:
val - string value
obj - an object


Copyright © 2007-2012. All Rights Reserved.