|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--irc.IRCObject | +--irc.IRCServer
The IRC server.
Field Summary |
Fields inherited from class irc.IRCObject |
_ircConfiguration |
Constructor Summary | |
IRCServer(IRCConfiguration config,
java.lang.String nick,
java.lang.String altNick,
java.lang.String userName,
java.lang.String name)
Create a new IRCServer. |
Method Summary | |
void |
addIgnore(java.lang.String nick)
Ignore the given nick. |
void |
addReplyServerListener(ReplyServerListener l)
Add a reply listener. |
void |
addServerListener(ServerListener l)
Add a server listener. |
void |
connect()
Try to connect to the server, using default configuration. |
void |
connected()
The server is now connected. |
void |
connectionFailed(java.lang.String message)
The connection coulnd't be established. |
void |
disconnect()
Disconnect from the irc server. |
void |
disconnected()
Connection to server has been lost. |
void |
enumerateSourcesAsCreated(ServerListener lis)
Enumerate all sources, as if they were created and notified to the given listener. |
void |
execute(java.lang.String str)
Execute the given command on the remote server. |
java.util.Enumeration |
getChanLists()
Get all the chanlists. |
char[][] |
getChannelModes()
Get an array of all known A,B,C,D channel modes. |
char[] |
getChannelPrefixes()
Get an array of all known channel prefixes. |
java.util.Enumeration |
getChannels()
Get all the channels. |
Source |
getDefaultSource()
Get the default server source, or null if no default source is defined. |
int |
getLocalPort()
Get the local port of the remote connection. |
java.lang.String |
getMode()
Get the current status mode. |
java.lang.String |
getNick()
Get the nickname on this server. |
java.lang.String |
getNickMode(java.lang.String prefix)
Get the nick mode associated with the given nick prefix. |
char[] |
getNickModes()
Get an array of all known nickname modes. |
java.lang.String |
getNickPrefix(java.lang.String mode)
Get the nick prefix associated with the given nick mode. |
char[] |
getNickPrefixes()
Get an array of all known nickname prefixes. |
java.util.Enumeration |
getQueries()
Get all the queries. |
Query |
getQuery(java.lang.String nick,
boolean local)
Get the query from its name. |
java.lang.String |
getServerName()
Get the server name. |
java.util.Enumeration |
getSources()
Get an enumeration of all the sources associated with this server. |
Status |
getStatus()
Get this server's status, or null if this server has no status. |
java.lang.String |
getUserName()
Get the username on this server. |
boolean |
ignore(java.lang.String nick)
Return true if this server is ignoring the given nick, false otherwise. |
boolean |
isConnected()
Return true if connected to the server, false otherwise. |
void |
leave()
Leave all sources, then leave the server. |
void |
leaveChanList(java.lang.String name)
Request to leave the given channel list. |
void |
leaveChannel(java.lang.String name)
Request to leave the given channel. |
void |
leaveQuery(java.lang.String name)
Request to leave the given query. |
void |
leaveStatus(java.lang.String name)
Request to leave the status. |
void |
messageReceived(java.lang.String prefix,
java.lang.String command,
java.lang.String[] params)
A new server message has been received. |
void |
release()
Release this object. |
void |
removeIgnore(java.lang.String nick)
Remove the given list from the ignore list. |
void |
removeReplyServerListener(ReplyServerListener l)
Remove a reply listener. |
void |
removeServerListener(ServerListener l)
Remove a listener. |
void |
replyReceived(java.lang.String prefix,
java.lang.String id,
java.lang.String[] params)
A new server numeric reply has been received. |
void |
say(java.lang.String destination,
java.lang.String str)
Say the specified string. |
void |
sendStatusMessage(java.lang.String msg)
Send the given message to the server's status. |
void |
setDefaultSource(Source s)
Set the default output source this server should use if the destination source is undefined. |
void |
setServers(java.lang.String[] host,
int[] port,
java.lang.String[] passWord)
Set default configuration for the next connection. |
Methods inherited from class irc.IRCObject |
getColor, getIRCConfiguration, getText, getText, getText, getText, getTimeStamp |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public IRCServer(IRCConfiguration config, java.lang.String nick, java.lang.String altNick, java.lang.String userName, java.lang.String name)
config
- global IRCConfiguration.nick
- claimed nick.altNick
- claimed alternate nick.userName
- user name.Method Detail |
public void release()
IRCObject
release
in class IRCObject
public java.util.Enumeration getSources()
Server
getSources
in interface Server
public void enumerateSourcesAsCreated(ServerListener lis)
Server
enumerateSourcesAsCreated
in interface Server
lis
- listener to call.public void setDefaultSource(Source s)
Server
setDefaultSource
in interface Server
s
- default source.public Source getDefaultSource()
public void setServers(java.lang.String[] host, int[] port, java.lang.String[] passWord)
host
- server host.port
- server port.passWord
- server password.public void connect()
Server
connect
in interface Server
public void disconnect()
disconnect
in interface Server
public boolean isConnected()
isConnected
in interface Server
public void connectionFailed(java.lang.String message)
ServerProtocolListener
connectionFailed
in interface ServerProtocolListener
message
- error message.public int getLocalPort()
public void connected()
ServerProtocolListener
connected
in interface ServerProtocolListener
public void disconnected()
ServerProtocolListener
disconnected
in interface ServerProtocolListener
public void sendStatusMessage(java.lang.String msg)
Server
sendStatusMessage
in interface Server
msg
- string to send to the status.public java.util.Enumeration getChannels()
public java.util.Enumeration getQueries()
public java.util.Enumeration getChanLists()
public Query getQuery(java.lang.String nick, boolean local)
local
- true if this query has been created following a local request.
public void leaveChannel(java.lang.String name)
name
- channel name.public void leaveQuery(java.lang.String name)
name
- query name.public void leave()
Server
leave
in interface Server
public void leaveStatus(java.lang.String name)
name
- Status name. Unused.public void leaveChanList(java.lang.String name)
name
- chanlist name.public java.lang.String getServerName()
public Status getStatus()
public void addServerListener(ServerListener l)
addServerListener
in interface Server
l
- listener to add.public void removeServerListener(ServerListener l)
removeServerListener
in interface Server
l
- listener to remove.public void addReplyServerListener(ReplyServerListener l)
l
- listener to add.public void removeReplyServerListener(ReplyServerListener l)
l
- listener to remove.public char[] getChannelPrefixes()
public char[] getNickPrefixes()
public char[] getNickModes()
public char[][] getChannelModes()
public java.lang.String getNickPrefix(java.lang.String mode)
mode
- nick mode.
public java.lang.String getNickMode(java.lang.String prefix)
public void replyReceived(java.lang.String prefix, java.lang.String id, java.lang.String[] params)
ServerProtocolListener
replyReceived
in interface ServerProtocolListener
prefix
- reply prefix.id
- reply id.params
- reply parameters.public boolean ignore(java.lang.String nick)
nick
- nick to test.public void addIgnore(java.lang.String nick)
nick
- nick to ignore.public void removeIgnore(java.lang.String nick)
nick
- nick to remove from ignore list.public void messageReceived(java.lang.String prefix, java.lang.String command, java.lang.String[] params)
ServerProtocolListener
messageReceived
in interface ServerProtocolListener
prefix
- message prefix.command
- message command.params
- message parameters.public java.lang.String getNick()
Server
getNick
in interface Server
public java.lang.String getUserName()
Server
getUserName
in interface Server
public java.lang.String getMode()
public void say(java.lang.String destination, java.lang.String str)
Server
say
in interface Server
destination
- message destination.str
- message itself.public void execute(java.lang.String str)
Server
execute
in interface Server
str
- the command to execute.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |