public class XMPPConnection extends TCPConnection implements NegotiatedConnection
TCPConnection with semenatics of XMPP protocol such
as reply timeout for packets.
The class does not have a public constructor; use ConnectionManager
to instantiate XMPPConnection.
isConnected| Modifier and Type | Method and Description |
|---|---|
void |
clearAuthenticatedStatus() |
void |
close()
closing a physical connection to the remote machine.
|
String |
getId()
Every connection has an unique id assigned.
|
Duration |
getReplyTimeout() |
XMPPStream |
getXmppStream() |
boolean |
isAuthenticated() |
boolean |
isNegotiated()
Connection implementation with protocol semantics, generally,
involves negotiating a packet stream; for example XMPP connections
requires XMPP stream to be negotiated before user packets can be
sent/received on the connection. |
void |
markAuthenticated()
Mark this connection status authenticated
|
void |
negotiationComplete()
Set negotiation state to complete for this connection
|
int |
read(ByteBuffer buffer)
Reads incoming data from this connection into the destination buffer
|
void |
setXmppStream(XMPPStream xmppStream) |
String |
toString() |
int |
write(ByteBuffer buffer)
Drains buffer bytes on the underlying connection
|
void |
write(Packet packet) |
connect, getConnConfig, getLastActivity, isConnected, writeclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitconnect, getLastActivity, isConnected, writepublic int read(ByteBuffer buffer) throws IOException
Connectionread in interface Connectionread in class TCPConnectionbuffer - bufferIOException - IOExceptionpublic int write(ByteBuffer buffer) throws IOException
Connectionwrite in interface Connectionwrite in class TCPConnectionbuffer - byte buffer which will drained on underlying socketIOException - if IO error occures while writing datapublic Duration getReplyTimeout()
public void close()
throws IOException
Connectionclose in interface Connectionclose in interface AutoCloseableclose in class TCPConnectionIOException - IOExceptionpublic String getId()
ConnectionConnectiongetId in interface Identifiable<String>getId in interface ConnectiongetId in class TCPConnectionpublic void write(Packet packet) throws IOException
IOExceptionpublic XMPPStream getXmppStream()
public void setXmppStream(XMPPStream xmppStream)
public boolean isNegotiated()
NegotiatedConnectionConnection implementation with protocol semantics, generally,
involves negotiating a packet stream; for example XMPP connections
requires XMPP stream to be negotiated before user packets can be
sent/received on the connection.isNegotiated in interface NegotiatedConnectionpublic void negotiationComplete()
NegotiatedConnectionnegotiationComplete in interface NegotiatedConnectionpublic void markAuthenticated()
public void clearAuthenticatedStatus()
public boolean isAuthenticated()
Copyright © 2019. All rights reserved.