public abstract class XMPPProcessor extends Object implements XMPPImplIfc
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.addReply(...)
, addMessage(...)
and
addBroadcast(...)
methods.Created: Tue Oct 5 20:31:23 2004
Modifier and Type | Field and Description |
---|---|
protected static String |
ALL_NAMES
Field description
|
protected static String[][] |
ALL_PATHS
Field description
|
protected static ComponentInfo |
cmpInfo |
CLIENT_XMLNS
Modifier | Constructor and Description |
---|---|
protected |
XMPPProcessor()
Constructs ...
|
Modifier and Type | Method and Description |
---|---|
Authorization |
canHandle(Packet packet,
XMPPResourceConnection conn)
By default the method uses
XMPPImplIfc.supElementNamePaths() and
XMPPImplIfc.supTypes() method results to determine whether the plugin would process
given packet. |
int |
compareTo(XMPPImplIfc proc) |
int |
concurrentThreadsPerQueue()
Deprecated.
|
ComponentInfo |
getComponentInfo()
Allows to obtain various informations about components
|
XMPPProcessor |
getInstance()
Method description
|
void |
getStatistics(StatisticsList list)
The method allows to retrieve plugin own statistics if it generates any.
|
void |
init(Map<String,Object> settings)
Method
init is called just after the plugin has been loaded
into memory. |
boolean |
isSupporting(String element,
String ns)
Deprecated.
|
Element[] |
supDiscoFeatures(XMPPResourceConnection session)
Method
supDiscoFeatures returns an array of XML
Element s with service discovery features which have to be
returned to the client uppon request. |
String[][] |
supElementNamePaths()
Method
supElementNamePaths returns an array of element
names in form of a full path to the XML element for
stanzas which can be processed by this plugin. |
String[] |
supElements()
Deprecated.
|
String[] |
supNamespaces()
Method
supNamespaces returns an array of name-spaces for
stanzas which can be processed by this plugin. |
Element[] |
supStreamFeatures(XMPPResourceConnection session)
Method
supStreamFeatures returns an array of XML
Element s with stream features which have to be returned to the
client uppon request. |
Set<StanzaType> |
supTypes()
Method returns an array of all stanza types which the plugin is able
to handle.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
concurrentQueuesNo, id
protected static final String ALL_NAMES
protected static final String[][] ALL_PATHS
protected static ComponentInfo cmpInfo
public Authorization canHandle(Packet packet, XMPPResourceConnection conn)
XMPPImplIfc
XMPPImplIfc.supElementNamePaths()
and
XMPPImplIfc.supTypes()
method results to determine whether the plugin would process
given packet. However, a plugin can implement own logic to determine packet
processing capabilities or conditions. Please note, this method must be very fast
and efficient. No I/O processing is recommended as it may impact performance of
the whole system.canHandle
in interface XMPPImplIfc
packet
- is a Packet
for processing.conn
- is a user session object or null.Authorization
enum value or null. Null means the
plugin is simply not processing the packet. Authorization.AUTHORIZED
means
the plugin can process the packet, any other Authorization
enum value
means an error which has to be returned to the sender.public final int compareTo(XMPPImplIfc proc)
compareTo
in interface Comparable<XMPPImplIfc>
@Deprecated public int concurrentThreadsPerQueue()
XMPPImplIfc
XMPPImplIfc.concurrentQueuesNo()
.concurrentThreadsPerQueue
in interface XMPPImplIfc
int
public void init(Map<String,Object> settings) throws TigaseDBException
XMPPImplIfc
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.init
in interface XMPPImplIfc
settings
- is a Map with initial processor settings from the configuration
file.TigaseDBException
public Element[] supDiscoFeatures(XMPPResourceConnection session)
XMPPImplIfc
supDiscoFeatures
returns an array of XML
Element
s 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.supDiscoFeatures
in interface XMPPImplIfc
session
- a XMPPResourceConnection
valueElement[]
valuepublic String[][] supElementNamePaths()
XMPPImplIfc
supElementNamePaths
returns an array of element
names in form of a full path to the XML element for
stanzas which can be processed by this plugin. Each element name path
corresponds to XMLNS returned in array by supNamespaces()
method. The element path itself is represented by a String array with each path
element as a separate String.supElementNamePaths
in interface XMPPImplIfc
String[][]
value is an array for element paths for which
the plugin offers processing capabilities. Each path is in form of a String array
in order to reduce parsing overhead.@Deprecated public String[] supElements()
XMPPImplIfc
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.
This method has been deprecated in favor of supElementNamePaths
.supElements
in interface XMPPImplIfc
String[]
valueXMPPImplIfc.supElementNamePaths()
public String[] supNamespaces()
XMPPImplIfc
supNamespaces
returns an array of name-spaces for
stanzas which can be processed by this plugin. Each namespace
corresponds to element name returned in array by
supElemenets()
method.supNamespaces
in interface XMPPImplIfc
String[]
valuepublic Element[] supStreamFeatures(XMPPResourceConnection session)
XMPPImplIfc
supStreamFeatures
returns an array of XML
Element
s 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.supStreamFeatures
in interface XMPPImplIfc
session
- a XMPPResourceConnection
valueElement[]
valuepublic Set<StanzaType> supTypes()
XMPPImplIfc
supTypes
in interface XMPPImplIfc
StanzaType[]
array of supported stanza types.public XMPPProcessor getInstance()
public void getStatistics(StatisticsList list)
XMPPImplIfc
getStatistics
in interface XMPPImplIfc
list
- is a statistics collection to which plugins own metrics can be added.public ComponentInfo getComponentInfo()
XMPPImplIfc
getComponentInfo
in interface XMPPImplIfc
@Deprecated public boolean isSupporting(String element, String ns)
XMPPImplIfc
isSupporting
takes element name and name-space for this
element and determines whether this element can be processed by this
plugin.isSupporting
in interface XMPPImplIfc
element
- a String
valuens
- a String
valueboolean
valueCopyright © 2018 "Tigase, Inc.". All rights reserved.