com.telelogic.cs.api
Class User

java.lang.Object
  extended by com.telelogic.cs.api.User
All Implemented Interfaces:
java.io.Serializable

public class User
extends java.lang.Object
implements java.io.Serializable

An immutable view of single user.

See Also:
Serialized Form

Constructor Summary
User()
          Do not call directly.
User(com.telelogic.cs.user.UserInfo user)
          Constructor to create a User object given a UserInfo object.
 
Method Summary
 boolean getCanAccessApplet()
          Determine if the user can currently access the applet or not.
 java.lang.String getContextDatabase()
          Gets the context database that the user is currently logged into.
 java.lang.String getDatabase()
          Gets the database that the user is currently logged into.
 java.lang.String getFormattedLastAccessedDate()
          Gets the last accessed date as a formatted time string.
 java.lang.String getFormattedTimeoutDate()
          Gets the the time when the user will timeout as a formatted string.
 java.util.List<java.lang.String> getGroups()
          Get the list of groups that the user is currently a member of.
 long getLastAccessedDate()
          Gets the time the user last had access to the server.
 java.lang.String getPrettyRole()
          Gets the user's role.
 java.util.List<java.lang.String> getPrivileges()
          Get an immutable list of the user's privileges (CM roles).
 java.lang.String getReadSecurityValue()
          Gets the user's read security value.
 java.lang.String getRealName()
          Same as getUserDisplayName().
 java.lang.String getRole()
          The user's role.
 long getTimeoutDate()
          Gets the time when the user will become idle.
 java.lang.String getToken()
          Gets the users token.
 java.lang.String getUserDisplayName()
          Get the user's display name as defined by the 'User Name Display' admin setting.
 java.lang.String getUserName()
          The name of the user.
 boolean hasPrivilege(java.lang.String privilege)
          Determines if the user has a given privilege (CM role) or not.
 boolean isCrProcessAdmin()
          Determines if the user has the CR Process admin role.
 boolean isGroupMember(java.lang.String group)
          Determines if the user is in a given group.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

User

public User()
Do not call directly. Used during serialization only.


User

public User(com.telelogic.cs.user.UserInfo user)
Constructor to create a User object given a UserInfo object. Extract all the required information from UserInfo and initializes necessary instance variables.

Parameters:
user - The UserInfo object to base this User object off of.
Method Detail

getPrettyRole

public java.lang.String getPrettyRole()
Gets the user's role. Some internal roles may have pretty versions that are more readable, but they should only be used for display to users. For programmatic use, the plain role should be used.

Returns:
the user's role or the pretty representation of the role.

getRole

public java.lang.String getRole()
The user's role.

Returns:
the login role for the user (Admin, User, ReportBuilder, etc).

getUserName

public java.lang.String getUserName()
The name of the user.

Returns:
the login name for the user.

getDatabase

public java.lang.String getDatabase()
Gets the database that the user is currently logged into.

Returns:
the complete database path that the user is currently logged into.

getContextDatabase

public java.lang.String getContextDatabase()
Gets the context database that the user is currently logged into. In stand-alone mode, this will always be the same as the database.

Returns:
the complete context database path that the user is currently logged into (where task operations should take place in central mode).

getToken

public java.lang.String getToken()
Gets the users token.

Returns:
the token for the user.

getReadSecurityValue

public java.lang.String getReadSecurityValue()
Gets the user's read security value.

Returns:
The user's read security value. The empty string indicates the user does not have a read security value.

getCanAccessApplet

public boolean getCanAccessApplet()
Determine if the user can currently access the applet or not.

Returns:
true if the user can access the applet, false otherwise.

getGroups

public java.util.List<java.lang.String> getGroups()
Get the list of groups that the user is currently a member of.

Returns:
A list of the current groups the user is a member of.

getPrivileges

public java.util.List<java.lang.String> getPrivileges()
Get an immutable list of the user's privileges (CM roles).

Returns:
a list of the user's privileges (CM roles).

isCrProcessAdmin

public boolean isCrProcessAdmin()
Determines if the user has the CR Process admin role.

Returns:
true if the user has the CR process admin role, false otherwise.

hasPrivilege

public boolean hasPrivilege(java.lang.String privilege)
Determines if the user has a given privilege (CM role) or not.

Parameters:
privilege - the name of the privilege (CM role) to check for.
Returns:
true if the user has the privilege (CM role), false otherwise.

isGroupMember

public boolean isGroupMember(java.lang.String group)
Determines if the user is in a given group.

Parameters:
group - the name of the role to check for.
Returns:
true if the user has the role, false otherwise.

getUserDisplayName

public java.lang.String getUserDisplayName()
Get the user's display name as defined by the 'User Name Display' admin setting.

Returns:
the user's display name.

getLastAccessedDate

public long getLastAccessedDate()
Gets the time the user last had access to the server.

Returns:
the time the user last accessed the server.

getTimeoutDate

public long getTimeoutDate()
Gets the time when the user will become idle.

Returns:
the time the user will become idle.

getRealName

public java.lang.String getRealName()
Same as getUserDisplayName().

Returns:
the user's display name.

getFormattedLastAccessedDate

public java.lang.String getFormattedLastAccessedDate()
Gets the last accessed date as a formatted time string.

Returns:
last accessed date in proper format.

getFormattedTimeoutDate

public java.lang.String getFormattedTimeoutDate()
Gets the the time when the user will timeout as a formatted string.

Returns:
timed out in proper format.


© Copyright IBM Corporation 2000, 2009
US Government Users Restricted Rights--Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
Notices