com.buildforge.services.common.dbo
Class ProjectDBO

java.lang.Object
  extended by com.buildforge.services.common.dbo.DBObject
      extended by com.buildforge.services.common.dbo.GeoAwareDBObject
          extended by com.buildforge.services.common.dbo.ProjectDBO

public class ProjectDBO
extends GeoAwareDBObject

Database information representing a project definition.


Nested Class Summary
static class ProjectDBO.InUse
          How this project is currently being used.
 
Field Summary
static char ACTIVE_NO
           
static char ACTIVE_YES
           
static java.lang.Class<ProjectDBO> CLASS
           
static char STICKY_NO
           
static char STICKY_YES
           
static java.lang.String TYPE_KEY
           
 
Constructor Summary
ProjectDBO()
           
 
Method Summary
 void addStep(StepDBO newStep)
          Adds a child Step object to this project at the end of the current list of steps
 void addStep(StepDBO newStep, int index)
          Adds a child Step object to this project at the specified, 0-based index in the list of steps.
 ProjectDBO clone()
           
 void copyStep(int fromIndex, int toIndex, java.lang.String newStepUid)
          Copies the specified step to another location in the step list and assigns a new unique ID to the copy.
 void copyStep(int fromIndex, java.lang.String newStepUid)
          Copies the specified step to the end of the step list and assigns a new unique ID to the copy.
 ProjectDBO fromArray(java.lang.Object[] data)
          Deserialize the database object's settings from a request array.
 boolean getActive()
           
 java.lang.String getBuildClass()
           
 int getEnvironmentId()
           
 int getFailChainId()
           
 int getFailNotify()
           
 int getLevel()
           
 int getMaxThread()
           
 java.lang.String getName()
           
 int getPassChainId()
           
 int getPassNotify()
           
 int getProjectId()
           
 int getRunLimit()
           
 java.lang.String getSelectorId()
           
 int getStartNotify()
           
 StepDBO getStep(int index)
          Retrieves a step from this project using its index within the step list.
 StepDBO getStep(java.lang.String uid)
          Retrieves a step by its unique ID.
 java.util.List<StepDBO> getSteps()
           
 boolean getSticky()
           
 java.lang.String getTag()
           
 int getTagSync()
           
 java.lang.String getTypeKey()
          Retrieve the key that should be used to look up the display name for a data type.
 int hashCode()
           
 boolean isLive()
          Checks whether or not the object is live.
 void moveStep(int fromIndex, int toIndex)
          Moves the specified step to another location in the step list.
 StepDBO removeStep(int index)
          Removes the specified child step from this project.
 StepDBO removeStep(java.lang.String stepUid)
          Removes a child step from this project using its unique identifier.
 void setActive(boolean active)
           
 void setBuildClass(java.lang.String buildClass)
           
 void setEnvironmentId(int environmentId)
           
 void setFailChainId(int newChain)
           
 void setFailNotify(int notify)
           
 void setLevel(int level)
           
 void setMaxThread(int maxThread)
           
 void setName(java.lang.String name)
           
 void setPassChainId(int newChain)
           
 void setPassNotify(int notify)
           
 void setProjectId(int newProjectId)
           
 void setRunLimit(int newRunLimit)
           
 void setSelectorId(java.lang.String selectorId)
           
 void setStartNotify(int notify)
           
 void setSteps(java.util.List<StepDBO> newSteps)
          Completely replaces the current step list for this project.
 void setSticky(boolean sticky)
           
 void setTag(java.lang.String tag)
           
 void setTagSync(int tagSync)
           
 java.lang.Object[] toArray()
          Serializes this database object as an array of objects.
 java.lang.String toString()
           
 
Methods inherited from class com.buildforge.services.common.dbo.GeoAwareDBObject
getGeoId, setGeoId
 
Methods inherited from class com.buildforge.services.common.dbo.DBObject
badId, badName, checkDead, checkLive, collision, collision
 
Methods inherited from class java.lang.Object
equals, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_KEY

public static final java.lang.String TYPE_KEY
See Also:
Constant Field Values

CLASS

public static final java.lang.Class<ProjectDBO> CLASS

ACTIVE_YES

public static final char ACTIVE_YES
See Also:
Constant Field Values

ACTIVE_NO

public static final char ACTIVE_NO
See Also:
Constant Field Values

STICKY_YES

public static final char STICKY_YES
See Also:
Constant Field Values

STICKY_NO

public static final char STICKY_NO
See Also:
Constant Field Values
Constructor Detail

ProjectDBO

public ProjectDBO()
Method Detail

getTypeKey

public java.lang.String getTypeKey()
Description copied from class: DBObject
Retrieve the key that should be used to look up the display name for a data type.

Specified by:
getTypeKey in class DBObject
Returns:
the type key for this object's class

isLive

public boolean isLive()
Description copied from class: DBObject
Checks whether or not the object is live. Note that this is not valid for object types that do not have a unique identifier. Those for which no reasonable implementation exists should always return false.

Specified by:
isLive in class DBObject
Returns:
true iff liveness is a valid concept for this object, and the object is live; otherwise, false is returned.

getActive

public boolean getActive()

