Class RequestWrapper
- java.lang.Object
-
- org.glassfish.jersey.client.oauth1.RequestWrapper
-
- All Implemented Interfaces:
OAuth1Request
class RequestWrapper extends java.lang.Object implements OAuth1Request
Implements the OAuth signature library Request interface, wrapping a Jersey client request object.- Since:
- 2.3
-
-
Field Summary
Fields Modifier and Type Field Description private javax.ws.rs.client.ClientRequestContextclientRequestThe wrapped Jersey client request.private MessageBodyWorkersmessageBodyWorkersprivate javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String>parametersForm and query parameters from the request (lazily initialized).
-
Constructor Summary
Constructors Constructor Description RequestWrapper(javax.ws.rs.client.ClientRequestContext clientRequest, MessageBodyWorkers messageBodyWorkers)Constructs a new OAuth client request wrapper around the specified Jersey client request object.
-
Method Summary
All 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 voidsetParameters()
-
-
-
Field Detail
-
clientRequest
private final javax.ws.rs.client.ClientRequestContext clientRequest
The wrapped Jersey client request.
-
messageBodyWorkers
private final MessageBodyWorkers messageBodyWorkers
-
parameters
private javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> parameters
Form and query parameters from the request (lazily initialized).
-
-
Constructor Detail
-
RequestWrapper
public RequestWrapper(javax.ws.rs.client.ClientRequestContext clientRequest, MessageBodyWorkers messageBodyWorkers)Constructs a new OAuth client request wrapper around the specified Jersey client request object.- Parameters:
clientRequest- Client request.messageBodyWorkers- Message body workers.
-
-
Method Detail
-
setParameters
private void setParameters()
-
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.
-
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)Description 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.
-
-