} else {
log.debug("Processing " + gatekeeperMessage.getSignatureRequests().length
+ " object signature requests");
// Process each signature request.
for (int i = 0; i < gatekeeperMessage.getSignatureRequests().length; i++) {
SignatureRequest signatureRequest = (SignatureRequest) gatekeeperMessage.getSignatureRequests()[i];
// Determine whether the request will be allowed. If the request is not allowed, the
// reason will be made available in the signature request object (with signatureRequest.declineRequest())
boolean allowed = authorizer.allowSignatureRequest(gatekeeperMessage, clientInformation, signatureRequest);
// Sign requests when they are allowed. When a request is signed, the signed URL is made available
// in the SignatureRequest object.
if (allowed) {
String signedUrl = null;
if (SignatureRequest.SIGNATURE_TYPE_GET.equals(signatureRequest.getSignatureType())) {
signedUrl = urlSigner.signGet(gatekeeperMessage, clientInformation, signatureRequest);
} else if (SignatureRequest.SIGNATURE_TYPE_HEAD.equals(signatureRequest.getSignatureType())) {
signedUrl = urlSigner.signHead(gatekeeperMessage, clientInformation, signatureRequest);
} else if (SignatureRequest.SIGNATURE_TYPE_PUT.equals(signatureRequest.getSignatureType())) {
signedUrl = urlSigner.signPut(gatekeeperMessage, clientInformation, signatureRequest);
} else if (SignatureRequest.SIGNATURE_TYPE_DELETE.equals(signatureRequest.getSignatureType())) {
signedUrl = urlSigner.signDelete(gatekeeperMessage, clientInformation, signatureRequest);
} else if (SignatureRequest.SIGNATURE_TYPE_ACL_LOOKUP.equals(signatureRequest.getSignatureType())) {
signedUrl = urlSigner.signGetAcl(gatekeeperMessage, clientInformation, signatureRequest);
} else if (SignatureRequest.SIGNATURE_TYPE_ACL_UPDATE.equals(signatureRequest.getSignatureType())) {
signedUrl = urlSigner.signPutAcl(gatekeeperMessage, clientInformation, signatureRequest);
}
signatureRequest.signRequest(signedUrl);
}
}
}
// Build response as a set of properties, and return this document.