use of com.sun.enterprise.admin.cli.remote.RemoteCLICommand in project Payara by payara.
the class BackupDomainCommand method isSuspended.
/**
* This method determines if the DAS is currently suspended.
*/
private boolean isSuspended() {
try {
RemoteCLICommand cmd = new RemoteCLICommand("suspend-domain", programOpts, env);
String response = cmd.executeAndReturnOutput("suspend-domain", "--_test=true");
if (response.indexOf("SUSPENDED=TRUE") >= 0)
return true;
} catch (Exception e) {
logger.info("Exception while probing DAS (suspend-domain): " + e.getMessage());
}
return false;
}
use of com.sun.enterprise.admin.cli.remote.RemoteCLICommand in project Payara by payara.
the class BackupDomainCommand method canSuspend.
/**
* This method determines if the DAS has the ability to suspend itself.
*/
private boolean canSuspend() {
try {
RemoteCLICommand cmd = new RemoteCLICommand("list-commands", programOpts, env);
String response = cmd.executeAndReturnOutput("list-commands");
if (response.indexOf("suspend-domain") >= 0)
return true;
} catch (Exception e) {
logger.info("Exception while probing DAS (list-commands): " + e.getMessage());
}
return false;
}
use of com.sun.enterprise.admin.cli.remote.RemoteCLICommand in project Payara by payara.
the class CreateLocalInstanceCommand method rendezvousOccurred.
private boolean rendezvousOccurred() {
boolean rendezvousOccurred = false;
RemoteCLICommand rc = null;
try {
rc = new RemoteCLICommand("get", this.programOpts, this.env);
String s = rc.executeAndReturnOutput("get", RENDEZVOUS_DOTTED_NAME);
String val = s.substring(s.indexOf("=") + 1);
rendezvousOccurred = Boolean.parseBoolean(val);
logger.log(Level.FINER, "rendezvousOccurred = {0} for instance {1}", new Object[] { val, instanceName });
} catch (CommandException ce) {
logger.log(Level.FINER, RENDEZVOUS_PROPERTY_NAME + " property may not be set yet on {0}", instanceName);
}
return rendezvousOccurred;
}
use of com.sun.enterprise.admin.cli.remote.RemoteCLICommand in project Payara by payara.
the class CreateLocalInstanceCommand method registerToDAS.
private int registerToDAS() throws CommandException {
ArrayList<String> argsList = new ArrayList<String>();
argsList.add(0, "_register-instance");
if (clusterName != null) {
argsList.add("--cluster");
argsList.add(clusterName);
}
if (lbEnabled != null) {
argsList.add("--lbenabled");
argsList.add(lbEnabled.toString());
}
if (configName != null) {
argsList.add("--config");
argsList.add(configName);
}
if (_node != null) {
argsList.add("--node");
argsList.add(_node);
}
argsList.add("--checkports");
argsList.add(String.valueOf(checkPorts));
if (portBase != null) {
argsList.add("--portbase");
argsList.add(portBase);
}
if (systemProperties != null) {
argsList.add("--systemproperties");
argsList.add(systemProperties);
}
argsList.add("--properties");
argsList.add(RENDEZVOUS_PROPERTY_NAME + "=true");
argsList.add(this.instanceName);
String[] argsArray = new String[argsList.size()];
argsArray = argsList.toArray(argsArray);
RemoteCLICommand rc = new RemoteCLICommand("_register-instance", this.programOpts, this.env);
return rc.execute(argsArray);
}
use of com.sun.enterprise.admin.cli.remote.RemoteCLICommand in project Payara by payara.
the class CreateLocalInstanceCommand method bootstrapSecureAdminFiles.
private int bootstrapSecureAdminFiles() throws CommandException {
RemoteCLICommand rc = new RemoteCLICommand("_bootstrap-secure-admin", this.programOpts, this.env);
rc.setFileOutputDirectory(instanceDir);
final int result = rc.execute(new String[] { "_bootstrap-secure-admin" });
return result;
}
Aggregations