|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.relayirc.chatengine.IRCConnection
A socket connection to a RFC-1459 compatible IRC server. Parses incoming IRC messages, replies, commands and errors and notifies all listeners of such. Also provides a writeln() method for sending commands to the IRC server.
FIX: Currently, only one listener is allowed.
IRCConnectionListener
,
IRCConnectionAdapter
Field Summary | |
static int |
CONNECTED
|
static int |
CONNECTING
|
static int |
DISCONNECTED
|
static int |
DISCONNECTING
|
Constructor Summary | |
IRCConnection(java.lang.String server,
int port,
java.lang.String nick,
java.lang.String altNick,
java.lang.String userName,
java.lang.String fullName)
Construct, but do not open, an IRC connection by specifying server hostname and port of a IRC server as well as user registration information. |
Method Summary | |
void |
close()
Close socket connection to IRC server and close down message loop thread. |
java.lang.String |
getNick()
Get nick name currently in use. |
int |
getState()
Get engine's state (see ChatEngine.DISCONNECTED, ChatEngine.CONNECTED, etc. |
boolean |
isConnected()
Returns true if we are connected. |
boolean |
isConnecting()
Deprecated. Use getState() instead. |
void |
open()
Opens socket connection to IRC server. |
void |
run()
The main message loop. |
void |
sendNick(java.lang.String nick)
Send change-nickname request to IRC server and save value as the nick name currently in use. |
void |
setIRCConnectionListener(IRCConnectionListener listener)
For now, only one listener is supported. |
void |
setState(int state)
Set engine's state (see ChatEngine.DISCONNECTED, ChatEngine.CONNECTED, etc. |
void |
writeln(java.lang.String message)
Write directly to the IRC chat server, refer to RFC-1459 for valid commands. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int CONNECTED
public static final int CONNECTING
public static final int DISCONNECTED
public static final int DISCONNECTING
Constructor Detail |
public IRCConnection(java.lang.String server, int port, java.lang.String nick, java.lang.String altNick, java.lang.String userName, java.lang.String fullName)
server
- DNS-resolvable hostname of server.port
- Server port number to connect to.nick
- User's IRC nick name (e.g. Mortz).userName
- User's login/user name (e.g. mps).fullName
- User's full name (e.g. Mortimer P. Snerd)Method Detail |
public int getState()
public void setState(int state)
public void open()
public void close()
public boolean isConnected()
public boolean isConnecting()
public void setIRCConnectionListener(IRCConnectionListener listener)
public java.lang.String getNick()
public void sendNick(java.lang.String nick)
public void run()
public void writeln(java.lang.String message)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |