org.apache.shindig.social.core.oauth2
Class OAuth2DataServiceImpl

java.lang.Object
  extended by org.apache.shindig.social.core.oauth2.OAuth2DataServiceImpl
All Implemented Interfaces:
OAuth2DataService

public class OAuth2DataServiceImpl
extends java.lang.Object
implements OAuth2DataService


Constructor Summary
OAuth2DataServiceImpl(java.lang.String jsonLocation, BeanConverter converter, java.lang.String contextroot)
           
 
Method Summary
 OAuth2Code getAccessToken(java.lang.String accessToken)
          Retrieves an access token by its value.
 OAuth2Code getAuthorizationCode(java.lang.String clientId, java.lang.String authCode)
          Retrieves an authorization code by its value.
 OAuth2Client getClient(java.lang.String clientId)
          Retrieves a pre-registered client by ID.
 OAuth2Code getRefreshToken(java.lang.String refreshToken)
          Retrieves a refresh token by its value.
 void registerAccessToken(java.lang.String clientId, OAuth2Code accessToken)
          Registers an access token with a client.
 void registerAuthorizationCode(java.lang.String clientId, OAuth2Code authCode)
          Registers an authorization code with a client.
 void registerRefreshToken(java.lang.String clientId, OAuth2Code refreshToken)
          Registers a refresh token with a client.
 void unregisterAccessToken(java.lang.String clientId, java.lang.String accessToken)
          Unregisters an access token with a client.
 void unregisterAuthorizationCode(java.lang.String clientId, java.lang.String authCode)
          Unregisters an authorization code with a client.
 void unregisterRefreshToken(java.lang.String clientId, java.lang.String refreshToken)
          Unregisters a refresh token with a client.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OAuth2DataServiceImpl

@Inject
public OAuth2DataServiceImpl(java.lang.String jsonLocation,
                                    BeanConverter converter,
                                    java.lang.String contextroot)
                      throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

getClient

public OAuth2Client getClient(java.lang.String clientId)
Description copied from interface: OAuth2DataService
Retrieves a pre-registered client by ID.

Specified by:
getClient in interface OAuth2DataService
Parameters:
clientId - identifies the client to retrieve

getAuthorizationCode

public OAuth2Code getAuthorizationCode(java.lang.String clientId,
                                       java.lang.String authCode)
Description copied from interface: OAuth2DataService
Retrieves an authorization code by its value.

Specified by:
getAuthorizationCode in interface OAuth2DataService
Parameters:
clientId - identifies the client who owns the authorization code
authCode - is the value of the authorization code to get
Returns:
OAuth2Code is the retrieved authorization code

registerAuthorizationCode

public void registerAuthorizationCode(java.lang.String clientId,
                                      OAuth2Code authCode)
Description copied from interface: OAuth2DataService
Registers an authorization code with a client.

Specified by:
registerAuthorizationCode in interface OAuth2DataService
Parameters:
clientId - identifies the client who owns the authorization code
authCode - is the authorization code to register with the client

unregisterAuthorizationCode

public void unregisterAuthorizationCode(java.lang.String clientId,
                                        java.lang.String authCode)
Description copied from interface: OAuth2DataService
Unregisters an authorization code with a client.

Specified by:
unregisterAuthorizationCode in interface OAuth2DataService
Parameters:
clientId - identifies the client who owns the authorization code
authCode - is the value of the authorization code to unregister

getAccessToken

public OAuth2Code getAccessToken(java.lang.String accessToken)
Description copied from interface: OAuth2DataService
Retrieves an access token by its value.

Specified by:
getAccessToken in interface OAuth2DataService
Parameters:
accessToken - is the value of the accessToken to retrieve
Returns:
OAuth2Code is the retrieved access token; null if not found

registerAccessToken

public void registerAccessToken(java.lang.String clientId,
                                OAuth2Code accessToken)
Description copied from interface: OAuth2DataService
Registers an access token with a client.

Specified by:
registerAccessToken in interface OAuth2DataService
Parameters:
clientId - identifies the client to register the access token with
accessToken - is the access token to register with the client

unregisterAccessToken

public void unregisterAccessToken(java.lang.String clientId,
                                  java.lang.String accessToken)
Description copied from interface: OAuth2DataService
Unregisters an access token with a client.

Specified by:
unregisterAccessToken in interface OAuth2DataService
Parameters:
clientId - identifies the client who owns the access token
accessToken - is the value of the access token to unregister

getRefreshToken

public OAuth2Code getRefreshToken(java.lang.String refreshToken)
Description copied from interface: OAuth2DataService
Retrieves a refresh token by its value.

Specified by:
getRefreshToken in interface OAuth2DataService
Parameters:
refreshToken - is the value of the refresh token to retrieve
Returns:
OAuth2Code is the retrieved refresh token; null if not found

registerRefreshToken

public void registerRefreshToken(java.lang.String clientId,
                                 OAuth2Code refreshToken)
Description copied from interface: OAuth2DataService
Registers a refresh token with a client.

Specified by:
registerRefreshToken in interface OAuth2DataService
Parameters:
clientId - identifies the client who owns the refresh token
refreshToken - is the refresh token to register with the client

unregisterRefreshToken

public void unregisterRefreshToken(java.lang.String clientId,
                                   java.lang.String refreshToken)
Description copied from interface: OAuth2DataService
Unregisters a refresh token with a client.

Specified by:
unregisterRefreshToken in interface OAuth2DataService
Parameters:
clientId - identifies the client who owns the refresh token
refreshToken - is the value of the refresh token to unregister


Copyright © 2007-2012 The Apache Software Foundation. All Rights Reserved.