henplus
Class HenPlus

java.lang.Object
  extended by henplus.HenPlus
All Implemented Interfaces:
Interruptable

public class HenPlus
extends Object
implements Interruptable


Field Summary
static byte LINE_EMPTY
           
static byte LINE_EXECUTED
           
static byte LINE_INCOMPLETE
           
static boolean verbose
           
 
Method Summary
 ConfigurationContainer createConfigurationContainer(String configName)
          returns an InputStream for a named configuration.
 byte executeLine(String line)
          add a new line.
 String getConfigurationDirectoryInfo()
           
 SQLSession getCurrentSession()
          get current session.
 CommandDispatcher getDispatcher()
           
static HenPlus getInstance()
           
 OutputDevice getMessageDevice()
           
 ListUserObjectsCommand getObjectLister()
           
 OutputDevice getOutputDevice()
           
 String getPartialLine()
           
 SessionManager getSessionManager()
          Provides access to the session manager.
 void initializeCommands(String[] argv)
           
 void interrupt()
           
static void main(String[] argv)
           
static OutputDevice msg()
           
static OutputDevice out()
           
 void popBuffer()
          pop the command execution buffer.
 void pushBuffer()
          push the current state of the command execution buffer, e.g.
 String readlineFromFile()
           
 void run()
           
 void setCurrentSession(SQLSession session)
          set current session.
 void setDefaultPrompt()
           
 void setOutput(OutputDevice out, OutputDevice msg)
           
 void setPrompt(String p)
           
 void terminate()
           
 String varsubst(String in, Map variables)
          substitute the variables in String 'in', that are in the form $VARNAME or ${VARNAME} with the equivalent value that is found in the Map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

verbose

public static final boolean verbose
See Also:
Constant Field Values

LINE_EXECUTED

public static final byte LINE_EXECUTED
See Also:
Constant Field Values

LINE_EMPTY

public static final byte LINE_EMPTY
See Also:
Constant Field Values

LINE_INCOMPLETE

public static final byte LINE_INCOMPLETE
See Also:
Constant Field Values
Method Detail

initializeCommands

public void initializeCommands(String[] argv)

pushBuffer

public void pushBuffer()
push the current state of the command execution buffer, e.g. to parse a new file.


popBuffer

public void popBuffer()
pop the command execution buffer.


readlineFromFile

public String readlineFromFile()
                        throws IOException
Throws:
IOException

executeLine

public byte executeLine(String line)
add a new line. returns one of LINE_EMPTY, LINE_INCOMPLETE or LINE_EXECUTED.


getPartialLine

public String getPartialLine()

run

public void run()

terminate

public void terminate()

getDispatcher

public CommandDispatcher getDispatcher()

getSessionManager

public SessionManager getSessionManager()
Provides access to the session manager. He maintains the list of opened sessions with their names.

Returns:
the session manager.

setCurrentSession

public void setCurrentSession(SQLSession session)
set current session. This is called from commands, that switch the sessions (i.e. the ConnectCommand.)


getCurrentSession

public SQLSession getCurrentSession()
get current session.


getObjectLister

public ListUserObjectsCommand getObjectLister()

setPrompt

public void setPrompt(String p)

setDefaultPrompt

public void setDefaultPrompt()

varsubst

public String varsubst(String in,
                       Map variables)
substitute the variables in String 'in', that are in the form $VARNAME or ${VARNAME} with the equivalent value that is found in the Map. Return the varsubstituted String.

Parameters:
in - the input string containing variables to be substituted (with leading $)
variables - the Map containing the mapping from variable name to value.

interrupt

public void interrupt()
Specified by:
interrupt in interface Interruptable

getInstance

public static HenPlus getInstance()

setOutput

public void setOutput(OutputDevice out,
                      OutputDevice msg)

getOutputDevice

public OutputDevice getOutputDevice()

getMessageDevice

public OutputDevice getMessageDevice()

out

public static OutputDevice out()

msg

public static OutputDevice msg()

main

public static final void main(String[] argv)
                       throws Exception
Throws:
Exception

createConfigurationContainer

public ConfigurationContainer createConfigurationContainer(String configName)
returns an InputStream for a named configuration. That stream must be closed on finish.


getConfigurationDirectoryInfo

public String getConfigurationDirectoryInfo()


? 1997..2006 Henner Zeller