NAME

BuildForge::Services::DBO::Server


SYNOPSIS

        use BuildForge::Services;
        $conn = new BuildForge::Services::Connection($hostname);
        $token = $conn->authUser($user, $pass);
        
        # Getting existing servers
        $allServers = BuildForge::Services::DBO::Server->findAll($conn);
        $oldserver1 = BuildForge::Services::DBO::Server->findById($conn, $serverId);
        $oldserver2 = BuildForge::Services::DBO::Server->findByName($conn, 'ServerName');
        # Getter / setter functions
        $id = $oldserver1->getServerId();
        $hostName = $oldserver1->getHost();
        $name = $oldserver1->getName();
        $isActive = $oldserver1->getActive();
        $serverAuthId = $oldserver1->getAuthId();
        $collectorId = $oldserver1->getCollectorId();
        $environmentId = $oldserver1->getEnvironmentId();
        $accessGroupId = $oldserver1->getLevel();
        $path = $oldserver1->getPath();
        $allowWhatOperations = $oldserver1->getPublish();
        $testResults = $oldserver1->getTestText();
        $currentState = $oldserver1->getUpstate();
        $errorState = $oldserver1->getError();
        $manifest = $oldserver1->getManifest();
        $oldserver1->setName('New Name');
        $oldserver1->setHost('hostname');
        $oldserver1->setActive(1);
        $oldserver1->setAuthId($authId);
        $oldserver1->setCollectorId($collectorId);
        $oldserver1->setEnvironmentId($environmentId);
        $oldserver1->setLevel($accessGroupId);
        $oldserver1->setPath('/tmp');
        $oldserver1->setPublish(ENUM_SERVER_PUBLISH->GET);
        $oldserver1->update();
        
        # Server creation, updating, deletion
        $newserver = new BuildForge::Services::DBO::Server($conn);
        $newserver->setName('New Build Server');
        $newserver->setLevel(1); # Guest access
        $newserver->create();
        $newserver->setLevel($accessGroupId);
        $newserver->update();
        
        $newserver->delete();
                
        $conn->logout;
        $conn->close;


DESCRIPTION

Server allows you to create, access, and delete BuildForge servers.


METHODS

new BuildForge::Services::DBO::Server(connection, {ServerParamsHashRef})

Returns a new instance of a Server object.

connection

A connected BuildForge::Services::Connection object.

ServerParamsHashRef

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

name

The name of the server.

level

The access group ID (from $accessGroup->getLevel()) for the access group that the server belongs to. Users who do not belong to this access group cannot view, edit, or use the server.

host

The hostname of the server (with an optional port number separated by ':').

path

The path to the server's root directory on the remote server.

publish

Determines which kinds of operations are allowed on the server. May be any of:

NONE

Allows neither get nor put operations.

GET

Allows files to be gotten from the server.

PUT

Allows files to be loaded onto the server.

ALL

Allows both get and put operations.

environmentId

The environment group ID (from $envGroup->getEnvironmentGroupId()) for the environment applied to jobs run on the server.

authId

The server authorization ID (from $serverAuth->getAuthId()) for the server authorization that is used to log in to the server.

active

If this evaluates to true, the server is enabled. If this evaluates to false, the server is disabled and no jobs will be run on it.

collectorId

The collector ID (from $collector->getCollectorName()) of the collector that operates on the selector in order to get manifest properties.

BuildForge::Services::DBO::Server->findAll(connection)

Returns a reference to an array of BuildForge::Services::DBO::Server objects corresponding to all servers in the database that the user has access to.

connection

A connected BuildForge::Services::Connection object.

BuildForge::Services::DBO::Server->findById(connection, serverId)

Returns the BuildForge::Services::DBO::Server object corresponding to the given server ID, or undef if no such object exists.

connection

A connected BuildForge::Services::Connection object.

serverId

The server ID (from $server->getServerId()) for the server to return.

BuildForge::Services::DBO::Server->findByName(connection, serverName)

Returns the BuildForge::Services::DBO::Server object corresponding to the given server name, or undef if no such object exists.

connection

A connected BuildForge::Services::Connection object.

serverName

The server name (from $server->getName()) for the server to return.

$server->create()

Creates the server record in the database.

$server->update()

Updates the server record in the database.

$server->delete()

Deletes the server record from the database.

$server->getServerId()

Returns the ID of the server.

$server->getName()

Returns the name of the server.

$server->getHost()

Returns the hostname of the server.

$server->getActive()

Returns 1 if the server is active and jobs can be run on it or 0 otherwise.

$server->getAuthId()

Returns the server auth ID for the server authorization the server uses to authenticate when connecting.

$server->getCollectorId()

Returns the collector ID for the collector that is used to gather manifest data about the server.

$server->getEnvironmentId()

Returns the enviroment group ID for the environment group that is applied to jobs run on this server.

$server->getLevel()

Returns the access group ID for the access group the server belongs to. Users who do not belong to this access group cannot view, edit, or use the server.

$server->getPath()

Returns the path to the server base directory.

$server->getPublish()

Returns which kinds of operations are allowed on the server. May be any of:

NONE

Allows neither get nor put operations.

GET

Allows files to be gotten from the server.

PUT

Allows files to be loaded onto the server.

ALL

Allows both get and put operations.

$server->getTestText()

Returns the output of the last time the server was tested.

$server->getUpstate()

This will return 'UPDATING' if the server is currently being tested or 'READY' otherwise.

$server->getError()

Returns 'TESTING' if the server is currently being tested, 'NO' if there is no error, or 'YES' if there is an error and the server has been disabled. To find out the actual error, use $server->getTestText() for test details.

$server->getManifest()

Returns the BuildForge::Services::DBO::Manifest object that holds the server's current manifest.

$server->setName(serverName)

Sets the name of the server. $server->update() must be run before changes are replicated in the database.

serverName

The new server name.

$server->setHost(host)

Sets the hostname of the server. $server->update() must be run before changes are replicated in the database.

host

The new server hostname.

$server->setActive(isActive)

Sets whether or not the server is active. Inactive servers will not have jobs run on them. $server->update() must be run before changes are replicated in the database.

isActive

If this evaluates to true, the server is activated. If not, the server is deactivated.

$server->setAuthId(authId)

Sets the server auth that the engine uses to authenticate when contacting the server. $server->update() must be run before changes are replicated in the database.

authId

The server auth ID (from $serverAuth->getAuthId()).

$server->setCollectorId(collectorId)

Sets the collector which is used to gather the server manifest. $server->update() must be run before changes are replicated in the database.

collectorId

The collector ID (from $collector->getCollectorId()).

$server->setEnvironmentId(envGroupId)

Sets the environment which is applied to any jobs that run on this server. $server->update() must be run before changes are replicated in the database.

envGroupId

The environment group ID (from $envGroup->getEnvironmentGroupId()).

$server->setLevel(accessGroupId)

Sets the access group which the server belongs to. Users that do not belong to this access group cannot view, edit, or use the server. $server->update() must be run before changes are replicated in the database.

accessGroupId

The access group's ID (from $accessGroup->getLevel()).

$server->setPath(path)

Sets the path to the server's base directory. $server->update() must be run before changes are replicated in the database.

path

The new server path.

$server->setPublish(publish)

Sets what operations are allowed on the server. $server->update() must be run before changes are replicated in the database.

publish

May be any of:

NONE

Allows neither get nor put operations.

GET

Allows files to be gotten from the server.

PUT

Allows files to be loaded onto the server.

ALL

Allows both get and put operations.


COPYRIGHT

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