}
protected void validateDeploymentRequestCommon() throws ParameterProblem {
if (this.req == null) {
throw new ParameterProblem("no deployment request is configured");
}
this.validateDeploymentRequestNodeNumber();
final ResourceAllocation_Type ra = this.req.getResourceAllocation();
if (ra == null) {
throw new ParameterProblem("ResourceAllocation is not present");
}
final RangeValue_Type rvt =
this.req.getResourceAllocation().getIndividualPhysicalMemory();
if (rvt == null) {
throw new ParameterProblem(
"memory specification is not present");
}
final GenericIntRange exact = new GenericIntRange(rvt);
if (exact.getMin() != exact.getMax()) {
throw new ParameterProblem(
"memory range requests aren't supported right now");
}
if (this.req.getInitialState() != null) {
final State testing =
State.fromInitialState_Type(this.req.getInitialState());
if (testing == null) {
throw new ParameterProblem(
"initial state in deployment request is unrecognized?");
}
}
final DeploymentTime_Type time = this.req.getDeploymentTime();
if (time == null) {
throw new ParameterProblem("no DeploymentTime_Type in request?");
}
final Duration minDuration = time.getMinDuration();
if (minDuration == null) {
throw new ParameterProblem("no minDuration in request?");
}
try {
if (CommonUtil.durationToSeconds(minDuration) < 1) {
throw new ParameterProblem(
"minDuration in request is less than 1 second?");
}
} catch (InvalidDurationException e) {
throw new ParameterProblem(
"minDuration is invalid: " + e.getMessage(), e);
}
}