com.sun.jersey.oauth.server
Class OAuthServerRequest

java.lang.Object
  extended by com.sun.jersey.oauth.server.OAuthServerRequest
All Implemented Interfaces:
OAuthRequest

public class OAuthServerRequest
extends java.lang.Object
implements OAuthRequest

Wraps a Jersey HttpRequestContext object, implementing the OAuth signature library OAuthRequest interface.

Author:
Hubert A. Le Van Gong , Paul C. Bryan

Constructor Summary
OAuthServerRequest(HttpRequestContext context)
           
 
Method Summary
 void addHeaderValue(java.lang.String name, java.lang.String value)
          Adds a header with the given name and value.
 java.util.List<java.lang.String> getHeaderValues(java.lang.String name)
          Returns the value(s) of the specified request header.
 java.util.Set<java.lang.String> getParameterNames()
          Returns an Set of String objects containing the names of the parameters contained in the request.
 java.util.List<java.lang.String> getParameterValues(java.lang.String name)
          Returns an List of String objects containing the values of the specified request parameter, or null if the parameter does not exist.
 java.lang.String getRequestMethod()
          Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.
 java.lang.String getRequestURL()
          Returns the URL of the request, including protocol, server name, optional port number, and server path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OAuthServerRequest

public OAuthServerRequest(HttpRequestContext context)
Method Detail

getRequestMethod

public java.lang.String getRequestMethod()
Description copied from interface: OAuthRequest
Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.

Specified by:
getRequestMethod in interface OAuthRequest
Returns:
the name of the method with which this request was made.

getRequestURL

public java.lang.String getRequestURL()
Description copied from interface: OAuthRequest
Returns the URL of the request, including protocol, server name, optional port number, and server path.

Specified by:
getRequestURL in interface OAuthRequest
Returns:
the request URL.

getParameterNames

public java.util.Set<java.lang.String> getParameterNames()
Description copied from interface: OAuthRequest
Returns an Set of String objects containing the names of the parameters contained in the request.

Specified by:
getParameterNames in interface OAuthRequest
Returns:
the names of the parameters.

getParameterValues

public java.util.List<java.lang.String> getParameterValues(java.lang.String name)
Description copied from interface: OAuthRequest
Returns an List of String objects containing the values of the specified request parameter, or null if the parameter does not exist. For HTTP requests, parameters are contained in the query string and/or posted form data.

Specified by:
getParameterValues in interface OAuthRequest
Parameters:
name - the name of the parameter.
Returns:
the values of the parameter.

getHeaderValues

public java.util.List<java.lang.String> getHeaderValues(java.lang.String name)
Description copied from interface: OAuthRequest
Returns the value(s) of the specified request header. If the request did not include a header of the specified name, this method returns null.

Specified by:
getHeaderValues in interface OAuthRequest
Parameters:
name - the header name.
Returns:
the value(s) of the requested header, or null if none exist.

addHeaderValue

public void addHeaderValue(java.lang.String name,
                           java.lang.String value)
                    throws java.lang.IllegalStateException
Description copied from interface: OAuthRequest
Adds a header with the given name and value.

Specified by:
addHeaderValue in interface OAuthRequest
Parameters:
name - the name of the header.
value - the header value.
Throws:
java.lang.IllegalStateException - if this method cannot be implemented.


Copyright © 2011 Sun Microsystems, Inc. All Rights Reserved.