public class XmlAccountManager extends GenericAccountManager implements IdUserAuthority, LoginUserAuthority
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.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CLASS_VERSION |
AUTHENTICATED, BAD_ACCOUNT_FAILURE, BAD_PASSWORD_FAILURE, CREATED_ACCOUNT, DEFAULT_GROUP_DOESNT_EXIST, INVALID_ACCOUNT, LOGIN_DISABLED_FAILURE, NO_PASSWORD_FAILURE, REMOVED_ACCOUNTSERVICE_INFO_KEYANY_ACCOUNT, GROUP_ACCOUNT, LOGIN_ACCOUNT, PRIVILEGE_ACCOUNTDEFAULT_LOG_TRACE_STATUSDEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS| Constructor and Description |
|---|
XmlAccountManager() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
addAccount, clear, doStartService, getAccountInitializer, getAccountIterator, getAlternateUserPasswordHasher, getAttributeResourceBundle, getDefaultLoginGroups, getDescriptionAttribute, getDisplayNameForAttribute, getFirstNameAttribute, getLastNameAttribute, getPasswordAttribute, getPasswordHasher, getPasswordHasherAttribute, loginWithUserPasswordHasher, newAccount, setAccountInitializer, setAccountMatchFields, setAlternateUserPasswordHasher, setAttributeResourceBundle, setDefaultLoginGroups, setDescriptionAttribute, setFirstNameAttribute, setLastNameAttribute, setPasswordAttribute, setPasswordHasher, setPasswordHasherAttribute, setUserAuthorityNameaddAuthenticationFailedListener, addAuthenticationSucceededListener, addSpecialPersona, fireAuthenticationFailedEvent, fireAuthenticationSucceededEvent, getProxyUserAuthorities, getSpecialPersonae, getSupportsEveryone, getUserAuthorityName, removeAuthenticationFailedListener, removeAuthenticationSucceededListener, removeSpecialPersona, setProxyUserAuthorities, setSpecialPersonae, setSupportsEveryone, userDestroyedaddToRegistry, getRegistry, getRegistryName, getServiceName, removeFromRegistry, setRegistryName, setServiceName, startService, stopServiceaddLogListener, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfovlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarningclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAlternateUserPasswordHasher, getPasswordHasher, loginWithUserPasswordHasheraddAuthenticationFailedListener, addAuthenticationSucceededListener, getUserAuthorityName, removeAuthenticationFailedListener, removeAuthenticationSucceededListener, userDestroyedpublic 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.AccountTypespublic 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.AccountExistsExceptionInvalidAttributeExceptionPermissionDeniedExceptionAccountTypespublic void removeAccount(java.lang.String pAccountName)
throws NoSuchAccountException
removeAccount in interface AccountManagerremoveAccount in class GenericAccountManagerNoSuchAccountExceptionpublic boolean setPersonaeFor(User pUser, java.lang.String pId)
setPersonaeFor in interface IdUserAuthoritysetPersonaeFor in class GenericAccountManagerpublic boolean login(User pUser, java.lang.String pName, java.lang.String pHashedPassword, java.lang.Object pHashKey)
getPasswordHasher().login in interface LoginUserAuthoritylogin in class GenericAccountManagerPasswordHasher