@Override protected void backdateInstanceDomainXML() throws BootstrapException { final File newDomainXMLFile = new File(newInstanceDirURI.resolve(DOMAIN_XML_PATH)); if (!newDomainXMLFile.setLastModified(0)) { throw new RuntimeException(Strings.get("secure.admin.boot.errSetLastMod", newDomainXMLFile.getAbsolutePath())); } }
@Override protected void mkdirs(String dir) { final File newDir = new File(newInstanceDirURI.resolve(dir)); if (!newDir.exists() && !newDir.mkdirs()) { throw new RuntimeException(Strings.get("secure.admin.boot.errCreDir", newDir.getAbsolutePath())); } }
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; }
private String pollForDeath() { int counter = 0; // 120 seconds while (++counter < 240) { if (!instance.isRunning()) return null; try { Thread.sleep(500); } catch (Exception e) { // ignore } } return Strings.get("stop.instance.timeout", instanceName); }
/** * * @param node the node of interest * @return null if all-OK, otherwise return an error message */ @Override protected String validateSubType(Node node) { if (!NodeUtils.isSSHNode(node)) { return Strings.get("notSshNode", name); } return null; } }
private String pollForDeath() { int counter = 0; // 120 seconds while (++counter < 240) { if (!instance.isRunning()) return null; try { Thread.sleep(500); } catch (Exception e) { // ignore } } return Strings.get("stop.instance.timeout", instanceName); }
private String pollForLife(Server instance) { int counter = 0; // 120 seconds while (++counter < 240) { if (instance.isRunning()) return null; try { Thread.sleep(500); } catch (Exception e) { // ignore } } return Strings.get("start.instance.timeout", instanceName); }
private String pollForLife() { int counter = 0; // 120 seconds while (++counter < 240) { if (instance.isRunning()) return null; try { Thread.sleep(500); } catch (Exception e) { // ignore } } return Strings.get("start.instance.timeout", instanceName); }
void validateHostName(String hostName) throws CommandValidationException { if (! StringUtils.ok(hostName)) { throw new CommandValidationException( Strings.get("nodehost.required")); } try { // Check if hostName is valid by looking up it's address InetAddress addr = InetAddress.getByName(hostName); } catch (UnknownHostException e) { throw new CommandValidationException( Strings.get("unknown.host", hostName), e); } }
private int reportFailure(final Exception ex, final ActionReport report) { String msg = Strings.get("create.instance.local.boot.failed", instance, node, nodeHost); logger.log(Level.SEVERE, msg, ex); report.setActionExitCode(ActionReport.ExitCode.FAILURE); report.setMessage(msg); return 1; }
private boolean checkEnvAndParams(Logger logger, ActionReport report) { // first check that we're the DAS if (!env.isDas()) { return setFail(logger, report, Strings.get("get.health.onlyRunsOnDas")); } // check that cluster exists Cluster cluster = domain.getClusterNamed(clusterName); if (cluster == null) { return setFail(logger, report, Strings.get("get.health.noCluster", clusterName)); } // ok to go return true; }
private boolean checkEnvAndParams() { // first check that we're the DAS if (!env.isDas()) { return setFail(Strings.get("get.health.onlyRunsOnDas")); } // check that cluster exists Cluster cluster = domain.getClusterNamed(clusterName); if (cluster == null) { return setFail(Strings.get("get.health.noCluster", clusterName)); } // ok to go return true; }
public void execute(AdminCommandContext context) { if (!env.isInstance()) { String msg = Strings.get("stop.instance.notInstance", env.getRuntimeType().toString()); context.getLogger().warning(msg); return; } doExecute(habitat, env, force); } }
private void setOldPid() throws CommandException { if (isError()) return; oldPid = getPid(); if (!StringUtils.ok(oldPid)) setError(Strings.get("restart.instance.nopid", instanceName)); }
private void setOldPid() throws CommandException { if (isError()) return; oldPid = getPid(); if (!StringUtils.ok(oldPid)) setError(Strings.get("restart.instance.nopid", instanceName)); }
public void execute(AdminCommandContext context) { if (!env.isInstance()) { String msg = Strings.get("stop.instance.notInstance", env.getRuntimeType().toString()); context.getLogger().warning(msg); return; } doExecute(habitat, env, context.getLogger(), force); } }
@Override public void execute(AdminCommandContext context) { if (!env.isInstance()) { String msg = Strings.get("restart.instance.notInstance", env.getRuntimeType().toString()); context.getLogger().warning(msg); return; } setRegistry(registry); setServerName(env.getInstanceName()); if (debug != null) setDebug(debug); doExecute(context); } }
@Override public void execute(AdminCommandContext context) { if (!env.isInstance()) { String msg = Strings.get("restart.instance.notInstance", env.getRuntimeType().toString()); context.getLogger().warning(msg); return; } setRegistry(registry); setServerName(env.getInstanceName()); if (debug != null) setDebug(debug); doExecute(context); } }