NAME

BuildForge::Services::DBO::ServerAuth


SYNOPSIS

        use BuildForge::Services;
        $conn = new BuildForge::Services::Connection($hostname);
        $token = $conn->authUser($user, $pass);
        
        # Getting existing serverauths
        $allServerAuthes = BuildForge::Services::DBO::ServerAuth->findAll($conn);
        $oldauth = BuildForge::Services::DBO::ServerAuth->findById($conn, $authId);
        # Getter / setter functions
        $id = $oldauth->getAuthId();
        $username = $oldauth->getUsername();
        $accessGroupId = $oldauth->getLevel();
        $oldauth->setAuthId('Server Authorization Name');
        $oldauth->setUsername('username');
        $oldauth->setPassword('password');
        $oldauth->setLevel($accessGroupId);
        $oldauth->update();
        
        # ServerAuth creation, updating, deletion
        $newserverauth = new BuildForge::Services::DBO::ServerAuth($conn);
        $newserverauth->setAuthId('New Build ServerAuth');
        $newserverauth->setLevel($accessGroupId);
        $newserverauth->create();
        $newserverauth->setLevel(2);
        $newserverauth->update();
        
        $newserverauth->delete();
        BuildForge::Services::DBO::ServerAuth->deleteById($conn, $oldauth->getAuthId());
                
        $conn->logout;
        $conn->close;


DESCRIPTION

ServerAuth allows you to create, access, and delete BuildForge server authorization objects.


METHODS

new BuildForge::Services::DBO::ServerAuth(connection, {ServerAuthParamsHashRef})

Returns a new instance of a ServerAuth object.

connection

A connected BuildForge::Services::Connection object.

ServerAuthParamsHashRef

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

authId

The name / ID of the new server auth.

username

The username used to connect to the server.

password

The password used to connect with the server.

level

The access group ID (from $accessGroup->getLevel()) of the access group this server auth belongs to. If a user does not belong to this access group, they cannot view, edit, or use this server auth.

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

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

connection

A connected BuildForge::Services::Connection object.

BuildForge::Services::DBO::ServerAuth->findById(connection, serverAuthId)

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

connection

A connected BuildForge::Services::Connection object.

serverAuthId

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

$serverauth->create()

Creates a record for the server auth in the database.

$serverauth->update()

Updates the server auth record in the database.

$serverauth->delete()

Deletes the server auth from the database.

BuildForge::Services::DBO::ServerAuth->deleteById(connection, serverAuthId)

Deletes the server auth from the database which has the specified ID.

connection

A connected BuildForge::Services::Connection object.

serverAuthId

The server auth ID (from $serverauth->getAuthId()) to be deleted.

$serverauth->getAuthId()

Returns the server auth name / ID.

$serverauth->getUsername()

Returns the username used to connect to servers with this server auth.

$serverauth->getLevel()

Returns the access group ID of the access group this server auth belongs to. Users not in the access group cannot view, edit, or use the server auth.

$serverauth->setAuthId(serverAuthId)

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

serverAuthId

The new server auth ID / name.

$serverauth->setUsername(username)

Sets the new username used to connect to servers with this server auth. $serverAuth->update() must be run before changes are replicated in the database.

username

The new user name.

$serverauth->setPassword(password)

Sets the new password used to connect to servers with this server auth. $serverAuth->update() must be run before changes are replicated in the database.

password

The new login password.

$serverauth->setLevel(accessGroupId)

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

accessGroupId

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


COPYRIGHT

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