@Override
protected void validate()
throws CommandException {
echoCommand();
if (configName != null && clusterName != null) {
throw new CommandException(
Strings.get("ConfigClusterConflict"));
}
if (lbEnabled != null && clusterName == null) {
throw new CommandException(
Strings.get("lbenabledNotForStandaloneInstance"));
}
setDasDefaultsOnly = true; //Issue 12847 - Call super.validate to setDasDefaults only
super.validate(); //so _validate-node uses das host from das.properties. No dirs created.
if (node != null) {
//BugDB 13431949 - If installdir is not specified on node, call _validate-node on DAS to populate installdir.
//If installdir is specified on node, validate installdir locally so we can take advantage of java path processing to
//normalize the installdir from the node.
//If installdir has tokens, call _validate-node on DAS to have DAS resolve the tokens
//If we are on Windows, call _validate-node on DAS instead of relying on the path processing in the local validation.
String nodeInstallDir = getNodeInstallDir();
if (nodeInstallDir == null || nodeInstallDir.isEmpty() || TokenResolver.hasToken(nodeInstallDir) || OS.isWindows()) {
validateNode(node, getProductRootPath(), getInstanceHostName(true));
} else {
validateNodeInstallDirLocal(nodeInstallDir, getProductRootPath());
validateNode(node, null, getInstanceHostName(true));
}
}
if (!rendezvousWithDAS()) {
throw new CommandException(
Strings.get("Instance.rendezvousFailed", DASHost, "" + DASPort));
}
if (instanceName.equals(SystemPropertyConstants.DAS_SERVER_NAME)) {
throw new CommandException(
Strings.get("Instance.alreadyExists", SystemPropertyConstants.DAS_SERVER_NAME));
}
setDomainName();
setDasDefaultsOnly = false;
super.validate(); // instanceName is validated and set in super.validate(), directories created
INSTANCE_DOTTED_NAME = "servers.server." + instanceName;
RENDEZVOUS_DOTTED_NAME = INSTANCE_DOTTED_NAME + ".property." + RENDEZVOUS_PROPERTY_NAME;
_rendezvousOccurred = rendezvousOccurred();
if (_rendezvousOccurred) {
throw new CommandException(
Strings.get("Instance.rendezvousAlready", instanceName));
}
}