com.buildforge.services.client.dbo
Class BuildClass

java.lang.Object
  extended by com.buildforge.services.client.dbo.BuildClass

public final class BuildClass
extends java.lang.Object

An object representing a build class within the Build Forge system. A build class specifies the purging behavior for the jobs that are associated with it. It controls when jobs are purged automatically, what gets purged (whether the job was purged automatically or not), what project (if any) to run automatically when the job is purged, and so forth.


Field Summary
static java.lang.Class<BuildClass> CLASS
           
 
Constructor Summary
BuildClass(APIClientConnection conn)
          Define a new build class object.
 
Method Summary
 BuildClass create()
          Creates a new build class as defined by this object.
 void delete()
          Removes this build class from the system.
static void deleteByName(APIClientConnection conn, java.lang.String name)
          Removes the specified build class from the system.
static java.util.List<BuildClass> findAll(APIClientConnection conn)
          Finds all build class objects in the system to which the user has access.
static BuildClass findByName(APIClientConnection conn, java.lang.String name)
          Finds the build class with the specified name.
 int getEnterChainProjectId()
          Returns the project id of the project to run if a build is moved into (enters) this build class.
 int getExitChainProjectId()
          Return the project id of the project to run if a build is moved out of (exits) this build class.
 int getLevel()
          Returns the level (access group ID) assigned to this class.
 int getMaxBuilds()
          The maximum number of builds to keep.
 java.lang.String getName()
          Returns the descriptive name of the class, as supplied by the user that created it.
 int getPurgeChainProjectId()
          Returns the project ID of the project to run as a purge chain.
 int getPurgeDays()
          Builds in this class will be purged if they are more than this many days old.
 BuildClassDBO.PurgeRule getPurgeRule()
          Controls which builds are eligible for purging on the basis of whether or not they passed.
 BuildClassDBO.PurgeType getPurgeType()
          Controls what gets deleted when a build is purged.
 void setEnterChainProjectId(int enterChainProjectId)
          Sets the project ID of the project to run when a build is moved into (enters) this class.
 void setExitChainProjectId(int exitChainProjectId)
          Sets the project ID of the project to run when a build is moved out of (exits) this class.
 void setLevel(int level)
          Sets the level (access group id) assigned to this class.
 void setMaxBuilds(int maxBuilds)
          Sets the maximum number of builds to keep.
 void setName(java.lang.String name)
          Sets the name of the class
 void setPurgeChainProjectId(int purgeChainProjectId)
          Sets the project id of a project to run as a purge chain.
 void setPurgeDays(int purgeDays)
          Builds in this class will be purged if they are more than this many days old.
 void setPurgeRule(BuildClassDBO.PurgeRule purgeRule)
          Controls which builds are eligible for purging on the basis of whether or not they passed.
 void setPurgeType(BuildClassDBO.PurgeType purgeType)
          Controls what gets deleted when a build is purged.
 java.lang.String toString()
           
 BuildClass update()
          Updates this existing build class to use the modified values in this object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS

public static final java.lang.Class<BuildClass> CLASS
Constructor Detail

BuildClass

public BuildClass(APIClientConnection conn)
Define a new build class object. The build class does not exist until after it has been created using the create() method.

Parameters:
conn - the services layer connection that the build class object should use when submitting requests
Method Detail

findAll

public static java.util.List<BuildClass> findAll(APIClientConnection conn)
                                          throws java.io.IOException,
                                                 ServiceException
Finds all build class objects in the system to which the user has access. A user has access to all build classes for which the user has direct or indirect membership in the build class's assigned access group.

Parameters:
conn - the API client connection to use for the request
Returns:
the list of build classes
Throws:
java.io.IOException
ServiceException

findByName

public static BuildClass findByName(APIClientConnection conn,
                                    java.lang.String name)
                             throws java.io.IOException,
                                    ServiceException
Finds the build class with the specified name.

Parameters:
conn - the API client connection to use for the request
name - The descriptive name of the build class to find
Returns:
The build class, or null if none could be found
Throws:
java.io.IOException
ServiceException

