com.stratelia.webactiv.beans.admin
Class UserDetail

java.lang.Object
  extended by com.stratelia.webactiv.beans.admin.UserDetail
All Implemented Interfaces:
Serializable, Comparable<UserDetail>
Direct Known Subclasses:
UserDetailWithProfiles, UserFull, UserProfileEntity

public class UserDetail
extends Object
implements Serializable, Comparable<UserDetail>

See Also:
Serialized Form

Field Summary
static String CURRENT_REQUESTER_KEY
           
 
Constructor Summary
UserDetail()
          Constructor
UserDetail(UserDetail toClone)
           
 
Method Summary
 int compareTo(UserDetail other)
           
 boolean equals(Object other)
           
 UserAccessLevel getAccessLevel()
          Get user's access level
static List<UserDetail> getAll()
          Gets the detail about all the users in Silverpeas, whatever their domain.
static List<UserDetail> getAllInDomain(String domainId)
          Gets the detail about all the users belonging in the specified domain.
static UserDetail getAnonymousUser()
          Gets the anonymous user or null if no such user exists.
protected static String getAnonymousUserId()
          Gets the unique identifier of the anonymous user as set in the general look properties.
 String getAvatar()
           
 String getAvatarFileName()
           
static UserDetail getById(String userId)
          Gets the detail about the specified user.
 Date getCreationDate()
           
static UserDetail getCurrentRequester()
          Gets the detail about the current user behind a request of treatment processing.
 String getDisplayedName()
           
 Domain getDomain()
          Gets the domain to which this user belongs.
 String getDomainId()
          Get user's domain id
 String getDurationOfCurrentSession()
          Gets the duration of the current user session since its last registered login date.
 String geteMail()
          Get user's email
 Date getExpirationDate()
           
 String getFirstName()
          Get user's first name
 String getId()
          Get user id as stored in database
 Date getLastLoginCredentialUpdateDate()
           
 Date getLastLoginDate()
           
 String getLastName()
          Get user's last name
 String getLogin()
          Get user's login
 String getLoginAnswer()
           
 String getLoginQuestion()
           
 int getNbSuccessfulLoginAttempts()
           
 Integer getNotifManualReceiverLimit()
           
protected static OrganisationController getOrganisationController()
           
 Date getSaveDate()
           
 String getSmallAvatar()
           
 String getSpecificId()
          Get specific user id
 UserState getState()
          Please use isValidState() to retrieve user validity information.
 Date getStateSaveDate()
           
 String getStatus()
           
 Date getTosAcceptanceDate()
           
 int getUserManualNotificationUserReceiverLimitValue()
          Gets the maximum user receivers the user can notify manually.
 UserPreferences getUserPreferences()
          Gets the preferences of this user.
 int getVersion()
           
 int hashCode()
           
 boolean isAccessAdmin()
           
 boolean isAccessDomainManager()
           
 boolean isAccessGuest()
           
 boolean isAccessPdcManager()
           
 boolean isAccessSpaceManager()
           
 boolean isAccessUnknown()
           
 boolean isAccessUser()
           
 boolean isActivatedState()
          This method indicates if the user is activated.
static boolean isActivatedStateFor(String userId)
           
 boolean isAnonymous()
          Is the user is the anonymous one?
static boolean isAnonymousUser(String userId)
          Is the specified user is the anonymous one?
static boolean isAnonymousUserExist()
          Is the anonymous user exist in this running Silverpeas application?
 boolean isAvatarPersonnalized()
           
 boolean isBackOfficeVisible()
           
 boolean isBlockedState()
          This method is the only one able to indicate the user blocked state.
 boolean isConnected()
          Is this user connected to Silverpeas?
 boolean isDeactivatedState()
          This method is the only one able to indicate the user deactivated state.
 boolean isDeletedState()
          This method is the only one able to indicate the user deletion state.
 boolean isDomainAdminRestricted()
           
 boolean isDomainRestricted()
          Is the specified user is restricted to access the resource in its own domain?
 boolean isExpiredState()
          This method is the only one able to indicate the user expiration state.
 boolean isFullyDefined()
           
 boolean isInRelationWithOrInvitedBy(String userId)
          Indicates if the current user is in relation with, or invited by, a user represented by the given identifier.
 boolean isUserManualNotificationUserReceiverLimit()
          Indicates if a limitation exists about the number of receivers the user can notify manually.
 boolean isValidState()
          This method is the only one able to indicate the user validity state.
 void setAccessLevel(UserAccessLevel accessLevel)
          Set user access level
 void setCreationDate(Date creationDate)
           
 void setDomainId(String domainId)
          Set user domain id
 void seteMail(String seMail)
          Set user's email
 void setExpirationDate(Date expirationDate)
           
 void setFirstName(String firstName)
          Set user first name
 void setId(String id)
          Set user identifier
 void setLastLoginCredentialUpdateDate(Date lastLoginCredentialUpdateDate)
           
 void setLastLoginDate(Date lastLoginDate)
           
 void setLastName(String sLastName)
          Set user last name
 void setLogin(String login)
          Set user login
 void setLoginAnswer(String loginAnswer)
          Set the login answer
 void setLoginQuestion(String loginQuestion)
          Set the login question
 void setNbSuccessfulLoginAttempts(int nbSuccessfulLoginAttempts)
           
 void setNotifManualReceiverLimit(Integer notifManualReceiverLimit)
          Sets the maximum user receivers the user can notify manually from the persistence context.
 void setSaveDate(Date saveDate)
           
 void setSpecificId(String specificId)
          Set specific user id
 void setState(UserState state)
          The state of the user (account) is updated and the according save date too.
 void setStateSaveDate(Date stateSaveDate)
           
 void setTosAcceptanceDate(Date tosAcceptanceDate)
           
 void setUserManualNotificationUserReceiverLimit(Integer limit)
          Sets the maximum user receivers the user can notify manually.
 void setVersion(int version)
           
 void traceUser()
          Dump user values to the trace system
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CURRENT_REQUESTER_KEY

public static final String CURRENT_REQUESTER_KEY
Constructor Detail

UserDetail

public UserDetail()
Constructor


UserDetail

public UserDetail(UserDetail toClone)
Method Detail

getById

public static UserDetail getById(String userId)
Gets the detail about the specified user.

Parameters:
userId - the unique identifier of the user to get.
Returns:
the detail about the user with the specified identifier or null if no such user exists.

getCurrentRequester

public static UserDetail getCurrentRequester()
Gets the detail about the current user behind a request of treatment processing.

Returns:
the detail about the user above described.

isActivatedStateFor

public static boolean isActivatedStateFor(String userId)
See Also:
isActivatedState()

getAll

public static List<UserDetail> getAll()
Gets the detail about all the users in Silverpeas, whatever their domain.

Returns:
a list with all the users in Silverpeas.

getAllInDomain

public static List<UserDetail> getAllInDomain(String domainId)
Gets the detail about all the users belonging in the specified domain.

Parameters:
domainId - the unique identifier of the domain.
Returns:
a list with all the users that defined in the specified domain or null if no such domain exists.

getLoginQuestion

public String getLoginQuestion()
Returns:
the login question String representation

setLoginQuestion

public void setLoginQuestion(String loginQuestion)
Set the login question

Parameters:
loginQuestion -

getLoginAnswer

public String getLoginAnswer()
Returns:
the login answer

setLoginAnswer

public void setLoginAnswer(String loginAnswer)
Set the login answer

Parameters:
loginAnswer -

getTosAcceptanceDate

public Date getTosAcceptanceDate()
Returns:
the date of terms of service acceptance

setTosAcceptanceDate

public void setTosAcceptanceDate(Date tosAcceptanceDate)
Parameters:
tosAcceptanceDate - the date of terms of service acceptance

getLastLoginDate

public Date getLastLoginDate()
Returns:
the date of the last user login

setLastLoginDate

public void setLastLoginDate(Date lastLoginDate)
Parameters:
lastLoginDate - the date of the last user login

getNbSuccessfulLoginAttempts

public int getNbSuccessfulLoginAttempts()
Returns:
number of successful login attempts

setNbSuccessfulLoginAttempts

public void setNbSuccessfulLoginAttempts(int nbSuccessfulLoginAttempts)
Parameters:
nbSuccessfulLoginAttempts - number of successful login attempts

getLastLoginCredentialUpdateDate

public Date getLastLoginCredentialUpdateDate()
Returns:
the date of the last update of login credentials

