|
Compoze Software, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.compoze.security.PrincipalImpl | +--com.compoze.security.User
This class represents an application User. To instantiate
a user, you can use the constructor or one of the create()
methods.
Group
,
IUserAuthenticationFactory
, Serialized FormField Summary | |
protected java.util.Date |
m_lastLoginDate
|
Constructor Summary | |
User()
Constructor. |
|
User(java.lang.String sName)
Creates a new anonymous user with default time zone and locale and the specified unique user name. |
|
User(UserInfo userInfo)
Creates a new user with the specified user information and default time zone and locale. |
Method Summary | |
void |
addGroup(Group g)
Adds the group to the user. |
static User |
create(java.lang.String sName,
java.lang.String[] groupNames)
Creates a new user with the specified name and group membership. |
boolean |
equals(java.lang.Object obj)
Compares this principal to the specified object. |
java.lang.String |
getEmailAddress()
Gets the email address for this user. |
InfoStore |
getInfoStore()
Gets the info store for this user. |
java.util.Date |
getLastLoginDate()
Gets the last login date. |
java.util.Locale |
getLocale()
Gets the locale for this user. |
java.lang.Object |
getProperty(java.lang.String sPropertyTag)
Gets a property of the principal. |
java.util.TimeZone |
getTimeZone()
Gets the time zone for this user. |
UserInfo |
getUserInfo()
Gets the user information object for the user. |
java.util.List |
groups()
Returns an un-modifiable list of the groups this user has membership. |
boolean |
hasEmailAddress()
Checks if the user has an email address set. |
boolean |
isAnonymous()
Checks if this user is anonymous. |
boolean |
isMember(Group group)
Checks if this user is a member of the specified group. |
java.util.Map |
properties()
Gets the map of properties for this user. |
void |
setAnonymous(boolean bAnonymous)
Sets the if this user is anonymous. |
void |
setEmailAddress(java.lang.String sEmailAddress)
Sets the email address for this user. |
void |
setInfoStore(InfoStore infoStore)
Sets the info store for this user. |
void |
setLastLoginDate(java.util.Date lastLoginDate)
Sets the last login date. |
void |
setLocale(java.util.Locale locale)
Sets the locale for this user. |
void |
setProperty(java.lang.String sPropertyTag,
java.lang.Object property)
Sets the property for the user. |
void |
setTimeZone(java.util.TimeZone timeZone)
Sets the time zone for this user. |
void |
setUserInfo(UserInfo userInfo)
Sets the user information object for the user. |
java.lang.String |
toString()
Returns a string representation of this user. |
Methods inherited from class com.compoze.security.PrincipalImpl |
getName, getPrincipal, setName |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.security.Principal |
hashCode |
Field Detail |
protected java.util.Date m_lastLoginDate
Constructor Detail |
public User()
public User(java.lang.String sName)
sName
- the unique user name (may not be null
)public User(UserInfo userInfo)
userInfo
- the user information for this userMethod Detail |
public static User create(java.lang.String sName, java.lang.String[] groupNames)
sName
- the unique user name (may not be null
)groupNames
- an array of unique group names the user has membership (null
for none)public java.util.Locale getLocale()
public java.util.Date getLastLoginDate()
null
if not availablepublic void setLastLoginDate(java.util.Date lastLoginDate)
lastLoginDate
- the date or null
for not setpublic void setLocale(java.util.Locale locale)
locale
- the locale for this user (may not be null
)public java.util.TimeZone getTimeZone()
public void setTimeZone(java.util.TimeZone timeZone)
timeZone
- the time zone for this user (may not be null
)public void setEmailAddress(java.lang.String sEmailAddress)
sEmailAddress
- the email addresspublic boolean hasEmailAddress()
null
or empty.true
- if the user has an email address set; false
otherwisepublic java.lang.String getEmailAddress()
public boolean isAnonymous()
true
if this user is anonymous; false
otherwisepublic void setAnonymous(boolean bAnonymous)
bAnonymous
- true
if this user is anonymous; false
otherwisepublic InfoStore getInfoStore()
ejbruntime.properties
.public void setInfoStore(InfoStore infoStore)
infoStore
- the info store for this user (may not be null
)public boolean equals(java.lang.Object obj)
equals
in class PrincipalImpl
obj
- principal to compare withtrue
if the principal passed in is the same as that encapsulated by this principal; false
otherwisepublic UserInfo getUserInfo()
public void setUserInfo(UserInfo userInfo)
userInfo
- the user info (may not be null
)public void setProperty(java.lang.String sPropertyTag, java.lang.Object property)
sPropertyTag
- the property tagproperty
- the property valuepublic java.lang.Object getProperty(java.lang.String sPropertyTag)
sPropertyTag
- the property tag to getnull
if property does not existpublic java.util.Map properties()
public void addGroup(Group g)
g
- the group to add (may not be null
)public java.util.List groups()
Group
)public boolean isMember(Group group)
group
- the group whose membership is to be checkedtrue
if this user is a member of the group; false
otherwisepublic java.lang.String toString()
toString
in class PrincipalImpl
|
Compoze Software, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |