netcom.log
Class Logger

java.lang.Object
  extended byjava.lang.Thread
      extended bynetcom.log.Logger
All Implemented Interfaces:
java.lang.Runnable

public class Logger
extends java.lang.Thread

Title: Logger This is a Thread which is initiated by both MDS and proxy nodes. It is responsible for establishing connections with the GUI over a socket and communicating with the GUI via LogMessage Objects Copyright: Copyright (c) 2002 Company NETCOM


Field Summary
static int CHAT_ADD_REQUEST
           
static int CHAT_REMOVE_REQUEST
           
static int CLIENT_CONNECTED
           
static int CLIENT_DISCONNECTED
           
static int CONNECTION_REJECTED
           
static int ERROR
           
static int FILE_ADD_REQUEST
           
static int FILE_REMOVE_REQUEST
           
static int GENERAL_ENTRY
           
static int NODE_EXITED
           
static int NODE_STARTED
           
static int SEARCH_REQUEST
           
static int SERVER_CONNECTED
           
static int SERVER_DISCONNECTED
           
static int SINGLE_RETURN_SENT
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Logger(LoggerInterface the_interface)
          This is the constructor for a Logger thread.
 
Method Summary
 void addLogEntry(int the_code, java.lang.String the_comment)
          This method is invoked externally by the parent node to request a LogEntry be made
 void run()
          the run method first connects to a serverSocket and begins to accept connections from GUI clients.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

GENERAL_ENTRY

public static final int GENERAL_ENTRY
See Also:
Constant Field Values

ERROR

public static final int ERROR
See Also:
Constant Field Values

NODE_STARTED

public static final int NODE_STARTED
See Also:
Constant Field Values

NODE_EXITED

public static final int NODE_EXITED
See Also:
Constant Field Values

SEARCH_REQUEST

public static final int SEARCH_REQUEST
See Also:
Constant Field Values

FILE_ADD_REQUEST

public static final int FILE_ADD_REQUEST
See Also:
Constant Field Values

CHAT_ADD_REQUEST

public static final int CHAT_ADD_REQUEST
See Also:
Constant Field Values

FILE_REMOVE_REQUEST

public static final int FILE_REMOVE_REQUEST
See Also:
Constant Field Values

CHAT_REMOVE_REQUEST

public static final int CHAT_REMOVE_REQUEST
See Also:
Constant Field Values

SINGLE_RETURN_SENT

public static final int SINGLE_RETURN_SENT
See Also:
Constant Field Values

SERVER_CONNECTED

public static final int SERVER_CONNECTED
See Also:
Constant Field Values

SERVER_DISCONNECTED

public static final int SERVER_DISCONNECTED
See Also:
Constant Field Values

CLIENT_CONNECTED

public static final int CLIENT_CONNECTED
See Also:
Constant Field Values

CLIENT_DISCONNECTED

public static final int CLIENT_DISCONNECTED
See Also:
Constant Field Values

CONNECTION_REJECTED

public static final int CONNECTION_REJECTED
See Also:
Constant Field Values
Constructor Detail

Logger

public Logger(LoggerInterface the_interface)
This is the constructor for a Logger thread. it instantiates the FileWriterThread and FileReaderThread

Parameters:
the_interface - is an interface that implements LoggerInterface that you need to access info about the parent mds/proxy node
Method Detail

run

public void run()
the run method first connects to a serverSocket and begins to accept connections from GUI clients. The GUIs send LogMessages which are processed according to the type of request, and then a LogMessage is created that will be sent back once the parent mds thread terminates it will activate the die flag in this thread which will end the while loop, kill its children treads, and close io streams.


addLogEntry

public void addLogEntry(int the_code,
                        java.lang.String the_comment)
This method is invoked externally by the parent node to request a LogEntry be made

Parameters:
the_code - this specifies the "type" of LogENtry thath should be made
the_comment - this variable gives any additional information that should be written out to the log file