NAME
perfSONAR_PS::LS::General - - A module that provides methods for general tasks that LSs need to perform.
DESCRIPTION
This module is a catch all for common methods (for now) of :Ss in the perfSONAR-PS framework. As such there is no 'common thread' that each method shares. This module IS NOT an object, and the methods can be invoked directly (and sparingly).
SYNOPSIS
use perfSONAR_PS::LS::General;
use Time::HiRes qw(gettimeofday tv_interval);
my $type = "LSStore";
my $store = wrapStore("<nmwg:data />", $type);
my $t0 = [Time::HiRes::gettimeofday];
my $key = "http://localhost:8080/perfSONAR_PS/services/LS";
my $controlKey = createControlKey($key, $t0->[0].".".$t0->[1]);
my $lsKey = createLSKey($key, "success.ls.registration");
my $lsData = createLSData($dataId, $metadataId, $data);
# Let $node be an XML::LibXML Node:
#
# <xquery:subject id="sub2">
# declare namespace nmwg="http://ggf.org/ns/nmwg/base/2.0/";
# declare namespace perfsonar="http://ggf.org/ns/nmwg/tools/org/perfsonar/1.0/";
# declare namespace psservice="http://ggf.org/ns/nmwg/tools/org/perfsonar/service/1.0/";
# declare namespace xquery="http://ggf.org/ns/nmwg/tools/org/perfsonar/service/lookup/xquery/1.0/";
# for $metadata in /nmwg:store/nmwg:metadata
# let $metadata_id := $metadata/@id
# let $data := /nmwg:store/nmwg:data[@metadataIdRef=$metadata_id]
# where $metadata//psservice:accessPoint[
# text()="http://localhost:8181/axis/services/snmpMA" or
# @value="http://localhost:8181/axis/services/snmpMA"]
# return <nmwg:stuff>{$metadata} {$data}</nmwg:stuff>
# </xquery:subject>
my $query = extractQuery($node);
cleanLS(\%conf, \%ns);
DETAILS
The API for this module aims to be simple; note that this is not an object and each method does not have the 'self knowledge' of variables that may travel between functions.
API
The offered API is basic for now, until more common features to LSs can be identified and utilized in this module.
wrapStore($content, $type)
Adds 'store' tags around some content. This is to mimic the way eXist deals with storing XML data. The 'type' argument is used to type the store file.
createControlKey($key, $time)
Creates a 'control' key for the control database that keeps track of time.
createLSKey($key, $eventType)
Creates the 'internals' of the metadata that will be returned w/ a key.
createLSData($dataId, $metadataId, $data)
Creates a 'data' block that is stored in the backend storage.
extractQuery($node)
Pulls out the COMPLETE contents of an XQuery subject, this also includes sub elements.
cleanLS($conf, $ns, $dirname)
Performs an LS cleaning.
SEE ALSO
Exporter, Log::Log4perl, perfSONAR_PS::Common
To join the 'perfSONAR-PS' mailing list, please visit:
https://mail.internet2.edu/wws/info/i2-perfsonar
The perfSONAR-PS subversion repository is located at:
https://svn.internet2.edu/svn/perfSONAR-PS
Questions and comments can be directed to the author, or the mailing list. Bugs, feature requests, and improvements can be directed here:
https://bugs.internet2.edu/jira/browse/PSPS
VERSION
$Id$
AUTHOR
Jason Zurawski, zurawski@internet2.edu
LICENSE
You should have received a copy of the Internet2 Intellectual Property Framework along with this software. If not, see <http://www.internet2.edu/membership/ip.html>
COPYRIGHT
Copyright (c) 2004-2007, Internet2 and the University of Delaware
All rights reserved.