public abstract class Connection extends Object implements AutoCloseable
| Modifier and Type | Method and Description |
|---|---|
abstract void |
connect(Jid from,
String namespace,
Consumer<Jid> onStreamOpened)
Connects to the server and provides an optional 'from' attribute.
|
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.
|
abstract String |
getStreamId()
Gets the stream id of this connection.
|
XmppSession |
getXmppSession()
Gets the XMPP session which is associated with this connection.
|
abstract boolean |
isSecure()
Indicates whether this connection is secured by TLS/SSL.
|
abstract void |
send(StreamElement streamElement)
Sends an element.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclosepublic final XmppSession getXmppSession()
public final String getHostname()
public final int getPort()
public final Proxy getProxy()
public abstract void send(StreamElement streamElement)
streamElement - The element.public abstract void connect(Jid from, String namespace, Consumer<Jid> onStreamOpened) throws IOException
from - The 'from' attribute.namespace - The content namespace, e.g. "jabber:client".onStreamOpened - The callback which gets notified when the stream gets opened, i.e. when the server has responded with a stream header. The parameter of the consumer is the stream id.IOException - If no connection could be established, e.g. due to unknown host.public abstract boolean isSecure()
public abstract String getStreamId()
Copyright © 2014–2015 XMPP.rocks. All rights reserved.