com.starbase.starteam
Class PromotionState

java.lang.Object
  |
  +--com.starbase.starteam.CacheRef
        |
        +--com.starbase.starteam.NamedCacheRef
              |
              +--com.starbase.starteam.TypedResource
                    |
                    +--com.starbase.starteam.SimpleTypedResource
                          |
                          +--com.starbase.starteam.PromotionState
All Implemented Interfaces:
java.lang.Cloneable, ISecurable, ISecurableObject

public class PromotionState
extends SimpleTypedResource
implements ISecurableObject

This class represents a promotion state associated with a promotion model. This class has no update() method so to save new or modified promotion states you must use PromotionModel.update()

See Also:
PromotionModel

Constructor Summary
PromotionState(PromotionModel model)
          Create a new PromotionState for the specified model.
 
Method Summary
 void acquireOwnership()
          Sets ownership of this securable object to the logged in user.
 boolean equals(java.lang.Object source)
          returns true if this object instance is equal to the source
 AclEntry[] getACL()
          Returns the Access Control List for this object.
 int getCreatedBy()
          Returns the user ID that created the state.
 OLEDate getCreatedOn()
          Returns the time at which the state was created.
 int getDeletedBy()
          Returns the user ID that deleted the state.
 OLEDate getDeletedOn()
          Returns the time at which the state was deleted.
 java.lang.String getDescription()
          Returns the description of the PromotionState.
 int getID()
          Returns the object ID for the PromotionState.
 int getLabelID()
          Returns the Label ID that defines this PromotionState.
 java.lang.String getName()
          Returns the name of the PromotionState.
 int getObjectID()
          Returns the object ID for the PromotionState.
 int getOwner()
          If there are no access rights explicitly assigned to this object, then the effective access rights come from a parent container.
 ISecurableContainer getParentContainer()
          If there are no access rights explicitly assigned to this object, then the effective access rights come from a parent container.
 PromotionModel getPromotionModel()
          Returns the "owning" PromotionModel object for this PromotionState.
 int hashCode()
          returns a unique hash for all instances of this type
 boolean hasPermission(int permissions)
          Returns true if desired permissions are granted
 void setACL(AclEntry[] acl)
          Modify the Access Control List for this object.
 void setDescription(java.lang.String description)
          Sets the description of the PromotionState.
 void setLabelID(int labelID)
          Sets the Label ID that defines this PromotionState.
 void setName(java.lang.String name)
          Sets the name of the PromotionState.
 
Methods inherited from class com.starbase.starteam.SimpleTypedResource
get, getByteArray, getDouble, getEnumDisplayName, getInt, getIntArray, getOLEDate, getPossibleValues, getPropertyNames, getString, getType, getTypeNames, put, putByPropertyID
 
Methods inherited from class com.starbase.starteam.TypedResource
addToIntArray, removeFromIntArray, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.starbase.starteam.ISecurable
getType
 

Constructor Detail

PromotionState

public PromotionState(PromotionModel model)
Create a new PromotionState for the specified model.

Parameters:
model - the owning PromotionModel
Method Detail

getPromotionModel

public PromotionModel getPromotionModel()
Returns the "owning" PromotionModel object for this PromotionState.

Returns:
the "owning" PromotionModel object for this PromotionState.

getObjectID

public int getObjectID()
Returns the object ID for the PromotionState.

Returns:
the object ID for the PromotionState.

getID

public int getID()
Returns the object ID for the PromotionState.

Overrides:
getID in class SimpleTypedResource
Returns:
the object ID for the PromotionState. Same as getObjectID.

getName

public java.lang.String getName()
Returns the name of the PromotionState.

Returns:
the name of the PromotionState.

setName

public void setName(java.lang.String name)
Sets the name of the PromotionState.

Parameters:
name - the new name for this promotion state.

getDescription

public java.lang.String getDescription()
Returns the description of the PromotionState.

Returns:
this state's description

setDescription

public void setDescription(java.lang.String description)
Sets the description of the PromotionState.

Parameters:
description - the new description for this state

getLabelID

public int getLabelID()
Returns the Label ID that defines this PromotionState. It may return -1 for PromotionStates defined as "current".

Returns:
the label ID for this state

setLabelID

public void setLabelID(int labelID)
Sets the Label ID that defines this PromotionState. May set it to -1 if you want the state to be defined as "current".

Parameters:
labelID - the label ID to associate with this state

getCreatedOn

public OLEDate getCreatedOn()
Returns the time at which the state was created.

Returns:
the time at which the state was created.

getCreatedBy

public int getCreatedBy()
Returns the user ID that created the state.

Returns:
the user ID that created the state.

getDeletedOn

public OLEDate getDeletedOn()
Returns the time at which the state was deleted.

Returns:
the time at which the state was deleted.

getDeletedBy

public int getDeletedBy()
Returns the user ID that deleted the state. Will return -1 for non-deleted states.

Returns:
the user ID for who deleted this state

getACL

public AclEntry[] getACL()
Returns the Access Control List for this object. This will return null if this object has not access control list.

Specified by:
getACL in interface ISecurable
Returns:
the access control list for this item. May return null.
See Also:
AclEntry

setACL

public void setACL(AclEntry[] acl)
Modify the Access Control List for this object. If the input parameter is null then the access control list will be dropped.

Specified by:
setACL in interface ISecurable
Parameters:
acl - the new access control list or null if to be dropped.
See Also:
AclEntry

getOwner

public int getOwner()
If there are no access rights explicitly assigned to this object, then the effective access rights come from a parent container. A RuntimeException will be thrown if SupportedFeature.hasObjectOwnership() returns false.

Specified by:
getOwner in interface ISecurableObject
Returns:
This object's parent container.
See Also:
SupportedFeatures.hasObjectOwnership()

acquireOwnership

public void acquireOwnership()
Sets ownership of this securable object to the logged in user. A RuntimeException will be thrown if SupportedFeature.hasObjectOwnership() returns false.

Specified by:
acquireOwnership in interface ISecurableObject
See Also:
SupportedFeatures.hasObjectOwnership()

getParentContainer

public ISecurableContainer getParentContainer()
If there are no access rights explicitly assigned to this object, then the effective access rights come from a parent container.

Specified by:
getParentContainer in interface ISecurable
Returns:
This object's parent container.
See Also:
ISecurableContainer

hasPermission

public boolean hasPermission(int permissions)
Returns true if desired permissions are granted

Specified by:
hasPermission in interface ISecurable
Parameters:
permissions - the desired permissions
Returns:
true if all the requested permissions are granted; false if at least one of the requested permissions is denied.
See Also:
Permission

equals

public boolean equals(java.lang.Object source)
returns true if this object instance is equal to the source

Overrides:
equals in class SimpleTypedResource
Parameters:
source - Object the source to comapre with
Returns:
boolean true if this object is equal to the source

hashCode

public int hashCode()
returns a unique hash for all instances of this type

Overrides:
hashCode in class SimpleTypedResource
Returns:
int a unique hash for all instances of this type


StarTeam SDK 10.4, Build 36
Copyright © 2003-2008 Borland Software Corporation. All rights reserved.