) throws Exception {
RequestType request = requestBuilder.createRequest(principal, roles, message);
ResponseType response = performRequest(request, message);
ResultType result = response.getResult();
// Handle any Obligations returned by the PDP
handleObligations(request, principal, message, result);
String resource = requestBuilder.getResource(message);
if (result != null
&& (result.getResourceId() == null || resource.equals(result.getResourceId()))
&& (result.getDecision().getDecision() == DecisionType.DECISION.Permit)) {
LOG.fine("XACML authorization permitted");
return true;
}
LOG.fine("XACML authorization not permitted:");
if (result != null && result.getStatus() != null) {
if (result.getStatus().getStatusCode() != null) {
LOG.fine("XACML Status Code: " + result.getStatus().getStatusCode().getValue());
}
if (result.getStatus().getStatusMessage() != null) {
LOG.fine("XACML Status Message: " + result.getStatus().getStatusMessage().getValue());
}
}
return false;
}