public class JPAUsersRepository extends AbstractUsersRepository
Constructor and Description |
---|
JPAUsersRepository() |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(String name)
Returns whether or not this user is in the repository
|
int |
countUsers()
Returns a count of the users in the repository.
|
protected void |
doAddUser(String username,
String password)
Add the user with the given username and password
|
void |
doConfigure(org.apache.commons.configuration.HierarchicalConfiguration config) |
String |
getRealName(String name)
Returns the user name of the user matching name on an equalsIgnoreCase
basis.
|
User |
getUserByName(String name)
Get the user object with the specified user name.
|
void |
init() |
Iterator<String> |
list()
List users in repository.
|
void |
removeUser(String name)
Removes a user from the repository
|
void |
setEntityManagerFactory(javax.persistence.EntityManagerFactory entityManagerFactory)
Sets entity manager.
|
boolean |
test(String name,
String password)
Test if user with name 'name' has password 'password'.
|
void |
updateUser(User user)
Update the repository with the specified user object.
|
addUser, configure, getLogger, isValidUsername, setDomainList, setEnableVirtualHosting, setLog, supportVirtualHosting
public final void setEntityManagerFactory(javax.persistence.EntityManagerFactory entityManagerFactory)
entityManagerFactory
- the entityManager to set@PostConstruct public void init()
public User getUserByName(String name) throws UsersRepositoryException
name
- the name of the user to retrieveUsersRepositoryException
- if errorpublic String getRealName(String name) throws UsersRepositoryException
name
- the name to case-correctUsersRepositoryException
public void updateUser(User user) throws UsersRepositoryException
UsersRepositoryException
public void removeUser(String name) throws UsersRepositoryException
name
- the user to remove from the repositoryUsersRepositoryException
public boolean contains(String name) throws UsersRepositoryException
name
- the name to check in the repositoryUsersRepositoryException
public boolean test(String name, String password) throws UsersRepositoryException
name
- the name of the user to be testedpassword
- the password to be testedUsersRepositoryException
- if errorpublic int countUsers() throws UsersRepositoryException
UsersRepositoryException
public Iterator<String> list() throws UsersRepositoryException
UsersRepositoryException
public void doConfigure(org.apache.commons.configuration.HierarchicalConfiguration config) throws org.apache.commons.configuration.ConfigurationException
doConfigure
in class AbstractUsersRepository
org.apache.commons.configuration.ConfigurationException
AbstractUsersRepository.doConfigure(org.apache.commons.configuration.HierarchicalConfiguration)
protected void doAddUser(String username, String password) throws UsersRepositoryException
AbstractUsersRepository
doAddUser
in class AbstractUsersRepository
UsersRepositoryException
- If an error occurredAbstractUsersRepository.doAddUser(java.lang.String, java.lang.String)
Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.