com.starteam
Class User.WebCacheUser

java.lang.Object
  extended by com.starteam.LiveObject.WebCacheLiveObject
      extended by com.starteam.TrackedObject.WebCacheTrackedObject
          extended by com.starteam.Principal.WebCachePrincipal
              extended by com.starteam.User.WebCacheUser
Enclosing class:
User

public static class User.WebCacheUser
extends Principal.WebCachePrincipal

User accessor for cached SDK Users contained objects are obtained from the artifact cache


Method Summary
 void addTo(Group.WebCacheGroup group)
          Adds this User to the specified group.
 boolean canCreateProject()
          Returns true if this user has the right to create projects Note that the user must be logged in to ascertain this right
static User.WebCacheUser create(ArtifactCacheManager.Context cntxt)
          Create a new User
 void forceLogoff()
          Forces this User account to be logged off from the server.
 void forcePasswordChange()
          Forces a password change for this User account.
 int getAccessEndTime1(User.DayOfWeek dayOfWeek)
          Returns the end time for the specified day for the first custom access policy.
 int getAccessEndTime2(User.DayOfWeek dayOfWeek)
          Returns the end time for the specified day for the second custom access policy.
 User.LogOnPolicy getAccessPolicy()
          Return's this account's access policy.
 int getAccessStartTime1(User.DayOfWeek dayOfWeek)
          Returns the start time for the specified day for the first custom access policy.
 int getAccessStartTime2(User.DayOfWeek dayOfWeek)
          Returns the start time for the specified day for the second custom access policy.
 User.Status getAccountStatus()
          Returns this account's status.
 DateTime getCacheLastUsedAt()
          Returns the time at which this user last used the cache
 Date[] getCapacityOverriddenOn(Project.WebCacheProject p)
          Returns the set of dates for which capacities have been overridden
 double getDefaultCapacity(Project.WebCacheProject p)
          Returns the default capacity assigned to a specific project
 java.lang.String getDistinguishedName()
          Gets the Distinguished Name for Directory Service.
 java.lang.String getEmailAddress()
          Returns the User's email address.
 Project.WebCacheProject[] getFavoriteProjects()
          Returns the User's Favorite Projects.
 java.lang.String getFaxNumber()
          Returns the User's fax number.
 boolean getHasFixedLicense()
          Returns true if the user has a fixed license
 DateTime getLastWebLogoutTime()
          Gets the time the user last logged out from the webserver.
 User.License getLicenseType()
          Gets the type of license assigned to this User.
 User.LoginHistory[] getLogins()
          Returns a history of logins for this User Login History has been introduced with the 12.0 server release
 java.lang.String getLogOnName()
          Returns the User's name.
 java.lang.String getName()
          Returns the User's name.
 double getOverriddenCapacity(Project.WebCacheProject p, Date d)
          Return the overridden capacity for the project for the specified week
 java.lang.String getPagerNumber()
          Returns the User's pager number.
 boolean getPasswordChangeRequired()
          Determines whether or not a password change is required during the current session.
 int getPasswordDaysRemaining()
          Returns the number of days remaining that the user's current password will remain valid.
 java.lang.String getPhoneNumber()
          Returns the User's phone number.
 Content.WebCacheContent getPicture()
          Returns the Content object used to store a picture of this user
 int getPolicyTimeZoneShift()
          Return's the timezone shift for this account's access policy.
 java.lang.String getPostalAddress()
          Returns the User's postal address.
 int getPresentationID()
          Returns the unique integer identifier for this user.
 User.GeographicTerritory getTerritory()
          Returns the Territory this User belongs to
 java.lang.String getVoiceMailNumber()
          Returns the User's voice mail number.
 boolean hasDefaultCapacity(Project.WebCacheProject p)
          Returns true if this user has a default capacity assigned to a specific project
 boolean hasOverriddenCapacity(Project.WebCacheProject p, Date d)
          return true if the default capacity is overwritten for a specified week the date will typically be specified as a Monday, implying the week coverage
 boolean isBuiltIn()
          Returns true if this is a built in user When a tenant is created, the system creates a built in user with full administrative privileges.
 boolean isMemberOf(Group.WebCacheGroup group)
          Determines whether or not this user is a member of the given group.
 void reactivate()
          Reactivates this User account.
 void removeFrom(Group.WebCacheGroup group)
          Removes this User from the specified group.
 void setAccessPolicy(User.LogOnPolicy policy)
          Changes this account's access policy.
 void setAccessTimes(User.DayOfWeek dayOfWeek, int start1, int end1, int start2, int end2)
          Changes the custom access policy start and end times for the specified day of the week.
 void setDefaultCapacity(Project.WebCacheProject p, double capacity)
          Set the default capacity for a given project
 void setDistinguishedName(java.lang.String distinguishedName)
          Sets the Distinguished Name for Directory Service.
 void setEmailAddress(java.lang.String emailAddress)
          Changes the User's email address.
 void setFavoriteProjects(Project.WebCacheProject[] favoriteProjects)
          Changes the User's favorite projects.
 void setFaxNumber(java.lang.String faxNumber)
          Changes the User's fax number.
 void setHasFixedLicense(boolean fixed)
          Set whether the user has a fixed or floating license
 void setLicenseType(User.License nLicenseType)
          Sets the type of license assigned to this User.
 void setLogOnName(java.lang.String logOnName)
          Changes the logon name for this account.
 void setName(java.lang.String name)
          Changes the User's full name.
 void setOverriddenCapacity(Project.WebCacheProject p, Date d, double capacity)
          Sets the overridden capacity for the project for the specified week
 void setPagerNumber(java.lang.String pagerNumber)
          Changes the User's pager number.
 void setPassword(java.lang.String password)
          Sets the password for this account.
 void setPhoneNumber(java.lang.String phoneNumber)
          Changes the User's phone number.
 void setPicture(Content.WebCacheContent picture)
          Saves a picture of this user to the server
 void setPolicyTimeZoneShift(int shift)
          Changes timezone shift for this account's access policy.
 void setPostalAddress(java.lang.String postalAddress)
          Changes the User's postal address.
 void setTerritory(User.GeographicTerritory t)
          Set the territory this User belongs to
 void setVoiceMailNumber(java.lang.String voiceMailNumber)
          Changes the User's voice mail number.
 void suspend()
          Suspend this User account.
 void unlock()
          Unlocks this User account.
 
