com.sun.enterprise.admin.cli.cluster
Class DeleteLocalInstanceCommand

java.lang.Object
  extended by com.sun.enterprise.admin.cli.CLICommand
      extended by com.sun.enterprise.admin.cli.LocalServerCommand
          extended by com.sun.enterprise.admin.cli.cluster.LocalInstanceCommand
              extended by com.sun.enterprise.admin.cli.cluster.DeleteLocalInstanceCommand
All Implemented Interfaces:
org.jvnet.hk2.component.PostConstruct

@Service(name="delete-local-instance")
@Scoped(value=org.jvnet.hk2.component.PerLookup.class)
public class DeleteLocalInstanceCommand
extends LocalInstanceCommand

Delete a local server instance. Wipeout the node dir if it is the last instance under the node Performance Note: getServerDirs().getServerDir() is all inlined by the JVM because the class instance is immutable.

Author:
Byron Nevins

Field Summary
 
Fields inherited from class com.sun.enterprise.admin.cli.cluster.LocalInstanceCommand
checkOneAndOnly, domainName, instanceDir, instanceName, isCreateInstanceFilesystem, node, nodeDir, nodeDirChild, nodeDirRoot
 
Fields inherited from class com.sun.enterprise.admin.cli.CLICommand
argv, commandModel, CONNECTION_ERROR, env, ERROR, INVALID_COMMAND_ERROR, logger, metadataErrors, name, operands, options, passwords, programOpts, SUCCESS, WARNING
 
Constructor Summary
DeleteLocalInstanceCommand()
           
 
Method Summary
protected  int executeCommand()
           
protected  void initInstance()
          initInstance goes to great lengths to figure out the correct directory structure.
protected  boolean mkdirs(java.io.File f)
          We most definitely do not want to create directories for nodes here!!
protected  void validate()
           
 
Methods inherited from class com.sun.enterprise.admin.cli.cluster.LocalInstanceCommand
getDasProperties, getInstallRootPath, getInstanceDirs, getMasterPasswordFile, getNodeInstallDir, getProductRootPath, isDirectory, setDasDefaults, setServerDirs, validateDasOptions, whackFilesystem
 
Methods inherited from class com.sun.enterprise.admin.cli.LocalServerCommand
checkForSpecialFiles, getAdminAddress, getAdminAddress, getDomainXml, getMasterPassword, getPrevPid, getServerDirs, getUptime, isRestartable, isRunning, isRunning, isRunning, isThisServer, loadAndVerifyKeystore, readFromMasterPasswordFile, resetServerDirs, setLocalPassword, setServerDirs, unsetLocalPassword, verifyMasterPassword, waitForRestart
 
Methods inherited from class com.sun.enterprise.admin.cli.CLICommand
checkHelp, execute, getBooleanOption, getCommand, getManPage, getName, getOperandModel, getOption, getPassword, getProgramOptions, getSystemProperties, getSystemProperty, getUsage, initializeLogger, initializePasswords, inject, ok, parse, postConstruct, prepare, prevalidate, printExceptionStackTrace, processProgramOptions, quote, readPassword, toString, usageOptions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DeleteLocalInstanceCommand

public DeleteLocalInstanceCommand()
Method Detail

initInstance

protected void initInstance()
                     throws CommandException
initInstance goes to great lengths to figure out the correct directory structure. We don't care about such errors. If the dir is not there -- then this is a simple error about trying to delete an instance that doesn't exist... Thank goodness for overriding methods!!

Overrides:
initInstance in class LocalInstanceCommand
Throws:
CommandException

mkdirs

protected boolean mkdirs(java.io.File f)
We most definitely do not want to create directories for nodes here!!

Overrides:
mkdirs in class LocalInstanceCommand
Parameters:
f - the directory to create

validate

protected void validate()
                 throws CommandException,
                        CommandValidationException
Overrides:
validate in class LocalInstanceCommand
Throws:
CommandException
CommandValidationException

executeCommand

protected int executeCommand()
                      throws CommandException,
                             CommandValidationException
Specified by:
executeCommand in class CLICommand
Throws:
CommandException
CommandValidationException


Copyright © 2012 GlassFish Community. All Rights Reserved.