com.atlassian.crowd.manager
Class GenericManager

java.lang.Object
  extended by com.atlassian.crowd.manager.GenericManager
Direct Known Subclasses:
ApplicationManagerGeneric, DirectoryManagerGeneric

public abstract class GenericManager
extends java.lang.Object


Field Summary
protected  CacheManager cacheManager
           
protected  I18nHelper i18nHelper
           
protected  org.apache.log4j.Logger logger
           
protected  PropertyManager propertyManager
           
protected  TokenDAO tokenDAO
           
 
Constructor Summary
GenericManager()
           
 
Method Summary
protected  Token generateToken(long directoryID, AuthenticationContext authenticationContext)
          This method will return a Token based on the passed in parameters.
protected  Token genericValidateToken(java.lang.String token, ValidationFactor[] validationFactors)
          Will validate a token key with the given ValidationFactor's against one (if it exists) in the datastore.
 PropertyManager getPropertyManager()
           
 TokenDAO getTokenDAO()
           
protected  boolean hasAccess(Application application, Token token)
           
protected  boolean hasAccess(Application application, Token token, boolean ignoreCache)
           
 void setCacheManager(CacheManager cacheManager)
           
 void setI18nHelper(I18nHelper i18nHelper)
          Autowire internationalized resource bundle helper.
 void setPropertyManager(PropertyManager propertyManager)
           
 void setTokenDAO(TokenDAO tokenDAO)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.log4j.Logger logger

tokenDAO

protected TokenDAO tokenDAO

propertyManager

protected PropertyManager propertyManager

i18nHelper

protected I18nHelper i18nHelper

cacheManager

protected CacheManager cacheManager
Constructor Detail

GenericManager

public GenericManager()
Method Detail

generateToken

protected Token generateToken(long directoryID,
                              AuthenticationContext authenticationContext)
                       throws InvalidTokenException
This method will return a Token based on the passed in parameters. If a token already exists in the datastore, this token will be returned with an updated lastAccessed time. If a token is not found based on the passed in parameters a new Token will be generated an stored in the datastore.

Parameters:
directoryID - the directoryID you wish to generate a Token for
authenticationContext - holder for the required attributes to authenticate against the Crowd server
Returns:
a Token
Throws:
InvalidTokenException - if there was an issue generating the key for a token.

genericValidateToken

protected Token genericValidateToken(java.lang.String token,
                                     ValidationFactor[] validationFactors)
                              throws InvalidTokenException,
                                     PersistenceException,
                                     PropertyManagerException
Will validate a token key with the given ValidationFactor's against one (if it exists) in the datastore.

Parameters:
token - the key of a Token
validationFactors - the ValidationFactor's that are being used for authentication
Returns:
the existing token if there is a match (with an updated lastAccessed time)
Throws:
InvalidTokenException - thrown if the token keys are not equal, or the token has expired, or the token does not exist
PersistenceException - if there is an issue finding, updating or removing the token.
PropertyManagerException - if there is an issue finding the session time.

hasAccess

protected boolean hasAccess(Application application,
                            Token token)
                     throws PropertyManagerException,
                            CacheManagerException,
                            DirectoryInstantiationException,
                            java.rmi.RemoteException
Throws:
PropertyManagerException
CacheManagerException
DirectoryInstantiationException
java.rmi.RemoteException

hasAccess

protected boolean hasAccess(Application application,
                            Token token,
                            boolean ignoreCache)
                     throws PropertyManagerException,
                            CacheManagerException,
                            DirectoryInstantiationException,
                            java.rmi.RemoteException
Throws:
PropertyManagerException
CacheManagerException
DirectoryInstantiationException
java.rmi.RemoteException

setI18nHelper

public void setI18nHelper(I18nHelper i18nHelper)
Autowire internationalized resource bundle helper.

Parameters:
i18nHelper - resource bundle helper.

getTokenDAO

public TokenDAO getTokenDAO()

setTokenDAO

public void setTokenDAO(TokenDAO tokenDAO)

getPropertyManager

public PropertyManager getPropertyManager()

setPropertyManager

public void setPropertyManager(PropertyManager propertyManager)

setCacheManager

public void setCacheManager(CacheManager cacheManager)


Copyright © 2008 Atlassian Software Systems Pty Ltd. All Rights Reserved.