zombie.chat
Class IRCClient

java.lang.Object
  extended by java.lang.Thread
      extended by zombie.chat.IRCClient
All Implemented Interfaces:
java.lang.Runnable

public class IRCClient
extends java.lang.Thread


Nested Class Summary
 class IRCClient.Listener
          Treats IRC events.
 class IRCClient.TrustManager
           
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 boolean allowPrint
           
 org.schwering.irc.lib.IRCConnection conn
          The IRC connection.
static java.lang.String name
           
static java.lang.String nick
           
static IRCClient staticClient
           
static java.lang.String user
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
IRCClient(java.lang.String host, int port, java.lang.String pass, java.lang.String nick, java.lang.String user, java.lang.String name, boolean ssl)
          Creates a new IRCConnection instance and starts the thread.
 
Method Summary
static void initClient(java.lang.String name)
          Parses the arguments and starts the client.
 void run()
          The thread waits for input.
static void send(java.lang.String send)
           
 void shipInput(java.lang.String input)
          Parses the input and sends it to the IRC server.
 
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

conn

public org.schwering.irc.lib.IRCConnection conn
The IRC connection.


nick

public static java.lang.String nick

user

public static java.lang.String user

name

public static java.lang.String name

allowPrint

public boolean allowPrint

staticClient

public static IRCClient staticClient
Constructor Detail

IRCClient

public IRCClient(java.lang.String host,
                 int port,
                 java.lang.String pass,
                 java.lang.String nick,
                 java.lang.String user,
                 java.lang.String name,
                 boolean ssl)
          throws java.io.IOException
Creates a new IRCConnection instance and starts the thread. If you get confused by the two setDaemon()s: The conn.setDaemon(false) marks the IRCConnection thread as user thread and the setDaemon(true) marks this class's thread (which just listens for keyboard input) as daemon thread. Thus, if the IRCConnection breaks, this console application shuts down, because due to the setDaemon(true) it will no longer wait for keyboard input (no input would make sense without being connected to a server).

Throws:
java.io.IOException
Method Detail

initClient

public static void initClient(java.lang.String name)
Parses the arguments and starts the client.


run

public void run()
The thread waits for input.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

send

public static void send(java.lang.String send)

shipInput

public void shipInput(java.lang.String input)
               throws java.lang.Exception
Parses the input and sends it to the IRC server.

Throws:
java.lang.Exception