henplus.commands
Class ListUserObjectsCommand

java.lang.Object
  extended by henplus.AbstractCommand
      extended by henplus.commands.ListUserObjectsCommand
All Implemented Interfaces:
Command, Interruptable

public class ListUserObjectsCommand
extends AbstractCommand
implements Interruptable

FIXME: use SQLMetaData stuff instead.


Field Summary
 
Fields inherited from interface henplus.Command
EXEC_FAILED, SUCCESS, SYNTAX_ERROR
 
Constructor Summary
ListUserObjectsCommand(HenPlus hp)
           
 
Method Summary
 Collection columnsFor(String tabName)
          fixme: add this to the cached values determined by rehash.
 Iterator completeAllColumns(String partialColumn)
           
 Iterator completeTableName(SQLSession session, String partialTable)
          used from diverse commands that need table name completion.
 String correctTableName(String tabName)
          see, if we find exactly one alternative, that is spelled correctly.
 int execute(SQLSession session, String cmd, String param)
          execute the command given.
 String[] getCommandList()
          returns the command-strings this command can handle.
 String getLongDescription(String cmd)
          returns a longer string describing this action.
 String getShortDescription()
          return a descriptive string.
 String getSynopsis(String cmd)
          retuns a synopsis-string.
 SortedSet getTableNamesForSession(SQLSession session)
           
 Iterator getTableNamesIteratorForSession(SQLSession session)
           
 void interrupt()
           
 void unhash(SQLSession session)
           
 
Methods inherited from class henplus.AbstractCommand
argumentCount, complete, getOption, getOptions, handleCommandline, isComplete, participateInCommandCompletion, registerOptions, requiresValidSession, setOptions, shutdown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListUserObjectsCommand

public ListUserObjectsCommand(HenPlus hp)
Method Detail

getCommandList

public String[] getCommandList()
returns the command-strings this command can handle.

Specified by:
getCommandList in interface Command

execute

public int execute(SQLSession session,
                   String cmd,
                   String param)
execute the command given.

Specified by:
execute in interface Command
Parameters:
session - the SQLsession this command is executed from.
cmd - the command as string.
param - the rest parameters following the command.
Returns:
one of SUCCESS, SYNTAX_ERROR, EXEC_FAILED to indicate the exit status of this command. On SYNTAX_ERROR, the CommandDispatcher displays a synopsis if available.

unhash

public void unhash(SQLSession session)

columnsFor

public Collection columnsFor(String tabName)
fixme: add this to the cached values determined by rehash.


correctTableName

public String correctTableName(String tabName)
see, if we find exactly one alternative, that is spelled correctly. If we have more than one alternative but one, that has the same length of the requested tablename, return this.


completeTableName

public Iterator completeTableName(SQLSession session,
                                  String partialTable)
used from diverse commands that need table name completion.


completeAllColumns

public Iterator completeAllColumns(String partialColumn)

getTableNamesIteratorForSession

public Iterator getTableNamesIteratorForSession(SQLSession session)

getTableNamesForSession

public SortedSet getTableNamesForSession(SQLSession session)

getShortDescription

public String getShortDescription()
return a descriptive string.

Specified by:
getShortDescription in interface Command
Overrides:
getShortDescription in class AbstractCommand

getSynopsis

public String getSynopsis(String cmd)
Description copied from interface: Command
retuns a synopsis-string. The synopsis string returned should follow the following conventions:

Should contain no newline, no leading spaces. This synopsis is printed in the detailed help of a command or if the execute()-method returned a SYNTAX_ERROR.

Specified by:
getSynopsis in interface Command
Overrides:
getSynopsis in class AbstractCommand
Parameters:
cmd - the command the synopsis is for. This is one of the possible commands returned by Command.getCommandList().

getLongDescription

public String getLongDescription(String cmd)
Description copied from interface: Command
returns a longer string describing this action. This should return a String describing details of the given command. This String should start with a TAB-character in each new line (the first line is a new line). The last line should not end with newline.

Specified by:
getLongDescription in interface Command
Overrides:
getLongDescription in class AbstractCommand
Parameters:
cmd - The command the long description is asked for. This is one of the possible commands returned by Command.getCommandList().

interrupt

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


? 1997..2006 Henner Zeller