Agent-TCLI

 view release on metacpan or  search on metacpan

lib/Agent/TCLI/Request.pm  view on Meta::CPAN

package Agent::TCLI::Request;
#
# $Id: Request.pm 62 2007-05-03 15:55:17Z hacker $
#
=head1 NAME

Agent::TCLI::Request - A Request class for Agent::TCLI::Request.

=head1 SYNOPSIS

An object for storing Agent::TCLI::Request information. Used by Transports
and not externally accessible at this point.

=head1 OVERVIEW

Requests are the basic transaction in TCLI. In the simplest form, they are created by Control
for sending to the Command to perform the Request. Requests come with their own Respond
method that will generate a Response object, so that Commands do not need to implement that logic.

In the more complex form, Requests may be handled directly by Transports. Of course,
Transports do not process a Request, they merely move them. If a Transport if acting on a Request (or the Reponse)
it must have it's own logic for doing so. In order to facilitate this process, sender and postback attrbutes
are arrays, so that they may be stacked. The Respond method will remove the entries from the stack.

=cut

use warnings;
use strict;
#use Carp;

use Object::InsideOut qw(Agent::TCLI::Base);
use Agent::TCLI::Response;

our $VERSION = '0.030.'.sprintf "%04d", (qw($Id: Request.pm 62 2007-05-03 15:55:17Z hacker $))[2];

=head2 ATTRIBUTES

The following attributes may be accessed through a combined mutator.
If the attribute is an array type, then additional array mutators are
available and described below.
In addition, Agent::TCLI::Request suports Auto-Attributes as described below.

=over

=item id

Id for request tracking. Must be unique for each request. One should
probably just let the object set it automatically.

=cut
my @id				:Field
					:All('id');

=item args

The request's arguments as parsed into an array. Usually built by the
Agent::TCLI::Control, but may be set up externally as well.
B<args> will only accept ARRAY type values. Since B<args> is an array, it is
often best use one of the mutator methods listed below.

=cut
my @args			:Field
					:All('args')
					:Type('ARRAY' );

=item command

An array containing the prmoinent verb for this request, followed by the
rest of the context the command was issued in reversed.
B<command> will only accept ARRAY type values. Since B<command> is an array,
it is often best use one of the mutator methods listed below.

=cut
my @command			:Field
					:All('command')
					:Type('ARRAY' );

=item sender

The POE session making the request, so that the response can be returned
properly. It is also the Tranport used when going between agents.



( run in 0.358 second using v1.01-cache-2.11-cpan-39bf76dae61 )