NAME
Net::STOMP::Frame - Frame support for Net::STOMP
SYNOPSIS
use Net::STOMP::Frame;
# create a connection frame
$frame = Net::STOMP::Frame->new(
command => "CONNECT",
headers => {
login => "guest",
passcode => "guest",
},
);
# get the command
$cmd = $frame->command();
# set the body
$frame->body("...some data...");
DESCRIPTION
This module provides an object oriented interface to manipulate STOMP frames.
A frame object has the following attributes: command
, headers
and body
. The headers
must be a reference to hash of header key, value pairs.
The check() method verifies that the frame is well-formed. For instance, it must contain a command
made of uppercase letters. See below for more information.
The header() method can be used to directly access (read only) a given header key. For instance:
$msgid = $frame->header("message-id");
The debug() method can be used to dump a frame object on STDERR. So far, this excludes the frame body.
The decode() function and the encode() method are used internally by Net::STOMP and are not expected to be used elsewhere.
FRAME CHECKING
Net::STOMP calls the check() method for every frame about to be sent and for every received frame.
The global variable $Net::STOMP::Frame::CheckLevel controls the amount of checking that is performed.
- 0
-
nothing is checked
- 1
-
the frame must have a good looking command and, if it has headers, the keys must be good looking and the values must be defined
- 2 (default)
-
in addition to level 1, the frame must have a known command and, for known header keys, their value must be good looking (e.g. the "timestamp" value must be an integer); also, the presence of mandatory keys (e.g. "session" for a "CONNECTED" frame) is checked
- 3
-
in addition to level 2, all header keys must be known/expected
Violations of these checks trigger errors in the check() method.
AUTHOR
Lionel Cons http://cern.ch/lionel.cons
2 POD Errors
The following errors were encountered while parsing the POD:
- Around line 433:
Expected text after =item, not a number
- Around line 445:
Expected text after =item, not a number