public class XMPPBOSHConnection
extends org.jivesoftware.smack.XMPPConnection
XMPPConnection| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
authID
The BOSH equivalent of the stream ID which is used for DIGEST authentication.
|
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.
|
| Constructor and Description |
|---|
XMPPBOSHConnection(boolean https,
java.lang.String host,
int port,
java.lang.String filePath,
java.lang.String xmppDomain)
Create a HTTP Binding connection to a XMPP server.
|
XMPPBOSHConnection(BOSHConfiguration config)
Create a HTTP Binding connection to a XMPP server.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
connectInternal() |
java.lang.String |
getConnectionID() |
protected org.jivesoftware.smack.SASLAuthentication |
getSASLAuthentication() |
java.lang.String |
getUser() |
protected void |
initDebugger()
Initialize the SmackDebugger which allows to log and debug XML traffic.
|
boolean |
isAnonymous() |
boolean |
isAuthenticated() |
boolean |
isConnected() |
boolean |
isSecureConnection() |
boolean |
isUsingCompression() |
void |
login(java.lang.String username,
java.lang.String password,
java.lang.String resource) |
void |
loginAnonymously() |
protected void |
notifyConnectionError(java.lang.Exception e)
Sends out a notification that there was an error with the connection
and closes the connection.
|
protected void |
processPacket(org.jivesoftware.smack.packet.Packet packet) |
protected void |
send(org.igniterealtime.jbosh.ComposableBody body)
Send a HTTP request to the connection manager with the provided body element.
|
protected void |
sendPacketInternal(org.jivesoftware.smack.packet.Packet packet) |
protected void |
serverRequiresBinding() |
protected void |
serverSupportsAccountCreation() |
protected void |
serverSupportsSession() |
protected void |
shutdown()
Closes the connection by setting presence to unavailable and closing the
HTTP client.
|
addConnectionCreationListener, addConnectionListener, addPacketInterceptor, addPacketListener, addPacketSendingListener, bindResourceAndEstablishSession, callConnectionAuthenticatedListener, callConnectionClosedOnErrorListener, callConnectionConnectedListener, connect, createPacketCollector, createPacketCollectorAndSend, disconnect, disconnect, finalize, getConfiguration, getConnectionCounter, getConnectionCreationListeners, getConnectionListeners, getFromMode, getHost, getPacketCollectors, getPacketInterceptors, getPacketListeners, getPacketReplyTimeout, getPacketSendingListeners, getPort, getReader, getRoster, getServiceCapsNode, getServiceName, getWriter, isRosterVersioningSupported, login, maybeResolveDns, removeConnectionCreationListener, removeConnectionListener, removePacketCollector, removePacketInterceptor, removePacketListener, removePacketSendingListener, schedule, sendPacket, setConnectionException, setFromMode, setLoginInfo, setPacketReplyTimeout, setRosterVersioningSupported, setServiceCapsNode, setServiceName, setWasAuthenticated, throwConnectionExceptionOrNoResponsepublic static final java.lang.String XMPP_BOSH_NS
public static final java.lang.String BOSH_URI
protected java.lang.String authID
protected java.lang.String sessionID
public XMPPBOSHConnection(boolean https,
java.lang.String host,
int port,
java.lang.String filePath,
java.lang.String xmppDomain)
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).xmppDomain - 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
connectInternal in class org.jivesoftware.smack.XMPPConnectionorg.jivesoftware.smack.SmackExceptionpublic java.lang.String getConnectionID()
getConnectionID in class org.jivesoftware.smack.XMPPConnectionpublic java.lang.String getUser()
getUser in class org.jivesoftware.smack.XMPPConnectionpublic boolean isAnonymous()
isAnonymous in class org.jivesoftware.smack.XMPPConnectionpublic boolean isAuthenticated()
isAuthenticated in class org.jivesoftware.smack.XMPPConnectionpublic boolean isConnected()
isConnected in class org.jivesoftware.smack.XMPPConnectionpublic boolean isSecureConnection()
isSecureConnection in class org.jivesoftware.smack.XMPPConnectionpublic boolean isUsingCompression()
isUsingCompression in class org.jivesoftware.smack.XMPPConnectionpublic void login(java.lang.String username,
java.lang.String password,
java.lang.String resource)
throws org.jivesoftware.smack.XMPPException,
org.jivesoftware.smack.SmackException,
java.io.IOException
login in class org.jivesoftware.smack.XMPPConnectionorg.jivesoftware.smack.XMPPExceptionorg.jivesoftware.smack.SmackExceptionjava.io.IOExceptionpublic void loginAnonymously()
throws org.jivesoftware.smack.XMPPException,
org.jivesoftware.smack.SmackException,
java.io.IOException
loginAnonymously in class org.jivesoftware.smack.XMPPConnectionorg.jivesoftware.smack.XMPPExceptionorg.jivesoftware.smack.SmackExceptionjava.io.IOExceptionprotected void sendPacketInternal(org.jivesoftware.smack.packet.Packet packet)
throws org.jivesoftware.smack.SmackException.NotConnectedException
sendPacketInternal in class org.jivesoftware.smack.XMPPConnectionorg.jivesoftware.smack.SmackException.NotConnectedExceptionprotected void shutdown()
XMPPConnection.disconnect() the connection's
BOSH packet reader and Roster will not be removed; thus
connection's state is kept.shutdown in class org.jivesoftware.smack.XMPPConnectionprotected void send(org.igniterealtime.jbosh.ComposableBody body)
throws org.igniterealtime.jbosh.BOSHException
body - the body which will be sent.org.igniterealtime.jbosh.BOSHExceptionprotected void initDebugger()
initDebugger in class org.jivesoftware.smack.XMPPConnectionprotected void notifyConnectionError(java.lang.Exception e)
e - the exception that causes the connection close event.protected void processPacket(org.jivesoftware.smack.packet.Packet packet)
processPacket in class org.jivesoftware.smack.XMPPConnectionprotected org.jivesoftware.smack.SASLAuthentication getSASLAuthentication()
getSASLAuthentication in class org.jivesoftware.smack.XMPPConnectionprotected void serverRequiresBinding()
serverRequiresBinding in class org.jivesoftware.smack.XMPPConnectionprotected void serverSupportsSession()
serverSupportsSession in class org.jivesoftware.smack.XMPPConnectionprotected void serverSupportsAccountCreation()
serverSupportsAccountCreation in class org.jivesoftware.smack.XMPPConnection