tigase.jaxmpp.core.client

## Interface Connector

- All Known Implementing Classes:
    AbstractBoshConnector, AbstractWebSocketConnector, BoshConnector, BoshConnector, ConnectorWrapper, SocketConnector, WebSocketConnector, WebSocketConnector

      public interface Connector

  Main Connector interface.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `Connector.ConnectedHandler` Implemented by handlers of LoggedInEvent.
    `static interface` | `Connector.DisconnectedHandler` Implemented by handlers of Connector.DisconnectedHandler.DisconnectedEvent.
    `static interface` | `Connector.EncryptionEstablishedHandler` Implemented by handlers of EncryptionEstablishedEvent.
    `static interface` | `Connector.ErrorHandler` Implemented by handlers of ErrorEvent.
    `static interface` | `Connector.StanzaReceivedHandler` Implemented by handlers of StanzaReceivedEvent.
    `static interface` | `Connector.StanzaSendingHandler` Implemented by handlers of StanzaSendingEvent.
    `static class` | `Connector.State` States of Connector.
    `static interface` | `Connector.StateChangedHandler` Implemented by handlers of StateChangedEvent.
    `static interface` | `Connector.StreamTerminatedHandler` Implemented by handlers of StreamTerminatedEvent.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `COMPRESSED_KEY` Name of property that specify if connection is already compressed.
    `static String` | `CONNECTOR_STAGE_KEY` Name of property that specify current state of connector.
    `static String` | `CONNECTOR_STAGE_TIMESTAMP_KEY` Name of property that specify timestamp (type: `Date`) of last state change.
    `static String` | `DISABLE_KEEPALIVE_KEY` Name of property that allows disable keep alive feature.
    `static String` | `ENCRYPTED_KEY` Name of property that specify if connection is encrypted.
    `static String` | `EXTERNAL_KEEPALIVE_KEY` Type: Boolean.
    `static String` | `PROXY_HOST`
    `static String` | `PROXY_PORT`
    `static String` | `PROXY_TYPE`
    `static String` | `RECONNECTING_KEY`
    `static String` | `SEE_OTHER_HOST_KEY` Type: Boolean.
    `static String` | `TRUST_MANAGERS_KEY` Name of property to define property.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `XmppSessionLogic` | `createSessionLogic(XmppModulesManager modulesManager, PacketWriter writer)` Returns instance of XmppSessionLogic to work with this connector.
    `Connector.State` | `getState()` Returns current State of connector.
    `boolean` | `isCompressed()` Returns XML Stream compression state.
    `boolean` | `isSecure()` Returns connection security state.
    `void` | `keepalive()` Whitespace ping.
    `void` | `restartStream()` Sends new XML Stream header.
    `void` | `send(Element stanza)` Sends given XML Element to server.
    `void` | `start()` Starts connector.
    `void` | `stop()` Stops connector and closes connections.
    `void` | `stop(boolean terminate)` Stops connector.

- - ### Field Detail

    - #### COMPRESSED_KEY

          static final String COMPRESSED_KEY

      Name of property that specify if connection is already compressed.
      Type: Boolean.
      See Also:
        Constant Field Values

    - #### CONNECTOR_STAGE_KEY

          static final String CONNECTOR_STAGE_KEY

      Name of property that specify current state of connector.
      Type: State.
      See Also:
        Constant Field Values

    - #### CONNECTOR_STAGE_TIMESTAMP_KEY

          static final String CONNECTOR_STAGE_TIMESTAMP_KEY

      Name of property that specify timestamp (type: `Date`) of last state change.
      See Also:
        Constant Field Values

    - #### DISABLE_KEEPALIVE_KEY

          static final String DISABLE_KEEPALIVE_KEY

      Name of property that allows disable keep alive feature. Keep alive is turned on by default.
      Type: Boolean.
      See Also:
        Constant Field Values

    - #### ENCRYPTED_KEY

          static final String ENCRYPTED_KEY

      Name of property that specify if connection is encrypted.
      Type: Boolean.
      See Also:
        Constant Field Values

    - #### EXTERNAL_KEEPALIVE_KEY

          static final String EXTERNAL_KEEPALIVE_KEY

      Type: Boolean.
      See Also:
        Constant Field Values

    - #### RECONNECTING_KEY

          static final String RECONNECTING_KEY

      See Also:
        Constant Field Values

    - #### SEE_OTHER_HOST_KEY

          static final String SEE_OTHER_HOST_KEY

      Type: Boolean.
      See Also:
        Constant Field Values

    - #### TRUST_MANAGERS_KEY

          static final String TRUST_MANAGERS_KEY

      Name of property to define property. Custom array of `TrustManagers[]` instead of default Java TrustManager.
      See Also:
        Constant Field Values

    - #### PROXY_HOST

          static final String PROXY_HOST

      See Also:
        Constant Field Values

    - #### PROXY_PORT

          static final String PROXY_PORT

      See Also:
        Constant Field Values

    - #### PROXY_TYPE

          static final String PROXY_TYPE

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### createSessionLogic

          XmppSessionLogic createSessionLogic(XmppModulesManager modulesManager,
                                              PacketWriter writer)

      Returns instance of XmppSessionLogic to work with this connector.
      Parameters:
        `modulesManager` - module manager
        `writer` - writer
      Returns:
        XmppSessionLogic

    - #### getState

          Connector.State getState()

      Returns current State of connector.
      Returns:
        State of connector.

    - #### isCompressed

          boolean isCompressed()

      Returns XML Stream compression state.
      Returns:
        `true> if XML Stream is compressed.`

    - #### isSecure

          boolean isSecure()

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

    - #### keepalive

          void keepalive()
                  throws JaxmppException

      Whitespace ping.
      Throws:
        `JaxmppException`

    - #### restartStream

          void restartStream()
                      throws JaxmppException

      Sends new XML Stream header.
      Throws:
        `JaxmppException`

    - #### send

          void send(Element stanza)
             throws JaxmppException

      Sends given XML Element to server.
      Parameters:
        `stanza` - XML element to send.
      Throws:
        `JaxmppException`

    - #### start

          void start()
              throws JaxmppException

      Starts connector. If connector is properly configured it will tries to establsh connection with server.
      Throws:
        `JaxmppException`

    - #### stop

          void stop()
             throws JaxmppException

      Stops connector and closes connections.
      Throws:
        `JaxmppException`

    - #### stop

          void stop(boolean terminate)
             throws JaxmppException

      Stops connector.
      Parameters:
        `terminate` - if `true`then connection will be terminated immediatelly and connector will be stopped.``
      Throws:
        `JaxmppException`

Copyright © 2006–2016 Tigase. All rights reserved.