| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractBoshConnector.BoshConnectorEvent |
Connector.ConnectorEvent, Connector.State| Modifier and Type | Field and Description |
|---|---|
static String |
AUTHID_KEY |
static String |
BOSH_SERVICE_URL
Deprecated.
use AbstractBoshConnector#BOSH_SERVICE_URL_KEY
|
static String |
BOSH_SERVICE_URL_KEY |
protected Logger |
log |
protected Observable |
observable |
protected Set<BoshRequest> |
requests |
static String |
RID_KEY |
protected SessionObject |
sessionObject |
static String |
SID_KEY |
BodyReceived, COMPRESSED_KEY, Connected, CONNECTOR_STAGE_KEY, DISABLE_KEEPALIVE_KEY, ENCRYPTED_KEY, EncryptionEstablished, Error, EXTERNAL_KEEPALIVE_KEY, SEE_OTHER_HOST_KEY, StanzaReceived, StanzaSending, StateChanged, StreamTerminated, TRUST_MANAGERS_KEY| Constructor and Description |
|---|
AbstractBoshConnector(Observable parentObservable,
SessionObject sessionObject) |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(EventType eventType,
Listener<? extends Connector.ConnectorEvent> listener)
Adds a listener bound by the given event type.
|
protected void |
addToRequests(BoshRequest worker) |
protected int |
countActiveRequests() |
XmppSessionLogic |
createSessionLogic(XmppModulesManager modulesManager,
PacketWriter writer)
Returns instance of XmppSessionLogic to work with this
connector.
|
protected void |
fireOnConnected(SessionObject sessionObject) |
protected void |
fireOnError(int responseCode,
String responseData,
Element response,
Throwable caught,
SessionObject sessionObject) |
protected void |
fireOnStanzaReceived(int responseCode,
String responseData,
Element response,
SessionObject sessionObject) |
protected void |
fireOnTerminate(int responseCode,
String responseData,
Element response,
SessionObject sessionObject) |
Observable |
getObservable()
Returns observable
|
protected String |
getSid() |
Connector.State |
getState() |
boolean |
isCompressed()
Returns true when stream is compressed
|
boolean |
isSecure() |
void |
keepalive()
Whitespace ping.
|
protected Long |
nextRid() |
protected void |
onError(BoshRequest request,
int responseCode,
String responseData,
Element response,
Throwable caught) |
protected void |
onResponse(BoshRequest request,
int responseCode,
String responseData,
Element response) |
protected void |
onTerminate(BoshRequest request,
int responseCode,
String responseData,
Element response) |
protected Element |
prepareBody(byte[] payload) |
protected Element |
prepareBody(Element payload) |
protected Element |
prepareRetartBody() |
protected Element |
prepareStartBody() |
protected Element |
prepareTerminateBody(Element payload) |
protected abstract void |
processSendData(Element element) |
void |
removeAllListeners() |
protected void |
removeFromRequests(BoshRequest ack) |
void |
removeListener(EventType eventType,
Listener<Connector.ConnectorEvent> listener) |
void |
restartStream() |
void |
send(byte[] buffer) |
void |
send(Element stanza) |
void |
setObservable(Observable observable) |
protected void |
setSid(String sid) |
protected void |
setStage(Connector.State state) |
void |
start() |
void |
stop() |
void |
stop(boolean terminate) |
protected void |
terminateAllWorkers() |
public static final String AUTHID_KEY
@Deprecated public static final String BOSH_SERVICE_URL
public static final String BOSH_SERVICE_URL_KEY
public static final String RID_KEY
public static final String SID_KEY
protected final Logger log
protected Observable observable
protected final Set<BoshRequest> requests
protected final SessionObject sessionObject
public AbstractBoshConnector(Observable parentObservable, SessionObject sessionObject)
public void addListener(EventType eventType, Listener<? extends Connector.ConnectorEvent> listener)
ConnectoraddListener in interface ConnectoreventType - type of eventlistener - the listenerprotected void addToRequests(BoshRequest worker)
protected int countActiveRequests()
public XmppSessionLogic createSessionLogic(XmppModulesManager modulesManager, PacketWriter writer)
ConnectorcreateSessionLogic in interface ConnectormodulesManager - module managerwriter - writerprotected void fireOnConnected(SessionObject sessionObject) throws JaxmppException
JaxmppExceptionprotected void fireOnError(int responseCode,
String responseData,
Element response,
Throwable caught,
SessionObject sessionObject)
throws JaxmppException
JaxmppExceptionprotected void fireOnStanzaReceived(int responseCode,
String responseData,
Element response,
SessionObject sessionObject)
throws JaxmppException
JaxmppExceptionprotected void fireOnTerminate(int responseCode,
String responseData,
Element response,
SessionObject sessionObject)
throws JaxmppException
JaxmppExceptionpublic Observable getObservable()
ConnectorgetObservable in interface Connectorprotected String getSid()
public Connector.State getState()
public boolean isCompressed()
isCompressed in interface Connectorpublic void keepalive()
throws JaxmppException
Connectorkeepalive in interface ConnectorJaxmppExceptionprotected Long nextRid()
protected void onError(BoshRequest request, int responseCode, String responseData, Element response, Throwable caught) throws JaxmppException
JaxmppExceptionprotected void onResponse(BoshRequest request, int responseCode, String responseData, Element response) throws JaxmppException
JaxmppExceptionprotected void onTerminate(BoshRequest request, int responseCode, String responseData, Element response) throws JaxmppException
JaxmppExceptionprotected Element prepareBody(byte[] payload) throws XMLException
XMLExceptionprotected Element prepareBody(Element payload) throws XMLException
XMLExceptionprotected Element prepareRetartBody() throws XMLException
XMLExceptionprotected Element prepareStartBody() throws XMLException
XMLExceptionprotected Element prepareTerminateBody(Element payload) throws XMLException
XMLExceptionprotected abstract void processSendData(Element element) throws XMLException, JaxmppException
XMLExceptionJaxmppExceptionpublic void removeAllListeners()
removeAllListeners in interface Connectorprotected void removeFromRequests(BoshRequest ack)
public void removeListener(EventType eventType, Listener<Connector.ConnectorEvent> listener)
removeListener in interface Connectorpublic void restartStream()
throws XMLException,
JaxmppException
restartStream in interface ConnectorXMLExceptionJaxmppExceptionpublic void send(byte[] buffer)
throws JaxmppException
JaxmppExceptionpublic void send(Element stanza) throws XMLException, JaxmppException
send in interface ConnectorXMLExceptionJaxmppExceptionpublic void setObservable(Observable observable)
setObservable in interface Connectorprotected void setSid(String sid)
protected void setStage(Connector.State state) throws JaxmppException
JaxmppExceptionpublic void start()
throws XMLException,
JaxmppException
start in interface ConnectorXMLExceptionJaxmppExceptionpublic void stop()
throws XMLException,
JaxmppException
stop in interface ConnectorXMLExceptionJaxmppExceptionpublic void stop(boolean terminate)
throws XMLException,
JaxmppException
stop in interface ConnectorXMLExceptionJaxmppExceptionprotected void terminateAllWorkers()
Copyright © 2006–2014 Tigase. All rights reserved.