}
long requestDur = 0;
for (int i = 0; i < bindings.length; i++) {
final VirtualMachineDeployment dep = bindings[i].getDeployment();
if (dep == null) {
final String msg = "ERROR: No deployment information in " +
"binding, can't make decision.";
buf.append(msg);
logger.error(buf.toString());
throw new AuthorizationException(msg);
}
final long seconds = dep.getMinDuration();
requestDur += seconds / 60;
}
final Double doubleRequestDur = requestDur * chargeRatio;
requestDur = doubleRequestDur.longValue();
if (bindings.length > 1) {
buf.append("Duration total of all requests in group: ");
} else {
buf.append("Duration request: ");
}
buf.append(requestDur)
.append("\n");
// zero or below means no check should be made
if (rights.getMaxCPUs() > 0) {
final long maxCPUs = rights.getMaxCPUs();
for (int i = 0; i < bindings.length; i++) {
final VirtualMachineDeployment dep = bindings[i].getDeployment();
if (dep == null) {
final String msg = "ERROR: No deployment information in " +
"binding, can't make decision.";
buf.append(msg);
logger.error(buf.toString());
throw new AuthorizationException(msg);
}
final long currentCPUs = dep.getIndividualCPUCount();
if (currentCPUs > maxCPUs) {
buf.append("\nDenied: Requested CPU count (")
.append(currentCPUs)
.append(") + is greater or equal to maximum CPU count (")