Methods inherited from class com.starteam.Principal.WebCachePrincipal
canAccessContainerForReading, canAccessForReading, canCreateArtifactType, getID, hasContainerRight, hasContainerRight, hasContainerRights, hasRight, hasRights, isDeleted
 
Methods inherited from class com.starteam.TrackedObject.WebCacheTrackedObject
getModifiedBy, getModifiedTime
 
Methods inherited from class com.starteam.LiveObject.WebCacheLiveObject
addTo, equals, getContext, getCreatedBy, getCreatedTime, getDisplayName, getObjectID, getServer, getType, getValue, getValue, hashCode, hasValue, isDirty, isNew, refresh, remove, removeFrom, setValue, setValue, toStarTeamURL, update
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static User.WebCacheUser create(ArtifactCacheManager.Context cntxt)
Create a new User

Parameters:
cntxt - the User Session Context
Returns:
a newly created user in the context of the ArtifactCacheManager

getCacheLastUsedAt

public DateTime getCacheLastUsedAt()
Returns the time at which this user last used the cache

Returns:
the time at which this user last used this cache or DateTime.VALUE_NOT_SET if this user has been logged out of the cache

canCreateProject

public boolean canCreateProject()
Returns true if this user has the right to create projects Note that the user must be logged in to ascertain this right

Returns:
true if user can create a project, false if they cannot or are not logged in

setPassword

public void setPassword(java.lang.String password)
Sets the password for this account. The password should be passed in as clear text, but is stored in an encrypted format

Parameters:
password - the new password for this account

getLogOnName

public java.lang.String getLogOnName()
Returns the User's name. This is not the same as the User's logon name.

Returns:
the User's name
See Also:
User.getName(), User.getLogOnName()

getLogins

public User.LoginHistory[] getLogins()
Returns a history of logins for this User Login History has been introduced with the 12.0 server release

Returns:
a history of logins for this User

setLogOnName

public void setLogOnName(java.lang.String logOnName)
Changes the logon name for this account.

Parameters:
logOnName - the new logon name for this account
Throws:
ServerException - if the logged in user does not have appropriate permissions

getName

public java.lang.String getName()
Returns the User's name. This is not the same as the User's logon name.

Overrides:
getName in class Principal.WebCachePrincipal
Returns:
the User's name
See Also:
User.getName(), User.getLogOnName()

getPresentationID

public int getPresentationID()
Returns the unique integer identifier for this user. on pre 14.0 servers, it returns the userID

Returns:
the unique integer identifier for this user.

setName

public void setName(java.lang.String name)
Changes the User's full name.

Parameters:
name - the new name for this User

setHasFixedLicense

public void setHasFixedLicense(boolean fixed)
Set whether the user has a fixed or floating license

Parameters:
fixed - true if the user has a fixed or floating license

getHasFixedLicense

public boolean getHasFixedLicense()
Returns true if the user has a fixed license

Returns:
true if the user has a fixed license

getEmailAddress

public java.lang.String getEmailAddress()
Returns the User's email address.

Returns:
the User's email address.
Throws:
ServerException - if the logged in user does not have appropriate permissions

setEmailAddress

public void setEmailAddress(java.lang.String emailAddress)
Changes the User's email address.

Parameters:
emailAddress - the new email address for this User

isMemberOf

public boolean isMemberOf(Group.WebCacheGroup group)
Determines whether or not this user is a member of the given group. note that membership is implied, i.e. a user is considered to be a member of the entire tree of parent groups of the group(s) that the user was explicitly added to

Parameters:
group - The group to be tested.
Returns:
true if this user is a member of the given group; false otherwise.

isBuiltIn

public boolean isBuiltIn()
Returns true if this is a built in user When a tenant is created, the system creates a built in user with full administrative privileges. Built in users can never be deleted and can never be denied system access rights

Returns:
true if this is a built in user

addTo

public void addTo(Group.WebCacheGroup group)
Adds this User to the specified group. The group cannot be null, must be from the same server as the User and the group account must have already been created on the server. You must call update() to save the changes on the server.

Parameters:
group - the group to which this User will be added.
Throws:
ServerException - if the logged in user does not have appropriate permissions

removeFrom

public void removeFrom(Group.WebCacheGroup group)
Removes this User from the specified group. The group cannot be null, must be from the same server as the User and the group account must have already been created on the server. You must call update() to save the changes on the server.

Parameters:
group - the group from which this User will be removed.
Throws:
ServerException - if the logged in user does not have appropriate permissions

getFaxNumber

public java.lang.String getFaxNumber()
Returns the User's fax number.

Returns:
the User's fax number.
Throws:
ServerException - if the logged in user does not have appropriate permissions

setFaxNumber

public void setFaxNumber(java.lang.String faxNumber)
Changes the User's fax number.

Parameters:
faxNumber - the User's new fax number.

getPagerNumber

public java.lang.String getPagerNumber()
Returns the User's pager number.

Returns:
the User's pager number.
Throws:
ServerException - if the logged in user does not have appropriate permissions

setPagerNumber

public void setPagerNumber(java.lang.String pagerNumber)
Changes the User's pager number.

Parameters:
pagerNumber - the User's new pager number.

getPhoneNumber

public java.lang.String getPhoneNumber()
Returns the User's phone number.

Returns:
the User's phone number.
Throws:
ServerException - if the logged in user does not have appropriate permissions

setPhoneNumber

public void setPhoneNumber(java.lang.String phoneNumber)
Changes the User's phone number.

Parameters:
phoneNumber - the User's new phone number.

getPostalAddress

public java.lang.String getPostalAddress()
Returns the User's postal address.

Returns:
the User's postal address.
Throws:
ServerException - if the logged in user does not have appropriate permissions

setPostalAddress

public void setPostalAddress(java.lang.String postalAddress)
Changes the User's postal address.

Parameters:
postalAddress - the User's new postal address

getDistinguishedName

public java.lang.String getDistinguishedName()
Gets the Distinguished Name for Directory Service. This property is supported by server release 6.0 and later; ignored for earlier releases.

Returns:
the Distinguished Name for Directory Service.
Throws:
ServerException - if the logged in user does not have appropriate permissions

setDistinguishedName

public void setDistinguishedName(java.lang.String distinguishedName)
Sets the Distinguished Name for Directory Service.

Parameters:
distinguishedName - the Distinguished Name for Directory Service.

getTerritory

public User.GeographicTerritory getTerritory()
Returns the Territory this User belongs to

Returns:
the Territory this User belongs to

setTerritory

public void setTerritory(User.GeographicTerritory t)
Set the territory this User belongs to

Parameters:
t - the territory this User belongs to

getAccountStatus

public User.Status getAccountStatus()
Returns this account's status. The user status can be changed using the api's suspend(), reactivate() and/or forceLogoff()

Returns:
this account's status.
Throws:
ServerException - if the logged in user does not have appropriate permissions

getVoiceMailNumber

public java.lang.String getVoiceMailNumber()
Returns the User's voice mail number.

Returns:
the User's voice mail number.
Throws:
ServerException - if the logged in user does not have appropriate permissions

setVoiceMailNumber

public void setVoiceMailNumber(java.lang.String voiceMailNumber)
Changes the User's voice mail number.

Parameters:
voiceMailNumber - the User's new voice mail number.

getLicenseType

public User.License getLicenseType()
Gets the type of license assigned to this User.

Returns:
The type of license assigned to this User.

setLicenseType

public void setLicenseType(User.License nLicenseType)
Sets the type of license assigned to this User.

Parameters:
nLicenseType - The type of license assigned to this User.

getAccessPolicy

public User.LogOnPolicy getAccessPolicy()
Return's this account's access policy. The access policy specifies when a User is allowed to connect to the server.

Returns:
this account's access policy
Throws:
ServerException - if the logged in user does not have appropriate permissions

setAccessPolicy

public void setAccessPolicy(User.LogOnPolicy policy)
Changes this account's access policy.

Parameters:
policy - this account's new access policy

getPolicyTimeZoneShift

public int getPolicyTimeZoneShift()
Return's the timezone shift for this account's access policy. This value only applies if the policy is other than POLICY_ALWAYS. The value is in hours from GMT.

Returns:
this timezone shift for this account's access policy.
Throws:
ServerException - if the logged in user does not have appropriate permissions
See Also:
User.WebCacheUser.setPolicyTimeZoneShift(int)

setPolicyTimeZoneShift

public void setPolicyTimeZoneShift(int shift)
Changes timezone shift for this account's access policy.

Parameters:
shift - the new timezone shift for this account's access policy.
See Also:
User.WebCacheUser.getPolicyTimeZoneShift()

getAccessStartTime1

public int getAccessStartTime1(User.DayOfWeek dayOfWeek)
Returns the start time for the specified day for the first custom access policy. The time is expressed in minutes from midnight. A value of -1 indicates access is denied on the specified day for the first custom access policy.

Parameters:
dayOfWeek - must be a valid day of the week
Returns:
the start time for the specified day for the first custom access policy.

getAccessStartTime2

public int getAccessStartTime2(User.DayOfWeek dayOfWeek)
Returns the start time for the specified day for the second custom access policy. The time is expressed in minutes from midnight. A value of -1 indicates access is denied on the specified day for the second custom access policy.

Parameters:
dayOfWeek - must be a valid day of the week
Returns:
the start time for the specified day for the second custom access policy.

getAccessEndTime1

public int getAccessEndTime1(User.DayOfWeek dayOfWeek)
Returns the end time for the specified day for the first custom access policy. The time is expressed in minutes from midnight. A value of -1 indicates access is denied on the specified day for the first custom access policy.

Parameters:
dayOfWeek - must be a valid day of the week
Returns:
the end time for the specified day for the first custom access policy.

getAccessEndTime2

public int getAccessEndTime2(User.DayOfWeek dayOfWeek)
Returns the end time for the specified day for the second custom access policy. The time is expressed in minutes from midnight. A value of -1 indicates access is denied on the specified day for the second custom access policy.

Parameters:
dayOfWeek - a valid day of the week, e.g. DAY_SUNDAY
Returns:
the end time for the specified day for the second custom access policy.

setAccessTimes

public void setAccessTimes(User.DayOfWeek dayOfWeek,
                           int start1,
                           int end1,
                           int start2,
                           int end2)
Changes the custom access policy start and end times for the specified day of the week.

Parameters:
dayOfWeek - a valid day of the week, e.g. SUNDAY
start1 - start time in minutes from midnight
end1 - end time in minutes from midnight
start2 - start time in minutes from midnight
end2 - end time in minutes from midnight

getPasswordChangeRequired

public boolean getPasswordChangeRequired()
Determines whether or not a password change is required during the current session. If the password is not changed, the user will lose access to the StarTeam server.

