tigase.jaxmpp.core.client

## Class JaxmppCore

- java.lang.Object
- - tigase.jaxmpp.core.client.JaxmppCore

- Direct Known Subclasses:
    Jaxmpp, Jaxmpp

      public abstract class JaxmppCore
      extends Object

  Base abstract class for implementation platform-specific jaxmpp clients.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected class` | `JaxmppCore.DefaultPacketWriter`
    `static interface` | `JaxmppCore.LoggedInHandler` Implemented by handlers of LoggedInEvent.
    `static interface` | `JaxmppCore.LoggedOutHandler` Implemented by handlers of LoggedOutEvent.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `AUTOADD_STANZA_ID_KEY`
    `protected Connector` | `connector`
    `protected Context` | `context`
    `protected DefaultXMPPStream` | `defaultXMPPStream`
    `protected EventBus` | `eventBus`
    `protected Logger` | `log`
    `protected XmppModulesManager` | `modulesManager`
    `protected Processor` | `processor`
    `protected Map<Class<Property>,Property>` | `properties`
    `protected XmppSessionLogic` | `sessionLogic`
    `protected SessionObject` | `sessionObject`
    `protected XmppStreamsManager` | `streamsManager`
    `protected PacketWriter` | `writer`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JaxmppCore()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected EventBus` | `createEventBus()`
    `abstract void` | `disconnect()` Closes XMPP session.
    `abstract void` | `execute(Runnable runnable)` Executes task in executor.
    `<T extends Property> T` | `get(Class<T> property)`
    `abstract <T extends ConnectionConfiguration> T` | `getConnectionConfiguration()` Returns configurator.
    `Connector` | `getConnector()` Returns connector.
    `Context` | `getContext()` Returns `Context` of this JaXMPP instance.
    `EventBus` | `getEventBus()` Returns `EventBus` of this JaXMPP instance.
    `<T extends XmppModule> T` | `getModule(Class<T> moduleClass)` Return module implementation by module class.
    `XmppModulesManager` | `getModulesManager()` Returns `ModuleManager`.
    `UserProperties` | `getProperties()` Returns `UserProperties`.
    `SessionObject` | `getSessionObject()` Returns `SessionObject`.
    `protected void` | `init()`
    `boolean` | `isConnected()` Returns connection state.
    `boolean` | `isSecure()` Returns connection security state.
    `void` | `keepalive()` Whitespace ping.
    `abstract void` | `login()` Connects to XMPP server.
    `protected void` | `modulesInit()`
    `protected void` | `onConnectorStateChanged(SessionObject sessionObject, Connector.State oldState, Connector.State newState)`
    `protected void` | `onConnectorStopped()`
    `protected abstract void` | `onException(JaxmppException e)`
    `protected abstract void` | `onResourceBindSuccess(JID bindedJID)`
    `protected void` | `onStanzaReceived(StreamPacket stanza)`
    `protected abstract void` | `onStreamError(StreamError condition, Throwable caught)`
    `protected abstract void` | `onStreamResumed(Long h, String previd)`
    `protected abstract void` | `onStreamTerminated()`
    `protected void` | `onUnacknowledged(List<Element> elements)`
    `void` | `send(IQ stanza, AsyncCallback asyncCallback)` Sends IQ `type='get'` stanza to XMPP Server in current connection.
    `void` | `send(IQ stanza, Long timeout, AsyncCallback asyncCallback)` Sends IQ `type='get'` stanza to XMPP Server in current connection.
    `void` | `send(Stanza stanza)` Sends stanza to XMPP Server in current connection.
    `<T extends Property> T` | `set(T property)`

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

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

- - ### Field Detail

    - #### AUTOADD_STANZA_ID_KEY

          public static final String AUTOADD_STANZA_ID_KEY

      See Also:
        Constant Field Values

    - #### log

          protected final Logger log

    - #### connector

          protected Connector connector

    - #### context

          protected Context context

    - #### eventBus

          protected EventBus eventBus

    - #### modulesManager

          protected XmppModulesManager modulesManager

    - #### processor

          protected Processor processor

    - #### properties

          protected Map<Class<Property>,Property> properties

    - #### sessionLogic

          protected XmppSessionLogic sessionLogic

    - #### sessionObject

          protected SessionObject sessionObject

    - #### streamsManager

          protected XmppStreamsManager streamsManager

    - #### writer

          protected PacketWriter writer

    - #### defaultXMPPStream

          protected DefaultXMPPStream defaultXMPPStream

  - ### Constructor Detail

    - #### JaxmppCore

          public JaxmppCore()

  - ### Method Detail

    - #### disconnect

          public abstract void disconnect()
                                   throws JaxmppException

      Closes XMPP session.
      Throws:
        `JaxmppException`

    - #### execute

          public abstract void execute(Runnable runnable)

      Executes task in executor. Used to handle received stanzas.
      Parameters:
        `runnable` - task to execute.

    - #### get

          public <T extends Property> T get(Class<T> property)

    - #### getConnectionConfiguration

          public abstract <T extends ConnectionConfiguration> T getConnectionConfiguration()

      Returns configurator.

      This wrapper for SessionObject.

      Returns:
        configuration

    - #### getConnector

          public Connector getConnector()

      Returns connector.
      Returns:
        `Connector` used by jaxmpp.

    - #### getContext

          public Context getContext()

      Returns `Context` of this JaXMPP instance.
      Returns:
        `Context`.

    - #### getEventBus

          public EventBus getEventBus()

      Returns `EventBus` of this JaXMPP instance.
      Returns:
        `EventBus`.

    - #### getModule

          public <T extends XmppModule> T getModule(Class<T> moduleClass)

      Return module implementation by module class. This method calls XmppModulesManager.getModule(Class).
      Parameters:
        `moduleClass` - module class
      Returns:
        module implementation

    - #### getModulesManager

          public XmppModulesManager getModulesManager()

      Returns `ModuleManager`.
      Returns:
        `XmppModulesManager`.

    - #### getProperties

          public UserProperties getProperties()

      Returns `UserProperties`.
      Returns:
        `UserProperties`.

    - #### getSessionObject

          public SessionObject getSessionObject()

      Returns `SessionObject`.
      Returns:
        `SessionObject`.

    - #### isConnected

          public boolean isConnected()

      Returns connection state.
      Returns:
        `true` if XMPP connection is established.

    - #### isSecure

          public boolean isSecure()

      Returns connection security state.
      Returns:
        `true` if connection is established and secured.

    - #### keepalive

          public void keepalive()
                         throws JaxmppException

      Whitespace ping.
      Throws:
        `JaxmppException`

    - #### login

          public abstract void login()
                              throws JaxmppException

      Connects to XMPP server.
      Throws:
        `JaxmppException`

    - #### send

          public void send(IQ stanza,
                           AsyncCallback asyncCallback)
                    throws JaxmppException

      Sends IQ `type='get'` stanza to XMPP Server in current connection.
      Parameters:
        `stanza` - IQ stanza to send.
        `asyncCallback` - callback to handle response for sent IQ stanza.
      Throws:
        `JaxmppException`

    - #### send

          public void send(IQ stanza,
                           Long timeout,
                           AsyncCallback asyncCallback)
                    throws JaxmppException

      Sends IQ `type='get'` stanza to XMPP Server in current connection.
      Parameters:
        `stanza` - IQ stanza to send.
        `timeout` - maximum time to wait for response in miliseconds.
        `asyncCallback` - asyncCallback callback to handle response for sent IQ stanza.
      Throws:
        `JaxmppException`

    - #### send

          public void send(Stanza stanza)
                    throws JaxmppException

      Sends stanza to XMPP Server in current connection.
      Parameters:
        `stanza` - stanza to send.
      Throws:
        `JaxmppException`

    - #### set

          public <T extends Property> T set(T property)

    - #### createEventBus

          protected EventBus createEventBus()

    - #### init

          protected void init()

    - #### modulesInit

          protected void modulesInit()

    - #### onConnectorStateChanged

          protected void onConnectorStateChanged(SessionObject sessionObject,
                                                 Connector.State oldState,
                                                 Connector.State newState)

    - #### onConnectorStopped

          protected void onConnectorStopped()

    - #### onException

          protected abstract void onException(JaxmppException e)
                                       throws JaxmppException

      Throws:
        `JaxmppException`

    - #### onResourceBindSuccess

          protected abstract void onResourceBindSuccess(JID bindedJID)
                                                 throws JaxmppException

      Throws:
        `JaxmppException`

    - #### onStanzaReceived

          protected void onStanzaReceived(StreamPacket stanza)

    - #### onStreamError

          protected abstract void onStreamError(StreamError condition,
                                                Throwable caught)
                                         throws JaxmppException

      Throws:
        `JaxmppException`

    - #### onStreamResumed

          protected abstract void onStreamResumed(Long h,
                                                  String previd)
                                           throws JaxmppException

      Throws:
        `JaxmppException`

    - #### onStreamTerminated

          protected abstract void onStreamTerminated()
                                              throws JaxmppException

      Throws:
        `JaxmppException`

    - #### onUnacknowledged

          protected void onUnacknowledged(List<Element> elements)
                                   throws JaxmppException

      Throws:
        `JaxmppException`

Copyright © 2006–2023 Tigase. All rights reserved.