tigase.jaxmpp.core.client
Interface Connector

All Known Implementing Classes:
AbstractBoshConnector, ConnectorWrapper

public interface Connector

Main Connector interface.

Events:
Connected : ConnectorEvent ()
Fires after creates XMPP Stream
EncryptionEstablished : ConnectorEvent ()
Fires after encrypted connection is established.
Error : ConnectorEvent (caught)
Fires on XMPP Stream error
StateChanged : ConnectorEvent ()
Fires after connection state is changed
StanzaReceived : ConnectorEvent (stanza)
Fires after next stanza is received
StreamTerminated : ConnectorEvent ()
Fires after XMPP Stream is terminated

Properties:
TRUST_MANAGER: Custom TrustManager instead of dummy (accespts all certificates) builded in.


Nested Class Summary
static class Connector.ConnectorEvent
          Event generated by Connector.
static class Connector.State
           
 
Field Summary
static EventType BodyReceived
           
static EventType Connected
          Event fires after creates XMPP Stream
static String CONNECTOR_STAGE_KEY
           
static String DISABLE_KEEPALIVE_KEY
           
static String ENCRYPTED_KEY
           
static EventType EncryptionEstablished
          Event fires after encrypted connection is established.
static EventType Error
          Event fires on XMPP Stream error.
static String EXTERNAL_KEEPALIVE_KEY
           
static String SEE_OTHER_HOST_KEY
           
static EventType StanzaReceived
          Event fires after creates XMPP Stream.
static EventType StanzaSending
           
static EventType StateChanged
          Event fires after connection state is changed.
static EventType StreamTerminated
          Event fires after XMPP Stream is terminated.
static String TRUST_MANAGERS_KEY
          Key for define property.
 
Method Summary
 void addListener(EventType eventType, Listener<? extends Connector.ConnectorEvent> listener)
          Adds a listener bound by the given event type.
 XmppSessionLogic createSessionLogic(XmppModulesManager modulesManager, PacketWriter writer)
          Returns instance of XmppSessionLogic to work with this connector.
 Observable getObservable()
          Returns observable
 Connector.State getState()
           
 boolean isSecure()
           
 void keepalive()
          Whitespace ping.
 void removeAllListeners()
           
 void removeListener(EventType eventType, Listener<Connector.ConnectorEvent> listener)
           
 void restartStream()
           
 void send(Element stanza)
           
 void setObservable(Observable observable)
           
 void start()
           
 void stop()
           
 void stop(boolean terminate)
           
 

Field Detail

BodyReceived

static final EventType BodyReceived

Connected

static final EventType Connected
Event fires after creates XMPP Stream


CONNECTOR_STAGE_KEY

static final String CONNECTOR_STAGE_KEY
See Also:
Constant Field Values

DISABLE_KEEPALIVE_KEY

static final String DISABLE_KEEPALIVE_KEY
See Also:
Constant Field Values

ENCRYPTED_KEY

static final String ENCRYPTED_KEY
See Also:
Constant Field Values

EncryptionEstablished

static final EventType EncryptionEstablished
Event fires after encrypted connection is established.


Error

static final EventType Error
Event fires on XMPP Stream error.

Filled fields:


EXTERNAL_KEEPALIVE_KEY

static final String EXTERNAL_KEEPALIVE_KEY
See Also:
Constant Field Values

SEE_OTHER_HOST_KEY

static final String SEE_OTHER_HOST_KEY
See Also:
Constant Field Values

StanzaReceived

static final EventType StanzaReceived
Event fires after creates XMPP Stream.

Filled fields:


StanzaSending

static final EventType StanzaSending

StateChanged

static final EventType StateChanged
Event fires after connection state is changed.


StreamTerminated

static final EventType StreamTerminated
Event fires after XMPP Stream is terminated.


TRUST_MANAGERS_KEY

static final String TRUST_MANAGERS_KEY
Key for define property. Custom array of TrustManagers[] instead of dummy (accepts all certificates) builded in.

See Also:
Constant Field Values
Method Detail

addListener

void addListener(EventType eventType,
                 Listener<? extends Connector.ConnectorEvent> listener)
Adds a listener bound by the given event type.

Parameters:
eventType - type of event
listener - the listener

createSessionLogic

XmppSessionLogic createSessionLogic(XmppModulesManager modulesManager,
                                    PacketWriter writer)
Returns instance of XmppSessionLogic to work with this connector.

Parameters:
modulesManager - module manager
writer - writer
Returns:
XmppSessionLogic

getObservable

Observable getObservable()
Returns observable

Returns:

getState

Connector.State getState()

isSecure

boolean isSecure()

keepalive

void keepalive()
               throws JaxmppException
Whitespace ping.

Throws:
JaxmppException

removeAllListeners

void removeAllListeners()

removeListener

void removeListener(EventType eventType,
                    Listener<Connector.ConnectorEvent> listener)

restartStream

void restartStream()
                   throws XMLException,
                          JaxmppException
Throws:
XMLException
JaxmppException

send

void send(Element stanza)
          throws XMLException,
                 JaxmppException
Throws:
XMLException
JaxmppException

setObservable

void setObservable(Observable observable)

start

void start()
           throws XMLException,
                  JaxmppException
Throws:
XMLException
JaxmppException

stop

void stop()
          throws XMLException,
                 JaxmppException
Throws:
XMLException
JaxmppException

stop

void stop(boolean terminate)
          throws XMLException,
                 JaxmppException
Throws:
XMLException
JaxmppException


Copyright © 2006-2012 Tigase. All Rights Reserved.