public class XMPPBOSHConnection
extends org.jivesoftware.smack.AbstractXMPPConnection
XMPPConnection| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
BOSH_URI
The BOSH namespace from XEP-0124.
|
protected java.lang.String |
sessionID
The session ID for the BOSH session with the connection manager.
|
static java.lang.String |
XMPP_BOSH_NS
The XMPP Over Bosh namespace.
|
ASYNC_BUT_ORDERED, authenticated, authenticatedConnectionInitiallyEstablishedTimestamp, closingStreamReceived, compressionHandler, connected, connectionCounterValue, connectionListeners, connectionLock, currentSmackException, currentXmppException, debugger, host, lastFeaturesReceived, outgoingStreamXmlEnvironment, port, reader, saslFeatureReceived, SMACK_REACTOR, streamFeatures, streamId, tlsHandled, user, wasAuthenticated, writer| Constructor and Description |
|---|
XMPPBOSHConnection(BOSHConfiguration config)
Create a HTTP Binding connection to an XMPP server.
|
XMPPBOSHConnection(java.lang.String username,
java.lang.String password,
boolean https,
java.lang.String host,
int port,
java.lang.String filePath,
org.jxmpp.jid.DomainBareJid xmppServiceDomain)
Create a HTTP Binding connection to an XMPP server.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
afterSaslAuthenticationSuccess() |
protected void |
connectInternal() |
protected void |
initDebugger()
Initialize the SmackDebugger which allows to log and debug XML traffic.
|
void |
instantShutdown() |
boolean |
isSecureConnection() |
boolean |
isUsingCompression() |
protected void |
loginInternal(java.lang.String username,
java.lang.String password,
org.jxmpp.jid.parts.Resourcepart resource) |
protected void |
send(org.igniterealtime.jbosh.ComposableBody body)
Send a HTTP request to the connection manager with the provided body element.
|
void |
sendNonza(org.jivesoftware.smack.packet.Nonza element) |
protected void |
sendStanzaInternal(org.jivesoftware.smack.packet.Stanza packet) |
protected void |
shutdown()
Closes the connection by setting presence to unavailable and closing the
HTTP client.
|
addAsyncStanzaListener, addConnectionListener, addMessageInterceptor, addOneTimeSyncCallback, addPresenceInterceptor, addStanzaInterceptor, addStanzaListener, addStanzaSendingListener, addStreamFeature, addSyncStanzaListener, afterFeaturesReceived, afterSuccessfulLogin, asyncGo, asyncGoLimited, authenticate, bindResourceAndEstablishSession, buildNonzaCallback, callConnectionAuthenticatedListener, callConnectionConnectedListener, callConnectionConnectingListener, connect, createStanzaCollector, createStanzaCollector, createStanzaCollectorAndSend, createStanzaCollectorAndSend, disconnect, disconnect, firePacketSendingListeners, getAuthenticatedConnectionInitiallyEstablishedTimestamp, getConfiguration, getConnectionCounter, getConnectionLock, getFeature, getFromMode, getHost, getLastStanzaReceived, getParsingExceptionCallback, getPort, getReactor, getReplyTimeout, getSmackTlsContext, getStanzaFactory, getStreamId, getUsedSaslMechansism, getUser, getXMPPServiceDomain, hasCurrentConnectionException, hasFeature, initState, invokeStanzaCollectorsAndNotifyRecvListeners, isAnonymous, isAuthenticated, isConnected, isSaslAuthenticated, login, login, login, notifyConnectionError, notifyWaitingThreads, onStreamOpen, parseAndProcessNonza, parseAndProcessStanza, parseFeatures, parseFeaturesAndNotify, processStanza, registerIQRequestHandler, removeAsyncStanzaListener, removeConnectionListener, removeMessageInterceptor, removePresenceInterceptor, removeStanzaCollector, removeStanzaInterceptor, removeStanzaListener, removeStanzaSendingListener, removeSyncStanzaListener, schedule, sendAndWaitForResponse, sendAsync, sendAsync, sendIqRequestAndWaitForResponse, sendIqRequestAsync, sendIqRequestAsync, sendStanza, sendStreamOpen, setCurrentConnectionExceptionAndNotify, setFromMode, setMaxAsyncOperations, setParsingExceptionCallback, setReplyTimeout, setUnknownIqRequestReplyMode, setWasAuthenticated, throwAlreadyConnectedExceptionIfAppropriate, throwAlreadyLoggedInExceptionIfAppropriate, throwCurrentConnectionException, throwNotConnectedExceptionIfAppropriate, throwNotConnectedExceptionIfAppropriate, toString, trySendStanza, trySendStanza, unregisterIQRequestHandler, unregisterIQRequestHandler, waitFor, waitForClosingStreamTagFromServer, waitForConditionOrThrowConnectionExceptionpublic static final java.lang.String XMPP_BOSH_NS
public static final java.lang.String BOSH_URI
protected java.lang.String sessionID
public XMPPBOSHConnection(java.lang.String username,
java.lang.String password,
boolean https,
java.lang.String host,
int port,
java.lang.String filePath,
org.jxmpp.jid.DomainBareJid xmppServiceDomain)
username - the username to use.password - the password to use.https - true if you want to use SSL
(e.g. false for http://domain.lt:7070/http-bind).host - the hostname or IP address of the connection manager
(e.g. domain.lt for http://domain.lt:7070/http-bind).port - the port of the connection manager
(e.g. 7070 for http://domain.lt:7070/http-bind).filePath - the file which is described by the URL
(e.g. /http-bind for http://domain.lt:7070/http-bind).xmppServiceDomain - the XMPP service name
(e.g. domain.lt for the user alice@domain.lt)public XMPPBOSHConnection(BOSHConfiguration config)
config - The configuration which is used for this connection.protected void connectInternal()
throws org.jivesoftware.smack.SmackException,
java.lang.InterruptedException
connectInternal in class org.jivesoftware.smack.AbstractXMPPConnectionorg.jivesoftware.smack.SmackExceptionjava.lang.InterruptedExceptionpublic boolean isSecureConnection()
isSecureConnection in interface org.jivesoftware.smack.XMPPConnectionisSecureConnection in class org.jivesoftware.smack.AbstractXMPPConnectionpublic boolean isUsingCompression()
isUsingCompression in interface org.jivesoftware.smack.XMPPConnectionisUsingCompression in class org.jivesoftware.smack.AbstractXMPPConnectionprotected void loginInternal(java.lang.String username,
java.lang.String password,
org.jxmpp.jid.parts.Resourcepart resource)
throws org.jivesoftware.smack.XMPPException,
org.jivesoftware.smack.SmackException,
java.io.IOException,
java.lang.InterruptedException
loginInternal in class org.jivesoftware.smack.AbstractXMPPConnectionorg.jivesoftware.smack.XMPPExceptionorg.jivesoftware.smack.SmackExceptionjava.io.IOExceptionjava.lang.InterruptedExceptionpublic void sendNonza(org.jivesoftware.smack.packet.Nonza element)
throws org.jivesoftware.smack.SmackException.NotConnectedException
sendNonza in interface org.jivesoftware.smack.XMPPConnectionsendNonza in class org.jivesoftware.smack.AbstractXMPPConnectionorg.jivesoftware.smack.SmackException.NotConnectedExceptionprotected void sendStanzaInternal(org.jivesoftware.smack.packet.Stanza packet)
throws org.jivesoftware.smack.SmackException.NotConnectedException
sendStanzaInternal in class org.jivesoftware.smack.AbstractXMPPConnectionorg.jivesoftware.smack.SmackException.NotConnectedExceptionprotected void shutdown()
AbstractXMPPConnection.disconnect() the connection's
BOSH stanza reader will not be removed; thus connection's state is kept.shutdown in class org.jivesoftware.smack.AbstractXMPPConnectionpublic void instantShutdown()
instantShutdown in class org.jivesoftware.smack.AbstractXMPPConnectionprotected void send(org.igniterealtime.jbosh.ComposableBody body)
throws org.igniterealtime.jbosh.BOSHException
body - the body which will be sent.org.igniterealtime.jbosh.BOSHException - if an BOSH (Bidirectional-streams Over Synchronous HTTP, XEP-0124) related error occursprotected void initDebugger()
initDebugger in class org.jivesoftware.smack.AbstractXMPPConnectionprotected void afterSaslAuthenticationSuccess()
throws org.jivesoftware.smack.SmackException.NotConnectedException,
java.lang.InterruptedException,
org.jivesoftware.smack.SmackException.SmackWrappedException
afterSaslAuthenticationSuccess in class org.jivesoftware.smack.AbstractXMPPConnectionorg.jivesoftware.smack.SmackException.NotConnectedExceptionjava.lang.InterruptedExceptionorg.jivesoftware.smack.SmackException.SmackWrappedException