irc
Class NullServer

java.lang.Object
  |
  +--irc.NullServer
All Implemented Interfaces:
Server

public class NullServer
extends java.lang.Object
implements Server

The null-server class.


Constructor Summary
NullServer()
          Create a new NullServer.
 
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 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.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 def)
          Set the default output source this server should use if the destination source is undefined.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullServer

public NullServer()
Create a new NullServer.

Method Detail

addServerListener

public void addServerListener(ServerListener l)
Description copied from interface: Server
Add a server listener.

Specified by:
addServerListener in interface Server
Parameters:
l - listener to add.

removeServerListener

public void removeServerListener(ServerListener l)
Description copied from interface: Server
Remove a listener.

Specified by:
removeServerListener in interface Server
Parameters:
l - listener to remove.

say

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

Specified by:
say in interface Server
Parameters:
destination - message destination.
str - message itself.

execute

public void execute(java.lang.String str)
Description copied from interface: Server
Execute the given command on the remote server.

Specified by:
execute in interface Server
Parameters:
str - the command to execute.

sendStatusMessage

public void sendStatusMessage(java.lang.String str)
Description copied from interface: Server
Send the given message to the server's status.

Specified by:
sendStatusMessage in interface Server
Parameters:
str - string to send to the status.

getNick

public java.lang.String getNick()
Description copied from interface: Server
Get the nickname on this server.

Specified by:
getNick in interface Server
Returns:
the nickname on the server.

getUserName

public java.lang.String getUserName()
Description copied from interface: Server
Get the username on this server.

Specified by:
getUserName in interface Server
Returns:
the username on this server.

connect

public void connect()
Description copied from interface: Server
Try to connect to the server, using default configuration.

Specified by:
connect in interface Server

disconnect

public void disconnect()
Description copied from interface: Server
Disconnect from the server.

Specified by:
disconnect in interface Server

isConnected

public boolean isConnected()
Description copied from interface: Server
Test whether the server is connected.

Specified by:
isConnected in interface Server
Returns:
true if server is connected, false otherwise.

setDefaultSource

public void setDefaultSource(Source def)
Description copied from interface: Server
Set the default output source this server should use if the destination source is undefined.

Specified by:
setDefaultSource in interface Server
Parameters:
def - default source.

leave

public void leave()
Description copied from interface: Server
Leave all sources, then leave the server.

Specified by:
leave in interface Server

enumerateSourcesAsCreated

public void enumerateSourcesAsCreated(ServerListener lis)
Description copied from interface: Server
Enumerate all sources, as if they were created and notified to the given listener.

Specified by:
enumerateSourcesAsCreated in interface Server
Parameters:
lis - listener to call.

getSources

public java.util.Enumeration getSources()
Description copied from interface: Server
Get an enumeration of all the sources associated with this server.

Specified by:
getSources in interface Server
Returns:
an enumeration of Source.