Class DatabaseCommand
- java.lang.Object
-
- com.sun.enterprise.admin.cli.CLICommand
-
- com.sun.enterprise.admin.cli.optional.DatabaseCommand
-
- All Implemented Interfaces:
org.glassfish.hk2.api.PostConstruct
- Direct Known Subclasses:
StartDatabaseCommand
,StopDatabaseCommand
public abstract class DatabaseCommand extends CLICommand
This is an abstract class to be inherited by StartDatabaseCommand and StopDatabaseCommand. This classes prepares the variables that are used to to invoke DBControl. It also contains a pingDatabase method that is used by both start/stop database command.- Author:
- Jane Young, Bill Shannon
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
DB_USER
protected String
dbHost
protected File
dbLocation
protected DBManager
dbManager
protected String
dbPort
protected ClassPathBuilder
sClasspath
protected ClassPathBuilder
sDatabaseClasspath
protected File
sInstallRoot
protected File
sJavaHome
-
Fields inherited from class com.sun.enterprise.admin.cli.CLICommand
argv, ASADMIN, commandModel, CONNECTION_ERROR, env, ERROR, INVALID_COMMAND_ERROR, lineReader, logger, metadataErrors, name, operands, options, passwords, programOpts, SUCCESS, terminal, WARNING
-
-
Constructor Summary
Constructors Constructor Description DatabaseCommand()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected File
getJavaExe()
Computes the java executable location fromsJavaHome
.protected String[]
pingDatabaseCmd(boolean bRedirect)
Defines the command to ping the database.protected void
prepareProcessExecutor()
Prepare variables to invoke start/ping database command.-
Methods inherited from class com.sun.enterprise.admin.cli.CLICommand
buildLineReader, buildTerminal, checkHelp, closeTerminal, execute, execute, executeCommand, expandManPage, getBooleanOption, getBriefCommandUsage, getCommand, getCommand, getCommandScope, getCommandUsage, getManPage, getName, getOperandModel, getOption, getOptions, getPassword, getPassword, getProgramOptions, getSystemProperties, getSystemProperty, getUsage, initializeLogger, initializePasswords, inject, newLineReaderBuilder, ok, parse, postConstruct, prepare, prevalidate, printExceptionStackTrace, processProgramOptions, quote, readPassword, setCommandScope, toString, usageOptions, validate
-
-
-
-
Field Detail
-
DB_USER
protected static final String DB_USER
- See Also:
- Constant Field Values
-
dbHost
protected String dbHost
-
dbPort
protected String dbPort
-
dbLocation
protected File dbLocation
-
sJavaHome
protected File sJavaHome
-
sInstallRoot
protected File sInstallRoot
-
sClasspath
protected final ClassPathBuilder sClasspath
-
sDatabaseClasspath
protected final ClassPathBuilder sDatabaseClasspath
-
dbManager
protected DBManager dbManager
-
-
Method Detail
-
prepareProcessExecutor
protected void prepareProcessExecutor() throws Exception
Prepare variables to invoke start/ping database command.- Throws:
Exception
-
pingDatabaseCmd
protected String[] pingDatabaseCmd(boolean bRedirect) throws Exception
Defines the command to ping the database.- Parameters:
bRedirect
-- Returns:
- Throws:
Exception
-
-