Class OAuthServerRequest

java.lang.Object
org.glassfish.jersey.server.oauth1.internal.OAuthServerRequest
All Implemented Interfaces:
OAuth1Request

public class OAuthServerRequest extends Object implements OAuth1Request
Wraps a Jersey ContainerRequestContext object, implementing the OAuth signature library OAuth1Request interface.
  • Field Details

    • context

      private final javax.ws.rs.container.ContainerRequestContext context
    • EMPTY_SET

      private static Set<String> EMPTY_SET
    • EMPTY_LIST

      private static List<String> EMPTY_LIST
    • formParams

      private final Value<javax.ws.rs.core.MultivaluedMap<String,String>> formParams
  • Constructor Details

    • OAuthServerRequest

      public OAuthServerRequest(javax.ws.rs.container.ContainerRequestContext context)
      Create a new instance.
      Parameters:
      context - Container request context.
  • Method Details

    • getRequestMethod

      public 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 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.
    • keys

      private static Set<String> keys(javax.ws.rs.core.MultivaluedMap<String,String> mvm)
    • values

      private static List<String> values(javax.ws.rs.core.MultivaluedMap<String,String> mvm, String key)
    • getParameterNames

      public Set<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 List<String> getParameterValues(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 List<String> getHeaderValues(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(String name, String value) throws IllegalStateException
      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.
      Throws:
      IllegalStateException - if this method cannot be implemented.