org.jboss.seam.security.management
Class JpaIdentityStore
java.lang.Object
org.jboss.seam.security.management.JpaIdentityStore
- All Implemented Interfaces:
- IdentityStore
@Scope(value=APPLICATION)
@BypassInterceptors
public class JpaIdentityStore
- extends Object
- implements IdentityStore
The default identity store implementation, uses JPA as its persistence mechanism.
- Author:
- Shane Bryzak
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EVENT_ACCOUNT_CREATED
public static final String EVENT_ACCOUNT_CREATED
- See Also:
- Constant Field Values
EVENT_ACCOUNT_AUTHENTICATED
public static final String EVENT_ACCOUNT_AUTHENTICATED
- See Also:
- Constant Field Values
JpaIdentityStore
public JpaIdentityStore()
init
@Create
public void init()
loadRoles
protected void loadRoles()
createAccount
public boolean createAccount(String username,
String password)
- Specified by:
createAccount
in interface IdentityStore
deleteAccount
public boolean deleteAccount(String name)
- Specified by:
deleteAccount
in interface IdentityStore
grantRole
public boolean grantRole(String name,
String role)
- Specified by:
grantRole
in interface IdentityStore
revokeRole
public boolean revokeRole(String name,
String role)
- Specified by:
revokeRole
in interface IdentityStore
enableAccount
public boolean enableAccount(String name)
- Specified by:
enableAccount
in interface IdentityStore
disableAccount
public boolean disableAccount(String name)
- Specified by:
disableAccount
in interface IdentityStore
changePassword
public boolean changePassword(String name,
String password)
- Specified by:
changePassword
in interface IdentityStore
accountExists
public boolean accountExists(String name)
- Specified by:
accountExists
in interface IdentityStore
isEnabled
public boolean isEnabled(String name)
- Specified by:
isEnabled
in interface IdentityStore
getGrantedRoles
public List<String> getGrantedRoles(String name)
- Specified by:
getGrantedRoles
in interface IdentityStore
getImpliedRoles
public List<String> getImpliedRoles(String name)
- Specified by:
getImpliedRoles
in interface IdentityStore
authenticate
public boolean authenticate(String username,
String password)
- Specified by:
authenticate
in interface IdentityStore
validateUser
protected UserAccount validateUser(String name)
throws NoSuchUserException
- Retrieves a user UserAccount from persistent storage. If the UserAccount does
not exist, an IdentityManagementException is thrown.
- Parameters:
name
- The user's username
- Returns:
- The UserAccount for the specified user
- Throws:
NoSuchUserException
validateRole
protected UserAccount validateRole(String name)
- Retrieves a role UserAccount from persistent storage. If the UserAccount
does not exist, an IdentityManagementException is thrown.
- Parameters:
name
- The role name
- Returns:
- The UserAccount for the specific role
listUsers
public List<String> listUsers()
- Specified by:
listUsers
in interface IdentityStore
listUsers
public List<String> listUsers(String filter)
- Specified by:
listUsers
in interface IdentityStore
listRoles
public List<String> listRoles()
- Specified by:
listRoles
in interface IdentityStore
persistAccount
protected void persistAccount(UserAccount account)
mergeAccount
protected UserAccount mergeAccount(UserAccount account)
getAccountClass
public Class<? extends UserAccount> getAccountClass()
setAccountClass
public void setAccountClass(Class<? extends UserAccount> accountClass)
getEntityManagerName
public String getEntityManagerName()
setEntityManagerName
public void setEntityManagerName(String name)
hashPassword
protected String hashPassword(String password,
String saltPhrase)