public abstract class Connection extends Object implements Closeable
| Modifier and Type | Field and Description |
|---|---|
protected String |
hostname |
protected int |
port |
| Modifier | Constructor and Description |
|---|---|
protected |
Connection(String hostname,
int port,
Proxy proxy)
Creates a connection to the specified host and port through a proxy.
|
protected |
Connection(XmppSession xmppSession,
ConnectionConfiguration connectionConfiguration)
Creates a connection to the specified host and port through a proxy.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
compressStream()
Compresses the stream.
|
abstract void |
connect()
Connects to the server.
|
String |
getHostname()
Gets the hostname, which is used for the connection.
|
int |
getPort()
Gets the port, which is used for the connection.
|
Proxy |
getProxy()
Gets the proxy.
|
XmppSession |
getXmppSession()
Gets the XMPP session which is associated with this connection.
|
void |
initialize(XmppSession xmppSession)
Deprecated.
|
protected abstract void |
restartStream()
Restarts the stream.
|
abstract void |
send(ClientStreamElement clientStreamElement)
Sends an element.
|
protected String hostname
protected int port
protected Connection(XmppSession xmppSession, ConnectionConfiguration connectionConfiguration)
connectionConfiguration - The connection configuration.public final XmppSession getXmppSession()
@Deprecated public final void initialize(XmppSession xmppSession)
xmppSession - The XMPP session.public final String getHostname()
public final int getPort()
public final Proxy getProxy()
protected abstract void restartStream()
public abstract void send(ClientStreamElement clientStreamElement)
clientStreamElement - The element.protected void compressStream()
public abstract void connect()
throws IOException
IOException - If no connection could be established, e.g. due to unknown host.Copyright © 2014 XMPP.rocks. All rights reserved.