tigase.xmpp

## Interface XMPPImplIfc

- All Superinterfaces:
    Comparable<XMPPImplIfc>
  All Known Subinterfaces:
    ClientStateIndication.Logic, XMPPPacketFilterIfc, XMPPPostprocessorIfc, XMPPPreprocessorIfc, XMPPProcessorIfc, XMPPStopListenerIfc
  All Known Implementing Classes:
    AbstractAuthPreprocessor, AnnotatedXMPPProcessor, BindResource, BlockingCommand, CAPS, ClientStateIndication, DomainFilter, EntityTime, ErrorCounter, ExternalServiceDiscoveryProcessor, FlexibleOfflineMessageRetrieval, InvisibleCommand, JabberIqAuth, JabberIqCommand, JabberIqIq, JabberIqPrivacy, JabberIqPrivate, JabberIqRegister, JabberIqRoster, JabberIqStats, JabberIqVersion, Jingle, LastActivity, LastActivityAbstract, LastActivityMarker, Message, MessageAll, MessageAmp, MessageCarbons, MessageForwarding, MobileV1, MobileV2, MobileV3, MotdProcessor, OfflineMessages, PepPlugin, PresenceAbstract, PresenceOffline, PresenceState, PresenceSubscription, RemoteRosterManagement, RosterPresence, SaslAuth, ServiceDiscovery, SessionBind, SessionManager.DefaultHandlerProc, SessionManager.SessionCloseProc, SessionManager.SessionOpenProc, SimpleForwarder, StartTLS, StartZLib, UrnXmppPing, VCard4, VCardTemp, VCardXMPPProcessorAbstract, XMPPProcessor, XMPPProcessorAbstract

      public interface XMPPImplIfc
      extends Comparable<XMPPImplIfc>

  This is a base interface for all session manager plugins. There are packet processing plugins, pre-processing, post-processing and packet filters. They all have a common basic methods which are defined here.
  Created: Sat Oct 14 16:11:22 2006
  Version:
    $Rev$
  Author:
    Artur Hefczyc

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `CLIENT_XMLNS`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `Authorization` | `canHandle(Packet packet, XMPPResourceConnection conn)` By default the method uses `supElementNamePaths()` and `supTypes()` method results to determine whether the plugin would process given packet.
    `default int` | `concurrentQueuesNo()` Methods returns a preferable number of threads/packets queues for the plugin.
    `int` | `concurrentThreadsPerQueue()` Deprecated.
    `ComponentInfo` | `getComponentInfo()` Allows to obtain various informations about components
    `void` | `getStatistics(StatisticsList list)` The method allows to retrieve plugin own statistics if it generates any.
    `String` | `id()` Method `id` returns a unique ID of the plugin.
    `void` | `init(Map<String,Object> settings)` Deprecated.
    `boolean` | `isSupporting(String elem, 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.

    - ### Methods inherited from interface java.lang.Comparable

      `compareTo`

- - ### Field Detail

    - #### CLIENT_XMLNS

          static final String CLIENT_XMLNS

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### canHandle

          Authorization canHandle(Packet packet,
                                  XMPPResourceConnection conn)

      By default the method uses `supElementNamePaths()` and `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.
      Parameters:
        `packet` - is a `Packet` for processing.
        `conn` - is a user session object or null.
      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.

    - #### concurrentQueuesNo

          default int concurrentQueuesNo()

      Methods returns a preferable number of threads/packets queues for the plugin. This number can be overwritten through configuration settings, however, a default value should be reasonably good for most standard installations. It is recommended to assign at least as much as twice a number of CPUs cores for I/O bound processing and number a number equal to CPUs cores for fast processing not slowed down by any I/O.
      Returns:
        an integer preferred number of processing threads for the plugin.

    - #### concurrentThreadsPerQueue

          @Deprecated
          int concurrentThreadsPerQueue()

      Deprecated.
      Number of threads per single packets queue. Not used anymore. At the moment only one thread is always used for each queue. For a higher concurrency set more queues using `concurrentQueuesNo()`.
      Returns:
        a value of `int`

    - #### id

          String id()

      Method `id` returns a unique ID of the plugin. Each plugin has own, unique ID which is used in the configuration file to determine whether it needs to be loaded or not. In most cases the ID can be equal to XMLNS of the packages processed by the plugin.
      Returns:
        a `String` value

    - #### init

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

      Deprecated.
      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.
      Parameters:
        `settings` - is a Map with initial processor settings from the configuration file.
      Throws:
        `TigaseDBException`

    - #### supDiscoFeatures

          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. Service discovery features returned by this method correspond to services supported by this plugin.
      Parameters:
        `session` - a `XMPPResourceConnection` value
      Returns:
        an `Element[]` value

    - #### supElementNamePaths

          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. 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.
      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
          String[] supElements()

      Deprecated.
      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. This method has been deprecated in favor of `supElementNamePaths`.
      Returns:
        a `String[]` value
      See Also:
        `supElementNamePaths()`

    - #### supNamespaces

          String[] supNamespaces()

      Method `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.
      Returns:
        a `String[]` value

    - #### supStreamFeatures

          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. Stream features returned by this method correspond to features supported by this plugin.
      Parameters:
        `session` - a `XMPPResourceConnection` value
      Returns:
        an `Element[]` value

    - #### supTypes

          Set<StanzaType> supTypes()

      Method returns an array of all stanza types which the plugin is able to handle. If the method returns NULL, then all stanzas of all types will be passed to the plugin for processing. Otherwise only stanzas with selected types, assuming that element names and name-spaces match as well.
      Returns:
        a `StanzaType[]` array of supported stanza types.

    - #### getComponentInfo

          ComponentInfo getComponentInfo()

      Allows to obtain various informations about components
      Returns:
        information about particular component

    - #### getStatistics

          void getStatistics(StatisticsList list)

      The method allows to retrieve plugin own statistics if it generates any.
      Parameters:
        `list` - is a statistics collection to which plugins own metrics can be added.

    - #### isSupporting

          @Deprecated
          boolean isSupporting(String elem,
                                           String ns)

      Deprecated.
      Method `isSupporting` takes element name and name-space for this element and determines whether this element can be processed by this plugin.
      Parameters:
        `elem` - a `String` value
        `ns` - a `String` value
      Returns:
        a `boolean` value

Copyright © 2004–2019 "Tigase, Inc.". All rights reserved.