Class AbstractApplication
- java.lang.Object
-
- org.apache.jackrabbit.vault.util.console.AbstractApplication
-
- Direct Known Subclasses:
HelloWorldApp,ShellApp,VaultFsApp
public abstract class AbstractApplication extends Object
Console...
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_CONF_FILENAMEstatic StringKEY_HOSTstatic StringKEY_LOGLEVELstatic StringKEY_PATHstatic StringKEY_PROMPTstatic StringKEY_USER
-
Constructor Summary
Constructors Constructor Description AbstractApplication()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description org.apache.commons.cli2.builder.GroupBuilderaddApplicationOptions(org.apache.commons.cli2.builder.GroupBuilder gbuilder)protected voidclose()voidexecute(org.apache.commons.cli2.CommandLine cl)protected org.apache.commons.cli2.util.HelpFormattergetAppHelpFormatter()org.apache.commons.cli2.GroupgetApplicationCLGroup()abstract StringgetApplicationName()Returns the name of this applicationabstract ConsolegetConsole()StringgetCopyrightLine()protected abstract ExecutionContextgetDefaultContext()PropertiesgetEnv()PomPropertiesgetPomProperties()StringgetProperty(String key)abstract StringgetShellCommand()Returns the name of the shell commandStringgetVersion()StringgetVersionString()protected voidinit()voidloadConfig(String path)voidprepare(org.apache.commons.cli2.CommandLine cl)voidprintHelp(String cmd)voidprintVersion()protected voidrun(String[] args)voidsaveConfig(String path)voidsetLogLevel(String level)voidsetProperty(String key, String value)
-
-
-
Field Detail
-
DEFAULT_CONF_FILENAME
public static final String DEFAULT_CONF_FILENAME
- See Also:
- Constant Field Values
-
KEY_PROMPT
public static final String KEY_PROMPT
- See Also:
- Constant Field Values
-
KEY_USER
public static final String KEY_USER
- See Also:
- Constant Field Values
-
KEY_PATH
public static final String KEY_PATH
- See Also:
- Constant Field Values
-
KEY_HOST
public static final String KEY_HOST
- See Also:
- Constant Field Values
-
KEY_LOGLEVEL
public static final String KEY_LOGLEVEL
- See Also:
- Constant Field Values
-
-
Method Detail
-
getVersion
public String getVersion()
-
getPomProperties
public PomProperties getPomProperties()
-
getCopyrightLine
public String getCopyrightLine()
-
getVersionString
public String getVersionString()
-
printVersion
public void printVersion()
-
getApplicationName
public abstract String getApplicationName()
Returns the name of this application- Returns:
- the name of this application
-
getShellCommand
public abstract String getShellCommand()
Returns the name of the shell command- Returns:
- the name of the shell command
-
printHelp
public void printHelp(String cmd)
-
getAppHelpFormatter
protected org.apache.commons.cli2.util.HelpFormatter getAppHelpFormatter()
-
getApplicationCLGroup
public org.apache.commons.cli2.Group getApplicationCLGroup()
-
addApplicationOptions
public org.apache.commons.cli2.builder.GroupBuilder addApplicationOptions(org.apache.commons.cli2.builder.GroupBuilder gbuilder)
-
init
protected void init()
-
run
protected void run(String[] args)
-
setLogLevel
public void setLogLevel(String level)
-
prepare
public void prepare(org.apache.commons.cli2.CommandLine cl) throws ExecutionException- Throws:
ExecutionException
-
execute
public void execute(org.apache.commons.cli2.CommandLine cl) throws ExecutionException- Throws:
ExecutionException
-
saveConfig
public void saveConfig(String path) throws IOException
- Throws:
IOException
-
loadConfig
public void loadConfig(String path) throws IOException
- Throws:
IOException
-
close
protected void close()
-
getEnv
public Properties getEnv()
-
getDefaultContext
protected abstract ExecutionContext getDefaultContext()
-
getConsole
public abstract Console getConsole()
-
-