setLastLoginCredentialUpdateDate

public void setLastLoginCredentialUpdateDate(Date lastLoginCredentialUpdateDate)
Parameters:
lastLoginCredentialUpdateDate - the date of the last update of login credentials

getExpirationDate

public Date getExpirationDate()
Returns:
the date of user expiration (account)

setExpirationDate

public void setExpirationDate(Date expirationDate)
Parameters:
expirationDate - the date of user expiration (account)

getState

public UserState getState()
Please use isValidState() to retrieve user validity information. Please use isDeletedState() to retrieve user deletion information. Please use isBlockedState() to retrieve user blocked information. Please use isDeactivatedState() to retrieve user deactivated information. Please use isExpiredState() to retrieve user expiration information. This method returns the stored state information but not the functional information.

Returns:
the state of the user (account)

setState

public void setState(UserState state)
The state of the user (account) is updated and the according save date too.

Parameters:
state - the state of the user (account)

getCreationDate

public Date getCreationDate()
Returns:
the date of the user creation

setCreationDate

public void setCreationDate(Date creationDate)
Parameters:
creationDate - the date of the user creation

getSaveDate

public Date getSaveDate()
Returns:
the date of the last user save

setSaveDate

public void setSaveDate(Date saveDate)
Parameters:
saveDate - the date of the last user save

getVersion

public int getVersion()
Returns:
the version of the last save

setVersion

public void setVersion(int version)
Parameters:
version - the version of the last save

getStateSaveDate

public Date getStateSaveDate()
Returns:
the date of last user state save (when it changes)

setStateSaveDate

public void setStateSaveDate(Date stateSaveDate)
Parameters:
stateSaveDate - the date of last user state save (when it changes)

getId

public String getId()
Get user id as stored in database

Returns:

setId

public void setId(String id)
Set user identifier

Parameters:
id - the user identifier to set

getSpecificId

public String getSpecificId()
Get specific user id

Returns:

setSpecificId

public void setSpecificId(String specificId)
Set specific user id

Parameters:
specificId -

getDomainId

public String getDomainId()
Get user's domain id

Returns:
user's domain id

setDomainId

public void setDomainId(String domainId)
Set user domain id

Parameters:
domainId -

getLogin

public String getLogin()
Get user's login

Returns:
user's login

setLogin

public void setLogin(String login)
Set user login

Parameters:
login - the login to set

getFirstName

public String getFirstName()
Get user's first name

Returns:
user's first name

setFirstName

public void setFirstName(String firstName)
Set user first name

Parameters:
firstName - user first name

getLastName

public String getLastName()
Get user's last name

Returns:
user's last name

setLastName

public void setLastName(String sLastName)
Set user last name

Parameters:
sLastName - user last name

seteMail

public void seteMail(String seMail)
Set user's email

Parameters:
seMail -

geteMail

public String geteMail()
Get user's email

Returns:

getAccessLevel

public UserAccessLevel getAccessLevel()
Get user's access level

Returns:

setAccessLevel

public void setAccessLevel(UserAccessLevel accessLevel)
Set user access level

Parameters:
accessLevel -

getDomain

public Domain getDomain()
Gets the domain to which this user belongs.

Returns:
a user domain.

isDomainRestricted

public boolean isDomainRestricted()
Is the specified user is restricted to access the resource in its own domain?

Returns:
true if he's restricted in its own domain, false otherwise.

isDomainAdminRestricted

public boolean isDomainAdminRestricted()

isBackOfficeVisible

public boolean isBackOfficeVisible()

isAccessAdmin

public boolean isAccessAdmin()

isAccessDomainManager

public boolean isAccessDomainManager()

isAccessSpaceManager

public boolean isAccessSpaceManager()

isAccessPdcManager

public boolean isAccessPdcManager()

isAccessUser

public boolean isAccessUser()

isAccessGuest

public boolean isAccessGuest()

isAccessUnknown

public boolean isAccessUnknown()

isActivatedState

public boolean isActivatedState()
This method indicates if the user is activated. The returned value is a combination of following method call result :

Returns:
true id the user is an activated one, false otherwise.

isValidState

public boolean isValidState()
This method is the only one able to indicate the user validity state. Please do not use getState() to retrieve user validity information.

Returns:

