com.starbase.starteam
Class ProcessItem

java.lang.Object
  |
  +--com.starbase.starteam.ProcessItem

public class ProcessItem
extends java.lang.Object

A process item in the context of a given target view.


Constructor Summary
ProcessItem(Item item)
          Constructs a process item.
ProcessItem(Item item, View target)
          Constructs a process item in the context of a given target view.
 
Method Summary
 boolean equals(java.lang.Object another)
           
static ItemList getActiveProcessItems(Type type, View view)
          Gets the list of process items of the given type that are in a valid active state.
static ItemList getActiveProcessItems(Type type, View target, Folder source, int depth)
          Gets the list of process items of the given type that are in a valid active state for the given target view.
static ItemList getActiveProcessItems(Type type, View target, View source)
          Gets the list of process items of the given type that are in a valid active state for the given target view.
static ItemList getActiveProcessItems(View target, ItemListManager source)
          Gets the list of process items of the given type that are in a valid active state for the given target view.
 Item[] getAllProcessTasks()
          Gets the list of process tasks associated with this process item in its target view.
 Item[] getAllProcessTasksInAnyView()
          Gets the list of process tasks associated with this process item.
 Item[] getAllProcessTasksInProgress(ProcessItemUsage usage)
          Gets the list of process tasks in progress in the target view.
 Item getItem()
          Gets the underlying item.
static Type[] getProcessItemTypes(View targetView)
          Gets the list of item types that are legal process item types for the given target view.
 Item getProcessTaskInProgress(ProcessItemUsage usage)
          Gets the process task in progress in the target view.
 View getTargetView()
          Gets the target view.
 int hashCode()
          Return a hashcode for this item.
 boolean isActiveState()
          Determines whether or not this process item is a legal process item for its target view, and is in a legal state to be selected as an active process item for that view.
 boolean isEnhanced()
          Determines whether or not this process item follows the rules of the enhanced process item model in the context of its target view.
 boolean isLegalType()
          Determines whether or not this process item is a legal type of process item for its target view.
 boolean isSelectable(ProcessItemUsage usage)
          Determines whether or not this process item is in a state that allows it to be selected as the active process item for its target view.
 Item[] resolve()
          Resolves this process item in the context of its target view.
 void verifyIsSelectable(ProcessItemUsage usage)
          Verifies that this process item is in a state that allows it to be selected as the active process item for its target view.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProcessItem

public ProcessItem(Item item)
Constructs a process item. Assumes that the item resides in the target view.

Parameters:
item - The item to be treated as a process item. The item is not necessarily a valid type for the target view.

ProcessItem

public ProcessItem(Item item,
                   View target)
Constructs a process item in the context of a given target view.

Parameters:
item - The item to be treated as a process item. The item is not necessarily a valid type for the target view.
Method Detail

getItem

public Item getItem()
Gets the underlying item.

Returns:
The underlying item.

getTargetView

public View getTargetView()
Gets the target view.

Returns:
The target view.

isSelectable

public boolean isSelectable(ProcessItemUsage usage)
Determines whether or not this process item is in a state that allows it to be selected as the active process item for its target view.

Parameters:
usage - The intended usage of this process item.
Returns:
true if this process item may be selected as the active process item for its target view; false otherwise.
See Also:
ProcessItem.verifyIsSelectable(com.starbase.starteam.ProcessItemUsage)

verifyIsSelectable

public void verifyIsSelectable(ProcessItemUsage usage)
Verifies that this process item is in a state that allows it to be selected as the active process item for its target view.

Parameters:
usage - The intended usage of this process item.
Throws:
java.lang.IllegalArgumentException - if the process item is not a valid process item for the target view.
java.lang.IllegalStateException - if the process item is not in a state that allows it to be selected as the active process item.
See Also:
ProcessItem.isSelectable(com.starbase.starteam.ProcessItemUsage)

isLegalType

public boolean isLegalType()
Determines whether or not this process item is a legal type of process item for its target view.

Note that even if this is a legal type of process item, it is not necessarily in a legal state to be selected as an active process item.

Returns:
true if this is a legal type of process item for its target view, or false otherwise.
See Also:
ProcessItem.isActiveState(), Project.isProcessItemsRequired(), Project.isProcessItemTypeEnabled(com.starbase.starteam.Type)

isActiveState

public boolean isActiveState()
Determines whether or not this process item is a legal process item for its target view, and is in a legal state to be selected as an active process item for that view.

Returns:
true if this is a legal process item in a legal state to be selected as an active process item for its target view, or false otherwise.
See Also:
ProcessItem.isLegalType(), Project#isProcessItemsEnabled, Project.isActiveProcessItemStateEnabled(com.starbase.starteam.EnumeratedValue)

isEnhanced

public boolean isEnhanced()
Determines whether or not this process item follows the rules of the enhanced process item model in the context of its target view.

In the enhanced model, changed files and folders are linked to process items indirectly, via a view-specific process task.

Returns:
true if this is an enhanced process item in the context of its target view; false otherwise.

resolve

public Item[] resolve()
Resolves this process item in the context of its target view.

Returns:
The list of associated file and folder revisions representing changes associated with this process item in the target view.

getProcessTaskInProgress

public Item getProcessTaskInProgress(ProcessItemUsage usage)
Gets the process task in progress in the target view.

Parameters:
usage - The operation being performed that will result in changed files or folders (for example, CHECKIN). May not be null.
Returns:
The process task in progress in this process item's target view, or null if there isn't one.
Throws:
java.lang.IllegalStateException - if there is more than one process task in progress with the requested usage in the target view.

getAllProcessTasksInProgress

public Item[] getAllProcessTasksInProgress(ProcessItemUsage usage)
Gets the list of process tasks in progress in the target view.

Parameters:
usage - The operation being performed that will result in changed files or folders (for example, CHECKIN). If null, then any usage is acceptable.
Returns:
The list of process tasks in progress in this process item's target view. In most cases, there will be at most one.

getAllProcessTasks

public Item[] getAllProcessTasks()
Gets the list of process tasks associated with this process item in its target view.

Returns:
The list of process tasks associated with this process item in its target view. The process tasks may be in any state.

getAllProcessTasksInAnyView

public Item[] getAllProcessTasksInAnyView()
Gets the list of process tasks associated with this process item.

Returns:
The list of process tasks associated with this process item. The process tasks may reside in any view and be in any state. Some of them may be disembodied items.
See Also:
View.getDisembodiedItem(int, com.starbase.starteam.Type), Item.isDisembodied()

getProcessItemTypes

public static Type[] getProcessItemTypes(View targetView)
Gets the list of item types that are legal process item types for the given target view.

Returns:
The list of item types that are legal process item types for the given target view.

getActiveProcessItems

public static ItemList getActiveProcessItems(Type type,
                                             View view)
Gets the list of process items of the given type that are in a valid active state.

Parameters:
type - The item type.
view - A view that is both the target view and the source of the candidate process items.
Returns:
A list of the process items that are in a valid active state.

getActiveProcessItems

public static ItemList getActiveProcessItems(Type type,
                                             View target,
                                             View source)
Gets the list of process items of the given type that are in a valid active state for the given target view.

Parameters:
type - The item type.
target - The target view.
source - The view that is the source of the candidate process items.
Returns:
A list of the process items that are in a valid active state.

getActiveProcessItems

public static ItemList getActiveProcessItems(Type type,
                                             View target,
                                             Folder source,
                                             int depth)
Gets the list of process items of the given type that are in a valid active state for the given target view.

Parameters:
type - The item type.
target - The target view.
source - The folder that is the source of the candidate process items.
depth - Determines which folders are searched for process items. Zero searches only the given folder; 1 searches the folder and all child folders to a depth of 1; and so on. Use -1 to search the folder and all child folders to any depth.
Returns:
A list of the process items that are in a valid active state.

getActiveProcessItems

public static ItemList getActiveProcessItems(View target,
                                             ItemListManager source)
Gets the list of process items of the given type that are in a valid active state for the given target view.

Parameters:
target - The target view.
source - The source of the candidate process items.
Returns:
A list of the process items that are in a valid active state.

hashCode

public int hashCode()
Return a hashcode for this item.

Overrides:
hashCode in class java.lang.Object
Returns:
a hashcode for this item.

equals

public boolean equals(java.lang.Object another)
Overrides:
equals in class java.lang.Object


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