org.apache.camel.component.gae.login
Class GLoginServiceImpl

java.lang.Object
  extended by org.apache.camel.component.gae.login.GLoginServiceImpl
All Implemented Interfaces:
GLoginService

public class GLoginServiceImpl
extends Object
implements GLoginService

Implements the interactions with Google's authentication and authorization services. If the endpoint is configured to run in development mode the authentication and authorization services of the development server are used.


Constructor Summary
GLoginServiceImpl()
           
 
Method Summary
 void authenticate(GLoginData data)
          Authenticates a user and stores the authentication token to GLoginData.setAuthenticationToken(String).
 void authorize(GLoginData data)
          Dispatches authorization to authorizeDev(GLoginData) if the endpoint is configured to run in development mode, otherwise to authorizeStd(GLoginData).
protected  void authorizeDev(GLoginData data)
          Authorizes access to a development server and stores the resulting authorization cookie to GLoginData.setAuthorizationCookie(String) .
protected  void authorizeStd(GLoginData data)
          Authorizes access to a Google App Engine application and stores the resulting authorization cookie to GLoginData.setAuthorizationCookie(String).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GLoginServiceImpl

public GLoginServiceImpl()
Method Detail

authenticate

public void authenticate(GLoginData data)
                  throws com.google.gdata.util.AuthenticationException
Authenticates a user and stores the authentication token to GLoginData.setAuthenticationToken(String). If the endpoint is configured to run in development mode this method simply returns without any further action.

Specified by:
authenticate in interface GLoginService
Parameters:
data - authentication input data and response data (authentication token) container.
Throws:
com.google.gdata.util.AuthenticationException

authorize

public void authorize(GLoginData data)
               throws Exception
Dispatches authorization to authorizeDev(GLoginData) if the endpoint is configured to run in development mode, otherwise to authorizeStd(GLoginData).

Specified by:
authorize in interface GLoginService
Parameters:
data - authentication input data and response data (authorization cookie) container.
Throws:
Exception

authorizeDev

protected void authorizeDev(GLoginData data)
                     throws Exception
Authorizes access to a development server and stores the resulting authorization cookie to GLoginData.setAuthorizationCookie(String) . Authorization in development mode doesn't require an authentication token.

Throws:
Exception

authorizeStd

protected void authorizeStd(GLoginData data)
                     throws Exception
Authorizes access to a Google App Engine application and stores the resulting authorization cookie to GLoginData.setAuthorizationCookie(String). This method requires an authentication token from GLoginData.getAuthenticationToken().

Throws:
Exception


Apache CAMEL