Returns:
true if a password change is required during the current session.
Throws:
ServerException - if the logged in user does not have appropriate permissions
See Also:
ServerAdministration.getUsers()

getPasswordDaysRemaining

public int getPasswordDaysRemaining()
Returns the number of days remaining that the user's current password will remain valid.

Returns:
The number of days remaining that the user's current password will remain valid, or -1 if the password will not expire.

unlock

public void unlock()
Unlocks this User account. The effect is immediate ( no need to call the update() method ).

Throws:
java.lang.IllegalStateException - if the User has not yet been created on the server

reactivate

public void reactivate()
Reactivates this User account. The effect is immediate ( no need to call the update() method ).

Throws:
java.lang.IllegalStateException - if the User has not yet been created on the server
See Also:
User.WebCacheUser.getAccountStatus()

suspend

public void suspend()
Suspend this User account. The effect is immediate ( no need to call the update() method ).

Throws:
java.lang.IllegalStateException - if the User has not yet been created on the server
See Also:
User.WebCacheUser.getAccountStatus()

forcePasswordChange

public void forcePasswordChange()
Forces a password change for this User account. The effect is immediate ( no need to call the update() method ).

Throws:
java.lang.IllegalStateException - if the User has not yet been created on the server

forceLogoff

public void forceLogoff()
Forces this User account to be logged off from the server. The effect is immediate ( no need to call the update() method ).

Throws:
java.lang.IllegalStateException - if the User has not yet been created on the server
See Also:
User.WebCacheUser.getAccountStatus()

getPicture

public Content.WebCacheContent getPicture()
Returns the Content object used to store a picture of this user

Returns:
the Content object used to store a picture of this user

setPicture

public void setPicture(Content.WebCacheContent picture)
Saves a picture of this user to the server

Parameters:
picture - the Content object describing a picture of this user

getFavoriteProjects

public Project.WebCacheProject[] getFavoriteProjects()
Returns the User's Favorite Projects.

Returns:
the User's Favorite Projects.

setFavoriteProjects

public void setFavoriteProjects(Project.WebCacheProject[] favoriteProjects)
Changes the User's favorite projects.

Parameters:
favoriteProjects - the User's favorite Projects.

getLastWebLogoutTime

public DateTime getLastWebLogoutTime()
Gets the time the user last logged out from the webserver.

Returns:
The time the user last logged out from the webserver.

hasDefaultCapacity

public boolean hasDefaultCapacity(Project.WebCacheProject p)
Returns true if this user has a default capacity assigned to a specific project

Parameters:
p - the project to test against
Returns:
true if this user has a default capacity assigned to the project

getDefaultCapacity

public double getDefaultCapacity(Project.WebCacheProject p)
Returns the default capacity assigned to a specific project

Parameters:
p - the project
Returns:
the default capacity assigned to this project or -1 if there is no default capacity

setDefaultCapacity

public void setDefaultCapacity(Project.WebCacheProject p,
                               double capacity)
Set the default capacity for a given project

Parameters:
p - the project
capacity - the default capacity to be assigned to this project

hasOverriddenCapacity

public boolean hasOverriddenCapacity(Project.WebCacheProject p,
                                     Date d)
return true if the default capacity is overwritten for a specified week the date will typically be specified as a Monday, implying the week coverage

Parameters:
p - the project
d - the Monday of the week
Returns:
true if the default capacity is overridden for the week

getOverriddenCapacity

public double getOverriddenCapacity(Project.WebCacheProject p,
                                    Date d)
Return the overridden capacity for the project for the specified week

Parameters:
p - the project
d - the Monday of the week
Returns:
the capacity for the week or -1 if there is no capacity override

getCapacityOverriddenOn

public Date[] getCapacityOverriddenOn(Project.WebCacheProject p)
Returns the set of dates for which capacities have been overridden

Parameters:
p - the project to test for
Returns:
the set of dates for which capacities have been overridden

setOverriddenCapacity

public void setOverriddenCapacity(Project.WebCacheProject p,
                                  Date d,
                                  double capacity)
Sets the overridden capacity for the project for the specified week

Parameters:
p - the project
d - the Monday of the week
capacity - the capacity for the week


StarTeam SDK 14.0, Build 21
Copyright © 2003-2012 Borland Software Corporation. All rights reserved.