LOG.log(Level.FINE, DOM2Writer.nodeToString(requestElement));
}
ResponseType response = performRequest(request, message);
ResultType result = response.getResult();
// Handle any Obligations returned by the PDP
handleObligations(request, principal, message, result);
List<String> resources = requestBuilder.getResources(message);
if (result != null
&& (result.getDecision().getDecision() == DecisionType.DECISION.Permit)) {
if (result.getResourceId() == null) {
LOG.fine("XACML authorization permitted");
return true;
}
for (String resource : resources) {
if (resource.equals(result.getResourceId())) {
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;
}