getBuildClass

public java.lang.String getBuildClass()

getEnvironmentId

public int getEnvironmentId()

getRunLimit

public int getRunLimit()

getFailChainId

public int getFailChainId()

getFailNotify

public int getFailNotify()

getLevel

public int getLevel()

getMaxThread

public int getMaxThread()

getName

public java.lang.String getName()

getPassChainId

public int getPassChainId()

getPassNotify

public int getPassNotify()

getProjectId

public int getProjectId()

getSelectorId

public java.lang.String getSelectorId()

getStartNotify

public int getStartNotify()

getSticky

public boolean getSticky()

getTag

public java.lang.String getTag()

getTagSync

public int getTagSync()

setActive

public void setActive(boolean active)

setBuildClass

public void setBuildClass(java.lang.String buildClass)

setEnvironmentId

public void setEnvironmentId(int environmentId)

setRunLimit

public void setRunLimit(int newRunLimit)

setFailChainId

public void setFailChainId(int newChain)

setFailNotify

public void setFailNotify(int notify)

setLevel

public void setLevel(int level)

setMaxThread

public void setMaxThread(int maxThread)

setName

public void setName(java.lang.String name)

setPassChainId

public void setPassChainId(int newChain)

setPassNotify

public void setPassNotify(int notify)

setProjectId

public void setProjectId(int newProjectId)

setSelectorId

public void setSelectorId(java.lang.String selectorId)

setStartNotify

public void setStartNotify(int notify)

setSticky

public void setSticky(boolean sticky)

setTag

public void setTag(java.lang.String tag)

setTagSync

public void setTagSync(int tagSync)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

fromArray

public ProjectDBO fromArray(java.lang.Object[] data)
                     throws APIException
Description copied from class: DBObject
Deserialize the database object's settings from a request array. This method is used to reconstruct a database object from the array that was created by DBObject.toArray().

Specified by:
fromArray in class DBObject
Parameters:
data - the object list that renders this object
Returns:
this object, for convenience
Throws:
APIException - if there is something wrong with the serialized data that interferes with the reconstruction of the object. The most obvious reason for this would be if the serialized array contains the wrong number of fields or otherwise does not match the serialized form for this type of database object.

toArray

public java.lang.Object[] toArray()
Description copied from class: DBObject
Serializes this database object as an array of objects. As specified in the description for Protocol, all supported protocols transfer database objects in this form.

Specified by:
toArray in class DBObject

clone

public ProjectDBO clone()
Overrides:
clone in class java.lang.Object

addStep

public void addStep(StepDBO newStep)
Adds a child Step object to this project at the end of the current list of steps

Parameters:
newStep -

addStep

public void addStep(StepDBO newStep,
                    int index)
             throws APIException
Adds a child Step object to this project at the specified, 0-based index in the list of steps. If the index is beyond the end of the existing list, the object will be added to the end of the list and the value of the supplied index will be ignored.

Parameters:
newStep -
index -
Throws:
APIException

removeStep

public StepDBO removeStep(int index)
                   throws APIException
Removes the specified child step from this project.

Parameters:
index - the 0-based index of the step within the project's step list
Returns:
the step that was removed
Throws:
APIException

removeStep

public StepDBO removeStep(java.lang.String stepUid)
Removes a child step from this project using its unique identifier.

Parameters:
stepUid - the step's unique ID
Returns:
the removed step.

copyStep

public void copyStep(int fromIndex,
                     java.lang.String newStepUid)
              throws APIException
Copies the specified step to the end of the step list and assigns a new unique ID to the copy.

Parameters:
fromIndex - The 0-based index of the step to copy
newStepUid - The unique ID to assign to the copy
Throws:
APIException

copyStep

public void copyStep(int fromIndex,
                     int toIndex,
                     java.lang.String newStepUid)
              throws APIException
Copies the specified step to another location in the step list and assigns a new unique ID to the copy.

Parameters:
fromIndex - The 0-based index of the step to copy
toIndex - The 0-based index at which to place the new step. If the value would place the copied step past the end of the list, then it is placed at the end of the list.
newStepUid - The unique ID to assign to the copy
Throws:
APIException

moveStep

public void moveStep(int fromIndex,
                     int toIndex)
              throws APIException
Moves the specified step to another location in the step list.

Parameters:
fromIndex - The 0-based original index of the step
toIndex - The 0-based index at which the step will be re-inserted. If this value would move the step past the end of the list, then the step is moved to the end. If this value is the same as the fromIndex, then no changes are made.
Throws:
APIException

getSteps

public java.util.List<StepDBO> getSteps()

getStep

public StepDBO getStep(java.lang.String uid)
Retrieves a step by its unique ID.

Parameters:
uid - the unique ID of the step to find
Returns:
the step DBO, or null if the step is not found

getStep

public StepDBO getStep(int index)
Retrieves a step from this project using its index within the step list.

Parameters:
index - the 0-based index of the step
Returns:
the step, or null if the specified index is outside the bounds of the current step list

setSteps

public void setSteps(java.util.List<StepDBO> newSteps)
Completely replaces the current step list for this project.

Parameters:
newSteps - the new step list