tigase.xmpp
Class XMPPProcessor

java.lang.Object
  extended by tigase.xmpp.XMPPProcessor
All Implemented Interfaces:
java.lang.Comparable<XMPPProcessor>, XMPPImplIfc
Direct Known Subclasses:
BindResource, DomainFilter, JabberIqAuth, JabberIqCommand, JabberIqIq, JabberIqPrivacy, JabberIqPrivate, JabberIqRegister, JabberIqStats, JabberIqVersion, Jingle, Message, MessageArchive, OfflineMessages, PepPlugin, RosterPresence, SaslAuth, ServiceDiscovery, SessionBind, SimpleForwarder, StartTLS, StartZLib, UrnXmppPing, VCardTemp

public abstract class XMPPProcessor
extends java.lang.Object
implements XMPPImplIfc, java.lang.Comparable<XMPPProcessor>

XMPPProcessor abstract class contains basic definition for XMPP processor. To create new processor implementing particular XMPP functionality it is enough to extend this class and implement one abstract method.
Additionally to allow system properly recognize this processor you need also to implement own constructor which sets proper values to parent constructor. You must implement exactly one constructor with zero parameters which calls parent constructor with proper values. Refer to constructor documentation for information about required parameters.
To fully interact with entity connected to the session or with other entities in XMPP network you should be also familiar with addReply(...), addMessage(...) and addBroadcast(...) methods.
There is also partialy implemented functionality to send messages to entities in other networks like SMTP or other implemented by the server. Once this implementation is finished there will be more information available. If you, however, are interested in this particular feature send a question to author.

Created: Tue Oct 5 20:31:23 2004

Version:
$Rev: 1547 $
Author:
Artur Hefczyc

Field Summary
protected static java.lang.String ALL
           
 
Constructor Summary
protected XMPPProcessor()
           
 
Method Summary
 int compareTo(XMPPProcessor proc)
          Method compareTo is used to perform
 int concurrentQueuesNo()
           
 int concurrentThreadsPerQueue()
           
 XMPPProcessor getInstance()
           
 void init(UserRepository rep)
          Method init is called just after the plugin has been loaded into memory.
 boolean isSupporting(java.lang.String element, java.lang.String ns)
          Method isSupporting takes element name and namespace for this element and determines whether this element can be processed by this plugin.
 tigase.xml.Element[] supDiscoFeatures(XMPPResourceConnection session)
          Method supDiscoFeatures returns an array of XML Elements with service discovery features which have to be returned to the client uppon request.
 java.lang.String[] supElements()
          Method supElements returns an array of element names for stanzas which can be processed by this plugin.
 java.lang.String[] supNamespaces()
          Method supNamespaces returns an array of namespaces for stanzas which can be processed by this pluing.
 tigase.xml.Element[] supStreamFeatures(XMPPResourceConnection session)
          Method supStreamFeatures returns an array of XML Elements with stream features which have to be returned to the client uppon request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface tigase.xmpp.XMPPImplIfc
id
 

Field Detail

ALL

protected static final java.lang.String ALL
See Also:
Constant Field Values
Constructor Detail

XMPPProcessor

protected XMPPProcessor()
Method Detail

supElements

public java.lang.String[] supElements()
Description copied from interface: XMPPImplIfc
Method supElements returns an array of element names for stanzas which can be processed by this plugin. Each element name corresponds to XMLNS returned in array by supNamespaces() method.

Specified by:
supElements in interface XMPPImplIfc
Returns:
a String[] value

supNamespaces

public java.lang.String[] supNamespaces()
Description copied from interface: XMPPImplIfc
Method supNamespaces returns an array of namespaces for stanzas which can be processed by this pluing. Each namespace corresponds to element name returned in array by supElemenets() method.

Specified by:
supNamespaces in interface XMPPImplIfc
Returns:
a String[] value

supStreamFeatures

public tigase.xml.Element[] supStreamFeatures(XMPPResourceConnection session)
Description copied from interface: XMPPImplIfc
Method supStreamFeatures returns an array of XML Elements with stream features which have to be returned to the client uppon request. Stream features returned by this method correspond to features supported by this plugin.

Specified by:
supStreamFeatures in interface XMPPImplIfc
Parameters:
session - a XMPPResourceConnection value
Returns:
an Element[] value

supDiscoFeatures

public tigase.xml.Element[] supDiscoFeatures(XMPPResourceConnection session)
Description copied from interface: XMPPImplIfc
Method supDiscoFeatures returns an array of XML Elements with service discovery features which have to be returned to the client uppon request. Service discovery features returned by this method correspond to services supported by this plugin.

Specified by:
supDiscoFeatures in interface XMPPImplIfc
Parameters:
session - a XMPPResourceConnection value
Returns:
an Element[] value

isSupporting

public boolean isSupporting(java.lang.String element,
                            java.lang.String ns)
Description copied from interface: XMPPImplIfc
Method isSupporting takes element name and namespace for this element and determines whether this element can be processed by this plugin.

Specified by:
isSupporting in interface XMPPImplIfc
Parameters:
element - a String value
ns - a String value
Returns:
a boolean value

concurrentQueuesNo

public int concurrentQueuesNo()
Specified by:
concurrentQueuesNo in interface XMPPImplIfc

concurrentThreadsPerQueue

public int concurrentThreadsPerQueue()
Specified by:
concurrentThreadsPerQueue in interface XMPPImplIfc

getInstance

public XMPPProcessor getInstance()

compareTo

public final int compareTo(XMPPProcessor proc)
Method compareTo is used to perform

Specified by:
compareTo in interface java.lang.Comparable<XMPPProcessor>
Parameters:
proc - an XMPPProcessor value
Returns:
an int value

init

public void init(UserRepository rep)
          throws TigaseDBException
Description copied from interface: XMPPImplIfc
Method init is called just after the plugin has been loaded into memory. The idea behind this is to allow it to initialize or check the database. This might be especially useful for plugins which want to have a database access via non-standard stored procedures or need schema upgrade.

Specified by:
init in interface XMPPImplIfc
Parameters:
rep - an UserRepository value
Throws:
TigaseDBException


Copyright © 2009 Tigase. All Rights Reserved.