private void validateEndpoint() throws ParameterProblem {
this.epr = this.stubConf.getEPR();
if (this.epr == null) {
throw new ParameterProblem(name() + " requires EPR");
}
final String eprStr;
try {
eprStr = EPRUtils.eprToString(this.epr);
} catch (Exception e) {
final String err = CommonUtil.genericExceptionMessageWrapper(e);
throw new ParameterProblem(err, e);
}
if (this.pr.enabled()) {
// xml print
final String dbg =
"\nGiven EPR:\n----------\n" + eprStr + "----------\n";
if (this.pr.useThis()) {
this.pr.dbg(dbg);
} else if (this.pr.useLogging()) {
logger.debug(dbg);
}
}
final String kind;
if (EPRUtils.isInstanceEPR(this.epr)) {
this.instanceDestroy =
new Destroy_Instance(this.epr, this.stubConf, this.pr);
kind = "an instance";
} else if (EPRUtils.isGroupEPR(this.epr)) {
this.groupDestroy =
new Destroy_Group(this.epr, this.stubConf, this.pr);
kind = "a group";
} else if (EPRUtils.isEnsembleEPR(this.epr)) {
this.ensembleDestroy =
new Destroy_Ensemble(this.epr, this.stubConf, this.pr);
kind = "an ensemble";
} else {
throw new ParameterProblem(name() + " requires an instance, " +
"group, or ensemble EPR.");
}
if (this.pr.enabled()) {
final String dbg = "Given EPR is " + kind + " EPR";