Chris Cobb > POE-Event-Message > POE::Event::Message::Header

Download:
POE-Event-Message-0.11.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 0.04   Source  

NAME ^

POE::Event::Message::Header - Generic messaging protocol header

VERSION ^

This document describes version 0.02, released November, 2005.

SYNOPSIS ^

 use POE::Event::Message::Header;

 $header = new POE::Event::Message::Header;
 $header = new POE::Event::Message::Header( $priorHeader );

 $header->set( $attrName, $newValue );

 $value = $header->get( $attrName );

 $header->del( $attrName );

 $id = $header->id();
 $r2id = $header->r2id();

 $header->addRouteTo( Args );
 $header->addRouteBack( Args );

 $route = $header->delRouteTo( );       # delete and return next
 $route = $header->delRouteBack( );     # delete and return next

 $route = $header->hasRouting();        # retain and return next
 $route = $header->hasRouteTo();        # retain and return next
 $route = $header->hasRouteBack();      # retain and return next

 $next = $header->nextRouteType();      # post, call, remote or ''
 $bool = $header->nextRouteIsRemote();  # 1 if remote    or 0 if not
 $bool = $header->nextRouteIsLocal();   # 1 if post|call or 0
 $bool = $header->nextRouteIsPost();    # 1 if post      or 0
 $bool = $header->nextRouteIsCall();    # 1 if call      or 0

 print $header->dump();

DESCRIPTION ^

This class is not intended for direct use. Objects of this class are manipulated via the message envelope objects of the 'POE::Event::Message' class.

This class is a starting point for creating a generic application messaging protocol headers. The intent is for this to be used as a starting point when building network client/server applications.

Messages headers of this class have flexible routing capabilities that work both inside and outside of POE-based applications. Message objects can contain complex Perl data structures.

Constructor

new ( [ Header ] )

This method instantiates a new message header. Optionally it can be used to create a response to an existing message.

Header

The optional Header argument, when included, is expected to be an original message of this class. This mechanism is used to create a 'response' to the original message.

Methods

set ( Attr, NewValue )
get ( Attr )
del ( Attr )

Store, retrieve or delete header attributes.

Attr

The Attr argument names the header attribute to be accessed or modified.

NewValue

When calling the set method, this is the new value for the named attribute.

addRouteTo ( Mode, Service, Event [, Args ] )
addRouteBack ( Mode, Service, Event [, Args ] )

These methods add auto-routing capabilities to messages that use this class. For a discussion of arguments and usage, see POE::Event::Message.

dump

This method is included for convenience when developing or debugging applications that use this class. This does not produce a 'pretty' output, but is formatted to show the contents of the message object and the message header object, when one exists.

DEPENDENCIES ^

This class depends upon the following classes:

 POE::Event::Message::UniqueID

INHERITANCE ^

None currently.

SEE ALSO ^

See POE::Event::Message::Header and POE::Event::Message::UniqueID.

AUTHOR ^

Chris Cobb [no dot spam at ccobb dot net]

COPYRIGHT ^

Copyright (c) 2005-2010 by Chris Cobb, All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: