|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectatg.nucleus.logging.VariableArgumentApplicationLoggingImpl
atg.nucleus.GenericService
atg.nucleus.RegisteredService
atg.security.GenericUserAuthority
atg.security.GenericAccountManager
public class GenericAccountManager
A generic implementation of an account manager/user authority.
| Field Summary | |
|---|---|
protected static java.lang.String |
AUTHENTICATED
|
protected static java.lang.String |
BAD_ACCOUNT_FAILURE
|
protected static java.lang.String |
BAD_PASSWORD_FAILURE
|
static java.lang.String |
CLASS_VERSION
|
protected static java.lang.String |
CREATED_ACCOUNT
|
protected static java.lang.String |
DEFAULT_GROUP_DOESNT_EXIST
|
protected static java.lang.String |
INVALID_ACCOUNT
|
protected static java.lang.String |
LOGIN_DISABLED_FAILURE
|
protected static java.lang.String |
NO_PASSWORD_FAILURE
|
protected static java.lang.String |
REMOVED_ACCOUNT
|
| Fields inherited from class atg.nucleus.GenericService |
|---|
SERVICE_INFO_KEY |
| Fields inherited from interface atg.security.AccountTypes |
|---|
ANY_ACCOUNT, GROUP_ACCOUNT, LOGIN_ACCOUNT, PRIVILEGE_ACCOUNT |
| Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
|---|
DEFAULT_LOG_TRACE_STATUS |
| Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
|---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
| Constructor Summary | |
|---|---|
GenericAccountManager()
|
|
GenericAccountManager(java.lang.String pUserAuthorityName)
|
|
| Method Summary | |
|---|---|
protected void |
addAccount(Account pAccount)
Adds an account to the set of accounts. |
void |
clear()
Clears out all accounts. |
Account |
createAccount(java.lang.String pAccountName,
int pType,
java.util.Map pAttributes)
Creates a new account with a given set of attributes. |
void |
doStartService()
When this service starts up, we may want to punch in some new accounts. |
Account |
getAccount(java.lang.String pAccountName)
Retrieves the account object for the account with the given name. |
AccountInitializer |
getAccountInitializer()
Returns the account initializer that will set up our standard accounts, if any. |
protected java.util.Iterator |
getAccountIterator()
Returns an iterator for all accounts. |
java.lang.String |
getAttributeResourceBundle()
Returns the name of the resource bundle used for translating attribute names to resource names. |
java.lang.String[] |
getDefaultLoginGroups()
Returns the set of groups that are assigned to a new login account. |
java.lang.String |
getDescriptionAttribute()
Returns the name of the group or privilege account attribute that describes the account in human-readable terms. |
java.lang.String |
getDisplayNameForAttribute(java.lang.String pAttributeName)
Returns the display name that should be associated with an attribute. |
java.lang.String |
getFirstNameAttribute()
Returns the name of the attribute that contains the first name of the owner of a login account. |
java.lang.String |
getLastNameAttribute()
Returns the name of the attribute that contains the last name of the owner of a login account. |
java.lang.String |
getPasswordAttribute()
Returns the name of the attribute that contains the password for a login account. |
PasswordHasher |
getPasswordHasher()
Returns the password hasher that should be used to manage password encryption. |
Persona |
getPersona(java.lang.Object pId)
Returns a persona for the given ID object. |
java.util.Iterator |
listAccounts(int pType)
Returns an iterator of accounts with a particular set of types. |
java.util.Iterator |
listMatchingAccounts(java.lang.String pExpression,
int pType)
Lists accounts that match a given expression. |
boolean |
login(User pUser,
java.lang.String pName,
java.lang.String pHashedPassword,
java.lang.Object pHashKey)
Authenticates a user, populating the User object with appropriate personae. |
protected Account |
newAccount(java.lang.String pAccountName,
int pType,
java.util.Map pAttributes)
Hook that allows subclasses to override the type of account that we create. |
void |
removeAccount(java.lang.String pAccountName)
Removes an account with the indicated name, if possible. |
void |
setAccountInitializer(AccountInitializer pInitializer)
Changes the account initializer that will set up our standard accounts, if any. |
void |
setAccountMatchFields(java.lang.String[] pFields)
Changes the set of attribute fields that are searched by listMatchingAccounts(). |
void |
setAttributeResourceBundle(java.lang.String pBundleName)
Changes the resource bundle used for translating attribute names to resource names. |
void |
setDefaultLoginGroups(java.lang.String[] pGroups)
Changes the set of groups that are assigned to a new login account. |
void |
setDescriptionAttribute(java.lang.String pDescriptionAttribute)
Changes the name of the attribute used for determining the description of a group or privilege account. |
void |
setFirstNameAttribute(java.lang.String pFirstNameAttribute)
Changes the name of the attribute used for determining the first name of a login account owner. |
void |
setLastNameAttribute(java.lang.String pLastNameAttribute)
Changes the name of the attribute used for determining the last name of a login account owner. |
void |
setPasswordAttribute(java.lang.String pPasswordAttribute)
Changes the name of the attribute used for determining the password for a login account. |
void |
setPasswordHasher(PasswordHasher pHasher)
Changes the password hasher used for obfuscating passwords. |
boolean |
setPersonaeFor(User pUser,
java.lang.String pAccountName)
Populates a User object with appropriate personae for the user with the indicated ID. |
void |
setUserAuthorityName(java.lang.String pUserAuthorityName)
Changes the name reported for the user authority. |
| Methods inherited from class atg.nucleus.RegisteredService |
|---|
addToRegistry, getRegistry, getRegistryName, getServiceName, removeFromRegistry, setRegistryName, setServiceName, startService, stopService |
| Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
|---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface atg.security.UserAuthority |
|---|
addAuthenticationFailedListener, addAuthenticationSucceededListener, getUserAuthorityName, removeAuthenticationFailedListener, removeAuthenticationSucceededListener, userDestroyed |
| Field Detail |
|---|
public static java.lang.String CLASS_VERSION
protected static final java.lang.String AUTHENTICATED
protected static final java.lang.String BAD_ACCOUNT_FAILURE
protected static final java.lang.String BAD_PASSWORD_FAILURE
protected static final java.lang.String CREATED_ACCOUNT
protected static final java.lang.String DEFAULT_GROUP_DOESNT_EXIST
protected static final java.lang.String INVALID_ACCOUNT
protected static final java.lang.String LOGIN_DISABLED_FAILURE
protected static final java.lang.String NO_PASSWORD_FAILURE
protected static final java.lang.String REMOVED_ACCOUNT
| Constructor Detail |
|---|
public GenericAccountManager()
public GenericAccountManager(java.lang.String pUserAuthorityName)
| Method Detail |
|---|
public AccountInitializer getAccountInitializer()
public void setAccountInitializer(AccountInitializer pInitializer)
public void setAccountMatchFields(java.lang.String[] pFields)
listMatchingAccounts(java.lang.String, int)public java.lang.String getAttributeResourceBundle()
public void setAttributeResourceBundle(java.lang.String pBundleName)
public java.lang.String[] getDefaultLoginGroups()
public void setDefaultLoginGroups(java.lang.String[] pGroups)
public void setDescriptionAttribute(java.lang.String pDescriptionAttribute)
public void setFirstNameAttribute(java.lang.String pFirstNameAttribute)
public void setLastNameAttribute(java.lang.String pLastNameAttribute)
public void setPasswordAttribute(java.lang.String pPasswordAttribute)
public void setPasswordHasher(PasswordHasher pHasher)
public void setUserAuthorityName(java.lang.String pUserAuthorityName)
setUserAuthorityName in class GenericUserAuthorityprotected void addAccount(Account pAccount)
public void clear()
protected java.util.Iterator getAccountIterator()
protected Account newAccount(java.lang.String pAccountName,
int pType,
java.util.Map pAttributes)
public Persona getPersona(java.lang.Object pId)
getPersona() is called.This means, for instance, that a change to a group will not take effect for any user who has an active persona.
getPersona in interface UserAuthoritygetPersona in class GenericUserAuthorityPersonapublic void doStartService()
doStartService in class GenericServicepublic java.util.Iterator listAccounts(int pType)
listAccounts in interface AccountManagerpType - The account type(s) to list. You may logical-or
the types togeter to select a union.AccountTypes
public java.util.Iterator listMatchingAccounts(java.lang.String pExpression,
int pType)
listMatchingAccounts in interface AccountManagerpExpression - The expression to use to determine which accounts
to list. Currently the language used for the
expression is undefined.pType - The account type(s) to match against. You may logical-or
the types togeter to select a union.AccountTypespublic Account getAccount(java.lang.String pAccountName)
getAccount in interface AccountManagerpAccountName - The name of the account to retrieve.
public Account createAccount(java.lang.String pAccountName,
int pType,
java.util.Map pAttributes)
throws AccountExistsException,
InvalidAttributeException,
PermissionDeniedException
createAccount in interface AccountManagerpAccountName - The name of the account to create.pAttributes - Set of attributes that should be set in the new
account. Usually at least "password" is required.
All attribute values must be strings.pType - The type of the account to create.
AccountExistsException
InvalidAttributeException
PermissionDeniedExceptionAccountTypes
public void removeAccount(java.lang.String pAccountName)
throws NoSuchAccountException
removeAccount in interface AccountManagerNoSuchAccountExceptionpublic java.lang.String getDescriptionAttribute()
getDescriptionAttribute in interface AccountManagerpublic java.lang.String getFirstNameAttribute()
getFirstNameAttribute in interface AccountManagerpublic java.lang.String getLastNameAttribute()
getLastNameAttribute in interface AccountManagerpublic java.lang.String getPasswordAttribute()
getPasswordAttribute in interface AccountManagerpublic PasswordHasher getPasswordHasher()
getPasswordHasher in interface AccountManagergetPasswordHasher in interface LoginUserAuthoritypublic java.lang.String getDisplayNameForAttribute(java.lang.String pAttributeName)
getDisplayNameForAttribute in interface atg.security.I18nAccountManager
public boolean setPersonaeFor(User pUser,
java.lang.String pAccountName)
Warning: This does not attempt to keep persona and account
information consistent. Changes made to the account will not become
effective until the next time setPersonaeFor() is called.
setPersonaeFor in interface IdUserAuthority
public boolean login(User pUser,
java.lang.String pName,
java.lang.String pHashedPassword,
java.lang.Object pHashKey)
getPasswordHasher().
login in interface LoginUserAuthorityPasswordHasher
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||