|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.schwering.irc.lib.IRCEventAdapter
Adapts the events of the IRCEventListener
interface.
Supported events:
For other, unkown events there's the unknown
-method.
IRCEventListener
Field Summary |
Constructor Summary | |
IRCEventAdapter()
The default and only constructor does nothing. |
Method Summary | |
void |
onDisconnected()
Fired when the own connection is broken. |
void |
onError(int num,
java.lang.String msg)
Fired when a numeric error is received. |
void |
onError(java.lang.String msg)
Fired when an ERROR command is received. |
void |
onInvite(java.lang.String chan,
IRCUser user,
java.lang.String passiveNick)
Fired when somebody is invited to a channel. |
void |
onJoin(java.lang.String chan,
IRCUser user)
Fired when somebody joins a channel. |
void |
onKick(java.lang.String chan,
IRCUser user,
java.lang.String passiveNick,
java.lang.String msg)
Fired when somebody is kicked from a channel. |
void |
onMode(IRCUser user,
java.lang.String passiveNick,
java.lang.String mode)
Fired when somebody changes somebody's usermodes. |
void |
onMode(java.lang.String chan,
IRCUser user,
IRCModeParser modeParser)
Fired when an operator changes the modes of a channel. |
void |
onNick(IRCUser user,
java.lang.String newNick)
Fired when somebody changes his nickname successfully. |
void |
onNotice(java.lang.String target,
IRCUser user,
java.lang.String msg)
Fired when somebody sends a NOTICE to a user or a group. |
void |
onPart(java.lang.String chan,
IRCUser user,
java.lang.String msg)
Fired when somebody parts from a channel. |
void |
onPing(java.lang.String ping)
Fired when a PING comes in.
|
void |
onPrivmsg(java.lang.String target,
IRCUser user,
java.lang.String msg)
Fired when a user sends a PRIVMSG to a user or to a
group. |
void |
onQuit(IRCUser user,
java.lang.String msg)
Fired when somebody quits from the network. |
void |
onRegistered()
Fired when the own connection is successfully established. |
void |
onReply(int num,
java.lang.String value,
java.lang.String msg)
Fired when a numeric reply is received. |
void |
onTopic(java.lang.String chan,
IRCUser user,
java.lang.String topic)
Fired when the topic is changed by operators. |
void |
unknown(java.lang.String prefix,
java.lang.String command,
java.lang.String middle,
java.lang.String trailing)
This event is fired when the incoming line can not be identified as a known event. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public IRCEventAdapter()
Method Detail |
public void onRegistered()
NOTICE
s. And if your nickname is invalid or in use or
anything else is wrong with your nickname, it asks you for a new one.
onRegistered
in interface IRCEventListener
public void onDisconnected()
onDisconnected
in interface IRCEventListener
public void onError(java.lang.String msg)
ERROR
command is received.
onError
in interface IRCEventListener
msg
- The message of the error.public void onError(int num, java.lang.String msg)
msg
's format is different for every reply. All replies'
formats are described in the IRCUtil
.
onError
in interface IRCEventListener
num
- The identifier (usually a 3-digit number).msg
- The message of the error.public void onInvite(java.lang.String chan, IRCUser user, java.lang.String passiveNick)
onInvite
in interface IRCEventListener
chan
- The channel the user is invited to.user
- The user who invites another. Contains nick, username and host.passiveNick
- The nickname of the user who is invited by another user
(passive).public void onJoin(java.lang.String chan, IRCUser user)
onJoin
in interface IRCEventListener
chan
- The channel the person joins.user
- The user who joins. Contains nick, username and host.public void onKick(java.lang.String chan, IRCUser user, java.lang.String passiveNick, java.lang.String msg)
onKick
in interface IRCEventListener
chan
- The channel somebody is kicked from.user
- The user who kicks another user from a channel.
Contains nick, username and host.passiveNick
- The nickname of the user who is kicked from a channel
(passive).msg
- The message the active user has set. This is ""
if
no message was set.public void onMode(java.lang.String chan, IRCUser user, IRCModeParser modeParser)
onMode
in interface IRCEventListener
chan
- The channel in which the modes are changed.user
- The user who changes the modes.
Contains nick, username and host.modeParser
- The IRCModeParser
object which contains the
parsed information about the modes which are changed.public void onMode(IRCUser user, java.lang.String passiveNick, java.lang.String mode)
onMode
in interface IRCEventListener
user
- The user who changes the modes of another user or himself.
Contains nick, username and host.passiveNick
- The nickname of the person whose modes are changed by
another user or himself.mode
- The changed modes which are set.public void onNick(IRCUser user, java.lang.String newNick)
onNick
in interface IRCEventListener
user
- The user who changes his nickname.
Contains nick, username and host.newNick
- The new nickname of the user who changes his nickname.public void onNotice(java.lang.String target, IRCUser user, java.lang.String msg)
NOTICE
to a user or a group.
onNotice
in interface IRCEventListener
target
- The channel or nickname the user sent a NOTICE
to.user
- The user who notices another person or a group.
Contains nick, username and host.msg
- The message.public void onPart(java.lang.String chan, IRCUser user, java.lang.String msg)
onPart
in interface IRCEventListener
chan
- The channel somebody parts from.user
- The user who parts from a channel.
Contains nick, username and host.msg
- The part-message which is optionally.
If it's empty, msg is ""
.public void onPing(java.lang.String ping)
PING
comes in.
The IRC server tests in different periods if the client is still there by
sending PING <ping>. The client must response PONG <ping>.
onPing
in interface IRCEventListener
ping
- The ping which is received from the server.public void onPrivmsg(java.lang.String target, IRCUser user, java.lang.String msg)
PRIVMSG
to a user or to a
group.
onPrivmsg
in interface IRCEventListener
target
- The channel or nickname the user sent a PRIVMSG
to.user
- The user who sent the PRIVMSG
.
Contains nick, username and host.msg
- The message the user transmits.public void onQuit(IRCUser user, java.lang.String msg)
onQuit
in interface IRCEventListener
user
- The user who quits. Contains nick, username and host.msg
- The optional message. ""
if no message is set by
the user.public void onReply(int num, java.lang.String value, java.lang.String msg)
WHOIS
queries are answered by the server with
numeric replies.
The msg
's format is different for every reply. All replies'
formats are described in the IRCUtil
.
The first word in the value
is always your own nickname!
onReply
in interface IRCEventListener
num
- The numeric reply.value
- The first part of the message.msg
- The main part of the message.public void onTopic(java.lang.String chan, IRCUser user, java.lang.String topic)
onReply
when you join a channel.
onTopic
in interface IRCEventListener
chan
- The channel where the topic is changed.user
- The user who changes the topic.
Contains nick, username and host.topic
- The new topic.public void unknown(java.lang.String prefix, java.lang.String command, java.lang.String middle, java.lang.String trailing)
unknown
in interface IRCEventListener
prefix
- The prefix of the incoming line.command
- The command of the incoming line.middle
- The part until the colon (:
).trailing
- The part behind the colon (:
).
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |