NAME

ReportCache - store report-related lists

AUTHOR

Ian Malpass <ian@aptest.com>

COPYRIGHT

Copyright 2001-2011 Applied Testing and Technology, Inc. All Rights Reserved.

SYNOPSIS

use ReportCache;

    # Open the Database for writing
    my $rc = new ReportCache(suite, 1);

    # Cache a session list
    my $md5 = $rc->storeSessList( @sList );

    # get the list for a report
    my @list = $rc->getSessList( $md5 );

    # release the database
    $rc->save;
    $rc->release;

The ReportCache is a persistent store for data relating to reports. Currently it stores the session lists to be used.

DATA STRUCTURE

lock

a handle to the lock that is set for the object

writeable

a boolean that indicates whether the session is open read/write

usingDBM

a boolean to indicate if the file is from a DBM source

data->

a hash of stored data

METHODS

new - open the report cache

$rdb = new ReportCache(suite, [read/write [, timeout [, path]]]);

Creates a new report cache object

suite

the name of the test suite

read/write

boolean set to True if the test database needs to be writeable or False if it can be readOnly.

timeout

the number of seconds to wait for a lock. Defaults to 60 seconds.

path

the path to the data file

path - get/set the path to the cache file

returns a path to the cache file.

print - print the contents of the ReportDB

$rc->print();
    $rc->print( key );
    $rc->print( key, id );

returns the string-ified version of the entire database, or just the contents of the data for "key", or just the "key" item stored under "id".

saveAsText - save the database as a serialized object

$status = $rc->saveAsText();

Returns the output of the database's save method, but forcing the database to write out into a text file instead of a DBM file.

save - save the database

returns the path saved into, or undef if the save failed.

storeSessList - store a session list in the cache

my $md5 = $rc->storeSessList( @sessList );

Stores a copy of @sessList in the cache, and returns the key to use to access it. The key is an MD5 hash of the comma-separated sessList.

getSessList - retrieve a cached session list

my @list = $rc->getSessList( $md5 );

Retrieves a previously-stored session list, using the MD5 hash returned from storeSessList().

Copyright © 2000-2013 Applied Testing and Technology, Inc. All rights reserved.