public class WebSocketConnection extends VirtualConnection
VirtualConnection
and delegates the expected XMPP connection behaviors to the corresponding XmppWebSocket.Connection.ClientAuth, Connection.CompressionPolicy, Connection.State, Connection.TLSPolicysession| Constructor and Description |
|---|
WebSocketConnection(XmppWebSocket socket,
InetSocketAddress remotePeer) |
| Modifier and Type | Method and Description |
|---|---|
void |
closeVirtualConnection()
Closes the virtual connection.
|
void |
deliver(org.xmpp.packet.Packet packet)
Delivers the packet to this connection without checking the recipient.
|
void |
deliverRawText(String text)
Delivers raw text to this connection.
|
byte[] |
getAddress()
Returns the raw IP address of this
InetAddress
object. |
ConnectionConfiguration |
getConfiguration()
Returns a representation of the desired state for this connection.
|
String |
getHostAddress()
Returns the IP address string in textual presentation.
|
String |
getHostName()
Gets the host name for this IP address.
|
PacketDeliverer |
getPacketDeliverer()
Returns the packet deliverer to use when delivering a packet over the socket fails.
|
boolean |
isCompressed()
Returns true if the connection is using compression.
|
boolean |
isSecure()
Returns true if this connection is secure.
|
void |
reinit(LocalSession session)
Reinitializes the connection to switch to a different session.
|
void |
systemShutdown()
Notification message indicating that the server is being shutdown.
|
boolean |
validate()
Verifies that the connection is still live.
|
addCompression, close, getCompressionPolicy, getLocalCertificates, getMajorXMPPVersion, getMinorXMPPVersion, getPeerCertificates, getTlsPolicy, init, isClosed, isFlashClient, isUsingSelfSignedCertificate, registerCloseListener, removeCloseListener, setCompressionPolicy, setFlashClient, setTlsPolicy, setUsingSelfSignedCertificate, setXMPPVersion, startCompression, startTLS, startTLSpublic WebSocketConnection(XmppWebSocket socket, InetSocketAddress remotePeer)
public void closeVirtualConnection()
VirtualConnectioncloseVirtualConnection in class VirtualConnectionpublic byte[] getAddress()
ConnectionInetAddress
object. The result is in network byte order: the highest order
byte of the address is in getAddress()[0].public String getHostAddress()
Connectionpublic String getHostName()
ConnectionIf this InetAddress was created with a host name,
this host name will be remembered and returned;
otherwise, a reverse name lookup will be performed
and the result will be returned based on the system
configured name lookup service. If a lookup of the name service
is required, call
getCanonicalHostName.
If there is a security manager, its
checkConnect method is first called
with the hostname and -1
as its arguments to see if the operation is allowed.
If the operation is not allowed, it will return
the textual representation of the IP address.
InetAddress.getCanonicalHostName(),
SecurityManager.checkConnect(java.lang.String, int)public void systemShutdown()
Connectionpublic void deliver(org.xmpp.packet.Packet packet)
throws UnauthorizedException
Connectionsocket.send(packet.getWriteBuffer()).packet - the packet to deliver.UnauthorizedException - if a permission error was detected.public void deliverRawText(String text)
ConnectionConnection.deliver(org.xmpp.packet.Packet).This method avoids having to get the writer of this connection and mess directly with the writer. Therefore, this method ensures a correct delivery of the stanza even if other threads were sending data concurrently.
text - the XML stanzas represented kept in a String.public boolean validate()
Connectionvalidate in interface Connectionvalidate in class VirtualConnectionpublic boolean isSecure()
ConnectionisSecure in interface ConnectionisSecure in class VirtualConnectionpublic PacketDeliverer getPacketDeliverer()
ConnectiongetPacketDeliverer in interface ConnectiongetPacketDeliverer in class VirtualConnectionpublic ConnectionConfiguration getConfiguration()
Connectionpublic boolean isCompressed()
ConnectionisCompressed in interface ConnectionisCompressed in class VirtualConnectionpublic void reinit(LocalSession session)
Connectionreinit in interface Connectionreinit in class VirtualConnectionsession - The new session now owning the connection.Copyright © 2003-2008 Jive Software.