Agent::TCLI::Transport::Base - Base Class for transports
Use as a base class for a Agent::TCLI::Transport
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.
A hash of the active controls controls will only accept hash objects.
An alias that the session will be run under. Alias can't be changed after starting.
An array of peers set_peers will only accept ARRAYREF type values.
A hash of options to pass to a new control object. These are passed straight through as is. See Agent::TCLI::Control for information about the options. control_options will only accept HASHREF type values.
Attributes that are typed as arrays also support the following mutators for the lazy: shift_>field< - works the same as shift, returing the shifted member. unshift_>field<(list) - works the same as unshift. pop_>field< - works the same as pop, returing the popped member. push_>field<(list) - works the same as push. depth_>field< - returns the curent size of the array.
These methods may be used as is, or subclasses may use them as starting point.
Get things rolling.
Mostly just a placeholder.
Just a placeholder.
This object method is used by transports to prepare a request for transmssion.
Currently the code is taking a lazy approach and using Perl's YAML and OIO->dump to safely freeze and thaw the request/responses for Internet transport. By standardizing these routines in the Base class, more elegant methods may be transparently enabled in the future.
This object method is used by transports to prepare a reseponse for transmssion. See PackRequest for more details.
This object method is used by transports to unpack a request from transmssion. See PackRequest for more details.
This object method is used by transports to unpack a reseponse from transmssion. See PackRequest for more details.
Checks to see if a id is authorized to use us.
$self->authorized ( firstname.lastname@example.org, qr(master|writer), # optional regex for auth qr(xmpp), # optional regex for protocol );
GetControl returns a control object for a control_id / user combination. It will return either an existing control or create a new one. All requests for a control are authenticated. Thus when a Transport recieves a new request, user priviledges are rechecked against the latest database if GetControl is used to obtain the Control.
The control_id is a unique ID for the transport to use to identify the control. This is useful in situations where a user may have more than one control active at a time. The user must be a Agent::TCLI::User object. The protocol should be one that the Transport supports and will be matched for authentication. A transport may optionally override the user_auth level. This would be best used to drop to a read only transport, but currently the direction is not enforced.
DeleteControl will remove a reference to Control from the transport. This does not shutdown the Control's POE session, but will allow it to stop if there are no other existing references.
This POE event handler is may be used by a Transport to enable a Package to set attributes in the Transport. It currently is not filtering out anything, so if something should not be accessible, either the Transport needs to implement its own Set, or the Package should apply necessary filters.
Set takes a hash of attribute => value pairs, and the Request object as arguments.
This POE event handler is may be used by a Transport to enable a Package to show current settings in the Transport. It currently is not filtering out anything, so if something should not be shown, either the Transport needs to implement its own Show, or the Package should apply necessary filters.
Show takes the attribute to show and the Request object as arguments.
This POE event handler is used to catch wayard calls to unavailable states. If verbose is on, it makes it rather obvious in the logs that an event was not handled.
Eric Hacker hacker can be emailed at cpan.org
SHOULDS and MUSTS are currently not enforced.
New commands could clobber old ones under certain circumstances.
Test scripts not thorough enough.
Probably many others.
Copyright (c) 2007, Alcatel Lucent, All rights resevred.
This package is free software; you may redistribute it and/or modify it under the same terms as Perl itself.