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_ACCOUNT
SERVICE_INFO_KEY
ANY_ACCOUNT, GROUP_ACCOUNT, LOGIN_ACCOUNT, PRIVILEGE_ACCOUNT
DEFAULT_LOG_TRACE_STATUS
DEFAULT_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, getPasswordHasherConfigurer, loginWithUserPasswordHasher, newAccount, setAccountInitializer, setAccountMatchFields, setAlternateUserPasswordHasher, setAttributeResourceBundle, setDefaultLoginGroups, setDescriptionAttribute, setFirstNameAttribute, setLastNameAttribute, setPasswordAttribute, setPasswordHasher, setPasswordHasherAttribute, setPasswordHasherConfigurer, setUserAuthorityName
addAuthenticationFailedListener, addAuthenticationSucceededListener, addSpecialPersona, fireAuthenticationFailedEvent, fireAuthenticationSucceededEvent, getProxyUserAuthorities, getSpecialPersonae, getSupportsEveryone, getUserAuthorityName, removeAuthenticationFailedListener, removeAuthenticationSucceededListener, removeSpecialPersona, setProxyUserAuthorities, setSpecialPersonae, setSupportsEveryone, userDestroyed
addToRegistry, getRegistry, getRegistryName, getServiceName, removeFromRegistry, setRegistryName, setServiceName, startService, stopService
addLogListener, 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, setServiceInfo
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAlternateUserPasswordHasher, getPasswordHasher, loginWithUserPasswordHasher
addAuthenticationFailedListener, addAuthenticationSucceededListener, getUserAuthorityName, removeAuthenticationFailedListener, removeAuthenticationSucceededListener, userDestroyed
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 UserAuthority
getPersona
in class GenericAccountManager
Persona
public java.util.Iterator listAccounts(int pType)
listAccounts
in interface AccountManager
listAccounts
in class GenericAccountManager
pType
- 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 AccountManager
listMatchingAccounts
in class GenericAccountManager
pExpression
- 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.AccountTypes
public Account getAccount(java.lang.String pAccountName)
getAccount
in interface AccountManager
getAccount
in class GenericAccountManager
pAccountName
- 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 AccountManager
createAccount
in class GenericAccountManager
pAccountName
- 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
PermissionDeniedException
AccountTypes
public void removeAccount(java.lang.String pAccountName) throws NoSuchAccountException
removeAccount
in interface AccountManager
removeAccount
in class GenericAccountManager
NoSuchAccountException
public boolean setPersonaeFor(User pUser, java.lang.String pId)
setPersonaeFor
in interface IdUserAuthority
setPersonaeFor
in class GenericAccountManager
public boolean login(User pUser, java.lang.String pName, java.lang.String pHashedPassword, java.lang.Object pHashKey)
getPasswordHasher()
.login
in interface LoginUserAuthority
login
in class GenericAccountManager
PasswordHasher