ecologylab.services.authentication.nio
Class AuthClientManager

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.authentication.nio.AuthClientManager
All Implemented Interfaces:
AuthMessages, AuthServerRegistryObjects, NetworkingConstants, ServerConstants

public class AuthClientManager
extends ClientManager
implements ServerConstants, AuthServerRegistryObjects, AuthMessages

Stores information about the connection context for the client, including authentication status. Only executes requests from an authenticated client. Should be extended for more specific implementations. Handles accumulating incoming messages and translating them into RequestMessage objects.

Author:
Zachary O. Toups (toupsz@cs.tamu.edu)
See Also:
ClientManager

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
 
Fields inherited from interface ecologylab.services.authentication.registryobjects.AuthServerRegistryObjects
MAIN_AUTHENTICATABLE
 
Fields inherited from interface ecologylab.services.authentication.messages.AuthMessages
LOGIN_FAILED_LOGGEDIN, LOGIN_FAILED_NO_IP_SUPPLIED, LOGIN_FAILED_PASSWORD, LOGIN_SUCCESSFUL, LOGOUT_FAILED_IP_MISMATCH, LOGOUT_FAILED_NOT_LOGGEDIN, LOGOUT_SUCCESSFUL, REQUEST_FAILED_NOT_AUTHENTICATED
 
Constructor Summary
AuthClientManager(java.lang.Object token, int maxPacketSize, NIOServerBackend server, NIOServerFrontend frontend, java.nio.channels.SelectionKey sk, TranslationSpace translationSpace, Scope registry, AuthLogging servicesServer)
          Constructs a new AuthContextManager on a server to handle authenticating client requests.
 
Method Summary
protected  ResponseMessage performService(RequestMessage requestMessage)
          Calls performService on the given RequestMessage using the local ObjectRegistry, if the client has been authenticated, or if the request is to log in.
 
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, shutdown, 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

AuthClientManager

public AuthClientManager(java.lang.Object token,
                         int maxPacketSize,
                         NIOServerBackend server,
                         NIOServerFrontend frontend,
                         java.nio.channels.SelectionKey sk,
                         TranslationSpace translationSpace,
                         Scope registry,
                         AuthLogging servicesServer)
Constructs a new AuthContextManager on a server to handle authenticating client requests.

Parameters:
token -
maxPacketSize -
server -
frontend -
socket -
translationSpace -
registry -
servicesServer -
Method Detail

performService

protected ResponseMessage performService(RequestMessage requestMessage)
Calls performService on the given RequestMessage using the local ObjectRegistry, if the client has been authenticated, or if the request is to log in. Can be overridden by subclasses to provide more specialized functionality.

Overrides:
performService in class AbstractClientManager
Parameters:
requestMessage -
Returns: