Class NetAcctServer.NetAcctServerSession

java.lang.Object
  extended byjava.lang.Thread
      extended byNetAcctServer.NetAcctServerSession
All Implemented Interfaces:
Runnable
Enclosing class:
NetAcctServer

class NetAcctServer.NetAcctServerSession
extends Thread

Handles processing and IO for individual client sessions.

Author:
Michael J. Douglas

Field Summary
(package private)  DrinkLoggerSpec log
           
(package private)  AcctMgrSpec mgr
           
(package private)  Socket socket
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
NetAcctServer.NetAcctServerSession(Socket s, AcctMgrSpec m, DrinkLoggerSpec l)
          Constructs the session.
 
Method Summary
private  String boolVal(boolean val)
          A simple method to convert a String "true" to a boolean 'true'.
 void run()
          Process input from the client.
private  boolean strToBool(String val)
          Complements boolVal( boolean ).
 
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

socket

Socket socket

mgr

AcctMgrSpec mgr

log

DrinkLoggerSpec log
Constructor Detail

NetAcctServer.NetAcctServerSession

public NetAcctServer.NetAcctServerSession(Socket s,
                                          AcctMgrSpec m,
                                          DrinkLoggerSpec l)
Constructs the session. Basically, just save the variables.

Parameters:
s - The socket to talk to the client through.
m - The AcctMgrSpec to use for peforming account management through.
l - The DrinkLoggerSpec to write log messages to.
Method Detail

run

public void run()
Process input from the client. Set up the connection, check to make sure the host is in the ACL, then grab their input and process it.


boolVal

private String boolVal(boolean val)
A simple method to convert a String "true" to a boolean 'true'.

Parameters:
val - The boolean to convert to a string.

strToBool

private boolean strToBool(String val)
Complements boolVal( boolean ). boolVal( strToBowl( x ) ).equals(x) == true

Parameters:
val - The String value to convert to a boolean primitive.