|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.relayirc.chatengine.ChatEngine
Manages a connection to an IRC server and handles incoming messages by creating channel objects, routing messages to channel objects and routing events to chat engine listeners.
After you have constructed a chat engine, add a ChatEngineListener to be notified of server connection and disconnection, channel joins and parts and status messages from the engine. Connect to the chat server using the connect() method and use the sendJoin() and sendPart() commands to join and leave chat channels. When a channel is joined, your listener will be informed and you may add a ChannelListener to the channel object so that you can repond to messages, bans, kicks, etc. from that channel.
ChatEngineListener
,
Server
,
Channel
,
IdentServer
,
ChannelSearch
,
IChatApp
,
IRCConnection
,
IRCConnectionListener
Constructor Summary | |
ChatEngine(java.lang.String serverName,
int serverPort,
java.lang.String nick,
java.lang.String altNick,
java.lang.String userName,
java.lang.String fullName)
Construct a chat engine by specifying server name, server port and user logon parameters. |
Method Summary | |
void |
addChatEngineListener(ChatEngineListener listener)
Add a chat engine listener. |
void |
connect()
Connect to IRC server that was specified in the constructor. |
void |
disconnect()
Disconnect from server by sending a QUIT to the server, closing the socket to the server and then waiting for the message loop thread to die. |
void |
fireStatusEvent(java.lang.String msg)
Send status message to all ChatEngineListeners. |
java.lang.String |
getAppName()
Get app name to be reported to version queries. |
java.lang.String |
getAppVersion()
Get app version to be reported to version queries. |
java.lang.String |
getNick()
Get nick name currently in use |
boolean |
isConnected()
Check connection status and returns true if connected. |
boolean |
isConnecting()
Check connection status and returns true if engine is in the process of connecting |
void |
processUserInput(java.lang.String txt,
java.lang.String chan)
Processes text entered by the user within a channel. |
void |
removeChatEngineListener(ChatEngineListener listener)
Remove a chat engine listener. |
void |
sendCommand(java.lang.String str)
Send command string directly to server |
void |
sendJoin(Channel chan)
Join specified channel by sending JOIN command to IRC server, adding channel object to engine's channel collection and notifying listeners of channel join. |
void |
sendJoin(java.lang.String name)
Join specified channel by sending a JOIN command to the IRC server creating a new channel object and notifying listeners of channel join. |
void |
sendMessage(java.lang.String str,
java.lang.String chan)
Deprecated. Use Channel.privMsg() instead. |
void |
sendPart(Channel chan)
Send channel part, notify listeners and remove channel. |
void |
sendPart(java.lang.String chanName)
Send channel part, notify listeners and remove channel. |
void |
sendQuit(java.lang.String str)
Send quit message to server. |
void |
sendVersion(java.lang.String user)
Send version information to server |
void |
setAppName(java.lang.String name)
Set app name to be reported to version queries. |
void |
setAppVersion(java.lang.String version)
Set app verion to be reported to version queries. |
void |
startChannelSearch(ChannelSearch search)
Start a channel search using the specified channel search object. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public ChatEngine(java.lang.String serverName, int serverPort, java.lang.String nick, java.lang.String altNick, java.lang.String userName, java.lang.String fullName)
serverName
- IRC chat server hostname (e.g. irc.mindspring.com).serverPort
- IRC chat server port (e.g. 6667).altNick
- Alternate nicknameuserName
- User's UNIX login namefullName
- User's real nameMethod Detail |
public void addChatEngineListener(ChatEngineListener listener)
public void removeChatEngineListener(ChatEngineListener listener)
public java.lang.String getAppName()
public void setAppName(java.lang.String name)
public java.lang.String getAppVersion()
public void setAppVersion(java.lang.String version)
public boolean isConnected()
public boolean isConnecting()
public java.lang.String getNick()
public void connect()
public void disconnect()
public void fireStatusEvent(java.lang.String msg)
public void processUserInput(java.lang.String txt, java.lang.String chan)
public void sendCommand(java.lang.String str)
public void sendJoin(Channel chan)
public void sendJoin(java.lang.String name)
public void sendMessage(java.lang.String str, java.lang.String chan)
public void sendPart(Channel chan)
public void sendPart(java.lang.String chanName)
public void sendVersion(java.lang.String user)
public void sendQuit(java.lang.String str)
public void startChannelSearch(ChannelSearch search)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |