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

java.lang.Object
  extended by org.apache.camel.component.gae.login.GLoginBinding
All Implemented Interfaces:
OutboundBinding<GLoginEndpoint,GLoginData,GLoginData>

public class GLoginBinding
extends Object
implements OutboundBinding<GLoginEndpoint,GLoginData,GLoginData>

Binds GLoginData to a Camel Exchange.


Field Summary
static String GLOGIN_COOKIE
          Name of the Camel header containing the resulting authorization cookie.
static String GLOGIN_HOST_NAME
          Name of the Camel header defining the host name.
static String GLOGIN_PASSWORD
          Name of the Camel header defining the login password.
static String GLOGIN_TOKEN
          Name of the Camel header containing the resulting authentication token.
static String GLOGIN_USER_NAME
          Name of the Camel header defining the login username.
 
Constructor Summary
GLoginBinding()
           
 
Method Summary
 org.apache.camel.Exchange readResponse(GLoginEndpoint endpoint, org.apache.camel.Exchange exchange, GLoginData response)
          Creates an exchange.getOut() message with a GLOGIN_TOKEN header containing an authentication token and a GLOGIN_COOKIE header containing an authorization cookie.
 GLoginData writeRequest(GLoginEndpoint endpoint, org.apache.camel.Exchange exchange, GLoginData request)
          Creates a GLoginData object from endpoint and exchange.getIn() header data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GLOGIN_HOST_NAME

public static final String GLOGIN_HOST_NAME
Name of the Camel header defining the host name. Overrides GLoginEndpoint.getHostName().

See Also:
Constant Field Values

GLOGIN_USER_NAME

public static final String GLOGIN_USER_NAME
Name of the Camel header defining the login username. Overrides GLoginEndpoint.getUserName().

See Also:
Constant Field Values

GLOGIN_PASSWORD

public static final String GLOGIN_PASSWORD
Name of the Camel header defining the login password. Overrides GLoginEndpoint.getPassword().

See Also:
Constant Field Values

GLOGIN_TOKEN

public static final String GLOGIN_TOKEN
Name of the Camel header containing the resulting authentication token.

See Also:
Constant Field Values

GLOGIN_COOKIE

public static final String GLOGIN_COOKIE
Name of the Camel header containing the resulting authorization cookie.

See Also:
Constant Field Values
Constructor Detail

GLoginBinding

public GLoginBinding()
Method Detail

writeRequest

public GLoginData writeRequest(GLoginEndpoint endpoint,
                               org.apache.camel.Exchange exchange,
                               GLoginData request)
Creates a GLoginData object from endpoint and exchange.getIn() header data. The created object is used to obtain an authentication token and an authorization cookie.

Specified by:
writeRequest in interface OutboundBinding<GLoginEndpoint,GLoginData,GLoginData>
Parameters:
endpoint - endpoint providing binding-relevant information.
exchange - exchange to read data from.
request - request to be populated or created (if null) from exchange data.
Returns:
the populated response.

readResponse

public org.apache.camel.Exchange readResponse(GLoginEndpoint endpoint,
                                              org.apache.camel.Exchange exchange,
                                              GLoginData response)
                                       throws Exception
Creates an exchange.getOut() message with a GLOGIN_TOKEN header containing an authentication token and a GLOGIN_COOKIE header containing an authorization cookie. If the endpoint is configured to run in development mode, no authentication token will be set, only an authorization cookie.

Specified by:
readResponse in interface OutboundBinding<GLoginEndpoint,GLoginData,GLoginData>
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