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 String
DEFAULT_CONF_FILENAME
static String
KEY_HOST
static String
KEY_LOGLEVEL
static String
KEY_PATH
static String
KEY_PROMPT
static String
KEY_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.GroupBuilder
addApplicationOptions(org.apache.commons.cli2.builder.GroupBuilder gbuilder)
protected void
close()
void
execute(org.apache.commons.cli2.CommandLine cl)
protected org.apache.commons.cli2.util.HelpFormatter
getAppHelpFormatter()
org.apache.commons.cli2.Group
getApplicationCLGroup()
abstract String
getApplicationName()
Returns the name of this applicationabstract Console
getConsole()
String
getCopyrightLine()
protected abstract ExecutionContext
getDefaultContext()
Properties
getEnv()
PomProperties
getPomProperties()
String
getProperty(String key)
abstract String
getShellCommand()
Returns the name of the shell commandString
getVersion()
String
getVersionString()
protected void
init()
void
loadConfig(String path)
void
prepare(org.apache.commons.cli2.CommandLine cl)
void
printHelp(String cmd)
void
printVersion()
protected void
run(String[] args)
void
saveConfig(String path)
void
setLogLevel(String level)
void
setProperty(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()
-
-