ecologylab.services.logging
Class LoggingClientManager

java.lang.Object
  extended by ecologylab.generic.Debug
      extended by ecologylab.services.distributed.server.clientmanager.AbstractClientManager
          extended by ecologylab.services.distributed.server.clientmanager.ClientManager
              extended by ecologylab.services.logging.LoggingClientManager
All Implemented Interfaces:
NetworkingConstants, ServerConstants

public class LoggingClientManager
extends ClientManager

Provides a special implementation of performService(), that open()'s an OutputStream as necessary to the appropriate directory for logging, based on the headers in the message, then logs the message to there with a minimum of translation.

Author:
andruid, eunyee, Zachary O. Toups (toupsz@cs.tamu.edu)

Field Summary
 
Fields inherited from class ecologylab.services.distributed.server.clientmanager.AbstractClientManager
frontend, headerBufOutgoing, headerMap, initialized, maxPacketSize, messageWaiting, msgBufIncoming, msgBufOutgoing, registry, requestQueue, server, sessionId, socketKey, startLine, startReadIndex, translationSpace
 
Fields inherited from interface ecologylab.services.distributed.common.ServerConstants
GARBAGE_CONNECTION_CLEANUP_TIMEOUT, MAX_CONNECTIONS, MAXIMUM_TRANSMISSION_ERRORS
 
Fields inherited from interface ecologylab.services.distributed.common.NetworkingConstants
CHARACTER_ENCODING, CONTENT_LENGTH_STRING, CONTENT_LENGTH_STRING_LENGTH, DECODER, ENCODER, HTTP_HEADER_LINE_DELIMITER, HTTP_HEADER_TERMINATOR, MAX_HTTP_HEADER_LENGTH, MAX_PACKET_SIZE_BYTES, MAX_PACKET_SIZE_CHARACTERS, UNIQUE_IDENTIFIER_STRING
 
Constructor Summary
LoggingClientManager(java.lang.Object token, int maxPacketSize, NIOLoggingServer loggingServer, NIOServerBackend server, java.nio.channels.SelectionKey sk, TranslationSpace translationSpace, Scope registry)
           
 
Method Summary
protected  java.io.OutputStreamWriter getOutputStreamWriter(java.lang.String fileName)
           
protected  ResponseMessage performService(RequestMessage requestMessage)
          Appends the sender's IP address to the incoming message and calls performService on the given RequestMessage using the local ObjectRegistry.
 void shutdown()
          Hook method for having shutdown behavior.
 
Methods inherited from class ecologylab.services.distributed.server.clientmanager.ClientManager
clearOutgoingMessageBuffer, clearOutgoingMessageHeaderBuffer, createHeader, prepareBuffers, translateResponseMessageToStringBufferContents
 
Methods inherited from class ecologylab.services.distributed.server.clientmanager.AbstractClientManager
enqueueRequest, getLastActivity, getNextRequest, getSocketKey, isInitialized, isMessageWaiting, parseHeader, processAllMessagesAndSendResponses, processIncomingSequenceBufToQueue, setSocket, translateStringToRequestMessage
 
Methods inherited from class ecologylab.generic.Debug
classSimpleName, closeLoggingFile, debug, debug, debug, debug, debugA, debugA, debugA, debugI, debugI, debugI, error, error, getClassName, getClassName, getInteractive, getPackageName, getPackageName, getPackageName, initialize, level, level, level, logToFile, print, print, println, println, println, println, println, println, printlnA, printlnA, printlnA, printlnI, printlnI, printlnI, printlnI, setLoggingFile, show, show, superString, toggleInteractive, toString, toString, warning, warning, weird, weird
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LoggingClientManager

public LoggingClientManager(java.lang.Object token,
                            int maxPacketSize,
                            NIOLoggingServer loggingServer,
                            NIOServerBackend server,
                            java.nio.channels.SelectionKey sk,
                            TranslationSpace translationSpace,
                            Scope registry)
Parameters:
token -
loggingServer -
server -
socket -
translationSpace -
registry -
Method Detail

performService

protected ResponseMessage performService(RequestMessage requestMessage)
Description copied from class: AbstractClientManager
Appends the sender's IP address to the incoming message and calls performService on the given RequestMessage using the local ObjectRegistry. performService(RequestMessage) may be overridden by subclasses to provide more specialized functionality. Generally, overrides should then call super.performService(RequestMessage) so that the IP address is appended to the message.

Overrides:
performService in class AbstractClientManager
Returns:

getOutputStreamWriter

protected java.io.OutputStreamWriter getOutputStreamWriter(java.lang.String fileName)

shutdown

public void shutdown()
Description copied from class: AbstractClientManager
Hook method for having shutdown behavior. This method is called whenever the client terminates their connection or when the server is shutting down.

Overrides:
shutdown in class AbstractClientManager