jet.utils
Class UserPrincipal
java.lang.Object
jet.utils.DynamicBean
jet.utils.UserPrincipal
- All Implemented Interfaces:
- java.io.Serializable, java.security.Principal
public class UserPrincipal
- extends DynamicBean
- implements java.security.Principal, java.io.Serializable
- Author:
- markus.meisters@web.de
- See Also:
- Serialized Form
Field Summary |
static java.lang.String |
ID
static variable holding the fieldname for identifier property |
static java.lang.String |
KEY
|
private java.util.concurrent.locks.Lock |
lock
|
static java.lang.String |
NAME
static variable holding the fieldname for name property |
private java.lang.String[] |
roles
|
Constructor Summary |
UserPrincipal()
Creates a new instance of UserPrincipal |
Method Summary |
void |
addRole(java.lang.String newrole)
|
static boolean |
checkPassword(java.lang.String givenPassword,
java.lang.String cryptedPassword)
|
boolean |
equals(java.lang.Object obj)
|
java.lang.String |
getId()
|
java.lang.String[] |
getRoles()
|
boolean |
isUserInRole(java.lang.String role)
|
void |
setRoles(java.lang.String[] newroles)
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.security.Principal |
getName, hashCode, toString |
KEY
public static final java.lang.String KEY
- See Also:
- Constant Field Values
ID
public static final java.lang.String ID
- static variable holding the fieldname for identifier property
- See Also:
- Constant Field Values
NAME
public static final java.lang.String NAME
- static variable holding the fieldname for name property
- See Also:
- Constant Field Values
roles
private java.lang.String[] roles
lock
private java.util.concurrent.locks.Lock lock
UserPrincipal
public UserPrincipal()
- Creates a new instance of UserPrincipal
getId
public java.lang.String getId()
setRoles
public void setRoles(java.lang.String[] newroles)
addRole
public void addRole(java.lang.String newrole)
getRoles
public java.lang.String[] getRoles()
isUserInRole
public boolean isUserInRole(java.lang.String role)
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equals
in interface java.security.Principal
- Overrides:
equals
in class java.lang.Object
checkPassword
public static boolean checkPassword(java.lang.String givenPassword,
java.lang.String cryptedPassword)