public interface IClient
| Modifier and Type | Interface and Description |
|---|---|
static class |
IClient.ListenerCommand
Start or stop listening to events.
|
| Modifier and Type | Method and Description |
|---|---|
void |
closeConnection()
Closes the connection with the message server.
|
boolean |
isConnected() |
void |
listenToTheDm(IClient.ListenerCommand command)
Configures the listener for messages from the DM.
|
void |
openConnection()
Opens a connection with the message server.
|
void |
sendMessageToTheDm(Message message)
Sends a message to the DM.
|
void |
setMessageQueue(LinkedBlockingQueue<Message> messageQueue)
Sets the message queue where the client can store the messages to process.
|
void |
setParameters(String messageServerIp,
String messageServerUsername,
String messageServerPassword)
Sets the connection parameters.
|
void setParameters(String messageServerIp, String messageServerUsername, String messageServerPassword)
messageServerIp - the IP address of the messaging servermessageServerUsername - the user name to connect to the servermessageServerPassword - the password to connect to the servervoid setMessageQueue(LinkedBlockingQueue<Message> messageQueue)
messageQueue - the message queueboolean isConnected()
void openConnection()
throws IOException
IOExceptionvoid closeConnection()
throws IOException
There is no need to check isConnected() before invoking this method.
IOExceptionvoid sendMessageToTheDm(Message message) throws IOException
message - the message to sendIOException - if something went wrongvoid listenToTheDm(IClient.ListenerCommand command) throws IOException
command - IClient.ListenerCommand.START to stop listening, IClient.ListenerCommand.STOP to stop listeningIOException - if something went wrongCopyright © 2015. All rights reserved.