create

public BuildClass create()
                  throws java.io.IOException,
                         ServiceException
Creates a new build class as defined by this object.

Restrictions: Requires Permission.AddClass and direct or indirect membership in the access group. The descriptive name must be unique.

Returns:
the newly created build class
Throws:
java.io.IOException
ServiceException

delete

public void delete()
            throws java.io.IOException,
                   ServiceException
Removes this build class from the system.

Restrictions: Requires Permission.DeleteClass. The build class can not be referenced as the current class for any build, as the default class for any project, or as the selected class for any scheduler entry.

Throws:
java.io.IOException
ServiceException

deleteByName

public static void deleteByName(APIClientConnection conn,
                                java.lang.String name)
                         throws java.io.IOException,
                                ServiceException
Removes the specified build class from the system.

Restrictions: As for delete()

Parameters:
conn - the connection to user for this request
name - the name of the build class to delete
Throws:
java.io.IOException
ServiceException

update

public BuildClass update()
                  throws java.io.IOException,
                         ServiceException
Updates this existing build class to use the modified values in this object.

Restrictions: Requires Permission.UpdateClass and direct or indirect membership in the access group. The descriptive name must be unique.

Returns:
the updated build class
Throws:
java.io.IOException
ServiceException

getEnterChainProjectId

public int getEnterChainProjectId()
Returns the project id of the project to run if a build is moved into (enters) this build class.


getExitChainProjectId

public int getExitChainProjectId()
Return the project id of the project to run if a build is moved out of (exits) this build class.


getLevel

public int getLevel()
Returns the level (access group ID) assigned to this class. Users that are not a direct or indirect member of this access group will not be able to use this class.


getMaxBuilds

public int getMaxBuilds()
The maximum number of builds to keep. Builds in this class will be purged, starting with the oldest, if there are more than this many builds of the project.


getName

public java.lang.String getName()
Returns the descriptive name of the class, as supplied by the user that created it.


getPurgeChainProjectId

public int getPurgeChainProjectId()
Returns the project ID of the project to run as a purge chain.


getPurgeDays

public int getPurgeDays()
Builds in this class will be purged if they are more than this many days old. If set to 0, then this criteria is not used to select builds for automated purging.


getPurgeRule

public BuildClassDBO.PurgeRule getPurgeRule()
Controls which builds are eligible for purging on the basis of whether or not they passed.


getPurgeType

public BuildClassDBO.PurgeType getPurgeType()
Controls what gets deleted when a build is purged.


setEnterChainProjectId

public void setEnterChainProjectId(int enterChainProjectId)
Sets the project ID of the project to run when a build is moved into (enters) this class.

Parameters:
enterChainProjectId - the project ID of the project to run when a build is moved into (enters) this class

setExitChainProjectId

public void setExitChainProjectId(int exitChainProjectId)
Sets the project ID of the project to run when a build is moved out of (exits) this class.

Parameters:
exitChainProjectId - the project ID of the project to run when a build is moved out of (exits) this class

setLevel

public void setLevel(int level)
Sets the level (access group id) assigned to this class. Users that are not direct or indirect members of this access group will not be able to use this class.


setMaxBuilds

public void setMaxBuilds(int maxBuilds)
Sets the maximum number of builds to keep. Builds in this class will be purged, starting with the oldest, if there are more than this many builds of the project.


setName

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


setPurgeChainProjectId

public void setPurgeChainProjectId(int purgeChainProjectId)
Sets the project id of a project to run as a purge chain.


setPurgeDays

public void setPurgeDays(int purgeDays)
Builds in this class will be purged if they are more than this many days old. If set to 0, then this criteria is not used to select builds for automated purging.


setPurgeRule

public void setPurgeRule(BuildClassDBO.PurgeRule purgeRule)
Controls which builds are eligible for purging on the basis of whether or not they passed.


setPurgeType

public void setPurgeType(BuildClassDBO.PurgeType purgeType)
Controls what gets deleted when a build is purged.


toString

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