|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.web_visage.ichat.IChatServiceBot
public class IChatServiceBot
iChat service bot framework.
Implements basic iChat bot operations (such as connect, disconnect, refresh etc.) and provides subscription-based possibility to handle all kind of messages received during the session.
The general iChat client lifecycle looks like this:
Constructor Summary | |
---|---|
IChatServiceBot(IChatBotProperties aProperties,
IChatMessageFactory messageFactory)
Constructor. |
Method Summary | |
---|---|
void |
addAlertMessageListener(AlertMessageListener aListener)
Registers the "alert" message listener. |
void |
addBoardMessageListener(BoardMessageListener aListener)
Registers the "board" message listener. |
void |
addBroadcastMessageListener(BroadcastMessageListener aListener)
Registers the private broadcast message listener. |
void |
addConnectListener(ConnectListener aListener)
Registers connect event listener. |
void |
addConnectMessageListener(ConnectMessageListener aListener)
Registers connect message listener. |
void |
addCreateLineMessageListener(CreateLineMessageListener aListener)
Registers the "create line" message listener. |
void |
addCreateMessageListener(CreateMessageListener aListener)
Registers create message listener. |
void |
addDisconnectListener(DisconnectListener aListener)
Registers disconnect event listener. |
void |
addDisconnectMessageListener(DisconnectMessageListener aListener)
Registers disconnect message listener. |
void |
addMeMessageListener(MeMessageListener aListener)
Registers the "me" message listener. |
void |
addPrivateMessageListener(PrivateMessageListener aListener)
Registers the private message listener. |
void |
addPublicMessageListener(PublicMessageListener aListener)
Registers public message listener. |
void |
addReceivedMessageListener(ReceivedMessageListener aListener)
Registers the "received" message listener. |
void |
addRefreshBoardMessageListener(RefreshBoardMessageListener aListener)
Registers the "refresh board" message listener. |
void |
addRefreshMessageListener(RefreshMessageListener aListener)
Registers refresh message listener. |
void |
addRenameMessageListener(RenameMessageListener aListener)
Registers disconnect message listener. |
void |
addShutdownListener(ShutdownListener aListener)
Registers disconnect event listener. |
void |
addStatusMessageListener(StatusMessageListener aListener)
Registers the "status" message listener. |
void |
addStatusReqMesageListener(StatusReqMessageListener aListener)
Registers STATUS message listener. |
void |
connect()
Connects to the iChat server specified in the properties. |
void |
disconnect()
Disconnects the bot from a server. |
java.util.List |
getAlertMessageListeners()
Returns the alertMessageListeners. |
java.util.List |
getBoardMessageListeners()
Returns the boardMessageListeners. |
java.util.List |
getBroadcastMessageListeners()
Returns the private broadcast message listeners. |
java.util.List |
getCreateLineMessageListeners()
Returns the createLineMessageListeners. |
java.util.List |
getCreateMessageListeners()
Returns the createMessageListeners. |
java.util.List |
getMeMessageListeners()
Returns the meMessageListeners. |
int |
getMessageId()
Generates message id. |
IChatBotProperties |
getProperties()
|
java.util.List |
getReceivedMessageListeners()
Returns the receivedMessageListeners. |
java.util.List |
getRefreshBoardMessageListeners()
Returns the refreshBoardMessageListeners. |
IChatSender |
getSender()
Returns sender object based on a properties values. |
java.util.List |
getStatusMessageListeners()
Returns the statusMessageListeners. |
IChatUserList |
getUserList()
Returns the userList. |
java.util.Map |
getUsers()
Returns the current user list map. |
boolean |
isConnected()
Checks whether the bot is connected to a server. |
boolean |
isConnecting()
Checks whether the bot is being connecting. |
boolean |
isDisconnected()
Checks whether the bot is disconnected. |
boolean |
isDisconnecting()
Checks whether the bot is being disconnected. |
boolean |
isOnline()
Checks whether the bot is online. |
boolean |
isShuttingDown()
Checks whether the bot is being shut down. |
void |
processConnectMessage(IChatConnectMessage aMessage)
Adds a user to the user list and sends him a refresh message. |
void |
processDisconnectMessage(IChatDisconnectMessage aMessage,
IChatUserInfo aUserInfo)
Handles the DISCONNECT message. |
void |
processRefreshMessage(IChatRefreshMessage aMessage)
Handle REFRESH message |
void |
processRenameMessage(IChatRenameMessage aMessage,
java.lang.String anOldNickname)
Handles rename message. |
void |
processStatusMessage(IChatStatusMessage aMessage)
Handles the iChat "status" message. |
void |
removeAlertMessageListener(AlertMessageListener aListener)
Unregisters the "alert" message listener. |
void |
removeBoardMessageListener(BoardMessageListener aListener)
Unregisters the "board" message listener. |
void |
removeBroadcastMessageListener(BroadcastMessageListener aListener)
Unregisters the private broadcast message listener. |
void |
removeConnectListener(ConnectListener aListener)
Unregisters given connect event listener. |
void |
removeConnectMessageListener(ConnectMessageListener aListener)
Unregisters connect message listener. |
void |
removeCreateLineMessageListener(CreateLineMessageListener aListener)
Unregisters the "create line" message listener. |
void |
removeCreateMessageListener(CreateMessageListener aListener)
Unregisters create message listener. |
void |
removeDisconnectListener(DisconnectListener aListener)
Unregisters given disconnect event listener. |
void |
removeDisconnectMessageListener(DisconnectMessageListener aListener)
Unregisters disconnect message listener. |
void |
removeMeMessageListener(MeMessageListener aListener)
Unregisters the "me" message listener. |
void |
removePrivateMessageListener(PrivateMessageListener aListener)
Unregisters the private message listener. |
void |
removePublicMessageListener(PublicMessageListener aListener)
Unregisters public message listener. |
void |
removeReceivedMessageListener(ReceivedMessageListener aListener)
Unregisters the "received" message listener. |
void |
removeRefreshBoardMessageListener(RefreshBoardMessageListener aListener)
Unregisters the "refresh board" message listener. |
void |
removeRefreshMessageListener(RefreshMessageListener aListener)
Unregisters refresh message listener. |
void |
removeRenameMessageListener(RenameMessageListener aListener)
Unregisters disconnect message listener. |
void |
removeShutdownListener(ShutdownListener aListener)
Unregisters given shutdown event listener. |
void |
removeStatusMessageListener(StatusMessageListener aListener)
Unregisters the "status" message listener. |
void |
removeStatusReqMesageListener(StatusReqMessageListener aListener)
Unregisters STATUS message listener. |
void |
sendMessage(IChatMessage aMessage,
java.lang.String aReceiver)
Sends a message to the server. |
void |
shutdown()
Attepts to perform smooth shutdown, infoming all other clients about our disconnection. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IChatServiceBot(IChatBotProperties aProperties, IChatMessageFactory messageFactory)
aProperties
- -
bot's propertiesmessageFactory
- Method Detail |
---|
public void addAlertMessageListener(AlertMessageListener aListener)
aListener
- public void addBoardMessageListener(BoardMessageListener aListener)
aListener
- public void addBroadcastMessageListener(BroadcastMessageListener aListener)
aListener
- public void addConnectListener(ConnectListener aListener)
aListener
- public void addConnectMessageListener(ConnectMessageListener aListener)
aListener
- public void addCreateLineMessageListener(CreateLineMessageListener aListener)
aListener
- public void addCreateMessageListener(CreateMessageListener aListener)
aListener
- public void addDisconnectListener(DisconnectListener aListener)
aListener
- public void addShutdownListener(ShutdownListener aListener)
aListener
- public void addDisconnectMessageListener(DisconnectMessageListener aListener)
aListener
- public void addMeMessageListener(MeMessageListener aListener)
aListener
- public void addPrivateMessageListener(PrivateMessageListener aListener)
aListener
- public void addPublicMessageListener(PublicMessageListener aListener)
aListener
- public void addReceivedMessageListener(ReceivedMessageListener aListener)
aListener
- public void addRefreshBoardMessageListener(RefreshBoardMessageListener aListener)
aListener
- public void addRefreshMessageListener(RefreshMessageListener aListener)
aListener
- public void addRenameMessageListener(RenameMessageListener aListener)
aListener
- public void addStatusMessageListener(StatusMessageListener aListener)
aListener
- public void addStatusReqMesageListener(StatusReqMessageListener aListener)
aListener
- public void connect() throws java.net.UnknownHostException, java.io.IOException, java.security.NoSuchAlgorithmException, javax.crypto.NoSuchPaddingException, java.security.InvalidKeyException, IChatException
java.net.UnknownHostException
java.io.IOException
java.security.NoSuchAlgorithmException
javax.crypto.NoSuchPaddingException
java.security.InvalidKeyException
IChatException
public final boolean isOnline()
public final boolean isDisconnecting()
public final boolean isConnecting()
public final boolean isDisconnected()
public final boolean isShuttingDown()
public void shutdown()
public void disconnect()
java.io.IOException
public java.util.List getAlertMessageListeners()
public java.util.List getBoardMessageListeners()
public java.util.List getBroadcastMessageListeners()
public java.util.List getCreateLineMessageListeners()
public java.util.List getCreateMessageListeners()
public java.util.List getMeMessageListeners()
public int getMessageId()
public IChatBotProperties getProperties()
public java.util.List getReceivedMessageListeners()
public java.util.List getRefreshBoardMessageListeners()
public IChatSender getSender()
public java.util.List getStatusMessageListeners()
public IChatUserList getUserList()
public java.util.Map getUsers()
public boolean isConnected()
public void processConnectMessage(IChatConnectMessage aMessage)
processConnectMessage
in interface ConnectMessageListener
ConnectMessageListener.processConnectMessage(IChatConnectMessage)
public void processDisconnectMessage(IChatDisconnectMessage aMessage, IChatUserInfo aUserInfo)
DisconnectMessageListener
processDisconnectMessage
in interface DisconnectMessageListener
aUserInfo
- -
an information about the user being disconnected. Can be
null
in case of "precautios" disconnect
messages.DisconnectMessageListener.processDisconnectMessage(IChatDisconnectMessage,
com.web_visage.ichat.IChatUserInfo)
public void processRefreshMessage(IChatRefreshMessage aMessage)
RefreshMessageListener
processRefreshMessage
in interface RefreshMessageListener
RefreshMessageListener.processRefreshMessage(IChatRefreshMessage)
public void processRenameMessage(IChatRenameMessage aMessage, java.lang.String anOldNickname)
RenameMessageListener
processRenameMessage
in interface RenameMessageListener
anOldNickname
- -
the old user's nicknameRenameMessageListener.processRenameMessage(IChatRenameMessage,
java.lang.String)
public void processStatusMessage(IChatStatusMessage aMessage)
StatusMessageListener
processStatusMessage
in interface StatusMessageListener
StatusMessageListener.processStatusMessage(IChatStatusMessage)
public void removeAlertMessageListener(AlertMessageListener aListener)
aListener
- public void removeBoardMessageListener(BoardMessageListener aListener)
aListener
- public void removeBroadcastMessageListener(BroadcastMessageListener aListener)
aListener
- public void removeConnectListener(ConnectListener aListener)
aListener
- public void removeConnectMessageListener(ConnectMessageListener aListener)
aListener
- public void removeCreateLineMessageListener(CreateLineMessageListener aListener)
aListener
- public void removeCreateMessageListener(CreateMessageListener aListener)
aListener
- public void removeDisconnectListener(DisconnectListener aListener)
aListener
- public void removeShutdownListener(ShutdownListener aListener)
aListener
- public void removeDisconnectMessageListener(DisconnectMessageListener aListener)
aListener
- public void removeMeMessageListener(MeMessageListener aListener)
aListener
- public void removePrivateMessageListener(PrivateMessageListener aListener)
aListener
- public void removePublicMessageListener(PublicMessageListener aListener)
aListener
- public void removeReceivedMessageListener(ReceivedMessageListener aListener)
aListener
- public void removeRefreshBoardMessageListener(RefreshBoardMessageListener aListener)
aListener
- public void removeRefreshMessageListener(RefreshMessageListener aListener)
aListener
- public void removeRenameMessageListener(RenameMessageListener aListener)
aListener
- public void removeStatusMessageListener(StatusMessageListener aListener)
aListener
- public void removeStatusReqMesageListener(StatusReqMessageListener aListener)
aListener
- public void sendMessage(IChatMessage aMessage, java.lang.String aReceiver)
aMessage
- aReceiver
-
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |