|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.edg.data.util.CommandBase
The base class for each command, dealing with the option parsing and help messages (the common base tasks).
Constructor Summary | |
protected |
CommandBase(java.lang.String programName,
java.lang.String commandName,
java.lang.String[] commandArgs)
|
Method Summary | |
protected void |
addArgument(int position,
java.lang.String name,
java.lang.String description)
|
protected void |
addOption(org.apache.commons.cli.Option opt)
|
protected void |
description(java.lang.String desc)
|
abstract boolean |
execute()
Execute the command. |
protected java.lang.String |
getArgument(java.lang.String name)
|
boolean |
getBoolOption(java.lang.String option)
|
protected org.apache.commons.cli.CommandLine |
getCommandLine()
return the parsed command line |
protected java.lang.String |
getCommandName()
|
java.lang.String |
getConfigFile()
|
protected org.apache.commons.cli.Options |
getOptions()
|
java.lang.String |
getStringOption(java.lang.String option)
|
java.lang.String |
getVO()
|
protected abstract void |
init()
do the per command initialization of each command's options |
boolean |
isSecure()
|
boolean |
isVerbose()
|
void |
printHelp()
print help on command |
void |
setOption(java.util.HashMap opt)
|
void |
setVerbose(boolean isVerbose)
|
protected static java.lang.String |
stripGuidPrefix(java.lang.String guid)
|
protected static java.lang.String |
stripGuidPrefixes(java.lang.String query)
given a query, which might contain some queries on the guid_guid column, remove guid: prefixes from those gueries |
protected static java.lang.String |
stripLfnPrefix(java.lang.String lfn)
|
protected static java.lang.String |
stripLfnPrefixes(java.lang.String query)
given a query, which might contain some queries on the lfn_lfn column, remove lfn: prefixes from those gueries |
protected static java.lang.String |
withGuidPrefix(java.lang.String guid)
|
protected static java.lang.String |
withLfnPrefix(java.lang.String lfn)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected CommandBase(java.lang.String programName, java.lang.String commandName, java.lang.String[] commandArgs) throws CommandLineException
Method Detail |
protected void addOption(org.apache.commons.cli.Option opt)
protected org.apache.commons.cli.CommandLine getCommandLine()
protected org.apache.commons.cli.Options getOptions()
protected java.lang.String getCommandName()
protected void addArgument(int position, java.lang.String name, java.lang.String description)
protected void description(java.lang.String desc)
protected java.lang.String getArgument(java.lang.String name) throws CommandLineException
CommandLineException
public void setVerbose(boolean isVerbose)
public boolean isVerbose()
isVerbose
in interface Command
public boolean isSecure()
isSecure
in interface Command
public java.lang.String getVO()
getVO
in interface Command
public java.lang.String getConfigFile()
getConfigFile
in interface Command
protected static final java.lang.String stripGuidPrefix(java.lang.String guid)
protected static final java.lang.String withGuidPrefix(java.lang.String guid)
protected static final java.lang.String stripGuidPrefixes(java.lang.String query)
query
-
protected static final java.lang.String stripLfnPrefix(java.lang.String lfn)
protected static final java.lang.String withLfnPrefix(java.lang.String lfn)
protected static final java.lang.String stripLfnPrefixes(java.lang.String query)
query
-
public void printHelp()
printHelp
in interface Command
public void setOption(java.util.HashMap opt) throws CommandLineException
CommandLineException
public java.lang.String getStringOption(java.lang.String option)
public boolean getBoolOption(java.lang.String option)
protected abstract void init()
public abstract boolean execute() throws DataException
Command
execute
in interface Command
DataException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |