|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjerklib.tasks.TaskImpl
jerklib.util.NickServAuthPlugin
public class NickServAuthPlugin
A Task to identify with NickServ and then join a list of channels names. Once the Task has succsessfully identifed with NickServ TaskCompletion Listeners will be notified with a true Boolean object.
If 40 seconds passes and the mode event to indicate ident success has not been received, TaskCompletion Listeners will be notified with a false Boolean object.
This plugin assumes Nickserv responds to the following syntax
"identify password"
To cancel this Task call cancel()
To Use This Task: You must use onEvent(Task , Type ... type) to add the Task You must pass Type.CONNECT_COMPLETE and Type.MODE_EVENT. Example of adding the Task:
session.onEvent(auth, Type.CONNECT_COMPLETE , Type.MODE_EVENT);
Example Code:
final NickServAuthPlugin auth = new NickServAuthPlugin ( "letmein", //password 'e', //mode char that indicates success session, //session Arrays.asList("#jerklib" , "##swing") // list of channels to join on success ); auth.addTaskListener(new TaskCompletionListener() { public void taskComplete(Object result) { if(result.equals(new Boolean(false))) { conman.quit(); } else { System.out.println("Authed!"); } } }); session.onEvent(auth, Type.CONNECT_COMPLETE , Type.MODE_EVENT);
Session.onEvent(jerklib.tasks.Task, jerklib.events.IRCEvent.Type...)
,
IRCEvent.Type
Constructor Summary | |
---|---|
NickServAuthPlugin(String pass,
char identMode,
Session session,
List<String> channels)
|
Method Summary | |
---|---|
void |
receiveEvent(IRCEvent e)
recieveEvent() - receive IRCEvents |
Methods inherited from class jerklib.tasks.TaskImpl |
---|
addTaskListener, cancel, getName, getTaskListeners, isCanceled, removeTaskListener |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NickServAuthPlugin(String pass, char identMode, Session session, List<String> channels)
pass
- - nickserv passwordidentMode
- - mode that indicates ident successsession
- - Session this Task is attatched tochannels
- - A list of channel names to join on ident successMethod Detail |
---|
public void receiveEvent(IRCEvent e)
IRCEventListener
e
- IRCEvent the event
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |