com.starteam
Class User

java.lang.Object
  extended by com.starteam.TypedResource
      extended by com.starteam.LiveObject
          extended by com.starteam.TrackedObject
              extended by com.starteam.Principal
                  extended by com.starteam.User
All Implemented Interfaces:
java.lang.Cloneable

public final class User
extends Principal

Represents a StarTeam User. Some of the information is accessible only to users with appropriate permissions. Applications which require only a subset of user data should use Server.getUsers().Applications which require the complete account information for all users should use ServerAdministration.getUsers(). The logged in user however needs to have permission Permission.SERVER_ADMIN_USER_ACCOUNTS granted for accessing the complete user account information.


Nested Class Summary
static class User.DayOfWeek
          The day of week
static class User.GeographicTerritory
          The accessible territory for the logged in User Account.
static class User.License
          The current license .
static class User.LoginHistory
          A history of User logins introduced with the 12.0 server release
static class User.LogOnPolicy
          The current logon access policy of the User Account.
static class User.Status
          The current status of the User Account.
static class User.Type
          The Type of the User
static class User.WebCacheUser
          User accessor for cached SDK Users contained objects are obtained from the artifact cache
 
Nested classes/interfaces inherited from class com.starteam.Principal
Principal.WebCachePrincipal
 
Nested classes/interfaces inherited from class com.starteam.TrackedObject
TrackedObject.WebCacheTrackedObject
 
Nested classes/interfaces inherited from class com.starteam.LiveObject
LiveObject.WebCacheLiveObject
 
Nested classes/interfaces inherited from class com.starteam.TypedResource
TypedResource.BranchState
 
Field Summary
static User LOGGED_IN_USER
          The Logged In User.
 
Constructor Summary
User(Server server)
          Creates a new User account to be activated on the server.
 
