/** * Bootstraps the instance for remote admin. * * @throws IOException */ public void bootstrapInstance() throws BootstrapException { try { mkdirs(); copyBootstrapFiles(); backdateInstanceDomainXML(); } catch (Exception ex) { throw new BootstrapException(ex); } }
@Override public final void execute(AdminCommandContext context) { populateBaseClass(); executeInternal(context); }
private void validateRemoteConnection(ParameterMap map) throws CommandValidationException { // guaranteed to either get a valid type -- or a CommandValidationException RemoteType type = parseType(map); // just too difficult to refactor now... if (type == RemoteType.SSH) validateSSHConnection(map); }
@Override protected void backdateInstanceDomainXML() throws BootstrapException { final String remoteDomainXML = remoteInstanceDir + DOMAIN_XML_PATH; try { setLastModified(remoteDomainXML, 0); } catch (IOException ex) { throw new BootstrapException(launcher, ex); } logger.log(Level.FINE, "Backdated the instance's copy of domain.xml"); }
@Override protected void backdateInstanceDomainXML() throws BootstrapException { final String remoteDomainXML = remoteInstanceDir + DOMAIN_XML_PATH; try { setLastModified(remoteDomainXML, 0); } catch (IOException ex) { throw new BootstrapException(launcher, ex); } logger.log(Level.FINE, "Backdated the instance's copy of domain.xml"); }
private boolean checkEnvAndParams() { if (containerType == null) { return fail(Strings.get("list.persistence.types.null.parameter")); } if (!containerType.equals("ejb") && !containerType.equals("web")) { return fail(Strings.get("list.persistence.types.invalid.parameter", containerType)); } // ok to go return true; }
@Override public Object run(Configs configs ) throws PropertyVetoException, TransactionFailure { return copyConfig(configs,config,configName,logger); } } ,domain.getConfigs());
private void mkdirs() throws IOException { for (String dirPath : SECURE_ADMIN_FILE_DIRS_TO_CREATE) { mkdirs(dirPath); } }
void runAdminCommandOnNode(Node node, List<String> command, AdminCommandContext context, String firstErrorMessage, String humanCommand, StringBuilder output) { runAdminCommandOnNode(node, command, context, firstErrorMessage, humanCommand, output, true); }
/** * Creates a new helper for delivering files needed for secure admin to * the local instance (local meaning on the same node as the DAS). * * @param existingInstanceDir directory of an existing instance (typically the DAS) from where the files can be copied * @param newInstanceDir directory of the new instance to where the files will be copied * * @return the local helper */ public static SecureAdminBootstrapHelper getLocalHelper( final File existingInstanceDir, final File newInstanceDir) { return new LocalHelper(existingInstanceDir, newInstanceDir); }
@Override public final void execute(AdminCommandContext context) { executeInternal(context); } /**
/** * Bootstraps the instance for remote admin. * * @throws IOException */ public void bootstrapInstance() throws BootstrapException { try { mkdirs(); copyBootstrapFiles(); backdateInstanceDomainXML(); } catch (Exception ex) { throw new BootstrapException(ex); } }
@Override public Object run(Configs configs ) throws PropertyVetoException, TransactionFailure { return copyConfig(configs,config,configName,logger); } } ,domain.getConfigs());
private void mkdirs() throws IOException { for (String dirPath : SECURE_ADMIN_FILE_DIRS_TO_CREATE) { mkdirs(dirPath); } }
void runAdminCommandOnNode(Node node, List<String> command, AdminCommandContext context, String firstErrorMessage, String humanCommand, StringBuilder output) { runAdminCommandOnNode(node, command, context, firstErrorMessage, humanCommand, output, true); } }