|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
com.vwp.net.irc.IRC
public class IRC
This is the base class which has to be used for an IRC connection. All other classes of this package are called from this one and don't have to be used in an other way. One exception is Ident, it can be used separately for establishing an ident server.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
static int |
DATA_IDENTERROR_STRING
Data code: an error information form the ident server |
static int |
DATA_KICKUSER_STRING
Data code: this identifier is used in pipeMiscData() to pipe a name of a user which was kicked to the main program |
static int |
DATA_NEWUSER_STRING
Data code: this identifier is used in pipeMiscData() to pipe a new username to the main program |
static int |
DATA_REMUSER_STRING
Data code: this identifier is used in pipeMiscData() to pipe a name of a user which leaves to the main program |
static int |
DATA_TOPIC_STRING
Data code: this identifier is used in pipeMiscData() to pipe the actual topic |
static int |
DATA_USERLIST_VECTOR
Data code: this identifier is used in pipeMiscData() to pipe the UserList Vector to the main program |
static int |
ERR_BANNED
Error code: own user was banned from the channel |
static int |
ERR_CHANNEL_LEFT
Error code: own user has left the channel (e.g. he was kicked) |
static int |
ERR_COULD_NOT_CONNECT
Error code: connection to IRC server failed |
static int |
ERR_COULD_NOT_LOGIN
Error code: could not log into using this username and channel |
static int |
ERR_INVITE_ONLY
Error code: the specified channel is invite only |
static int |
ERR_KICKED
Error code: own user was kicked from the channel |
static int |
ERR_LINK_CLOSED
Error code: link closed from IRC network |
static int |
ERR_NOSUCHUSER
Error code: the specified user doesn't exists |
static int |
ERR_REQUIRES_KEYWORD
Error code: a keyword is required to enter the specified channel |
static int |
SUCC_CHANNEL_ENTERED
Return code: the IRC was entered successfully |
static int |
SUCC_CHANNEL_JOINED
Return code: the channel was joined successfully |
static int |
SUCC_CHANNEL_LEFT
Return code: actual channel left |
static int |
SUCC_LOGGED_IN
Return code: logged in successfully |
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
IRC(java.lang.String Server,
short Port,
java.lang.String Channel,
java.lang.String Username,
java.lang.String Realname,
MessagePipe TextOut,
boolean retryOtherNicks,
java.lang.String DisconnectInfo)
The default constructor for an IRC object. |
|
| Method Summary | |
|---|---|
void |
disconnect()
This method leaves the actual IRC channel, disconnects from the server and closes all connections immediately. |
java.lang.String |
getChannelName()
This method returns the name of the IRC channel this object already uses. |
java.lang.String |
getServerName()
This method returns the name of the IRC server this object already uses. |
void |
leaveChannel(java.lang.String reason)
This method sends a channel-left message to the actual IRC channel and leaves it, it should be called before disconnectiong |
void |
run()
|
void |
sendChatText(java.lang.String Text)
This method has to be used to send chat texts to the actual channel. |
void |
sendWhisperText(java.lang.String Text,
java.lang.String TargetUser)
This method has to be used to send private chat texts to a specific user. |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int ERR_COULD_NOT_CONNECT
public static final int ERR_COULD_NOT_LOGIN
public static final int ERR_LINK_CLOSED
public static final int ERR_CHANNEL_LEFT
public static final int ERR_BANNED
public static final int ERR_KICKED
public static final int ERR_NOSUCHUSER
public static final int ERR_REQUIRES_KEYWORD
public static final int ERR_INVITE_ONLY
public static final int SUCC_LOGGED_IN
public static final int SUCC_CHANNEL_LEFT
public static final int SUCC_CHANNEL_ENTERED
public static final int SUCC_CHANNEL_JOINED
public static final int DATA_USERLIST_VECTOR
public static final int DATA_NEWUSER_STRING
public static final int DATA_REMUSER_STRING
public static final int DATA_KICKUSER_STRING
public static final int DATA_TOPIC_STRING
public static final int DATA_IDENTERROR_STRING
| Constructor Detail |
|---|
public IRC(java.lang.String Server,
short Port,
java.lang.String Channel,
java.lang.String Username,
java.lang.String Realname,
MessagePipe TextOut,
boolean retryOtherNicks,
java.lang.String DisconnectInfo)
Server - the name of the IRC server which has to be usedPort - the port number for the IRC connectionChannel - the name of the IRC channel, this name requires a leading
"#" as known from the IRC channel namesUsername - the user- or nickname to log into the IRC network withRealname - the realname of the user which can be read using a "whois"
requestTextOut - a MessagePipe which is used for the communication with the
calling instance; this MessagePipe transfers all chat texts, error
codes, information messages and so onretryOtherNicks - if this parameter is set to true and the given
Username already exists in IRC, it is tried to log in using other
nicknames. These other names are constructed by appending the
numbers from 1..9 to the given Username. If all these other
nicknames aren't available too, the log in process failsDisconnectInfo - a string which is displayed whenever the user leaves
a channel. This string is used every time the connection has to be
disconnected automatically. For an external triggered disconnect
a separate reason can be specified.| Method Detail |
|---|
public java.lang.String getServerName()
public java.lang.String getChannelName()
public void run()
run in interface java.lang.Runnablerun in class java.lang.Threadpublic void sendChatText(java.lang.String Text)
Text - the text which has to be sent to the channel
public void sendWhisperText(java.lang.String Text,
java.lang.String TargetUser)
Text - the text which has to be sent to the userTargetUser - the name of the user which has to receive the textpublic void leaveChannel(java.lang.String reason)
reason - this text is displayed when the user leaves the IRC channelpublic void disconnect()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||