org.apache.camel.component.gae.auth
Class GAuthAuthorizeBinding

java.lang.Object
  extended by org.apache.camel.component.gae.auth.GAuthAuthorizeBinding
All Implemented Interfaces:
OutboundBinding<GAuthEndpoint,com.google.gdata.client.authn.oauth.GoogleOAuthParameters,com.google.gdata.client.authn.oauth.GoogleOAuthParameters>

public class GAuthAuthorizeBinding
extends Object
implements OutboundBinding<GAuthEndpoint,com.google.gdata.client.authn.oauth.GoogleOAuthParameters,com.google.gdata.client.authn.oauth.GoogleOAuthParameters>

Binds GoogleOAuthParameters to a Camel Exchange. This binding is used by gauth:authorize endpoints by default.


Field Summary
static String GAUTH_CALLBACK
          Name of the Camel header containing a callback URL.
static String GAUTH_SCOPE
          Name of the Camel header defining the access scope.
 
Constructor Summary
GAuthAuthorizeBinding()
           
 
Method Summary
 org.apache.camel.Exchange readResponse(GAuthEndpoint endpoint, org.apache.camel.Exchange exchange, com.google.gdata.client.authn.oauth.GoogleOAuthParameters response)
          Creates an exchange.getOut() message that represents an HTTP redirect to Google's OAuth confirmation page.
 com.google.gdata.client.authn.oauth.GoogleOAuthParameters writeRequest(GAuthEndpoint endpoint, org.apache.camel.Exchange exchange, com.google.gdata.client.authn.oauth.GoogleOAuthParameters request)
          Creates a GoogleOAuthParameters object from endpoint and exchange.getIn() data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GAUTH_SCOPE

public static final String GAUTH_SCOPE
Name of the Camel header defining the access scope. Overrides the scope parameter defined in a gauth:authorize endpoint URI.

See Also:
Constant Field Values

GAUTH_CALLBACK

public static final String GAUTH_CALLBACK
Name of the Camel header containing a callback URL. Overrides the callback parameter defined in a gauth:authorize endpoint URI.

See Also:
Constant Field Values
Constructor Detail

GAuthAuthorizeBinding

public GAuthAuthorizeBinding()
Method Detail

writeRequest

public com.google.gdata.client.authn.oauth.GoogleOAuthParameters writeRequest(GAuthEndpoint endpoint,
                                                                              org.apache.camel.Exchange exchange,
                                                                              com.google.gdata.client.authn.oauth.GoogleOAuthParameters request)
Creates a GoogleOAuthParameters object from endpoint and exchange.getIn() data. The created parameter object is used to fetch an unauthorized request token from Google.

Specified by:
writeRequest in interface OutboundBinding<GAuthEndpoint,com.google.gdata.client.authn.oauth.GoogleOAuthParameters,com.google.gdata.client.authn.oauth.GoogleOAuthParameters>
Parameters:
endpoint -
exchange -
request - ignored.
Returns:

readResponse

public org.apache.camel.Exchange readResponse(GAuthEndpoint endpoint,
                                              org.apache.camel.Exchange exchange,
                                              com.google.gdata.client.authn.oauth.GoogleOAuthParameters response)
                                       throws Exception
Creates an exchange.getOut() message that represents an HTTP redirect to Google's OAuth confirmation page. Additionally, if the GAuthComponent is configured to use the HMAC_SHA1 signature method, a cookie is created containing the request token secret. It is needed later to upgrade an authorized request token to an access token.

Specified by:
readResponse in interface OutboundBinding<GAuthEndpoint,com.google.gdata.client.authn.oauth.GoogleOAuthParameters,com.google.gdata.client.authn.oauth.GoogleOAuthParameters>
Parameters:
endpoint - endpoint providing binding-relevant information.
exchange - exchange to be populated or created (if null) from response data.
response - response to read data from.
Returns:
the populated exchange.
Throws:
Exception


Apache Camel