findAll(connection)
create()
update()
delete()
getName()
getLevel()
getMaxBuilds()
getPurgeDays()
getPurgeRule()
getPurgeType()
getEnterChainProjectId()
getExitChainProjectId()
getPurgeChainProjectId()
setName(className)
setLevel(accessGroupId)
setMaxBuilds(maxBuilds)
setPurgeDays(purgeDays)
setPurgeRule(purgeRule)
setPurgeType(purgeType)
setEnterChainProjectId(projectID)
setExitChainProjectId(projectID)
setPurgeChainProjectId(projectID)
BuildForge::Services::DBO::BuildClass
use BuildForge::Services;
$conn = new BuildForge::Services::Connection($hostname); $token = $conn->authUser($user, $pass); # Getting existing classes $allClasses = BuildForge::Services::DBO::BuildClass->findAll($conn); $oldclass = BuildForge::Services::DBO::BuildClass->findByName($conn, 'ClassName');
# Getter / setter functions $id = $oldclass->getName(); $accessGroupId = $oldclass->getLevel(); $maxBuilds = $oldclass->getMaxBuilds(); $daysUntilPurge = $oldclass->getPurgeDays(); $whichBuildsToPurge = $oldclass->getPurgeRule(); $whatDataToPurge = $oldclass->getPurgeType(); $enterProjectId = $oldclass->getEnterChainProjectId(); $exitProjectId = $oldclass->getExitChainProjectId(); $purgeProjectId = $oldclass->getPurgeChainProjectId(); $project = new BuildForge::Services::DBO::Project(); $project->setName('ProjectName'); $project->create();
$oldclass->setName('newName'); $oldclass->setLevel(6); $oldclass->setMaxBuilds(16); $oldclass->setPurgeDays(5); $oldclass->setPurgeRule('ANY_BUILD'); $oldclass->setPurgeType('CONSOLE_DATA'); $oldclass->setEnterChainProjectId($project->getProjectId()); $oldclass->setExitChainProjectId($project->getProjectId()); $oldclass->setPurgeChainProjectId($project->getProjectId()); $oldclass->update(); # Class creation, updating, deletion $newclass = new BuildForge::Services::DBO::BuildClass($conn); $newclass->setName('New Build Class'); $newclass->setLevel(4); $newclass->create();
$newclass->setLevel(2); $newclass->update(); $newclass->delete(); BuildForge::Services::DBO::BuildClass->deleteByName($conn, $oldclass->getName()); $conn->logout; $conn->close;
BuildClass allows you to create, access, and delete BuildForge classes.
Creates a new BuildClass instance.
A connected BuildForge::Services::Connection object.
An optional reference to a hash containing any or all of the following fields.
The name/ID of the build class.
The AccessGroup ID of the access group this class is in (from $accessGroup->getLevel()). If a user is not in the access group, the user can't view, edit, or use this class.
The maximum number of builds with this class of a given project that will be kept before it is eligible for automatic purging. A value of 0 causes no build to be purged due to number of builds of this class.
If a build of this class is more than this number of days old it becomes eligible for automatic purging. A value of 0 means that no build is automatically purged due to its age.
This sets the rule for what types of builds will be purged according to the maxBuilds and purgeDays directives. This can be any of:
Any build will be deleted.
The most recent passed build will be kept no matter how old it is in comparison to the failed builds.
Only failed builds will be purged automatically.
Only passed builds will be purged automatically.
This sets the rule for what is deleted when a build is purged. It can be any of:
Removes the information for the build from the console, but leaves the files and directories
that were created for the build from the server(s)
on which it was built.
Removes the build logs from the console and the directories and files created in the build
from the server(s)
on which it was built, but leaves the build record on the console. The build
record is moved to the ``Archived'' section.
Removes the directories and files created for the build from the server(s)
on which it was built,
but leaves the build record and build logs on the console. The build record is moved to the
``Archived'' section.
Removes the build logs from the console, but leaves the build record on the console and the
directories and files created on the server(s)
on which the build was built. The build
record is moved to the ``Archived'' section.
All data for the build is deleted.
The project ID (from $project->getProjectId())
for the project that gets kicked off when
a build of this class is purged, or 0 (the default) if no project gets
kicked off for this reason.
The project ID (from $project->getProjectId())
for the project that gets kicked off when
a build gets changed from another class to this one, or 0 (the default) if no project gets
kicked off for this reason.
The project ID (from $project->getProjectId())
for the project that gets kicked off when
a build gets changed from this class to another one, or 0 (the default) if no project gets
kicked off for this reason.
findAll(connection)
Returns a reference to an array of BuildForge::Services::DBO::BuildClass objects, one for each entry in the database that the current user has access to.
A connected BuildForge::Services::Connection object.
Returns the BuildForge::Services::DBO::BuildClass object that corresponds to the given name, or undef if no such BuildClass exists.
A connected BuildForge::Services::Connection object.
The name of the desired class (from $class->getName()).
create()
Creates an entry for the build class in the database with the current settings.
update()
Updates the build class in the database to correspond to the current state of the BuildClass object.
delete()
Removes the class from the database (if it exists).
Deletes the class with the given name from the database (if it exists).
A connected BuildForge::Services::Connection object.
The name of the desired class (from $class->getName()).
getName()
Returns the name / ID of the class.
getLevel()
Returns the access group ID of the access group the class belongs to. Users not in the access group can not see, edit, or use the class.
getMaxBuilds()
Returns the maximum number of builds of this class a given project may have before excess builds become eligible for automatic purging. A value of 0 means that unlimited builds will be kept.
getPurgeDays()
Returns the number of days a build of this class will remain before it becomes eligible for automatic purging. A value of 0 means that builds of this class will not be deleted due to the length of time they have remained.
getPurgeRule()
Returns the rule for what types of builds will be purged according to the maxBuilds and purgeDays directives. This can be any of:
Any build will be deleted.
The most recent passed build will be kept no matter how old it is in comparison to the failed builds.
Only failed builds will be purged automatically.
Only passed builds will be purged automatically.
getPurgeType()
Returns the rule for what is deleted when a build is purged. It can be any of:
Removes the information for the build from the console, but leaves the files and directories
that were created for the build from the server(s)
on which it was built.
Removes the build logs from the console and the directories and files created in the build
from the server(s)
on which it was built, but leaves the build record on the console. The build
record is moved to the ``Archived'' section.
Removes the directories and files created for the build from the server(s)
on which it was built,
but leaves the build record and build logs on the console. The build record is moved to the
``Archived'' section.
Removes the build logs from the console, but leaves the build record on the console and the
directories and files created on the server(s)
on which the build was built. The build
record is moved to the ``Archived'' section.
All data for the build is deleted.
getEnterChainProjectId()
Returns the project ID (from $project->getProjectId())
for the project that gets kicked off when
a build of another class gets changed to this class, or 0 if no project gets kicked off for this
reason.
getExitChainProjectId()
Returns the project ID (from $project->getProjectId())
for the project that gets kicked off when
a build of this class gets changed to another class, or 0 if no project gets kicked off for this
reason.
getPurgeChainProjectId()
Returns the project ID (from $project->getProjectId())
for the project that gets kicked off when
a build of this class is purged, or 0 if no project gets kicked off for this
reason.
setName(className)
Sets the name / ID for the class. $class->update()
must be run before changes are
replicated in the database.
The new name for the class
setLevel(accessGroupId)
Sets the access group the class belongs to. Users not belonging to the class's access
group will not be able to view, edit, or use the class. $class->update()
must be
run before changes are replicated in the database.
The new access group ID for the class, from $accessGroup->getLevel().
setMaxBuilds(maxBuilds)
Sets the maximum number of builds of this class a project may have before older ones
become eligible for automatic deletion. $class->update()
must be
run before changes are replicated in the database.
The number of builds allowed. 0 will make no build deletable for this reason.
setPurgeDays(purgeDays)
Sets the maximum number of days a build will remain before being eligible for
automatic deletion. $class->update()
must be run before changes are replicated
in the database.
The number of days, with 0 corresponding to a build being able to remain for unlimited time.
setPurgeRule(purgeRule)
Sets the rule for what types of builds will be purged according to the maxBuilds and
purgeDays directives. $class->update()
must be run before changes are replicated in the database.
The deletion rule. It may be any of:
Any build will be deleted.
The most recent passed build will be kept no matter how old it is in comparison to the failed builds.
Only failed builds will be purged automatically.
Only passed builds will be purged automatically.
setPurgeType(purgeType)
Sets the rule for what is deleted when a build is purged. $class->update()
must be
run before changes are replicated in the database.
The deletion rule. It may be any of:
Removes the information for the build from the console, but leaves the files and directories
that were created for the build from the server(s)
on which it was built.
Removes the build logs from the console and the directories and files created in the build
from the server(s)
on which it was built, but leaves the build record on the console. The build
record is moved to the ``Archived'' section.
Removes the directories and files created for the build from the server(s)
on which it was built,
but leaves the build record and build logs on the console. The build record is moved to the
``Archived'' section.
Removes the build logs from the console, but leaves the build record on the console and the
directories and files created on the server(s)
on which the build was built. The build
record is moved to the ``Archived'' section.
All data for the build is deleted.
setEnterChainProjectId(projectID)
Sets the project ID (from $project->getProjectId())
for the project that gets kicked off when
a build of another class gets changed to this class. $class->update()
must be
run before changes are replicated in the database.
The ID of the project to be kicked off (from $project->getProjectID()). A value of 0 causes no project to be kicked off for this reason.
setExitChainProjectId(projectID)
Sets the project ID (from $project->getProjectId())
for the project that gets kicked off when
a build of this class gets changed to another class. $class->update()
must be
run before changes are replicated in the database.
The ID of the project to be kicked off (from $project->getProjectID()). A value of 0 causes no project to be kicked off for this reason.
setPurgeChainProjectId(projectID)
Sets the project ID (from $project->getProjectId())
for the project that gets kicked off when
a build of this class is purged. $class->update()
must be
run before changes are replicated in the database.
The ID of the project to be kicked off (from $project->getProjectID()). A value of 0 causes no project to be kicked off for this reason.
Copyright (c)2006-2007 International Business Machines, Inc. All rights reserved.