|
Wildfire 3.2.4 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Connection
Represents a connection on the server.
Nested Class Summary | |
---|---|
static class |
Connection.CompressionPolicy
Enumeration of possible compression policies required to interact with the server. |
static class |
Connection.TLSPolicy
Enumeration of possible TLS policies required to interact with the server. |
Method Summary | |
---|---|
void |
close()
Close this session including associated socket connection. |
void |
deliver(Packet packet)
Delivers the packet to this connection without checking the recipient. |
void |
deliverRawText(String text)
Delivers raw text to this connection. |
Connection.CompressionPolicy |
getCompressionPolicy()
Returns whether compression is optional or is disabled. |
InetAddress |
getInetAddress()
Returns the InetAddress describing the connection. |
String |
getLanguage()
Returns the language code that should be used for this connection (e.g. |
int |
getMajorXMPPVersion()
Returns the major version of XMPP being used by this connection (major_version.minor_version. |
int |
getMinorXMPPVersion()
Returns the minor version of XMPP being used by this connection (major_version.minor_version. |
PacketDeliverer |
getPacketDeliverer()
Returns the packet deliverer to use when delivering a packet over the socket fails. |
Connection.TLSPolicy |
getTlsPolicy()
Returns whether TLS is mandatory, optional or is disabled. |
void |
init(Session session)
Initializes the connection with it's owning session. |
boolean |
isClosed()
Returns true if the connection/session is closed. |
boolean |
isCompressed()
Returns true if the connection is using compression. |
boolean |
isFlashClient()
Returns true if the connected client is a flash client. |
boolean |
isSecure()
Returns true if this connection is secure. |
void |
registerCloseListener(ConnectionCloseListener listener,
Object handbackMessage)
Registers a listener for close event notification. |
void |
removeCloseListener(ConnectionCloseListener listener)
Removes a registered close event listener. |
void |
setCompressionPolicy(Connection.CompressionPolicy compressionPolicy)
Sets whether compression is enabled or is disabled. |
void |
setFlashClient(boolean flashClient)
Sets whether the connected client is a flash client. |
void |
setLanaguage(String language)
Sets the language code that should be used for this connection (e.g. |
void |
setTlsPolicy(Connection.TLSPolicy tlsPolicy)
Sets whether TLS is mandatory, optional or is disabled. |
void |
setXMPPVersion(int majorVersion,
int minorVersion)
Sets the XMPP version information. |
void |
startCompression()
Start using compression for this connection. |
void |
startTLS(boolean clientMode,
String remoteServer)
Secures the plain connection by negotiating TLS with the client. |
void |
systemShutdown()
Notification message indicating that the server is being shutdown. |
boolean |
validate()
Verifies that the connection is still live. |
Method Detail |
---|
boolean validate()
void init(Session session)
session
- the session that owns this connectionInetAddress getInetAddress() throws UnknownHostException
UnknownHostException
- if IP address of host could not be determined.void close()
void systemShutdown()
boolean isClosed()
boolean isSecure()
void registerCloseListener(ConnectionCloseListener listener, Object handbackMessage)
listener
- the listener to register for events.handbackMessage
- the object to send in the event notification.void removeCloseListener(ConnectionCloseListener listener)
listener
- the listener to deregister for close events.void deliver(Packet packet) throws UnauthorizedException
socket.send(packet.getWriteBuffer())
.
packet
- the packet to deliver.
UnauthorizedException
- if a permission error was detected.void deliverRawText(String text)
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.boolean isFlashClient()
void setFlashClient(boolean flashClient)
flashClient
- true if the if the connection is a flash client.int getMajorXMPPVersion()
int getMinorXMPPVersion()
void setXMPPVersion(int majorVersion, int minorVersion)
majorVersion
- the major version.minorVersion
- the minor version.String getLanguage()
void setLanaguage(String language)
language
- the language code.boolean isCompressed()
Connection.CompressionPolicy getCompressionPolicy()
void setCompressionPolicy(Connection.CompressionPolicy compressionPolicy)
compressionPolicy
- whether Compression is enabled or is disabled.Connection.TLSPolicy getTlsPolicy()
void setTlsPolicy(Connection.TLSPolicy tlsPolicy)
tlsPolicy
- whether TLS is mandatory, optional or is disabled.PacketDeliverer getPacketDeliverer()
void startTLS(boolean clientMode, String remoteServer) throws Exception
true
and
remoteServer is the server name of the remote server. Otherwise clientMode
will be false
and remoteServer null.
clientMode
- boolean indicating if this entity is a client or a server.remoteServer
- server name of the remote server we are connecting to or null
when not in client mode.
Exception
- if an error occured while securing the connection.void startCompression()
|
Wildfire 3.2.4 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |