GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  DJABBERD::AGENT::NODE (3)

.ds Aq ’

NAME

DJabberd::Agent::Node - Abstract class for an agent that handles a specific node

CONTENTS

SYNOPSIS



    package MyPackage::DJabberd::MyNode;
    use base DJabberd::Agent::Node;
   
    # Example of an agent that responds to incoming chat messages
   
    sub handle_message {
        my ($self, $vhost, $stanza) = @_;
       
        my $response = $stanza->make_response();
        $response->set_raw("<body>Hello. Im a software agent.</body>");
        $response->deliver($vhost);
    }



This class provides a parent class for agents which recieve stanzas addressed to a particular nodename within a domain.

Such an agent is often referred to as a Bot. A higher-level API for implementing chat bots is also provided in DJabberd::Bot.

USAGE

This class is a specialization of DJabberd::Agent. In most cases, users of this class will use the API exposed by DJabberd::Agent. However, there is some special behaviour to note and some additional methods that are not part of the basic agent class.

handles_destination($self, CW$to_jid, CW$vhost)

This class provides an overriden version of this method which responds with a true value if and only if the domain and the nodename of the destination JID match those that are handled by this instance.

vcard($self, CW$requester_jid)

The overriden version of this method will return a vCard where the full name is set to the nodename of this instance. Subclasses will probably want to override this to do something more fancy.

SEE ALSO

See also DJabberd::Agent, DJabberd::Component.

COPYRIGHT

Copyright 2007-2008 Martin Atkins

This module is part of the DJabberd distribution and is covered by the distribution’s overall licence.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 DJABBERD::AGENT::NODE (3) 2011-06-13

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.