NAME

BuildForge::Services::DBO::BuildClass


SYNOPSIS

        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;


DESCRIPTION

BuildClass allows you to create, access, and delete BuildForge classes.


METHODS

new BuildForge::Services::DBO::BuildClass(connection, {ClassParamsHashRef})

Creates a new BuildClass instance.

connection

A connected BuildForge::Services::Connection object.

ClassParamsHashRef

An optional reference to a hash containing any or all of the following fields.

name

The name/ID of the build class.

level

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.

maxBuilds

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.

purgeDays

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.

purgeRule

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

Any build will be deleted.

KEEP_PASS

The most recent passed build will be kept no matter how old it is in comparison to the failed builds.

ONLY_FAILED

Only failed builds will be purged automatically.

ONLY_PASSED

Only passed builds will be purged automatically.

purgeType

This sets the rule for what is deleted when a build is purged. It can be any of:

CONSOLE_DATA

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.

LOGS_AND_FILES

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.

FILES

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.

LOGS

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.

EVERYTHING

All data for the build is deleted.

purgeChainProjectId

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.

enterChainProjectId

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.

exitChainProjectId

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.

BuildForge::Services::DBO::BuildClass->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.

connection

A connected BuildForge::Services::Connection object.

BuildForge::Services::DBO::BuildClass->findByName(connection, className)

Returns the BuildForge::Services::DBO::BuildClass object that corresponds to the given name, or undef if no such BuildClass exists.

connection

A connected BuildForge::Services::Connection object.

className

The name of the desired class (from $class->getName()).

$class->create()

Creates an entry for the build class in the database with the current settings.

$class->update()

Updates the build class in the database to correspond to the current state of the BuildClass object.

$class->delete()

Removes the class from the database (if it exists).

BuildForge::Services::DBO::BuildClass->deleteByName(connection, className)

Deletes the class with the given name from the database (if it exists).

connection

A connected BuildForge::Services::Connection object.

className

The name of the desired class (from $class->getName()).

$class->getName()

Returns the name / ID of the class.

$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.

$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.

$class->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.

$class->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

Any build will be deleted.

KEEP_PASS

The most recent passed build will be kept no matter how old it is in comparison to the failed builds.

ONLY_FAILED

Only failed builds will be purged automatically.

ONLY_PASSED

Only passed builds will be purged automatically.

$class->getPurgeType()

Returns the rule for what is deleted when a build is purged. It can be any of:

CONSOLE_DATA

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.

LOGS_AND_FILES

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.

FILES

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.

LOGS

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.

EVERYTHING

All data for the build is deleted.

$class->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.

$class->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.

$class->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.

$class->setName(className)

Sets the name / ID for the class. $class->update() must be run before changes are replicated in the database.

className

The new name for the class

$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.

accessGroupId

The new access group ID for the class, from $accessGroup->getLevel().

$class->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.

maxBuilds

The number of builds allowed. 0 will make no build deletable for this reason.

$class->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.

purgeDays

The number of days, with 0 corresponding to a build being able to remain for unlimited time.

$class->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.

purgeRule

The deletion rule. It may be any of:

ANY_BUILD

Any build will be deleted.

KEEP_PASS

The most recent passed build will be kept no matter how old it is in comparison to the failed builds.

ONLY_FAILED

Only failed builds will be purged automatically.

ONLY_PASSED

Only passed builds will be purged automatically.

$class->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.

purgeType

The deletion rule. It may be any of:

CONSOLE_DATA

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.

LOGS_AND_FILES

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.

FILES

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.

LOGS

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.

EVERYTHING

All data for the build is deleted.

$class->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.

projectID

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.

$class->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.

projectID

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.

$class->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.

projectID

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

Copyright (c)2006-2007 International Business Machines, Inc. All rights reserved.