isDeletedState

public boolean isDeletedState()
This method is the only one able to indicate the user deletion state. Please do not use getState() to retrieve user deletion information.

Returns:

isBlockedState

public boolean isBlockedState()
This method is the only one able to indicate the user blocked state. Please do not use getState() to retrieve user blocked information.

Returns:

isDeactivatedState

public boolean isDeactivatedState()
This method is the only one able to indicate the user deactivated state. Please do not use getState() to retrieve user deactivated information.

Returns:

isExpiredState

public boolean isExpiredState()
This method is the only one able to indicate the user expiration state. Please do not use getState() to retrieve user expiration information.

Returns:
true if user is expired.

isAnonymous

public boolean isAnonymous()
Is the user is the anonymous one?

Returns:
true if he's the anonymous user.

getAnonymousUser

public static UserDetail getAnonymousUser()
Gets the anonymous user or null if no such user exists.

Returns:
the detail about the anonymous user or null if no such user exists.

getDisplayedName

public String getDisplayedName()

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

traceUser

public void traceUser()
Dump user values to the trace system


compareTo

public int compareTo(UserDetail other)
Specified by:
compareTo in interface Comparable<UserDetail>

getAvatar

public String getAvatar()

getSmallAvatar

public String getSmallAvatar()

isAvatarPersonnalized

public boolean isAvatarPersonnalized()

getAvatarFileName

public String getAvatarFileName()

getStatus

public String getStatus()

getUserPreferences

public final UserPreferences getUserPreferences()
Gets the preferences of this user.

Returns:
the user preferences.

isConnected

public boolean isConnected()
Is this user connected to Silverpeas?

Returns:
true if the user is currently connected to Silverpeas, false otherwise.

isAnonymousUserExist

public static boolean isAnonymousUserExist()
Is the anonymous user exist in this running Silverpeas application?

Returns:
true if the anonymous user exist, false otherwise.

isAnonymousUser

public static boolean isAnonymousUser(String userId)
Is the specified user is the anonymous one?

Parameters:
userId - the identifier of the user.
Returns:
true if the specified user is the anonymous one, false otherwise.

isFullyDefined

public boolean isFullyDefined()

getDurationOfCurrentSession

public String getDurationOfCurrentSession()
Gets the duration of the current user session since its last registered login date.

Returns:
the formatted duration of the current user session, or empty string if the user is not connected.

isInRelationWithOrInvitedBy

public boolean isInRelationWithOrInvitedBy(String userId)
Indicates if the current user is in relation with, or invited by, a user represented by the given identifier.

Parameters:
userId - the identifier of the user which the current user is potentially in relation with or invited by.
Returns:
true if the current user is in relation with, or invited by, the user represented by the given identifier, false otherwise.

isUserManualNotificationUserReceiverLimit

public boolean isUserManualNotificationUserReceiverLimit()
Indicates if a limitation exists about the number of receivers the user can notify manually.

Returns:
true if the limitation exists, false otherwise.

getUserManualNotificationUserReceiverLimitValue

public int getUserManualNotificationUserReceiverLimitValue()
Gets the maximum user receivers the user can notify manually.

Returns:
the maximum user receivers the user can notify manually. If the value is not greater than 0, the user is not limited.

setUserManualNotificationUserReceiverLimit

public void setUserManualNotificationUserReceiverLimit(Integer limit)
Sets the maximum user receivers the user can notify manually. If the given value is: The value is persisted only if the user has USER or GUEST access right and if the limitation is enabled at server level.

Parameters:
limit - the maximum user receivers the user can notify manually.

setNotifManualReceiverLimit

public void setNotifManualReceiverLimit(Integer notifManualReceiverLimit)
Sets the maximum user receivers the user can notify manually from the persistence context.
This method must only be used be the administration persistence services.

Parameters:
notifManualReceiverLimit - the maximum user receivers the user can notify manually from the persistence context.

getNotifManualReceiverLimit

public Integer getNotifManualReceiverLimit()

getAnonymousUserId

protected static String getAnonymousUserId()
Gets the unique identifier of the anonymous user as set in the general look properties.

Returns:
the anonymous user identifier.

getOrganisationController

protected static OrganisationController getOrganisationController()


Copyright © 2016 Silverpeas. All Rights Reserved.