|
|||||||||
| 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
atg.security.XmlAccountManager
public class XmlAccountManager
An account manager/user authority that loads user account information from an XML file.
This is a fairly simplistic implementation that is best used for small sets of accounts or for prototyping purposes. Its primary limitation is that changes to the accounts are not persistent.
| Field Summary | |
|---|---|
static java.lang.String |
CLASS_VERSION
|
| Fields inherited from class atg.security.GenericAccountManager |
|---|
AUTHENTICATED, BAD_ACCOUNT_FAILURE, BAD_PASSWORD_FAILURE, CREATED_ACCOUNT, DEFAULT_GROUP_DOESNT_EXIST, INVALID_ACCOUNT, LOGIN_DISABLED_FAILURE, NO_PASSWORD_FAILURE, 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 | |
|---|---|
XmlAccountManager()
|
|
| Method Summary | |
|---|---|
Account |
createAccount(java.lang.String pAccountName,
int pType,
java.util.Map pAttributes)
Creates a new account with a given set of attributes. |
Account |
getAccount(java.lang.String pAccountName)
Version of getAccount() that loads the database if necessary |
atg.xml.XMLFile |
getAccountFile()
Returns the name of an XML file from which to obtain user information. |
Persona |
getPersona(java.lang.Object pId)
Version of getPersona() that loads the database if necessary. |
atg.xml.tools.XMLToolsFactory |
getXMLToolsFactory()
Returns the tools factory that creates an XML parser for this user authority. |
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. |
void |
removeAccount(java.lang.String pAccountName)
Removes an account with the indicated name, if possible. |
void |
setAccountFile(atg.xml.XMLFile mXmlFile)
Sets or changes the name of the XML file from which to obtain user information. |
boolean |
setPersonaeFor(User pUser,
java.lang.String pId)
Populates a user object with the persona information for the given user ID. |
void |
setXMLToolsFactory(atg.xml.tools.XMLToolsFactory pNewFactory)
Sets the tools factory that will be used to create an XML parser for this 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 |
| Methods inherited from interface atg.security.LoginUserAuthority |
|---|
getPasswordHasher |
| Methods inherited from interface atg.security.UserAuthority |
|---|
addAuthenticationFailedListener, addAuthenticationSucceededListener, getUserAuthorityName, removeAuthenticationFailedListener, removeAuthenticationSucceededListener, userDestroyed |
| Field Detail |
|---|
public static java.lang.String CLASS_VERSION
| Constructor Detail |
|---|
public XmlAccountManager()
| Method Detail |
|---|
public atg.xml.XMLFile getAccountFile()
public void setAccountFile(atg.xml.XMLFile mXmlFile)
public atg.xml.tools.XMLToolsFactory getXMLToolsFactory()
public void setXMLToolsFactory(atg.xml.tools.XMLToolsFactory pNewFactory)
public Persona getPersona(java.lang.Object pId)
getPersona in interface UserAuthoritygetPersona in class GenericAccountManagerPersonapublic java.util.Iterator listAccounts(int pType)
listAccounts in interface AccountManagerlistAccounts in class GenericAccountManagerpType - 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 AccountManagerlistMatchingAccounts in class GenericAccountManagerpExpression - 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 AccountManagergetAccount in class GenericAccountManagerpAccountName - 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 AccountManagercreateAccount in class GenericAccountManagerpAccountName - 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 AccountManagerremoveAccount in class GenericAccountManagerNoSuchAccountException
public boolean setPersonaeFor(User pUser,
java.lang.String pId)
setPersonaeFor in interface IdUserAuthoritysetPersonaeFor in class GenericAccountManager
public boolean login(User pUser,
java.lang.String pName,
java.lang.String pHashedPassword,
java.lang.Object pHashKey)
getPasswordHasher().
login in interface LoginUserAuthoritylogin in class GenericAccountManagerPasswordHasher
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||