public abstract class TorqueAbstractUserManager extends AbstractUserManager
ROLE
Constructor and Description |
---|
TorqueAbstractUserManager() |
Modifier and Type | Method and Description |
---|---|
boolean |
checkExists(String userName)
Check whether a specified user's account exists.
|
void |
configure(org.apache.avalon.framework.configuration.Configuration conf)
Avalon Service lifecycle method
|
protected abstract <T extends User> |
doSelectAllUsers(Connection con)
Get all specialized Users
|
protected abstract <T extends User> |
doSelectById(Integer id,
Connection con)
Get a specialized User by id
|
protected abstract <T extends User> |
doSelectByName(String name,
Connection con)
Get a specialized User by name
|
UserSet |
getAllUsers()
Retrieves all users defined in the system.
|
Boolean |
getCustomPeer() |
String |
getPeerClassName() |
<T extends User> |
getUser(String userName)
Retrieve a user from persistent storage using username as the
key.
|
<T extends User> |
getUserById(Object id)
Retrieve a User object with specified id.
|
protected <T extends User> |
persistNewUser(T user)
Creates new user account with specified attributes.
|
void |
removeUser(User user)
Removes an user account from the system.
|
void |
saveUser(User user)
Stores User attributes.
|
void |
setCustomPeer(Boolean customPeer) |
void |
setPeerClassName(String peerClassName) |
addUser, authenticate, changePassword, checkExists, forcePassword, getACL, getACLFactory, getUser, getUserInstance, getUserInstance
getClassName, setClassName
dispose, getGroupManager, getPermissionManager, getRoleManager, getServiceManager, getUserManager, release, resolve, service
public void configure(org.apache.avalon.framework.configuration.Configuration conf) throws org.apache.avalon.framework.configuration.ConfigurationException
configure
in interface org.apache.avalon.framework.configuration.Configurable
configure
in class AbstractEntityManager
org.apache.avalon.framework.configuration.ConfigurationException
public Boolean getCustomPeer()
public void setCustomPeer(Boolean customPeer)
public String getPeerClassName()
public void setPeerClassName(String peerClassName)
protected abstract <T extends User> List<T> doSelectAllUsers(Connection con) throws org.apache.torque.TorqueException
con
- a database connectionorg.apache.torque.TorqueException
- if any database error occursprotected abstract <T extends User> T doSelectByName(String name, Connection con) throws org.apache.torque.NoRowsException, org.apache.torque.TooManyRowsException, org.apache.torque.TorqueException
name
- the name of the groupcon
- a database connectionorg.apache.torque.NoRowsException
- if no such group existsorg.apache.torque.TooManyRowsException
- if multiple groups with the given name existorg.apache.torque.TorqueException
- if any other database error occursprotected abstract <T extends User> T doSelectById(Integer id, Connection con) throws org.apache.torque.NoRowsException, org.apache.torque.TooManyRowsException, org.apache.torque.TorqueException
id
- the id of the groupcon
- a database connectionorg.apache.torque.NoRowsException
- if no such group existsorg.apache.torque.TooManyRowsException
- if multiple groups with the given id existorg.apache.torque.TorqueException
- if any other database error occurspublic void removeUser(User user) throws DataBackendException, UnknownEntityException
user
- the object describing the account to be removed.DataBackendException
- if there was an error accessing the data
backend.UnknownEntityException
- if the user account is not present.protected <T extends User> T persistNewUser(T user) throws DataBackendException
persistNewUser
in class AbstractUserManager
user
- the object describing account to be created.DataBackendException
- if there was an error accessing the
data backend.EntityExistsException
- if the user account already exists.public void saveUser(User user) throws DataBackendException, UnknownEntityException
user
- The User to be stored.DataBackendException
- if there was an error accessing the data
backend.UnknownEntityException
- if the role does not exist.public boolean checkExists(String userName) throws DataBackendException
userName
- The name of the user to be checked.DataBackendException
- if there was an error accessing
the data backend.public <T extends User> T getUser(String userName) throws UnknownEntityException, DataBackendException
getUser
in interface UserManager
getUser
in class AbstractUserManager
userName
- the name of the user.UnknownEntityException
- if the user's account does not
exist in the database.DataBackendException
- if there is a problem accessing the
storage.public UserSet getAllUsers() throws DataBackendException
DataBackendException
- if there was an error accessing the data
backend.public <T extends User> T getUserById(Object id) throws DataBackendException, UnknownEntityException
getUserById
in interface UserManager
getUserById
in class AbstractUserManager
id
- the id of the User.DataBackendException
- if there was an error accessing the data backend.UnknownEntityException
- if the user does not exist.Copyright © 2011-2015 The Apache Software Foundation. All Rights Reserved.