|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthenplus.AbstractCommand
henplus.commands.DumpCommand
public class DumpCommand
Dump out and read that dump of a table; database-independently. This reads directly from the stream, so only needs not much memory, no matter the size of the file. --------------------------- (tabledump 'student' (dump-version 1 1) (henplus-version 0.3.3) (database-info 'MySQL - 3.23.47') (meta ('name', 'sex', 'student_id') ('STRING', 'STRING', 'INTEGER' )) (data ('Megan','F',1) ('Joseph','M',2) ('Kyle','M',3) ('Mac Donald\'s','M',44)) (rows 4)) --------------------------- QUICK AND DIRTY HACK .. NOT YET NICE. Too long. grown. Refactor..! (create an henplus.dump package so that this can be used
Field Summary |
---|
Fields inherited from interface henplus.Command |
---|
EXEC_FAILED, SUCCESS, SYNTAX_ERROR |
Constructor Summary | |
---|---|
DumpCommand(ListUserObjectsCommand tc,
LoadCommand lc)
|
Method Summary | |
---|---|
void |
checkSupported(int version)
|
Iterator |
complete(CommandDispatcher disp,
String partialCommand,
String lastWord)
complete the table name. |
int |
execute(SQLSession session,
String cmd,
String param)
execute the command given. |
void |
expect(LineNumberReader in,
char ch)
|
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. |
void |
interrupt()
|
boolean |
isComplete(String command)
dump-in and verify-dump is complete as single-liner. |
henplus.commands.DumpCommand.MetaProperty[] |
parseMetaData(LineNumberReader in)
|
boolean |
requiresValidSession(String cmd)
verify works without session. |
Methods inherited from class henplus.AbstractCommand |
---|
argumentCount, getOption, getOptions, handleCommandline, participateInCommandCompletion, registerOptions, setOptions, shutdown |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DumpCommand(ListUserObjectsCommand tc, LoadCommand lc)
Method Detail |
---|
public String[] getCommandList()
getCommandList
in interface Command
public boolean requiresValidSession(String cmd)
requiresValidSession
in interface Command
requiresValidSession
in class AbstractCommand
cmd
- the subcommand this is requested for; one of the
commands returned by Command.getCommandList()
.public boolean isComplete(String command)
isComplete
in interface Command
isComplete
in class AbstractCommand
command
- the partial command read so far given to decide by
the command whether it is complete or not.public int execute(SQLSession session, String cmd, String param)
execute
in interface Command
session
- the SQLsession this command is executed from.cmd
- the command as string.param
- the rest parameters following the command.
public henplus.commands.DumpCommand.MetaProperty[] parseMetaData(LineNumberReader in) throws IOException
IOException
public void checkSupported(int version) throws IllegalArgumentException
IllegalArgumentException
public void expect(LineNumberReader in, char ch) throws IOException
IOException
public void interrupt()
interrupt
in interface Interruptable
public Iterator complete(CommandDispatcher disp, String partialCommand, String lastWord)
complete
in interface Command
complete
in class AbstractCommand
disp
- the CommandDispatcher - you might want to access
other values through it.partialCommand
- The command typed so farlastWord
- the last word returned by readline.public String getShortDescription()
getShortDescription
in interface Command
getShortDescription
in class AbstractCommand
public String getSynopsis(String cmd)
Command
export-xml <table> <filename>
help [command]
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.
getSynopsis
in interface Command
getSynopsis
in class AbstractCommand
cmd
- the command the synopsis is for. This is one of the possible
commands returned by Command.getCommandList()
.public String getLongDescription(String cmd)
Command
getLongDescription
in interface Command
getLongDescription
in class AbstractCommand
cmd
- The command the long description is asked for. This
is one of the possible commands returned by
Command.getCommandList()
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |