tigase.xmpp

## Class XMPPProcessor

- java.lang.Object
- - tigase.xmpp.XMPPProcessor

- All Implemented Interfaces:
    Comparable<XMPPImplIfc>, XMPPImplIfc
  Direct Known Subclasses:
    BindResource, CAPS, DomainFilter, InvisibleCommand, JabberIqAuth, JabberIqCommand, JabberIqIq, JabberIqPrivacy, JabberIqPrivate, JabberIqRegister, JabberIqRoster, JabberIqStats, Jingle, Message, MessageAll, MessageAmp, MessageCarbons, MessageForwarding, MobileV1, MobileV2, MobileV3, OfflineMessages, Presence, RosterPresence, SaslAuth, SessionBind, SimpleForwarder, StartTLS, StartZLib, XMPPProcessorAbstract

      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.
  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$
  Author:
    Artur Hefczyc

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static String` | `ALL_NAMES` Field description
    `protected static String[][]` | `ALL_PATHS` Field description
    `protected static ComponentInfo` | `cmpInfo`

    - ### Fields inherited from interface tigase.xmpp.XMPPImplIfc

      `CLIENT_XMLNS`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `XMPPProcessor()` Constructs ...

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Authorization` | `canHandle(Packet packet, XMPPResourceConnection conn)` Method description
    `int` | `compareTo(XMPPImplIfc proc)` Method `compareTo` is used to perform
    `int` | `concurrentQueuesNo()` Method description
    `int` | `concurrentThreadsPerQueue()` Deprecated.
    `ComponentInfo` | `getComponentInfo()` Allows to obtain various informations about components
    `XMPPProcessor` | `getInstance()` Method description
    `void` | `getStatistics(StatisticsList list)` Method description
    `void` | `init(Map<String,Object> settings)` Method description
    `boolean` | `isSupporting(String element, String ns)` Deprecated.
    `tigase.xml.Element[]` | `supDiscoFeatures(XMPPResourceConnection session)` Method description
    `String[][]` | `supElementNamePaths()` Method description
    `String[]` | `supElements()` Deprecated.
    `String[]` | `supNamespaces()` Method description
    `tigase.xml.Element[]` | `supStreamFeatures(XMPPResourceConnection session)` Method description
    `Set<StanzaType>` | `supTypes()` Method description
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface tigase.xmpp.XMPPImplIfc

      `id`

- - ### Field Detail

    - #### ALL_NAMES

          protected static final String ALL_NAMES

      Field description
      See Also:
        Constant Field Values

    - #### ALL_PATHS

          protected static final String[][] ALL_PATHS

      Field description

    - #### cmpInfo

          protected static ComponentInfo cmpInfo

  - ### Constructor Detail

    - #### XMPPProcessor

          protected XMPPProcessor()

      Constructs ...

  - ### Method Detail

    - #### canHandle

          public Authorization canHandle(Packet packet,
                                XMPPResourceConnection conn)

      Method description
      Specified by:
        `canHandle` in interface `XMPPImplIfc`
      Parameters:
        `packet` -
        `conn` -
      Returns:
        returns `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.

    - #### compareTo

          public final int compareTo(XMPPImplIfc proc)

      Method `compareTo` is used to perform
      Specified by:
        `compareTo` in interface `Comparable<XMPPImplIfc>`
      Parameters:
        `proc` - an `XMPPProcessor` value
      Returns:
        an `int` value

    - #### concurrentQueuesNo

          public int concurrentQueuesNo()

      Method description
      Specified by:
        `concurrentQueuesNo` in interface `XMPPImplIfc`
      Returns:
        an integer preferred number of processing threads for the plugin.

    - #### concurrentThreadsPerQueue

          @Deprecated
          public int concurrentThreadsPerQueue()

      Deprecated.
      Method description
      Specified by:
        `concurrentThreadsPerQueue` in interface `XMPPImplIfc`
      Returns:
        a value of `int`

    - #### init

          public void init(Map<String,Object> settings)
                    throws TigaseDBException

      Method description
      Specified by:
        `init` in interface `XMPPImplIfc`
      Parameters:
        `settings` -
      Throws:
        `TigaseDBException`

    - #### supDiscoFeatures

          public tigase.xml.Element[] supDiscoFeatures(XMPPResourceConnection session)

      Method description
      Specified by:
        `supDiscoFeatures` in interface `XMPPImplIfc`
      Parameters:
        `session` -
      Returns:
        an `Element[]` value

    - #### supElementNamePaths

          public String[][] supElementNamePaths()

      Method description
      Specified by:
        `supElementNamePaths` in interface `XMPPImplIfc`
      Returns:
        a `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.

    - #### supElements

          @Deprecated
          public String[] supElements()

      Deprecated.
      Method description
      Specified by:
        `supElements` in interface `XMPPImplIfc`
      Returns:
        a `String[]` value
      See Also:
        `XMPPImplIfc.supElementNamePaths()`

    - #### supNamespaces

          public String[] supNamespaces()

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

    - #### supStreamFeatures

          public tigase.xml.Element[] supStreamFeatures(XMPPResourceConnection session)

      Method description
      Specified by:
        `supStreamFeatures` in interface `XMPPImplIfc`
      Parameters:
        `session` -
      Returns:
        an `Element[]` value

    - #### supTypes

          public Set<StanzaType> supTypes()

      Method description
      Specified by:
        `supTypes` in interface `XMPPImplIfc`
      Returns:
        a `StanzaType[]` array of supported stanza types.

    - #### getInstance

          public XMPPProcessor getInstance()

      Method description

    - #### getStatistics

          public void getStatistics(StatisticsList list)

      Method description
      Specified by:
        `getStatistics` in interface `XMPPImplIfc`
      Parameters:
        `list` -

    - #### getComponentInfo

          public ComponentInfo getComponentInfo()

      Allows to obtain various informations about components
      Specified by:
        `getComponentInfo` in interface `XMPPImplIfc`
      Returns:
        information about particular component

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### isSupporting

          @Deprecated
          public boolean isSupporting(String element,
                                        String ns)

      Deprecated.
      Method description
      Specified by:
        `isSupporting` in interface `XMPPImplIfc`
      Parameters:
        `element` -
        `ns` -
      Returns:
        a `boolean` value

Copyright © 2013 Tigase. All rights reserved.