public class JabberConnection extends TimeableConnection implements JabberMessageListener
listenerList| Constructor and Description |
|---|
JabberConnection(JabberSession session,
JabberMessageReceiver receiver) |
| Modifier and Type | Method and Description |
|---|---|
void |
addConnectionListener(ConnectionListener l)
adds a subscriber to listen for connection events
|
void |
addMessageListener(JabberMessageListener l) |
void |
connect(ConnectionModel cmodel)
This method is synchronous and will not return until connection is established or fails.
|
void |
disconnect()
Disconnects from the remote server
|
ConnectionModel |
getConnectionModel() |
boolean |
isConnected() |
void |
messageReceived(JabberMessageEvent event)
listens for a session init message in case it comes in before
us sending a
|
void |
removeConnectionListener(ConnectionListener l)
remove from listening to connection events
|
void |
removeMessageListener(JabberMessageListener l) |
void |
send(JabberMessage msg)
Sends a message to the server
|
void |
sendLater(java.lang.Runnable sendThread)
this works the same as send() with the exception that the message will be wrapped in a separate thread before sending
out the message.
|
fireConnectionClosed, fireConnectionEstablishedfireConnectionStarting, fireConnectionStartingWithoutVetopublic JabberConnection(JabberSession session, JabberMessageReceiver receiver)
public void disconnect()
public void connect(ConnectionModel cmodel) throws ConnectionFailedException
ConnectionFailedException - if connection is not established within the timeout periodpublic void send(JabberMessage msg) throws SendMessageFailedException
SendMessageFailedExceptionpublic void sendLater(java.lang.Runnable sendThread)
sendThread - the thread that will get run to send a messagepublic void addConnectionListener(ConnectionListener l)
ConnectionaddConnectionListener in class Connectionpublic void removeConnectionListener(ConnectionListener l)
ConnectionremoveConnectionListener in class Connectionpublic ConnectionModel getConnectionModel()
public boolean isConnected()
public void addMessageListener(JabberMessageListener l)
public void removeMessageListener(JabberMessageListener l)
public void messageReceived(JabberMessageEvent event)
messageReceived in interface JabberMessageListenerCopyright © 2001-2005 Echomine. All Rights Reserved.