Class OAuthServerRequest
- java.lang.Object
-
- org.glassfish.jersey.server.oauth1.internal.OAuthServerRequest
-
- All Implemented Interfaces:
OAuth1Request
public class OAuthServerRequest extends java.lang.Object implements OAuth1Request
Wraps a JerseyContainerRequestContextobject, implementing the OAuth signature libraryOAuth1Requestinterface.
-
-
Field Summary
Fields Modifier and Type Field Description private javax.ws.rs.container.ContainerRequestContextcontextprivate static java.util.List<java.lang.String>EMPTY_LISTprivate static java.util.Set<java.lang.String>EMPTY_SETprivate Value<javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String>>formParams
-
Constructor Summary
Constructors Constructor Description OAuthServerRequest(javax.ws.rs.container.ContainerRequestContext context)Create a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddHeaderValue(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 anSetofStringobjects containing the names of the parameters contained in the request.java.util.List<java.lang.String>getParameterValues(java.lang.String name)Returns anListofStringobjects containing the values of the specified request parameter, or null if the parameter does not exist.java.lang.StringgetRequestMethod()Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.java.net.URLgetRequestURL()Returns the URL of the request, including protocol, server name, optional port number, and server path.private static java.util.Set<java.lang.String>keys(javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> mvm)private static java.util.List<java.lang.String>values(javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> mvm, java.lang.String key)
-
-
-
Field Detail
-
context
private final javax.ws.rs.container.ContainerRequestContext context
-
EMPTY_SET
private static java.util.Set<java.lang.String> EMPTY_SET
-
EMPTY_LIST
private static java.util.List<java.lang.String> EMPTY_LIST
-
formParams
private final Value<javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String>> formParams
-
-
Method Detail
-
getRequestMethod
public java.lang.String getRequestMethod()
Description copied from interface:OAuth1RequestReturns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.- Specified by:
getRequestMethodin interfaceOAuth1Request- Returns:
- the name of the method with which this request was made.
-
getRequestURL
public java.net.URL getRequestURL()
Description copied from interface:OAuth1RequestReturns the URL of the request, including protocol, server name, optional port number, and server path.- Specified by:
getRequestURLin interfaceOAuth1Request- Returns:
- the request URL.
-
keys
private static java.util.Set<java.lang.String> keys(javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> mvm)
-
values
private static java.util.List<java.lang.String> values(javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> mvm, java.lang.String key)
-
getParameterNames
public java.util.Set<java.lang.String> getParameterNames()
Description copied from interface:OAuth1RequestReturns anSetofStringobjects containing the names of the parameters contained in the request.- Specified by:
getParameterNamesin interfaceOAuth1Request- Returns:
- the names of the parameters.
-
getParameterValues
public java.util.List<java.lang.String> getParameterValues(java.lang.String name)
Description copied from interface:OAuth1RequestReturns anListofStringobjects 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:
getParameterValuesin interfaceOAuth1Request- 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:OAuth1RequestReturns 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:
getHeaderValuesin interfaceOAuth1Request- 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.IllegalStateExceptionDescription copied from interface:OAuth1RequestAdds a header with the given name and value.- Specified by:
addHeaderValuein interfaceOAuth1Request- Parameters:
name- the name of the header.value- the header value.- Throws:
java.lang.IllegalStateException- if this method cannot be implemented.
-
-