org.exoplatform.ws.security.oauth.impl
Class OAuthConsumerServiceImpl

java.lang.Object
  extended by org.exoplatform.ws.security.oauth.impl.OAuthConsumerServiceImpl
All Implemented Interfaces:
OAuthConsumerService

public final class OAuthConsumerServiceImpl
extends Object
implements OAuthConsumerService

Version:
$Id: $
Author:
Andrey Parfonov

Field Summary
static long DEFAULT_TOKEN_ALIVE_TIME
          Default token alive time is 5 hours.
 
Constructor Summary
OAuthConsumerServiceImpl(ExoOAuthClient oauthClient, org.exoplatform.container.xml.InitParams params)
          Without token cleaner.
OAuthConsumerServiceImpl(ExoOAuthClient oauthClient, OAuthTokenCleaner tokenCleaner, org.exoplatform.container.xml.InitParams params)
          With token cleaner.
 
Method Summary
 net.oauth.OAuthAccessor getAccessor(net.oauth.OAuthMessage oauthMessage)
          Get accessor, if accessor not found new one must be created.
 void removeAccessor(net.oauth.OAuthMessage oauthMessage)
          Remove accessor, can be used for removing accessor when client logout.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_TOKEN_ALIVE_TIME

public static final long DEFAULT_TOKEN_ALIVE_TIME
Default token alive time is 5 hours.

See Also:
Constant Field Values
Constructor Detail

OAuthConsumerServiceImpl

public OAuthConsumerServiceImpl(ExoOAuthClient oauthClient,
                                org.exoplatform.container.xml.InitParams params)
Without token cleaner. Tokens never expired.

Parameters:
oauthClient - the ExoOAuthClient instance.
params - initialized parameters.

OAuthConsumerServiceImpl

public OAuthConsumerServiceImpl(ExoOAuthClient oauthClient,
                                OAuthTokenCleaner tokenCleaner,
                                org.exoplatform.container.xml.InitParams params)
With token cleaner. Token will be removed after timeout.

Parameters:
oauthClient - the ExoOAuthClient instance.
tokenCleaner - the TokenCleaner.
params - initialized parameters.
Method Detail

getAccessor

public net.oauth.OAuthAccessor getAccessor(net.oauth.OAuthMessage oauthMessage)
                                    throws net.oauth.OAuthProblemException
Get accessor, if accessor not found new one must be created.

Specified by:
getAccessor in interface OAuthConsumerService
Parameters:
oauthMessage - the OAuthMessage. Must have at least two parameters
Returns:
satisfied accessor.
Throws:
net.oauth.OAuthProblemException - if can't get accessor and can't create new one.
See Also:
net.oauth.OAuth.OAUTH_TOKEN,, net.oauth.OAuth.OAUTH_TOKEN_SECRET.

removeAccessor

public void removeAccessor(net.oauth.OAuthMessage oauthMessage)
                    throws net.oauth.OAuthProblemException
Remove accessor, can be used for removing accessor when client logout.

Specified by:
removeAccessor in interface OAuthConsumerService
Parameters:
oauthMessage - the OAuthMessage. Must have at least two parameters
Throws:
net.oauth.OAuthProblemException - if accessor can't be removed.
See Also:
net.oauth.OAuth.OAUTH_TOKEN,, net.oauth.OAuth.OAUTH_TOKEN_SECRET.


Copyright © 2009 eXo Platform SAS. All Rights Reserved.