Package org.opensaml.xacml.ctx

Examples of org.opensaml.xacml.ctx.ResultType


            decisionType.setDecision(DecisionType.DECISION.Permit);
        } else {
            decisionType.setDecision(DecisionType.DECISION.Deny);
        }
       
        ResultType result = resultTypeBuilder.buildObject();
        result.setDecision(decisionType);
       
        StatusType status = statusTypeBuilder.buildObject();
        StatusCodeType statusCode = statusCodeTypeBuilder.buildObject();
        statusCode.setValue("urn:oasis:names:tc:xacml:1.0:status:ok");
        status.setStatusCode(statusCode);
        result.setStatus(status);
       
        ResponseType response = responseTypeBuilder.buildObject();
        response.setResult(result);
       
        return response;
View Full Code Here


            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);
       
        if (result != null
            && (result.getDecision().getDecision() == DecisionType.DECISION.Permit)
            && (result.getResourceId() == null)) {
            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;
    }
View Full Code Here

            decisionType.setDecision(DecisionType.DECISION.Permit);
        } else {
            decisionType.setDecision(DecisionType.DECISION.Deny);
        }
       
        ResultType result = resultTypeBuilder.buildObject();
        result.setDecision(decisionType);
       
        StatusType status = statusTypeBuilder.buildObject();
        StatusCodeType statusCode = statusCodeTypeBuilder.buildObject();
        statusCode.setValue("urn:oasis:names:tc:xacml:1.0:status:ok");
        status.setStatusCode(statusCode);
        result.setStatus(status);
       
        ResponseType response = responseTypeBuilder.buildObject();
        response.setResult(result);
       
        return response;
View Full Code Here

            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);
       
        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;
    }
View Full Code Here

        @SuppressWarnings("unchecked")
        XACMLObjectBuilder<StatusCodeType> statusCodeTypeBuilder =
            (XACMLObjectBuilder<StatusCodeType>)
            builderFactory.getBuilder(StatusCodeType.DEFAULT_ELEMENT_NAME);
           
        ResultType result = resultTypeBuilder.buildObject();

        DecisionType decisionType = decisionTypeBuilder.buildObject();
        decisionType.setDecision(decision);
        result.setDecision(decisionType);
       
        StatusType status = statusTypeBuilder.buildObject();
        StatusCodeType statusCode = statusCodeTypeBuilder.buildObject();
        statusCode.setValue("urn:oasis:names:tc:xacml:1.0:status:ok");
        status.setStatusCode(statusCode);
        result.setStatus(status);
       
        ResponseType response = responseTypeBuilder.buildObject();
        response.setResult(result);
        return response;
    }
View Full Code Here

            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;
    }
View Full Code Here

        super(targetNamespaceURI, targetLocalName);
    }

    /** {@inheritDoc} */
    protected void marshallAttributes(XMLObject samlElement, Element domElement) throws MarshallingException {
        ResultType result = (ResultType) samlElement;

        if (result.getResourceId() != null) {
            domElement.setAttributeNS(null, ResultType.RESOURCE_ID_ATTTRIB_NAME, result.getResourceId());
        }
    }
View Full Code Here

        super(targetNamespaceURI, targetLocalName);
    }

    /** {@inheritDoc} */
    protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException {
        ResultType result = (ResultType) xmlObject;
        if (attribute.getLocalName().equals(ResultType.RESOURCE_ID_ATTTRIB_NAME)) {
            result.setResourceId(attribute.getValue());
        } else {
            super.processAttribute(xmlObject, attribute);
        }
    }
View Full Code Here

        }
    }

    /** {@inheritDoc} */
    protected void processChildElement(XMLObject parentObject, XMLObject childObject) throws UnmarshallingException {
        ResultType result = (ResultType) parentObject;

        if (childObject instanceof ObligationsType) {
            result.setObligations((ObligationsType) childObject);
        } else if (childObject instanceof StatusType) {
            result.setStatus((StatusType) childObject);
        } else if (childObject instanceof DecisionType) {
            result.setDecision((DecisionType) childObject);
        } else {
            super.processChildElement(parentObject, childObject);
        }
    }
View Full Code Here

            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);
       
        if (result == null) {
            return false;
        }

        DECISION decision = result.getDecision() != null ? result.getDecision().getDecision() : DECISION.Deny;
        String code = "";
        String statusMessage = "";
        if (result.getStatus() != null) {
            StatusType status = result.getStatus();
            code = status.getStatusCode() != null ? status.getStatusCode().getValue() : "";
            statusMessage = status.getStatusMessage() != null ? status.getStatusMessage().getValue() : "";
        }
        LOG.fine("XACML authorization result: " + decision + ", code: " + code + ", message: " + statusMessage);
        return decision == DECISION.Permit;
View Full Code Here

TOP

Related Classes of org.opensaml.xacml.ctx.ResultType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.