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.
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.
 java.lang.String getDistinguishedName()
          Gets the Distinguished Name for Directory Service.
 java.lang.String getEmailAddress()
          Returns the User's email address.
 java.lang.String getFaxNumber()
          Returns the User's fax number.
 boolean getHasFixedLicense()
          Returns true if the user has a fixed license
 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.
 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.
 User.GeographicTerritory getTerritory()
          Returns the Territory this User belongs to
 java.lang.String getVoiceMailNumber()
          Returns the User's voice mail number.
 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 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 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 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
getID, isDeleted
 
Methods inherited from class com.starteam.TrackedObject.WebCacheTrackedObject
getModifiedBy, getModifiedTime
 
Methods inherited from class com.starteam.LiveObject.WebCacheLiveObject
equals, getContext, getCreatedBy, getCreatedTime, getDisplayName, getObjectID, getServer, getType, getValue, getValue, hashCode, isDirty, isNew, refresh, remove, 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

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()

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.

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


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