NAME

BuildForge::Services::DBO::AdaptorLink


SYNOPSIS

        use BuildForge::Services;
        $conn = new BuildForge::Services::Connection($hostname);
        $token = $conn->authUser($user, $pass);
        
        # Getting existing adaptor links
        $project = new BuildForge::Services::DBO::Project($conn);
        $project->setName('Test Project');
        $project->create();
        
        $allLinks = BuildForge::Services::DBO::AdaptorLink->findAll($conn);
        $allLinksWithProject = BuildForge::Services::DBO::AdaptorLink->findByProjectId($conn, $project->getProjectId());
        $allLinksWithAdaptor = BuildForge::Services::DBO::AdaptorLink->findByAdaptorName($conn);
        $link1 = BuildForge::Services::DBO::AdaptorLink->findById($conn, 1);
        $link2 = BuildForge::Services::DBO::AdaptorLink->findByProjectIdAndAdaptorName($conn, $project->getProjectId(), 'AdaptorName');
        # Getter / setter functions
        $id = $link1->getScopeId();
        $adaptorname = $link1->getAdaptorName();
        $projectid = $link1->getProjectId();
        $isactive = $link1->getActive();
        $environmentid = $link1->getEnvironmentGroupId();
        $link1->setAdaptorName('DifferentAdaptor');
        $link1->setProjectId($project->getProjectId());
        $link1->setActive('YES');
        $environment = BuildForge::Services::DBO::Environment->findByName($conn, 'MyEnvName');
        $link1->setEnvironmentGroupId($environment->getEnvGroupId());
        $link1->update();
        
        # Adaptor link creation, updating, deletion
        $newadaptorlink = new BuildForge::Services::DBO::AdaptorLink($conn);
        $newadaptorlink->setAdaptorName('MyAdaptor');
        $newadaptorlink->setProjectId($projectid);
        $newadaptorlink->setActive('DEBUG');
        $newadaptorlink->create();
        $newadaptorlink->setEnvironmentGroupId($environment->getEnvGroupId());
        $newadaptorlink->update();
        $newadaptorlink->deactivate();
        $newadaptorlink->debug();
        $newadaptorlink->activate();
        
        $newadaptorlink->delete();
        BuildForge::Services::DBO::AdaptorLink->deleteById($conn, $link1->getInterfaceId());
                
        $conn->logout;
        $conn->close;


DESCRIPTION

AdaptorLink is used to create new BuildForge Adaptor Links and to access existing adaptor link information.


METHODS

BuildForge::Services::DBO::AdaptorLink->new(connection, {AdaptorLinkHashRef})

Creates an AdaptorLink instance.

connection

A connected BuildForge::Services::Connection object.

AccessParamsHashRef

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

projectId

The ID for the project that the adaptor should be linked to (from Project->getProjectId()).

adaptorName

The ID for the adaptor that the project should be linked to (from Adaptor->getInterfaceId()).

active

Set to 'YES' for an active link, 'NO' for an inactive link, or 'DEBUG' to put the adaptor link in debug mode. The default, if not set, is 'YES'.

environmentGroupId

The ID for the environment the adaptor link should use (from Environment->getEnvGroupId()). Set it to 0 (the default) to have no environment group used.

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

Returns a reference to an array of AdaptorLink 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::AdaptorLink->findByProjectId(connection, projectId)

Returns a reference to an array of AdaptorLink objects, one for each entry in the database that the current user has access to and that connect to the given project.

connection

A connected BuildForge::Services::Connection object.

projectId

The project ID that the desired adaptor links connect to (from Project->getProjectId()).

BuildForge::Services::DBO::AdaptorLink->findByAdaptorName(connection, adaptorName)

Returns a reference to an array of AdaptorLink objects, one for each entry in the database that the current user has access to and that use the given adaptor.

connection

A connected BuildForge::Services::Connection object.=item adaptorName

The adaptor ID that the desired adaptor links connect to (from Adaptor->getInterfaceId()).

BuildForge::Services::DBO::AdaptorLink->findByProjectIdAndAdaptorName(connection, projectId, adaptorName)

Returns the AdaptorLink object that connects the given project to the given adaptor, or undef if no such AdaptorLink exists.

connection

A connected BuildForge::Services::Connection object.

projectId

The project ID that the desired adaptor link connects to (from Project->getProjectId()).

adaptorName

The adaptor ID that the desired adaptor link connects to (from Adaptor->getInterfaceId()).

BuildForge::Services::DBO::AdaptorLink->findById(connection, scopeId)

Returns the AdaptorLink object with the given ID, or undef if no such AdaptorLink exists.

connection

A connected BuildForge::Services::Connection object.

scopeId

The ID of the desired adaptor link (from AdaptorLink->getScopeId()).

$adaptorlink->create()

Creates the adaptor link within the database.

$adaptorlink->update()

Updates the adaptor link within the database with the current values in the object.

$adaptorlink->delete()

Deletes the adaptor link from the database.

BuildForge::Services::DBO::AdaptorLink->deleteById(connection, scopeId)

Deletes the adaptor link from the database which has the given scopeId.

connection

A connected BuildForge::Services::Connection object.

scopeId

The ID of the adaptor link to delete (from AdaptorLink->getScopeId()).

$adaptorlink->deactivate()

Deactivates the adaptor link in the database. Unlike $adaptorlink->setActive('NO'), this actually performs the action without the need for an $adaptorlink->update() call.

$adaptorlink->debug()

Sets the adaptor link in the database to debug mode. Unlike $adaptorlink->setActive('DEBUG'), this actually performs the action without the need for an $adaptorlink->update() call.

$adaptorlink->activate()

Activates the adaptor link in the database. Unlike $adaptorlink->setActive('YES'), this actually performs the action without the need for an $adaptorlink->update() call.

$adaptorlink->getScopeId()

Returns the adaptor link ID.

$adaptorlink->getAdaptorName()

Returns the name / ID of the adaptor the adaptor link is linked to.

$adaptorlink->getProjectId()

Returns the ID of the project the adaptor link is linked to.

$adaptorlink->getActive()

Returns 'YES' if the adaptor is active, 'NO' if the adaptor is inactive, and 'DEBUG' if the adaptor is in debug mode.

$adaptorlink->getEnvironmentGroupId()

Returns the ID of the environment group the adaptor link is linked to, or 0 if it isn't linked to an environment group.

$adaptorlink->setAdaptorName(adaptorId)

Sets the adaptor the adaptor link is linked to. $adaptorlink->update() must be run before changes are replicated in the database.

adaptorId

The ID of the adaptor, gotten from $adaptor->getInterfaceId().

$adaptorlink->setProjectId(projectId)

Sets the project that the adaptor link is linked to. $adaptorlink->update() must be run before changes are replicated in the database.

projectId

The ID of the project, from $project->getProjectId().

$adaptorlink->setActive(state)

Sets the mode of the adaptor link - active, inactive, or debug. $adaptorlink->update() must be run before changes are replicated in the database.

state

May be one of 'YES' for active, 'NO' for inactive, or 'DEBUG' for debug mode.

$adaptorlink->setEnvironmentGroupId(envGroupId)

Sets the environment group that the adaptor link is linked to. $adaptorlink->update() must be run before changes are replicated in the database.

envGroupId

The ID of the environment group to link to (from $environment->getEnvGroupId()), or 0 for no environment group.


COPYRIGHT

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