<<

NAME

Inca::ReporterManager::ReporterCache - Manages the local cache of reporter packages

SYNOPSIS

  use Inca::ReporterManager::ReporterCache;
  my $rc = new Inca::ReporterManager::ReporterCache( "var/cache" );
  $rc->storePackage( "Inca::Reporter", "Reporter.pm", "2.0", "lib/perl", undef,
                     undef, "/tmp/inca.tmp.434" );
=for example end

DESCRIPTION

The Reporter Cache (RC) handles the maintenance and installation of reporter packages (e.g., reporters, reporter libraries, and reporter dependencies) which it receives from the Reporter Agent (who downloads it from one or more Reporter Repositories). Reporters will be stored in the "bin" directory and libraries in the "lib/perl" directory.

CLASS METHODS

new( $location )

Class constructor which returns a new Inca::ReporterManager::ReporterCache object. The constructor must be called with $location and may be called with any of the following attributes.

Arguments:

location

A string containing the path to the local cache of reporter and libraries. Reporters will be stored in the <location>/bin directory and libraries in the <location>/lib/perl directory.

Options:

errorReporterPath

A string containing the path to the special reporter used when generating error reports

getDependencies( $name, $version )

Return the dependencies for the given reporter.

Arguments:

name

A string containing the name of the reporter to query the dependencies

version

A string containing the version of the reporter to query the dependencies

getErrorReporterPath( )

Get the error_reporter of the reporter repository on the local machine.

Returns:

A string containing the path to the local cache of reporter and libraries.

getLocation( )

Get the location of the reporter repository on the local machine.

Returns:

A string containing the path to the local cache of reporter and libraries.

getPath( $name, $version )

Return a path to a local copy of a reporter using the reporter name and version.

Arguments:

name

A string containing the name of the reporter to execute

version

A string containing the version of the reporter to execute

setErrorReporterPath( $path )

Set the path to the special reporter that the reporter manager will use to generate an error report if a reporter execution fails. If the path points to a non-existent file or is not executable, it errors out with a 'die' call.

Arguments:

path

A string containing the path to the reporter.

setLocation( $path )

Set the location of the reporter repository on the local machine. If the path points to a non-existent directory, it errors out with a 'die' call.

Arguments:

path

A string containing the path to the local cache of reporter and libraries.

storePackage( $name, $filename, $version, $installpath, $perms, $dependencies, $tmpfilename )

Store the specified package into the reporter cache.

Arguments:

name

A string containing the name of the reporter package.

filename

A string containing the filename that the package should be stored under.

version

A string containing the version of the package.

installpath

A string containing the directory the package should be stored under relative to the reporter cache location.

perms

A string of format "[0-7][0-7][0-7]" that can be used to set the permissions of the stored file after its written to disk. A value of undef means that no change of permissions is needed.

dependencies

A string containing a whitespace delimited list of dependencies or undef if there are none.

content

A string containing the name of a temporary file that is storing the content of the package.

Returns:

True if the package is succesfully cached in the reporter cache and false otherwise.

AUTHOR

Shava Smallen <ssmallen@sdsc.edu>

CAVEATS/WARNINGS

None so far.

<<