|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.lang.Thread
NetLogServer
The server end of the remote logging software. At it's simpliest, the server listens for connections on the specified port, and when a client connects, it takes the messages the client sends and saves them to a file. The server can listen for multiple connections and handling logging for several clients. There can be multiple files or a single file for all the output. Usually, each line of the output contains the hostname, the date, and the actual log message. Depending on the config file, selections of host(s) can have their own log file. To implement the basic logging functionality, the class wraps the LocalDrinkLogger class. TODO: For now, all logging will be done to a single file. TODO: Allow for named streams. The server makes a list of what streams are TODO: available. Clients can subscribe to those streams.
| Field Summary | |
private Socket |
client
The socket that is connected to the client, from which we read our the messages the client is sending to us. |
static int |
DEFAULT_PORT
The port that this server normally listens on. |
private String |
ipAddy
The IP address of the host we are logging for. |
private static ServerSocket |
listener
The ServerSocket where all incoming clients connect to. |
private DrinkLoggerSpec |
log
The log an individual session uses to write the actual message. |
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
NetLogServer(DrinkLoggerSpec log,
Socket socket)
Set up an individual session of logging. |
|
| Method Summary | |
static void |
main(String[] args)
The entry point for the program. |
void |
run()
Actually do something useful. |
| 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 |
public static final int DEFAULT_PORT
private static ServerSocket listener
private DrinkLoggerSpec log
private Socket client
private String ipAddy
| Constructor Detail |
public NetLogServer(DrinkLoggerSpec log,
Socket socket)
log - The DrinkLoggerSpec that we actually print to.socket - The client whose messages we are logging.| Method Detail |
public static void main(String[] args)
args - The command line arguments, which are ignored.
All run-time configuration info is read out of the config filepublic void run()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||