SuiteDB |
![]() |
SuiteDB - suite metadata class
Shane P. McCarron <shane@aptest.com>
Copyright 2004-2006 Applied Testing and Technology, Inc. All Rights Reserved.
use SuiteDB;
# open the suite Database for writing
my $db = new SuiteDB(1);
# who is the creator of this suite?
my $name = $db->creator()
# and what is the description
my $desc = $db->description() ;
# release the database
$db->release();
The SuiteDB object is a generic multi-level data structure storage facility. The data stored in this facility is expected to be keyed by a unique value - usually a value prefixed by the module that wanted to store it. The purpose of this data store is to act as a general use storage facility for meta information related to items in a Test Suite (e.g., test session summary information).
The data structure of this object is optimized to be most efficient when used in conjunction with MLDBM and a single key hashed database (with short key names). This object CAN use serialized objects as well, but it is MUCH slower. Note that when using MLDBM, the save method doesn't do anything (except possibly for the first time it is called if the database had not yet been converted to MLDBM format).
$suiteDb = new SuiteDB(name, [read/write [, timeout[, path]]]);
Creates a new suite database object, optionally opening a non-default target file and optionally making it writeable.
returns a reference to the suite database object.
Removes everything from the database.
returns true if it succeeded, false if it did not.
returns a path to the file.
$suiteDb->print();
$suiteDb->print(ID);
returns the string-ified version of the entire database.
$suiteDb->release() ;
returns the path saved into, or undef if the save failed.
$suiteDb->deleteSession($session);
deletes a session if it is defined.
$suiteDb->deleteSet($name);
deletes a set if it is defined.
$suiteDb->session(ID);
$suiteDb->session(ID, ref);
With an ID parameter, retrieves the data for a specific session.
With an ID and a ref, sets the parameters for a session to ref.
returns the pointer a SuiteDB::Session object that represents the specific session.
@sessionList = $suiteH->sessionList() ;
@sessionList = $suiteH->sessionList(set) ;
$setHash = $suiteDb->set(ID);
$setHash = $suiteDb->set(ID, ref);
With an ID parameter, retrieves the data for a specific set.
With an ID and a ref, sets the parameters for a set to ref.
Adds a lastChangeTime key to the dataset when updating a test set. Returns the pointer to the data for a specific set.
@setList = $suiteDb->setList() ;
$time = $suiteDb->lastEditUpdate() ;
$time = $suiteDb->lastRunUpdate() ;
$time = $suiteDb->lastRunUpdate(setName) ;
$val = $suiteDb->dirtyFlag( [ state ] ) ;
If state is supplied, it is a value to set. When state is 0, the data is NOT dirty. When state is 1, the associated "Run" data was updated, and the data is dirty. When state is 2, the associated "Edit" data was updated and the data is dirty.
Returns undef if the database is not writeable. Otherwise returns the current value of the dirtyFlag state;
@list = $suiteDb->userList(alevel, [listRef] ) ;
Returns a list of users who have an access level of at least "alevel". If the user database has not been updated since the list for this level was last cached, just returns the cached list. Otherwise generates a new list, updates the cache, and returns that list.
Returns the list of users.
$rRef = $suiteDb->results( [ $rRef ] ) ;
$rRef is an optional reference to a results object. If provided, that object is put into the suiteDB cache. Otherwise, the object currently in the cache is returned.
$vRef = $suiteDb->variables( [ $vRef ] ) ;
$vRef is an optional reference to a VariableSet object. If provided, that object is put into the suiteDB cache. Otherwise, the object currently in the cache is returned.
$sRef = $suiteDb->schema( [ $sRef ] ) ;
$sRef is an optional reference to a schema object. If provided, that object is put into the suiteDB cache. Otherwise, the object currently in the cache is returned.
$vset = $suiteDb->dirtyFlag( [ curSet ] ) ;
If curSet is supplied, it is used as a handle to a variable set object for the suiteDB. Otherwise, one is initialized.
Returns a handle to a variable set.
SuiteDB::Session - class for manipulating session metadata
$session = new SuiteDB::Session(sessnum) ;
Creates a session object. Returns a reference to the created object.
$value = $session->defaultVariable() ;
Returns the value of the variable from the session, or the default value if the session has no setting for the variable.
$session->variable(varName) ;
returns the value of variable in a scalar context.
SuiteDB::Set - class for manipulating set metadata
$set = SuiteDB::Set->new(setname, hashRef) ;
Creates a set object. Returns a reference to the created object.
Copyright © 2000-2006 Applied Testing and Technology, Inc. All rights reserved.