Package org.opensaml.xacml.policy

Examples of org.opensaml.xacml.policy.RuleType


        super();
    }

    /** {@inheritDoc} */
    protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
        RuleType ruleType = (RuleType) xmlObject;

        if (!DatatypeHelper.isEmpty(ruleType.getRuleId())) {
            domElement.setAttribute(RuleType.RULE_ID_ATTRIB_NAME, ruleType.getRuleId());
        }
       
        if(!DatatypeHelper.isEmpty(ruleType.getEffect().toString())){
            if(ruleType.getEffect().equals(EffectType.Deny)){
                domElement.setAttribute(RuleType.EFFECT_ATTRIB_NAME,EffectType.Deny.toString());
            }else{
                domElement.setAttribute(RuleType.EFFECT_ATTRIB_NAME,EffectType.Permit.toString());
            }
        }
View Full Code Here


    }

   
    /** {@inheritDoc} */
    protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException {
        RuleType ruleType = (RuleType) xmlObject;
     
        if(attribute.getLocalName().equals(RuleType.EFFECT_ATTRIB_NAME)){
            ruleType.setEffect(EffectType.valueOf(
                    DatatypeHelper.safeTrimOrNullString(attribute.getValue())));                      
        } else if(attribute.getLocalName().equals(RuleType.RULE_ID_ATTRIB_NAME)){
            ruleType.setRuleId(DatatypeHelper.safeTrimOrNullString(attribute.getValue()));
        } else {
            super.processAttribute(xmlObject, attribute);
        }

    }
View Full Code Here

    }

    /** {@inheritDoc} */
    protected void processChildElement(XMLObject parentXMLObject, XMLObject childXMLObject)
            throws UnmarshallingException {
        RuleType ruleType = (RuleType) parentXMLObject;
       
        if(childXMLObject instanceof TargetType){
            ruleType.setTarget((TargetType)childXMLObject);
        } else if(childXMLObject instanceof DescriptionType){
            ruleType.setDescription((DescriptionType)childXMLObject);
        }else if(childXMLObject instanceof ConditionType){
            ruleType.setCondition((ConditionType)childXMLObject);
        } else {
            super.processChildElement(parentXMLObject, childXMLObject);
        }
    }
View Full Code Here

    }

    private void removeRule(PapContainer papContainer, String id) {
        List<PolicyType> policyList = papContainer.getAllPolicies();
        PolicyType targetPolicy = null;
        RuleType targetRule = null;

        for (PolicyType policy : policyList) {
            List<RuleType> ruleList = policy.getRules();

            for (RuleType rule : ruleList) {
View Full Code Here

    private static final RuleHelper instance = new RuleHelper();

    private RuleHelper() {}

    public static RuleType build(String ruleId, EffectType effect) {
        RuleType rule = (RuleType) builderFactory.getBuilder(elementQName).buildObject(elementQName);
        rule.setRuleId(ruleId);
        rule.setEffect(effect);
        return rule;
    }
View Full Code Here

        if (targetPolicy == null) {
            throw new RepositoryException("Id not found or not a rule-id: " + pivotId);
        }

        RuleType rule = PolicyHelper.removeRule(targetPolicy, id);

        if (rule == null) {
            throw new RepositoryException(String.format("Id \"%s\" not found into action \"%s\"",
                                                        id,
                                                        targetPolicy.getPolicyId()));
View Full Code Here

            return null;
        }

        List<RuleType> ruleList = policy.getRules();

        RuleType targetRule = null;

        for (RuleType rule : ruleList) {
            if (ruleId.equals(rule.getRuleId())) {
                targetRule = rule;
                break;
View Full Code Here

TOP

Related Classes of org.opensaml.xacml.policy.RuleType

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.