public abstract class LocalServerCommand
extends com.sun.enterprise.admin.cli.CLICommand
| Constructor and Description |
|---|
LocalServerCommand() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
checkForSpecialFiles()
Override this method and return false to turn-off the file validation.
|
protected com.sun.enterprise.util.HostAndPort |
getAdminAddress()
Returns the admin address of the local domain.
|
protected com.sun.enterprise.util.HostAndPort |
getAdminAddress(String serverName)
Returns the admin address of a particular server.
|
protected File |
getDomainXml() |
protected String |
getMasterPassword()
Get the master password, either from a password file or
by asking the user.
|
protected File |
getMasterPasswordFile() |
protected int |
getPrevPid() |
protected com.sun.enterprise.util.io.ServerDirs |
getServerDirs() |
protected int |
getServerPid() |
protected long |
getUptime()
Get uptime from the server.
|
protected boolean |
isLocal() |
protected boolean |
isRemote() |
protected boolean |
isRestartable()
See if the server is restartable
As of March 2011 -- this only returns false if a passwordfile argument was given
when the server started -- but it is no longer available - i.e.
|
protected boolean |
isRunning()
Is the server still running?
This is only called when we're hanging around waiting for the server to die.
|
protected boolean |
isRunning(String host,
int port)
There is sometimes a need for subclasses to know if a
local domain is running. |
protected boolean |
isThisServer(File ourDir,
String directoryKey)
See if the server is alive and is the one at the specified directory.
|
protected boolean |
loadAndVerifyKeystore(File jks,
String mpv) |
protected String |
readFromMasterPasswordFile()
Checks if the create-domain was created using --savemasterpassword flag
which obtains security by obfuscation! Returns null in case of failure
of any kind.
|
protected void |
resetServerDirs() |
protected void |
setLocalPassword() |
protected void |
setServerDirs(com.sun.enterprise.util.io.ServerDirs sd) |
protected void |
unsetLocalPassword() |
protected boolean |
verifyMasterPassword(String mpv) |
protected void |
waitForRestart(int oldServerPid)
Byron Nevins Says: We have quite a historical assortment of ways to
determine if a server has restarted.
|
checkHelp, execute, executeCommand, expandManPage, getBooleanOption, getBriefCommandUsage, getCommand, getCommand, getCommandScope, getCommandUsage, getManPage, getName, getOperandModel, getOption, getOptions, getPassword, getPassword, getProgramOptions, getSystemProperties, getSystemProperty, getUsage, initializeLogger, initializePasswords, inject, ok, parse, postConstruct, prepare, prevalidate, printExceptionStackTrace, processProgramOptions, quote, readPassword, setCommandScope, toString, usageOptions, validateprotected boolean checkForSpecialFiles()
protected final com.sun.enterprise.util.HostAndPort getAdminAddress()
throws org.glassfish.api.admin.CommandException
org.glassfish.api.admin.CommandException - in case of parsing errorsprotected final com.sun.enterprise.util.HostAndPort getAdminAddress(String serverName) throws org.glassfish.api.admin.CommandException
org.glassfish.api.admin.CommandException - in case of parsing errorsprotected final void setServerDirs(com.sun.enterprise.util.io.ServerDirs sd)
protected final boolean isLocal()
protected final boolean isRemote()
protected final void setLocalPassword()
protected final void unsetLocalPassword()
protected final void resetServerDirs()
throws IOException
IOExceptionprotected final com.sun.enterprise.util.io.ServerDirs getServerDirs()
protected final File getDomainXml()
protected final String readFromMasterPasswordFile()
protected final boolean verifyMasterPassword(String mpv)
protected final String getMasterPassword() throws org.glassfish.api.admin.CommandException
org.glassfish.api.admin.CommandExceptionprotected final boolean isThisServer(File ourDir, String directoryKey)
protected final int getServerPid()
protected final boolean isRunning(String host, int port)
local domain is running. An example of such a command is
change-master-password command. The stop-domain command also needs to
know if a domain is running without having to provide user
name and password on command line (this is the case when I own a domain
that has non-default admin user and password) and want to stop it
without providing it.
In such cases, we need to know if the domain is running and this method provides a way to do that.
protected boolean isRunning()
protected final void waitForRestart(int oldServerPid)
throws org.glassfish.api.admin.CommandException
oldServerPid - The pid of the server which is being restarted.org.glassfish.api.admin.CommandException - if we time out.protected final int getPrevPid()
protected final long getUptime()
throws org.glassfish.api.admin.CommandException
org.glassfish.api.admin.CommandExceptionprotected final boolean isRestartable()
throws org.glassfish.api.admin.CommandException
org.glassfish.api.admin.CommandExceptionprotected File getMasterPasswordFile()
Copyright © 2017. All rights reserved.