|
Jive Messenger 2.2.2 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.
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. |
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. |
Writer |
getWriter()
Returns the Writer used to send data to the connection. |
void |
init(Session session)
Initializes the connection with it's owning session. |
boolean |
isClosed()
Returns true if the connection/session is closed. |
boolean |
isFlashClient()
Returns true if the connected client is a flash client. |
boolean |
isSecure()
Returns true if this connection is secure. |
Object |
registerCloseListener(ConnectionCloseListener listener,
Object handbackMessage)
Registers a listener for close event notification. |
Object |
removeCloseListener(ConnectionCloseListener listener)
Removes a registered close event listener. |
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
Writer getWriter()
deliver(Packet)
method should be used to send data instead of using the writer directly.
You must synchronize on the writer before writing data to it to ensure
data consistency:
Writer writer = connection.getWriter(); synchronized(writer) { // write data.... }
void close()
boolean isClosed()
boolean isSecure()
Object registerCloseListener(ConnectionCloseListener listener, Object handbackMessage)
listener
- the listener to register for events.handbackMessage
- the object to send in the event notification.
Object 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
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()
int getMajorXMPPVersion()
int getMinorXMPPVersion()
String getLanguage()
|
Jive Messenger 2.2.2 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |