irc
Interface Server

All Known Implementing Classes:
DCCChatServer, DCCFileHandler, IRCServer, NullServer

public interface Server

The server class.


Method Summary
 void addServerListener(ServerListener l)
          Add a server listener.
 void connect()
          Try to connect to the server, using default configuration.
 void disconnect()
          Disconnect from the server.
 void enumerateSourcesAsCreated(ServerListener l)
          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.lang.String getNick()
          Get the nickname on this server.
 java.util.Enumeration getSources()
          Get an enumeration of all the sources associated with this server.
 java.lang.String getUserName()
          Get the username on this server.
 boolean isConnected()
          Test whether the server is connected.
 void leave()
          Leave all sources, then leave the server.
 void removeServerListener(ServerListener l)
          Remove a listener.
 void say(java.lang.String destination, java.lang.String str)
          Say the specified string.
 void sendStatusMessage(java.lang.String str)
          Send the given message to the server's status.
 void setDefaultSource(Source source)
          Set the default output source this server should use if the destination source is undefined.
 

Method Detail

say

public void say(java.lang.String destination,
                java.lang.String str)
Say the specified string. This string is sent as it to the remote server.

Parameters:
destination - message destination.
str - message itself.

execute

public void execute(java.lang.String str)
Execute the given command on the remote server.

Parameters:
str - the command to execute.

sendStatusMessage

public void sendStatusMessage(java.lang.String str)
Send the given message to the server's status.

Parameters:
str - string to send to the status.

getNick

public java.lang.String getNick()
Get the nickname on this server.

Returns:
the nickname on the server.

getUserName

public java.lang.String getUserName()
Get the username on this server.

Returns:
the username on this server.

connect

public void connect()
Try to connect to the server, using default configuration.


disconnect

public void disconnect()
Disconnect from the server.


isConnected

public boolean isConnected()
Test whether the server is connected.

Returns:
true if server is connected, false otherwise.

getSources

public java.util.Enumeration getSources()
Get an enumeration of all the sources associated with this server.

Returns:
an enumeration of Source.

enumerateSourcesAsCreated

public void enumerateSourcesAsCreated(ServerListener l)
Enumerate all sources, as if they were created and notified to the given listener.

Parameters:
l - listener to call.

setDefaultSource

public void setDefaultSource(Source source)
Set the default output source this server should use if the destination source is undefined.

Parameters:
source - default source.

addServerListener

public void addServerListener(ServerListener l)
Add a server listener.

Parameters:
l - listener to add.

removeServerListener

public void removeServerListener(ServerListener l)
Remove a listener.

Parameters:
l - listener to remove.

leave

public void leave()
Leave all sources, then leave the server.