tigase.jaxmpp.core.client.xmpp.modules

## Class AbstractStanzaModule<T extends Stanza>

- java.lang.Object
- - tigase.jaxmpp.core.client.xmpp.modules.AbstractStanzaModule<T>

- All Implemented Interfaces:
    ContextAware, InitializingModule, XmppModule
  Direct Known Subclasses:
    AbstractStanzaExtendableModule, MessageArchiveManagementModule, MucModule, PresenceModule, PushNotificationModule, VCardModule

      public abstract class AbstractStanzaModule<T extends Stanza>
      extends Object
      implements XmppModule, InitializingModule, ContextAware

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Context` | `context`
    `protected Logger` | `log`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractStanzaModule()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `afterRegister()` Called when module is registered.
    `void` | `beforeRegister()` Called just before registration module in XmppModulesManager .
    `void` | `beforeUnregister()` Called when module is unregistered.
    `protected void` | `fireEvent(Event<?> event)`
    `protected static Element` | `getFirstChild(Element element, String elementName)`
    `void` | `process(Element element)` Main method of module.
    `abstract void` | `process(T stanza)` Method for processing incoming stanza.
    `void` | `setContext(Context context)`
    `protected Element` | `write(Element stanza)`
    `protected Element` | `write(Element stanza, AsyncCallback asyncCallback)`
    `protected Element` | `write(Element stanza, Long timeout, AsyncCallback asyncCallback)`

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

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

    - ### Methods inherited from interface tigase.jaxmpp.core.client.XmppModule

      `getCriteria, getFeatures`

- - ### Field Detail

    - #### log

          protected final Logger log

    - #### context

          protected Context context

  - ### Constructor Detail

    - #### AbstractStanzaModule

          public AbstractStanzaModule()

  - ### Method Detail

    - #### getFirstChild

          protected static Element getFirstChild(Element element,
                                                 String elementName)
                                          throws XMLException

      Throws:
        `XMLException`

    - #### afterRegister

          public void afterRegister()

      Description copied from interface: `InitializingModule`
      Called when module is registered. At this moment module is formally registered and it is part of client.
      Specified by:
        `afterRegister` in interface `InitializingModule`

    - #### beforeRegister

          public void beforeRegister()

      Description copied from interface: `InitializingModule`
      Called just before registration module in XmppModulesManager . It is good place to check if module is initialized properly.
      Specified by:
        `beforeRegister` in interface `InitializingModule`

    - #### beforeUnregister

          public void beforeUnregister()

      Description copied from interface: `InitializingModule`
      Called when module is unregistered.
      Specified by:
        `beforeUnregister` in interface `InitializingModule`

    - #### fireEvent

          protected void fireEvent(Event<?> event)

    - #### process

          public void process(Element element)
                       throws JaxmppException

      Description copied from interface: `XmppModule`
      Main method of module. Module will process incoming stanza by call this method.
      Specified by:
        `process` in interface `XmppModule`
      Parameters:
        `element` - incoming XMPP stanza
      Throws:
        `JaxmppException`

    - #### process

          public abstract void process(T stanza)
                                throws JaxmppException

      Method for processing incoming stanza.
      Parameters:
        `stanza` - incoming stanza
      Throws:
        `JaxmppException`

    - #### setContext

          public void setContext(Context context)

      Specified by:
        `setContext` in interface `ContextAware`

    - #### write

          protected Element write(Element stanza)
                           throws JaxmppException

      Throws:
        `JaxmppException`

    - #### write

          protected Element write(Element stanza,
                                  AsyncCallback asyncCallback)
                           throws JaxmppException

      Throws:
        `JaxmppException`

    - #### write

          protected Element write(Element stanza,
                                  Long timeout,
                                  AsyncCallback asyncCallback)
                           throws JaxmppException

      Throws:
        `JaxmppException`

Copyright © 2006–2023 Tigase. All rights reserved.