Package emissary.command
Class BaseCommand
- java.lang.Object
-
- emissary.command.BaseCommand
-
- All Implemented Interfaces:
EmissaryCommand
,Runnable
- Direct Known Subclasses:
HttpCommand
public abstract class BaseCommand extends Object implements EmissaryCommand
-
-
Field Summary
Fields Modifier and Type Field Description static String
COMMAND_NAME
-
Constructor Summary
Constructors Constructor Description BaseCommand()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Path
getBinDir()
Path
getConfig()
Path
getErrorDir()
String
getFlavor()
String
getLogbackConfig()
Path
getOutputDir()
Path
getProjectBase()
boolean
getQuiet()
boolean
isVerbose()
void
logInfo(String format, Object... args)
void
outputBanner()
protected void
overrideFlavor(String flavor)
static <T extends EmissaryCommand>
Tparse(Class<T> clazz, String... args)
Create a new command and parse the args.static <T extends EmissaryCommand>
Tparse(Class<T> clazz, List<String> args)
Create a new command and parse the argsvoid
reinitLogback()
void
run()
protected void
setSystemProperty(String key, String value)
void
setupCommand()
void
setupConfig()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface emissary.command.EmissaryCommand
getCommandName, run, setup
-
-
-
-
Field Detail
-
COMMAND_NAME
public static final String COMMAND_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getConfig
public Path getConfig()
-
getProjectBase
public Path getProjectBase()
-
getLogbackConfig
public String getLogbackConfig()
-
getFlavor
public String getFlavor()
-
overrideFlavor
protected void overrideFlavor(String flavor)
-
getBinDir
public Path getBinDir()
-
getOutputDir
public Path getOutputDir()
-
getErrorDir
public Path getErrorDir()
-
getQuiet
public boolean getQuiet()
-
isVerbose
public boolean isVerbose()
-
setupCommand
public void setupCommand()
- Specified by:
setupCommand
in interfaceEmissaryCommand
-
setupConfig
public void setupConfig()
-
parse
public static <T extends EmissaryCommand> T parse(Class<T> clazz, String... args) throws EmissaryException
Create a new command and parse the args.Useful for testings. Also calls setup so properties are set
- Parameters:
clazz
- the Class of return type classargs
- vararg of Strings- Throws:
EmissaryException
-
parse
public static <T extends EmissaryCommand> T parse(Class<T> clazz, List<String> args) throws EmissaryException
Create a new command and parse the argsUseful for testings
- Parameters:
clazz
- the Class of return type classargs
- vararg of Strings- Throws:
EmissaryException
-
reinitLogback
public void reinitLogback()
-
outputBanner
public void outputBanner()
- Specified by:
outputBanner
in interfaceEmissaryCommand
-
run
public void run()
- Specified by:
run
in interfaceEmissaryCommand
- Specified by:
run
in interfaceRunnable
-
-