Class 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.ClientRequestContext clientRequest
      The wrapped Jersey client request.
      private MessageBodyWorkers messageBodyWorkers  
      private javax.ws.rs.core.MultivaluedMap<java.lang.String,​java.lang.String> parameters
      Form 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
      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.net.URL getRequestURL()
      Returns the URL of the request, including protocol, server name, optional port number, and server path.
      private void setParameters()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • clientRequest

        private final javax.ws.rs.client.ClientRequestContext clientRequest
        The wrapped Jersey client request.
      • 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: OAuth1Request
        Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.
        Specified by:
        getRequestMethod in interface OAuth1Request
        Returns:
        the name of the method with which this request was made.
      • getRequestURL

        public java.net.URL getRequestURL()
        Description copied from interface: OAuth1Request
        Returns the URL of the request, including protocol, server name, optional port number, and server path.
        Specified by:
        getRequestURL in interface OAuth1Request
        Returns:
        the request URL.
      • getParameterNames

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

        public java.util.List<java.lang.String> getParameterValues​(java.lang.String name)
        Description copied from interface: OAuth1Request
        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 OAuth1Request
        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: OAuth1Request
        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 OAuth1Request
        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: OAuth1Request
        Adds a header with the given name and value.
        Specified by:
        addHeaderValue in interface OAuth1Request
        Parameters:
        name - the name of the header.
        value - the header value.