NAME
Net::CLI::Transport::XMPP - xmpp transport for Net::CLI
SYNOPSIS
todo
DESCRIPTION
GETTING STARTED
DEFINING COMMANDS
args
LAUNCHING THE CONTROL
commands
hostname
appname
SHUTTING DOWN
ATTRIBUTES
The following attributes are accessible through standard get_ or set_ methods and may be set as a parameter to new unless otherwise noted.
jid
xmpp id of user we're connecting as' set_jid will only accept SCALAR type values.
jserver
jserver will only accept SCALAR type values.
jpassword
The password for the transport to use to log in to the server. jpassword will only accept scalar type values.
xmpp_debug
Sets the debug (verbosity) level for the XMPP libraries
xmpp_process_time
Sets the time in seconds to wait before calling XMPP Process to look for more XMPP data. Should be near 1.
peers
An array of peers set_peers will only accept ARRAYREF type values.
connection_retries
A max number to retry connection before giving up. connection_retries will only accept NUMERIC type values.
connection_delay
How long to wait beteen connection attempts when failed. Defaults to 30 seconds. connection_delay will only accept NUMERIC type values.
roster
Holds the Net::XMPP::Roster if enabled. To enable the roster, a paramater of 'roster' => 1, must be passed in with new. roster will contain a Net::XMPP::Roster object after initialization if enabled.
server_time
The time at the server. Useful for determining if messages were sent before we started up. server_time should only contain hash values.
group_mode
The default setting to determine how to interact with groups. Options are: 'all' - process everything said in room 'named' - process only when called by name: (name followed by colon). 'log' - don't listen to anything, but log events there (which ones?) 'prefixed' - named + anything beginning with a designated prefix character group_mode should only contain scalar values.
group_prefix
The group_prefix used for group moded prefixed. group_prefix should only contain a single scalar value.
start
Get things rolling. Starts up a POE::Component::Jabber::Client using the user provided config info.
stop
Mostly just a placeholder.
shutdown
Forcibly shutdown
JoinPeerRooms
This POE event handler will go through each of the users in the peers array, and if the peers is a groupchat, join the conference room. It will check to make sure it is not already conencted (though this could be buggy). It does not take any arguments.
Process ( )
Description
This event interfaces with the XMPP Process to have it check for new data
send_presence
Sends a xmpp presence message. See Net::XMPP::Presence for parameter details.
send_message
Sends a xmpp message for a control. Takes the thread and the messaage as parameters. It will overwrite the control->send attribute text with the message parameter.
not_authorized ( { parameters (see usage) } )
Checks to see if a id is authorized to use us. Returns 1 if user is authorized, 0 if id is not a match, and -1 if id a match, but auth does not match.
Description
description
Usage
$self->not_authorized ( <Net:XMPP:JID>, qr(master|writer), # option regex for auth } );
GetControlForNode ( node )
Determines the control from a node and returns the control object.
Description
Takes a node parameter and returns the hash key to the proper control object in the controls array. If the control object is not in the array, it will add it.
When a new control object is created, a new Control session must be started for the control and that is handled here as well.
Usage
$self->GetControlForNode($node)
Peers
This POE event handler performs the transport end of the peer manipulation commands, such as add peer. It takes an action, a User object and an optional Request object as arguments.
Valid actions are add and delete. Currently delete does not force a log off from a chatroom, but it might if I fix that and forget to update the docs.
REQUIREMENTS
The following perl modules are required for this module to work properly.
Carp
File::Basename
POE
Params::Validate
Sys::Hostname
BUGS
New commands could clobber old ones under certain circumstances.
AUTHOR
Eric Hacker hacker can be emailed at cpan.org
REVISION
$LastChangedRevision: 63 $
DATE
$Date: 2004-05-09 22:59:17 -0400 (Sun, 09 May 2004) $
LICENSE
Copyright (c) 2006, Lucent Technologies
Lucent License here...
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.