com.dyuproject.oauth
Class HttpAuthTransport

java.lang.Object
  extended by com.dyuproject.oauth.Transport
      extended by com.dyuproject.oauth.HttpAuthTransport
All Implemented Interfaces:
Signature.Listener

public final class HttpAuthTransport
extends Transport

Sends the oauth request parameters via the HTTP Authorization header.

Author:
David Yu
Date created:
Jun 1, 2009

Field Summary
static HttpAuthTransport DEFAULT
          The default instance.
static String NAME
          "Authorization"
static String WWW_AUTHENTICATE
          "WWW-Authenticate"
 
Constructor Summary
HttpAuthTransport()
           
 
Method Summary
static String getAuthHeaderValue(UrlEncodedParameterMap params, Endpoint ep, Token token, NonceAndTimestamp nts, Signature signature)
          Gets the computed value for the "Authorization" header.
static HttpAuthTransport getDefault()
          Gets the default instance.
 String getMethod()
          Gets the method name of this transport.
 String getName()
          Gets the name of this transport.
 void handleOAuthParameter(String key, String value, StringBuilder buffer)
          Handles the encoded oauth key and value.
 HttpConnector.Response send(UrlEncodedParameterMap params, Endpoint ep, Token token, TokenExchange exchange, NonceAndTimestamp nts, Signature signature, HttpConnector connector)
          Sends the params to the service provided and returns the http response HttpConnector.Response.
 
Methods inherited from class com.dyuproject.oauth.Transport
appendToUrl, buildAuthUrl, buildAuthUrl, get, getAuthUrl, getAuthUrl, handleRequestParameter, putDefaults, register
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final String NAME
"Authorization"

See Also:
Constant Field Values

WWW_AUTHENTICATE

public static final String WWW_AUTHENTICATE
"WWW-Authenticate"

See Also:
Constant Field Values

DEFAULT

public static final HttpAuthTransport DEFAULT
The default instance.

Constructor Detail

HttpAuthTransport

public HttpAuthTransport()
Method Detail

getDefault

public static HttpAuthTransport getDefault()
Gets the default instance.


getName

public String getName()
Description copied from class: Transport
Gets the name of this transport.

Specified by:
getName in class Transport

getMethod

public String getMethod()
Description copied from class: Transport
Gets the method name of this transport.

Specified by:
getMethod in class Transport

handleOAuthParameter

public void handleOAuthParameter(String key,
                                 String value,
                                 StringBuilder buffer)
Description copied from interface: Signature.Listener
Handles the encoded oauth key and value.


send

public HttpConnector.Response send(UrlEncodedParameterMap params,
                                   Endpoint ep,
                                   Token token,
                                   TokenExchange exchange,
                                   NonceAndTimestamp nts,
                                   Signature signature,
                                   HttpConnector connector)
                            throws IOException
Description copied from class: Transport
Sends the params to the service provided and returns the http response HttpConnector.Response.

Specified by:
send in class Transport
Throws:
IOException

getAuthHeaderValue

public static String getAuthHeaderValue(UrlEncodedParameterMap params,
                                        Endpoint ep,
                                        Token token,
                                        NonceAndTimestamp nts,
                                        Signature signature)
Gets the computed value for the "Authorization" header.



Copyright © 2008-2013. All Rights Reserved.