|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.ircappender.impl.IrcConnection
public class IrcConnection
a very simple IRC bot
| Constructor Summary | |
|---|---|
IrcConnection(java.lang.String server,
int port,
boolean ssl,
java.lang.String user,
java.lang.String password,
java.lang.String nick,
java.lang.String channel)
create a new IRC bot |
|
| Method Summary | |
|---|---|
void |
connect()
connects to the specified IRC server |
void |
disconnect()
disconnects from the IRC server. |
boolean |
isChannelEmpty()
checks whether the channel is empty |
boolean |
isRunning()
Returns the running state of the thread |
void |
login()
logs in to IRC |
void |
onChannelJoined()
starts the forwarder thread |
void |
onNickAccepted()
handles the acceptance of the nick name. |
void |
onNickInUse()
picks a different nickname |
void |
sendMessage(java.lang.String target,
java.lang.String message)
sends a message to a channel or nickname |
void |
setDebug(boolean debug)
Sets the debug flag |
void |
setEventQueue(Fifo eventQueue)
Sets the event queue. |
void |
setMessageDelay(long messageDelay)
Sets the message delay |
void |
setRunning(boolean isRunning)
Sets the isRunning. |
void |
waitForForwardThreadToFinish()
waits for the forwarder thread to finish |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IrcConnection(java.lang.String server,
int port,
boolean ssl,
java.lang.String user,
java.lang.String password,
java.lang.String nick,
java.lang.String channel)
server - the irc serverport - the irc portssl - use SSL securityuser - username of botpassword - password of botnick - nickname of botchannel - channel to join| Method Detail |
|---|
public void connect()
throws java.net.UnknownHostException,
java.io.IOException
java.net.UnknownHostException - in case of an invalid irc server name
java.io.IOException - in case of an unexpected input/output errorpublic void disconnect()
public boolean isChannelEmpty()
public boolean isRunning()
public void login()
public void onChannelJoined()
public void onNickAccepted()
public void onNickInUse()
public void sendMessage(java.lang.String target,
java.lang.String message)
target - channel or nickname to send tomessage - message to sendpublic void setDebug(boolean debug)
debug - debug flagpublic void setEventQueue(Fifo eventQueue)
eventQueue - The event queue to setpublic void setMessageDelay(long messageDelay)
messageDelay - The message delay to setpublic void setRunning(boolean isRunning)
isRunning - The isRunning to setpublic void waitForForwardThreadToFinish()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||