com.starteam
Class Principal

java.lang.Object
  extended by com.starteam.TypedResource
      extended by com.starteam.LiveObject
          extended by com.starteam.TrackedObject
              extended by com.starteam.Principal
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
Group, User

public abstract class Principal
extends TrackedObject

A StarTeam Resource with the right to manipulate StarTeam Artifacts. Users and Groups are instances of Principals. Access Rights may be granted or denied.

See Also:
Important Note: This abstract class is not intended to be implemented by client applications. We reserve the right to add methods in the future. Applications that implement this interface may not be compatible with future versions of the StarTeam SDK.

Nested Class Summary
static class Principal.Type
          The Type of the Principal
static class Principal.WebCachePrincipal
          Base accessor for cached SDK objects encapsulating the statefulness of objects obtained from the artifact cache.
 
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
 
Method Summary
abstract  int getID()
          Returns this principal's server wide unique integer identifier.
abstract  java.lang.String getName()
          Returns the name of this principal
abstract  Server getServer()
          Returns the Server object to which this principal belongs.
abstract  java.lang.Object getValue(Property property)
          Return the value for the specified property.
abstract  boolean isDeleted()
          Returns true if the Principal has been deleted.
abstract  boolean isDirty()
          Returns true if any property has been modified from the original value (including properties set on new items).
abstract  boolean isNew()
          Returns true if this Principal has been created on the server yet.
abstract  void remove()
          Removes this principal from the StarTeam server, plus any direct or indirect members of this principal.
abstract  void setName(java.lang.String name)
          Changes the name of this principal.
abstract  java.lang.Object setValue(Property property, java.lang.Object value)
          Sets the value of the specified property and return the old value.
abstract  void update()
          Persistently saves the changes to this principal in the server.
 
Methods inherited from class com.starteam.TrackedObject
getModifiedBy, getModifiedTime
 
Methods inherited from class com.starteam.LiveObject
getCreatedBy, getCreatedTime, toStarTeamURL
 
Methods inherited from class com.starteam.TypedResource
addToIntegerArray, getBooleanValue, getByteArrayValue, getCachedProperties, getContentValue, getDateTimeValue, getDateValue, getDisplayName, 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, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getID

public abstract int getID()
Returns this principal's server wide unique integer identifier.

Overrides:
getID in class TypedResource
Returns:
this principal's server wide unique integer identifier.

getName

public abstract java.lang.String getName()
Returns the name of this principal

Returns:
the name of this principal

setName

public abstract void setName(java.lang.String name)
Changes the name of this principal. You must call update to save this change.

Parameters:
name - the new name for the principal.
See Also:
Principal.update()

getValue

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

Overrides:
getValue in class TypedResource
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 abstract java.lang.Object setValue(Property property,
                                          java.lang.Object value)
Sets the value of the specified property and return the old value.

Overrides:
setValue in class TypedResource
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

update

public abstract void update()
Persistently saves the changes to this principal in the server. If the principal is new it will be added, otherwise it will be modified.

Throws:
java.lang.IllegalStateException - if this is a new Group with no Parent assigned.

getServer

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

Overrides:
getServer in class TypedResource
Returns:
the Server object to which this principal belongs.

remove

public abstract void remove()
                     throws java.lang.IllegalStateException
Removes this principal from the StarTeam server, plus any direct or indirect members of this principal.

Throws:
java.lang.IllegalStateException - if this principal was never saved, if it is a built-in account, or if removing it would result in another principal having no parent membership.
ServerException - if the logged in user does not have appropriate permissions

isNew

public abstract boolean isNew()
Returns true if this Principal has been created on the server yet.

Overrides:
isNew in class TypedResource
Returns:
true is this Principal has not yet been created on the server server.

isDirty

public abstract 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().

Overrides:
isDirty in class TypedResource
Returns:
true if any of this principal's properties have been modified locally and not yet saved.

isDeleted

public abstract boolean isDeleted()
Returns true if the Principal has been deleted.

Returns:
true if the Principal has been deleted.


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