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

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.CreateLocalInstanceFilesystemCommand
                  extended by com.sun.enterprise.admin.cli.cluster.CreateLocalInstanceCommand
All Implemented Interfaces:
org.jvnet.hk2.component.PostConstruct

@Service(name="create-local-instance")
@Scoped(value=org.jvnet.hk2.component.PerLookup.class)
public final class CreateLocalInstanceCommand
extends CreateLocalInstanceFilesystemCommand

This is a local command that calls the primitive remote _register-instance to add the entries in domain.xml and then the primitive local command _create-instance-filesystem to create the empty directory structure and das.properties


Field Summary
protected static java.lang.String DEFAULT_MASTER_PASSWORD
           
 
Fields inherited from class com.sun.enterprise.admin.cli.cluster.CreateLocalInstanceFilesystemCommand
setDasDefaultsOnly
 
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
CreateLocalInstanceCommand()
           
 
Method Summary
protected  void chmod(java.lang.String args, java.io.File file)
           
protected  void createMasterPasswordFile(java.lang.String masterPassword)
          Create the master password keystore.
protected  int executeCommand()
           
protected  boolean isDirectory(java.io.File f)
          Override this method if your class does NOT want CommandException thrown if directory does not exist.
protected  boolean mkdirs(java.io.File f)
          Override this method if your class does NOT want to create directories
protected  boolean setServerDirs()
          Override this method if your class does NOT want to set ServerDirs
protected  void validate()
           
 
Methods inherited from class com.sun.enterprise.admin.cli.cluster.LocalInstanceCommand
getDasProperties, getInstallRootPath, getInstanceDirs, getMasterPasswordFile, getNodeInstallDir, getProductRootPath, initInstance, setDasDefaults, 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
 

Field Detail

DEFAULT_MASTER_PASSWORD

protected static final java.lang.String DEFAULT_MASTER_PASSWORD
See Also:
Constant Field Values
Constructor Detail

CreateLocalInstanceCommand

public CreateLocalInstanceCommand()
Method Detail

validate

protected void validate()
                 throws CommandException
Overrides:
validate in class CreateLocalInstanceFilesystemCommand
Throws:
CommandException

executeCommand

protected int executeCommand()
                      throws CommandException,
                             CommandValidationException
Overrides:
executeCommand in class CreateLocalInstanceFilesystemCommand
Throws:
CommandException
CommandValidationException

createMasterPasswordFile

protected void createMasterPasswordFile(java.lang.String masterPassword)
                                 throws CommandException
Create the master password keystore. This routine can also modify the master password if the keystore already exists

Parameters:
masterPassword -
Throws:
CommandException

chmod

protected void chmod(java.lang.String args,
                     java.io.File file)
              throws java.io.IOException
Throws:
java.io.IOException

mkdirs

protected boolean mkdirs(java.io.File f)
Description copied from class: LocalInstanceCommand
Override this method if your class does NOT want to create directories

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

isDirectory

protected boolean isDirectory(java.io.File f)
Description copied from class: LocalInstanceCommand
Override this method if your class does NOT want CommandException thrown if directory does not exist.

Overrides:
isDirectory in class LocalInstanceCommand
Parameters:
f - directory to check

setServerDirs

protected boolean setServerDirs()
Description copied from class: LocalInstanceCommand
Override this method if your class does NOT want to set ServerDirs

Overrides:
setServerDirs in class LocalInstanceCommand


Copyright © 2012 GlassFish Community. All Rights Reserved.