Method Summary
 void addTo(Group group)
          Adds this User to the specified group.
 User copy()
          Creates a copy of this User object.
 boolean equals(java.lang.Object another)
          Returns true if the specified Object identifies the same exact 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.
 int getBLSSlipGuid()
          Gets the Slip ID assigned to this license.
 Date[] getCapacityOverriddenOn(Project p)
          Returns the set of dates for which capacities have been overridden
 DateTime getCreatedTime()
          Gets the time at which this User was created.
 double getDefaultCapacity(Project p)
          Returns the default capacity assigned to a specific project
 java.lang.String getDisplayName()
          Gets a short string that can be used to refer to this User in an application's user interface.
 java.lang.String getDistinguishedName()
          Gets the Distinguished Name for Directory Service.
 java.lang.String getEmailAddress()
          Returns the User's email address.
 Project[] getFavoriteProjects()
          Returns the User's Favorite Projects.
 java.lang.String getFaxNumber()
          Returns the User's fax number.
 Group[] getGroups()
          Returns all of the groups to which this User belongs.
 boolean getHasFixedLicense()
          Determines whether this User has a fixed ( named-User ) license or a floating ( concurrent ) license.
 int getID()
          Returns an integer ID that represents this User account.
 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
 int getLogOnCount()
          Returns the number of times this User is logged in to the server.
 java.lang.String getLogOnName()
          Returns the logon name or identifier for this account.
 int getMinimumPasswordLength()
          Returns the minimum required password length.
 java.lang.String getName()
          Returns the User's name.
 double getOverriddenCapacity(Project 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 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.Type.PropertyCollection getProperties()
          Returns the properties of the User Type
 Server getServer()
          Returns the Server object to which this User belongs.
 User.GeographicTerritory getTerritory()
          Returns the Territory this User belongs to
 boolean getValidateThroughDirectoryService()
          Indicates whether the User validates through Directory Service.
 java.lang.Object getValue(Property property)
          Return the value for the specified property.
 java.lang.String getVoiceMailNumber()
          Returns the User's voice mail number.
 int getWebLogOnCount()
          Returns the number of times this User is logged in via the webserver.
 java.lang.String[] getWorkstations()
          Currently unused.
 boolean hasDefaultCapacity(Project p)
          Returns true if this user has a default capacity assigned to a specific project
 int hashCode()
          Returns a hash code for this User.
 boolean hasOverriddenCapacity(Project 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 isDeleted()
          Returns true if this User has been deleted.
 boolean isDirty()
          Returns true if any property has been modified from the original value (including properties set on new items).
 boolean isEqualTo(User account)
          Compares two User objects.
 boolean isMemberOf(Group group)
          Determines whether or not this user is a member of the given group.
 boolean isNew()
          Tells if this User account has been created on the server yet.
 void reactivate()
          Reactivates this User account.
 void remove()
          Removes this User account from the server, and from any group of which it is a member.
 void removeFrom(Group 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 setBLSSlipGuid(int nSlipGuid)
          Sets the Slip ID assigned to this license.
 void setDefaultCapacity(Project 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[] favoriteProjects)
          Changes the User's favorite projects.
 void setFaxNumber(java.lang.String faxNumber)
          Changes the User's fax number.
 void setHasFixedLicense(boolean bFixed)
          Sets the license type for this User.
 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 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 c)
          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 setValidateThroughDirectoryService(boolean bValidateThroughDirectoryService)
          Sets whether User validates through Directory Service.
 java.lang.Object setValue(Property property, java.lang.Object value)
          Sets the value of the specified property and return the old value.
 void setVoiceMailNumber(java.lang.String voiceMailNumber)
          Changes the User's voice mail number.
 void suspend()
          Suspend this User account.
 java.lang.String toString()
          Returns the name of this User account.
 void unlock()
          Unlocks this User account.
 void update()
          Create or modify this User in the StarTeam Server.
 
Methods inherited from class com.starteam.TrackedObject
getModifiedBy, getModifiedTime
 
Methods inherited from class com.starteam.LiveObject
getCreatedBy, toStarTeamURL
 
Methods inherited from class com.starteam.TypedResource
addToIntegerArray, getBooleanValue, getByteArrayValue, getCachedProperties, getContentValue, getDateTimeValue, getDateValue, getDoubleValue, getEnumDisplayName, getEnumeratedValues, getIntegerArrayValue, getIntegerValue, getLinkValue, getLongValue, getObjectID, getPossibleValues, getStringValue, getTimeSpanValue, getType, hasCachedProperties, hasValue, removeFromIntegerArray, setBooleanValue, setByteArrayValue, setContentValue, setDateTimeValue, setDateValue, setDoubleValue, setEnumeratedValue, setEnumeratedValues, setIntegerArrayValue, setIntegerValue, setLinkValue, setLongValue, setStringValue, setTimeSpanValue
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

LOGGED_IN_USER

public static final User LOGGED_IN_USER
The Logged In User. Note that this is a special user that should not be changed or attempted to be updated in any way. The LOGGED_IN_USER is primarily used for establishing the context of 'me' queries and should not be confused with the actual logged in user,

See Also:
Server.getLoggedInUser()
Constructor Detail

User

public User(Server server)
Creates a new User account to be activated on the server. The new account will not actually be created until update() is called.

Parameters:
server - the server where the new account is to be created
Method Detail

isDirty

public boolean isDirty()
Returns true if any property has been modified from the original value (including properties set on new items). Modified properties are saved by a call to update().

Specified by:
isDirty in class Principal
Returns:
true if any of this item's properties have been modified locally and not yet saved.

getProperties

public User.Type.PropertyCollection getProperties()
Returns the properties of the User Type

Returns:
the properties of the User Type

getServer

public Server getServer()
Returns the Server object to which this User belongs.

Specified by:
getServer in class Principal
Returns:
the Server object to which this User belongs.

getDisplayName

public java.lang.String getDisplayName()
Gets a short string that can be used to refer to this User in an application's user interface.

Overrides:
getDisplayName in class TypedResource
Returns:
A short string that can be used to refer to this User in an application's user interface.

getName

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

Specified by:
getName in class Principal
Returns:
the User's name
See Also:
User.WebCacheUser.getName(), User.WebCacheUser.getLogOnName()

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

isDeleted

public boolean isDeleted()
Returns true if this User has been deleted.

Specified by:
isDeleted in class Principal
Returns:
true if this User has been deleted.

getMinimumPasswordLength

public int getMinimumPasswordLength()
Returns the minimum required password length.

Returns:
the minimum required password length.

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.

getValue

public java.lang.Object getValue(Property property)
                          throws NoSuchPropertyException
Return the value for the specified property.

Specified by:
getValue in class Principal
Parameters:
property - the name of property to be retrieved
Returns:
the value of the specified property
Throws:
NoSuchPropertyException - if the named property does not exist

setValue

public java.lang.Object setValue(Property property,
                                 java.lang.Object value)
                          throws NoSuchPropertyException,
                                 java.lang.ClassCastException
Sets the value of the specified property and return the old value.

Specified by:
setValue in class Principal
Parameters:
property - the property to set
value - the new value to set for the specified property
Returns:
the old property value
Throws:
NoSuchPropertyException - if the named property does not exist
java.lang.ClassCastException - if the value is of the wrong type for the specified property

hashCode

public int hashCode()
Returns a hash code for this User.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code for this User.

equals

public boolean equals(java.lang.Object another)
Returns true if the specified Object identifies the same exact User.

Overrides:
equals in class java.lang.Object
Parameters:
another - the object to be compared to for equality
Returns:
true if the specified object identifies the same User as this one.

copy

public User copy()
Creates a copy of this User object. Useful to applications that want to save a snapshot of the account information in a given state, for example, before calling ServerAdministration.refreshAccounts().

Returns:
A new copy of this User object.
See Also:
User.isEqualTo(com.starteam.User)

getID

public int getID()
Returns an integer ID that represents this User account.

Specified by:
getID in class Principal
Returns:
an integer ID that represents this User account.

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.

Specified by:
setName in class Principal
Parameters:
name - the new name for this User
See Also:
Principal.update()

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

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

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.

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.

getFavoriteProjects

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

Returns:
the User's Favorite Projects.

setFavoriteProjects

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

Parameters:
favoriteProjects - the User's favorite Projects.

getLogOnName

public java.lang.String getLogOnName()
Returns the logon name or identifier for this account.

Returns:
the logon name or identifier for this account.
Throws:
ServerException - if the logged in user does not have appropriate permissions

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

hasDefaultCapacity

public boolean hasDefaultCapacity(Project 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 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 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 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 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 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 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

setPassword

public void setPassword(java.lang.String password)
Sets the password for this account. The password should be passed in as clear text.

Parameters:
password - the new password for this account

getAccountStatus

public User.Status getAccountStatus()
Returns this account's status. To change the status of an account, use the 'immediate' api's User.suspend() or User.reactivate() or User.forceLogoff()

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

getPicture

public Content 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 c)
Saves a picture of this user to the server

Parameters:
c - the Content object describing a picture of 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.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.getPolicyTimeZoneShift()

getLogOnCount

public int getLogOnCount()
Returns the number of times this User is logged in to the server.

Returns:
the number of times this User is logged in to the server.
Throws:
ServerException - if the logged in user does not have appropriate permissions

getWebLogOnCount

public int getWebLogOnCount()
Returns the number of times this User is logged in via the webserver.

Returns:
the number of times this User is logged in via the webserver.
Throws:
ServerException - if the logged in user does not have appropriate permissions
See Also:
ServerAdministration.getUsers()

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.

getWorkstations

public java.lang.String[] getWorkstations()
Currently unused.

Returns:
a list of workstation names.
Throws:
ServerException - if the logged in user does not have appropriate permissions

getValidateThroughDirectoryService

public boolean getValidateThroughDirectoryService()
Indicates whether the User validates through Directory Service. This property is supported by server release 6.0 and later; ignored for earlier releases.

Returns:
true if the User validates through Directory Service, otherwise false. This property is supported by server release 6.0 and later; ignored for earlier releases. Note that when setting this value to false, a valid password must also be set.

setValidateThroughDirectoryService

public void setValidateThroughDirectoryService(boolean bValidateThroughDirectoryService)
Sets whether User validates through Directory Service. Note that when setting this value to false, a valid password must also be set. This property is supported by server release 6.0 and later; ignored for earlier releases.

Parameters:
bValidateThroughDirectoryService - whether or not to validate through Directory Service

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. This property is supported by server release 6.0 and later; ignored for earlier releases.
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. This property is supported by server release 6.0 and later; ignored for earlier releases.

Parameters:
distinguishedName - the Distinguished Name for Directory Service.

getHasFixedLicense

public boolean getHasFixedLicense()
Determines whether this User has a fixed ( named-User ) license or a floating ( concurrent ) license.

Returns:
True if this User has a fixed ( named-User ) license; false if this User has a floating ( concurrent ) license. Note that if the StarTeam Server does not support floating licenses, then every User has a fixed license.
See Also:
ServerAdministration.License.getAvailableFixedLicenses(), ServerAdministration.License.getAvailableFloatingLicenses(), ServerAdministration.License.getTotalFixedLicenses()

setHasFixedLicense

public void setHasFixedLicense(boolean bFixed)
Sets the license type for this User.

Parameters:
bFixed - True if this User has a fixed ( named-User ) license; false if this User has a floating ( concurrent ) license. Note that it is an error to set a floating license if the StarTeam Server does not support them.
See Also:
ServerAdministration.License.getAvailableFixedLicenses(), ServerAdministration.License.getAvailableFloatingLicenses()

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

isNew

public boolean isNew()
Tells if this User account has been created on the server yet.

Specified by:
isNew in class Principal
Returns:
true is this User account has not yet been created in the server.

toString

public java.lang.String toString()
Returns the name of this User account.

Overrides:
toString in class TypedResource
Returns:
the name of this User account.

addTo

public void addTo(Group 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 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

getGroups

public Group[] getGroups()
Returns all of the groups to which this User belongs. The returned set is the explicit set of Groups this user belongs to. It does not reflect implied membership. A user is implicitly a member of the parent (hierarchy tree) Group's of Groups that (s)he explicitly belongs to

Returns:
all of the groups to which this User belongs.
See Also:
User.isMemberOf(Group)

update

public void update()
Create or modify this User in the StarTeam Server. If the account is new it will be created otherwise the account information will be modified.

Specified by:
update in class Principal

isMemberOf

public boolean isMemberOf(Group 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.

remove

public void remove()
Removes this User account from the server, and from any group of which it is a member.

Specified by:
remove in class Principal
Throws:
ServerException - if the logged in user does not have appropriate permissions

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

isEqualTo

public boolean isEqualTo(User account)
Compares two User objects.

Parameters:
account - The User to be compared with this one.
Returns:
true if no differences were found.
See Also:
User.copy()

getCreatedTime

public DateTime getCreatedTime()
Gets the time at which this User was created.

Overrides:
getCreatedTime in class LiveObject
Returns:
The time at which this User was created.

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

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

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.

getBLSSlipGuid

public int getBLSSlipGuid()
Gets the Slip ID assigned to this license.

Returns:
The Slip ID assigned to this license, or 0 if this User does not have a license managed by the Borland License Server.
See Also:
ServerAdministration.License.getBLSSlipGUIDs(), ServerAdministration.License.getNumUsersForBLSLicense(int)

setBLSSlipGuid

public void setBLSSlipGuid(int nSlipGuid)
Sets the Slip ID assigned to this license.

Parameters:
nSlipGuid - The Slip ID assigned to this license.
See Also:
ServerAdministration.License.getBLSSlipGUIDs(), ServerAdministration.License.getNumUsersForBLSLicense(int)


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