Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.platform.oauth.tokens
Class OAuthTokenStoreImpl

java.lang.Object
  extended by org.nuxeo.runtime.model.DefaultComponent
      extended by org.nuxeo.ecm.platform.oauth.tokens.OAuthTokenStoreImpl
All Implemented Interfaces:
OAuthTokenStore, Adaptable, Component, Extensible

public class OAuthTokenStoreImpl
extends DefaultComponent
implements OAuthTokenStore

Service implementation for OAuthTokenStore.

This service is responsible for managing storage of the OAuthToken. A simple SQL Directory is used for ACCESS Token whereas a simple in memory storage is used for REQUEST Tokens.

Author:
tiry

Field Summary
static String DIRECTORY_NAME
           
 
Constructor Summary
OAuthTokenStoreImpl()
           
 
Method Summary
 OAuthToken addVerifierToRequestToken(String token, Long duration)
          Generates a verification code and attache it to the REQUEST Token.
 OAuthToken createAccessTokenFromRequestToken(OAuthToken requestToken)
          Exchanges the REQUEST Token witha Real ACCESS Token (persistent) Token/TocketSecret Strings are regerated during the exchange.
 OAuthToken createRequestToken(String consumerKey, String callBack)
          Creates a new REQUEST Token (transient)
 OAuthToken getAccessToken(String token)
          Retrieves an ACCESS from the store.
 NuxeoOAuthToken getClientAccessToken(String appId, String owner)
          Get a Access token for the Shindig Client.
 OAuthToken getRequestToken(String token)
          Retrieves a REQUEST Token given a Token string (extracted from the Request).
 List<OAuthToken> listAccessTokenForConsumer(String consumerKey)
          Lists ACCESS Token associated to a Consumer application.
 List<OAuthToken> listAccessTokenForUser(String login)
          Lists ACCESS Token associated to a User.
 void removeAccessToken(String token)
          Deletes an ACCESS Token from the storage.
 void removeClientAccessToken(String appId, String owner)
          Deletes a Client side Access Token.
 void removeRequestToken(String token)
          Deletes a REQUEST Token.
 void storeClientAccessToken(String consumerKey, String callBack, String token, String tokenSecret, String appId, String owner)
          Stores a Access token generated fro Shindig client.
 
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
activate, applicationStarted, deactivate, getAdapter, registerContribution, registerExtension, unregisterContribution, unregisterExtension
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIRECTORY_NAME

public static final String DIRECTORY_NAME
See Also:
Constant Field Values
Constructor Detail

OAuthTokenStoreImpl

public OAuthTokenStoreImpl()
Method Detail

addVerifierToRequestToken

public OAuthToken addVerifierToRequestToken(String token,
                                            Long duration)
Description copied from interface: OAuthTokenStore
Generates a verification code and attache it to the REQUEST Token.

Specified by:
addVerifierToRequestToken in interface OAuthTokenStore

createAccessTokenFromRequestToken

public OAuthToken createAccessTokenFromRequestToken(OAuthToken requestToken)
Description copied from interface: OAuthTokenStore
Exchanges the REQUEST Token witha Real ACCESS Token (persistent) Token/TocketSecret Strings are regerated during the exchange.

Specified by:
createAccessTokenFromRequestToken in interface OAuthTokenStore

getClientAccessToken

public NuxeoOAuthToken getClientAccessToken(String appId,
                                            String owner)
                                     throws Exception
Description copied from interface: OAuthTokenStore
Get a Access token for the Shindig Client.

Specified by:
getClientAccessToken in interface OAuthTokenStore
Throws:
Exception

removeClientAccessToken

public void removeClientAccessToken(String appId,
                                    String owner)
                             throws Exception
Description copied from interface: OAuthTokenStore
Deletes a Client side Access Token.

Specified by:
removeClientAccessToken in interface OAuthTokenStore
Throws:
Exception

storeClientAccessToken

public void storeClientAccessToken(String consumerKey,
                                   String callBack,
                                   String token,
                                   String tokenSecret,
                                   String appId,
                                   String owner)
Description copied from interface: OAuthTokenStore
Stores a Access token generated fro Shindig client.

Specified by:
storeClientAccessToken in interface OAuthTokenStore

createRequestToken

public OAuthToken createRequestToken(String consumerKey,
                                     String callBack)
Description copied from interface: OAuthTokenStore
Creates a new REQUEST Token (transient)

Specified by:
createRequestToken in interface OAuthTokenStore

getAccessToken

public OAuthToken getAccessToken(String token)
Description copied from interface: OAuthTokenStore
Retrieves an ACCESS from the store.

Specified by:
getAccessToken in interface OAuthTokenStore

getRequestToken

public OAuthToken getRequestToken(String token)
Description copied from interface: OAuthTokenStore
Retrieves a REQUEST Token given a Token string (extracted from the Request).

Specified by:
getRequestToken in interface OAuthTokenStore

listAccessTokenForConsumer

public List<OAuthToken> listAccessTokenForConsumer(String consumerKey)
Description copied from interface: OAuthTokenStore
Lists ACCESS Token associated to a Consumer application.

Specified by:
listAccessTokenForConsumer in interface OAuthTokenStore

listAccessTokenForUser

public List<OAuthToken> listAccessTokenForUser(String login)
Description copied from interface: OAuthTokenStore
Lists ACCESS Token associated to a User.

Specified by:
listAccessTokenForUser in interface OAuthTokenStore

removeAccessToken

public void removeAccessToken(String token)
                       throws Exception
Description copied from interface: OAuthTokenStore
Deletes an ACCESS Token from the storage.

Specified by:
removeAccessToken in interface OAuthTokenStore
Throws:
Exception

removeRequestToken

public void removeRequestToken(String token)
Description copied from interface: OAuthTokenStore
Deletes a REQUEST Token.

Specified by:
removeRequestToken in interface OAuthTokenStore

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.