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

java.lang.Object
  extended by org.apache.camel.support.ServiceSupport
      extended by org.apache.camel.impl.DefaultEndpoint
          extended by org.apache.camel.component.gae.auth.GAuthEndpoint
All Implemented Interfaces:
org.apache.camel.CamelContextAware, org.apache.camel.Endpoint, org.apache.camel.IsSingleton, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.HasId, org.apache.camel.StatefulService, org.apache.camel.SuspendableService

public class GAuthEndpoint
extends org.apache.camel.impl.DefaultEndpoint

Represents a GAuth Endpoint. Instances can have one of two names, either authorize for requesting an unauthorized request token or upgrade for upgrading an authorized request token to an access token. The corresponding endpoint URIs are gauth:authorize and gauth:upgrade , respectively.


Nested Class Summary
static class GAuthEndpoint.Name
           
 
Field Summary
 
Fields inherited from class org.apache.camel.support.ServiceSupport
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
 
Constructor Summary
GAuthEndpoint(String endpointUri, org.apache.camel.Component component, String name)
           
 
Method Summary
 org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor)
           
 org.apache.camel.Producer createProducer()
          Returns a GAuthProducer
 OutboundBinding<GAuthEndpoint,com.google.gdata.client.authn.oauth.GoogleOAuthParameters,com.google.gdata.client.authn.oauth.GoogleOAuthParameters> getAuthorizeBinding()
           
 String getCallback()
          Returns the value of callback query parameter in the gauth:authorize endpoint URI.
 GAuthComponent getComponent()
          Returns the component instance that created this endpoint.
 String getConsumerKey()
          Returns the consumer key.
 String getConsumerSecret()
          Returns the consumer secret.
 GAuthKeyLoader getKeyLoader()
          Returns the key loader.
 GAuthEndpoint.Name getName()
          Returns the endpoint name.
 String getScope()
          Returns the value of the scope query parameter in gauth:authorize endpoint URI.
 String[] getScopeArray()
          Returns the value of the scope query parameter as array.
 GAuthService getService()
           
 OutboundBinding<GAuthEndpoint,com.google.gdata.client.authn.oauth.GoogleOAuthParameters,com.google.gdata.client.authn.oauth.GoogleOAuthParameters> getUpgradeBinding()
           
 boolean isSingleton()
          Returns true.
 void setAuthorizeBinding(OutboundBinding<GAuthEndpoint,com.google.gdata.client.authn.oauth.GoogleOAuthParameters,com.google.gdata.client.authn.oauth.GoogleOAuthParameters> authorizeBinding)
          Sets the binding for gauth:authorize endpoints.
 void setCallback(String callback)
           
 void setConsumerKey(String consumerKey)
          Sets the consumer key.
 void setConsumerSecret(String consumerSecret)
          Sets the consumer secret.
 void setKeyLoader(GAuthKeyLoader keyLoader)
          Sets a key loader for loading a private key.
 void setScope(String services)
           
 void setService(GAuthService service)
          Sets the service that makes the remote calls to Google services.
 void setUpgradeBinding(OutboundBinding<GAuthEndpoint,com.google.gdata.client.authn.oauth.GoogleOAuthParameters,com.google.gdata.client.authn.oauth.GoogleOAuthParameters> upgradeBinding)
          Sets the binding for gauth:upgrade endpoints.
 
Methods inherited from class org.apache.camel.impl.DefaultEndpoint
configureConsumer, configurePollingConsumer, configureProperties, createEndpointConfiguration, createEndpointUri, createExchange, createExchange, createExchange, createPollingConsumer, doStart, doStop, equals, getCamelContext, getConsumerProperties, getEndpointConfiguration, getEndpointKey, getEndpointUri, getExchangePattern, getId, hashCode, isLenientProperties, isSynchronous, setCamelContext, setConsumerProperties, setEndpointConfiguration, setEndpointUri, setEndpointUriIfNotSpecified, setExchangePattern, setProperties, setSynchronous, toString
 
Methods inherited from class org.apache.camel.support.ServiceSupport
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, resume, shutdown, start, stop, suspend
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.camel.Service
start, stop
 

Constructor Detail

GAuthEndpoint

public GAuthEndpoint(String endpointUri,
                     org.apache.camel.Component component,
                     String name)
Method Detail

getAuthorizeBinding

public OutboundBinding<GAuthEndpoint,com.google.gdata.client.authn.oauth.GoogleOAuthParameters,com.google.gdata.client.authn.oauth.GoogleOAuthParameters> getAuthorizeBinding()

setAuthorizeBinding

public void setAuthorizeBinding(OutboundBinding<GAuthEndpoint,com.google.gdata.client.authn.oauth.GoogleOAuthParameters,com.google.gdata.client.authn.oauth.GoogleOAuthParameters> authorizeBinding)
Sets the binding for gauth:authorize endpoints.


getUpgradeBinding

public OutboundBinding<GAuthEndpoint,com.google.gdata.client.authn.oauth.GoogleOAuthParameters,com.google.gdata.client.authn.oauth.GoogleOAuthParameters> getUpgradeBinding()

setUpgradeBinding

public void setUpgradeBinding(OutboundBinding<GAuthEndpoint,com.google.gdata.client.authn.oauth.GoogleOAuthParameters,com.google.gdata.client.authn.oauth.GoogleOAuthParameters> upgradeBinding)
Sets the binding for gauth:upgrade endpoints.


getComponent

public GAuthComponent getComponent()
Returns the component instance that created this endpoint.

Overrides:
getComponent in class org.apache.camel.impl.DefaultEndpoint

getName

public GAuthEndpoint.Name getName()
Returns the endpoint name.


getCallback

public String getCallback()
Returns the value of callback query parameter in the gauth:authorize endpoint URI.


setCallback

public void setCallback(String callback)

getScope

public String getScope()
Returns the value of the scope query parameter in gauth:authorize endpoint URI. This can be a single scope or a comma-separated list of scopes.


setScope

public void setScope(String services)

getScopeArray

public String[] getScopeArray()
Returns the value of the scope query parameter as array.

See Also:
getScope()

getConsumerKey

public String getConsumerKey()
Returns the consumer key. If this endpoint's consumer key is null then GAuthComponent.getConsumerKey() is returned.


setConsumerKey

public void setConsumerKey(String consumerKey)
Sets the consumer key. This key is generated when a web application is registered at Google.

Parameters:
consumerKey - consumer key to set.

getConsumerSecret

public String getConsumerSecret()
Returns the consumer secret. If this endpoint's consumer secret is null then GAuthComponent.getConsumerSecret() is returned.


setConsumerSecret

public void setConsumerSecret(String consumerSecret)
Sets the consumer secret. This secret is generated when a web application is registered at Google. Only set the consumer secret if the HMAC-SHA1 signature method shall be used.


getKeyLoader

public GAuthKeyLoader getKeyLoader()
Returns the key loader. If this endpoint's key loader is null then GAuthComponent.getKeyLoader() is returned.


setKeyLoader

public void setKeyLoader(GAuthKeyLoader keyLoader)
Sets a key loader for loading a private key. A private key is required when the RSA-SHA1 signature method shall be used.


getService

public GAuthService getService()

setService

public void setService(GAuthService service)
Sets the service that makes the remote calls to Google services. Testing code should inject a mock service here (using serviceRef in endpoint URI).


createConsumer

public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor)
                                         throws Exception
Throws:
UnsupportedOperationException
Exception

createProducer

public org.apache.camel.Producer createProducer()
                                         throws Exception
Returns a GAuthProducer

Throws:
Exception

isSingleton

public boolean isSingleton()
Returns true.



Apache Camel