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::COMPONENT::NODE (3)

.ds Aq ’

NAME

DJabberd::Component::Node - Specialization of DJabberd::Agent::Node that knows it belongs to a component

CONTENTS

DESCRIPTION

This abstract class is a specialization of DJabberd::Agent::Node. The only difference between this class and its parent is that nodes represented by this class know that they belong to a component and have a reference to that component stored.

SYNOPSIS

Create your node class as a subclass of this class:



    package MyPackage::DJabberd::MyNode;
    use base DJabberd::Component::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);
    }



The class can then be instantiated from inside a method in a DJabberd::Component instance:



    # $self here is a DJabberd::Component object
    my $node = MyPackage::DJabberd::MyNode->new(
        component => $self,
        nodename => "bob",
    );



The above created instance will accept stanzas addressed to the node bob inside the domain owned by the given component.

It is not possible to directly use subclasses of this class as delivery plugins, since they must be associated with a component at runtime.

SEE ALSO

See also DJabberd::Agent::Node, 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::COMPONENT::NODE (3) 2011-06-13

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