The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

perfSONAR_PS::Messages - A module that provides common methods for performing actions on message constructs.

DESCRIPTION

This module is a catch all for message related methods 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::Messages;
    
    # NOTE: Individual methods can be extraced:
    # 
    # use perfSONAR_PS::Messages qw( getResultMessage getResultCodeMessage )

    my $id = genuid();	
    my $idRef = genuid();

    my $content = "<nmwg:metadata />";
	
    my $msg = getResultMessage($id, $idRef, "response", $content);
    
    $msg = getResultCodeMessage($id, $idRef, "response", "error.ma.transport" , "something...");
    
    $msg = getResultCodeMetadata($id, $idRef, "error.ma.transport);
    
    $msg = getResultCodeData($id, $idRef, "something...");
    
    $msg = createMetadata($id, $idRef, $content);

    $msg = createData($id, $idRef, $content);
    
           

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 API of perfSONAR_PS::Messages offers simple calls to create message constructs.

getResultMessage($id, $messageIdRef, $type, $content, $namespaces)

Given a messageId, messageIdRef, a type, and some amount of content a message element is returned. If $namespaces is specified, it adds the specified namespaces to the resulting nmwg:message.

getResultCodeMessage($id, $messageIdRef, $metadataIdRef, $type, $event, $description, $encode_description)

Given a messageId, messageIdRef, metadataIdRef, messageType, event code, and some sort of description, generate a result code message. This function uses the getResultCodeMetadata and getResultCodeData. If the $escape_description value is equal to 1, the description is XML escaped.

getResultCodeMetadata($id, $metadataIdRef, $event)

Given an id, metadataIdRef, and some event code retuns the result metadata.

getResultCodeData($id, $metadataIdRef, $description, $escape_description)

Given an id, metadataIdRef, and some description return the result data. If the $escape_description value is equal to 1, the description is XML escaped.

createMetadata($id, $metadataIdRef, $content)

Given an id, metadataIdRef and some content, create a metadata.

createData($dataId, $metadataIdRef, $content)

Given an id, metadataIdRef and some content, create a data.

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.

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.