jhomenet.server.console
Class LocalSession

java.lang.Object
  extended by java.lang.Thread
      extended by jhomenet.server.console.Session
          extended by jhomenet.server.console.LocalSession
All Implemented Interfaces:
java.lang.Runnable

public class LocalSession
extends Session

TODO: Class description.

Id: $Id: $

Author:
Dave Irwin (jhomenet at gmail dot com)

Nested Class Summary
 
Nested classes/interfaces inherited from class jhomenet.server.console.Session
Session.Login
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected  boolean pauseSession
          Flag used to pause and restart the local session
 
Fields inherited from class jhomenet.server.console.Session
authManager, commandHistory, consoleService, CURRENT_COMMAND, CURRENT_DIRECTORY, currentCommand, environment, err, inCommand, inputStream, lastCommand, loginStack, loginSuccessMessage, myThreadID, outputStream, paramsArray, paramsVector, password, prompt, PROMPT, retArray, shutdown, user, userName, version, welcomeMessage
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
LocalSession(AuthManager authManager, IWorkQueue workQueue, SystemInputStream in, SystemPrintStream out, SystemPrintStream err, ConsoleService consoleService)
          Default constructor.
 
Method Summary
 void currentCommandFinished()
          Notifies this session that the current command has completed.
 void exceptionThrown(java.lang.Exception e)
          Notifies this session that exception was thrown when executing a command.
 void login()
          Logs a user into the system.
 void sessionEnding()
          Notify session implementations that the session is ending.
 
Methods inherited from class jhomenet.server.console.Session
addToHistory, endSession, execute, forceEndSession, forceEndSession, getEnvironment, getErrStream, getFromEnvironment, getHistoryNumber, getNextCommand, getOutputStream, getParams, getUserName, inCommand, parseLogin, printHistory, run, stepDownHistory, stepUpHistory, su, updatePrompt
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, 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

pauseSession

protected boolean pauseSession
Flag used to pause and restart the local session

Constructor Detail

LocalSession

public LocalSession(AuthManager authManager,
                    IWorkQueue workQueue,
                    SystemInputStream in,
                    SystemPrintStream out,
                    SystemPrintStream err,
                    ConsoleService consoleService)
Default constructor.

Parameters:
workQueue - Reference to the work queue
authManager - Reference to the authentication manager
in - stream this session should use to get data from user
out - stream this session should use to output to user
err - stream this session should use to output errors to user
consoleService -
Method Detail

login

public void login()
           throws java.io.IOException
Description copied from class: Session
Logs a user into the system. This method is responsible for identifying and verifying the user. Typically this is done with a user location and password.

Specified by:
login in class Session
Throws:
java.io.IOException
See Also:
Session.login()

currentCommandFinished

public void currentCommandFinished()
Description copied from class: Session
Notifies this session that the current command has completed. For example, the user types "ls". The command is received and parsed, then the appropriate command is called in the shell. Finally, this session may need to again display the system prompt or perform other session-specific functions. Only call this from a synchronized block!!!

Specified by:
currentCommandFinished in class Session
See Also:
Session.currentCommandFinished()

sessionEnding

public void sessionEnding()
Description copied from class: Session
Notify session implementations that the session is ending. This allows implementing sessions to clean up any resources associated with this session when it terminates.

Specified by:
sessionEnding in class Session
See Also:
jhomenet.shell.server.Session#sessionEnding()

exceptionThrown

public void exceptionThrown(java.lang.Exception e)
Description copied from class: Session
Notifies this session that exception was thrown when executing a command. This method will attempt to notify the user. Any exceptions raised specifically by shell commands should try to give as descriptive a message to the exception as possible.

Specified by:
exceptionThrown in class Session
Parameters:
e - the exception thrown
See Also:
jhomenet.shell.server.Session#exceptionThrown(java.lang.Exception)


Copyright © 2004-2007 David Irwin. All Rights Reserved.