Class ImportSyncBundleCommand
- java.lang.Object
-
- com.sun.enterprise.admin.cli.CLICommand
-
- com.sun.enterprise.admin.servermgmt.cli.LocalServerCommand
-
- com.sun.enterprise.admin.cli.cluster.LocalInstanceCommand
-
- com.sun.enterprise.admin.cli.cluster.ImportSyncBundleCommand
-
- All Implemented Interfaces:
org.glassfish.hk2.api.PostConstruct
@Service(name="import-sync-bundle") @PerLookup public class ImportSyncBundleCommand extends LocalInstanceCommand
This is a local command that unbundles the bundle generated by export-sync-bundle. import-sync-bundle applies the content under ${com.sun.aas.instanceRoot}/ directory. Synchronization cookie with DAS's timestamp should be created. It also creates das.properties (if not present) under agent dir (ex. installRoot/glassfish4/glassfish/nodes//agent/config/das.properties). Before running this command the instance should already have been registered in DAS (server element created in DAS domain.xml) by running create-instance. This command does not validate --node or instance_name. For upgrade - this command creates a new instance filesystem if it does not exist. and completes DAS registration by setting rendezvousOccurred=true. For manual sync - this command creates a new instance filesystem or updates the directories of an existing instance (remove existing application, generated, config, docroot, lib dir first and explode the zip) and completes registration with DAS by setting rendezvousOccurred=true. If setting of rendezvousOccurred=true with DAS fails, the command does not not fail. Only a warning is printed out in the command output. We provide the exact "asadmin set command" in this warning so that user can run that command on DAS to change the rendezvousOccurred property for the server instance. Usage: import-sync-bundle [--node node_name] [--nodedir node_path] --file xyz-sync-bundle.zip instance_name --node name of the node; this is optional. The command fails if there is more than one node under the default location (installRoot/glassfish4/glassfish/nodes/ /) --nodedir parent dir where node is created; this is optional. Default location is installRoot/glassfish4/glassfish/nodes/ --file sync bundle created by export-sync-bundle instance_name name of the server instance
-
-
Field Summary
Fields Modifier and Type Field Description protected String
nodeParam
-
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.servermgmt.cli.LocalServerCommand
DEFAULT_MASTER_PASSWORD
-
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 ImportSyncBundleCommand()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
executeCommand()
Execute the command using the options in options and the operands in operands.protected void
validate()
The validate method can be used by a subclass to validate that the type and quantity of parameters and operands matches the requirements for this command.-
Methods inherited from class com.sun.enterprise.admin.cli.cluster.LocalInstanceCommand
getDasProperties, getInstanceDirs, getInstanceName, getMasterPasswordFile, getNodeInstallDir, getNodeProperties, getProductRootPath, initInstance, isDirectory, mkdirs, setDasDefaults, setInstanceName, setServerDirs, validateDasOptions, whackFilesystem
-
Methods inherited from class com.sun.enterprise.admin.servermgmt.cli.LocalServerCommand
checkAdditionalTrustAndKeyStores, checkForSpecialFiles, dataGridEncryptionEnabled, getAdminAddress, getAdminAddress, getDomainXml, getInstallRootPath, getMasterPassword, getPrevPid, getServerDirs, getServerPid, getUptime, isLocal, isRemote, isRestartable, isRunning, isRunning, isThisServer, loadAndVerifyKeystore, readFromMasterPasswordFile, resetServerDirs, setLocalPassword, setServerDirs, unsetLocalPassword, verifyMasterPassword, waitForRestart, waitForRestart
-
Methods inherited from class com.sun.enterprise.admin.cli.CLICommand
buildLineReader, buildTerminal, checkHelp, closeTerminal, execute, execute, 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
-
-
-
-
Field Detail
-
nodeParam
protected String nodeParam
-
-
Method Detail
-
validate
protected void validate() throws CommandException
Description copied from class:CLICommand
The validate method can be used by a subclass to validate that the type and quantity of parameters and operands matches the requirements for this command.- Overrides:
validate
in classLocalInstanceCommand
- Throws:
CommandException
- if execution of the command failsCommandValidationException
- if there's something wrong with the options or arguments
-
executeCommand
protected int executeCommand() throws CommandException
Description copied from class:CLICommand
Execute the command using the options in options and the operands in operands.- Specified by:
executeCommand
in classCLICommand
- Returns:
- the exit code
- Throws:
CommandException
- if execution of the command failsCommandValidationException
- if there's something wrong with the options or arguments
-
-