Package org.opensaml.xacml.policy

Examples of org.opensaml.xacml.policy.AttributeValueType


        super();
    }   

    /** {@inheritDoc} */
    protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException {
        AttributeValueType attributeValue = (AttributeValueType) xmlObject;

        QName attribQName = XMLHelper.getNodeQName(attribute);
        if (attribute.isId()) {
            attributeValue.getUnknownAttributes().registerID(attribQName);
        }
        attributeValue.getUnknownAttributes().put(attribQName, attribute.getValue());
       
        if(attribute.getLocalName().equals(AttributeValueType.DATA_TYPE_ATTRIB_NAME)){
          attributeValue.setDataType(DatatypeHelper.safeTrimOrNullString(attribute.getValue()));
        }
    }
View Full Code Here


    }

    /** {@inheritDoc} */
    protected void processChildElement(XMLObject parentXMLObject, XMLObject childXMLObject)
            throws UnmarshallingException {
        AttributeValueType attributeValue = (AttributeValueType) parentXMLObject;
        attributeValue.getUnknownXMLObjects().add(childXMLObject);
    }
View Full Code Here

        attributeValue.getUnknownXMLObjects().add(childXMLObject);
    }

    /** {@inheritDoc} */
    protected void processElementContent(XMLObject xmlObject, String elementContent) {
        AttributeValueType attributeValue = (AttributeValueType) xmlObject;
        attributeValue.setValue(elementContent);
    }
View Full Code Here

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

        if(!DatatypeHelper.isEmpty(attributeValue.getDataType())){
          domElement.setAttributeNS(null,AttributeAssignmentType.DATA_TYPE_ATTRIB_NAME, attributeValue.getDataType());
        }
       
        Attr attribute;
        for (Entry<QName, String> entry : attributeValue.getUnknownAttributes().entrySet()) {
            attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), entry.getKey());
            attribute.setValue(entry.getValue());
            domElement.setAttributeNodeNS(attribute);
            if (Configuration.isIDAttribute(entry.getKey())
                    || attributeValue.getUnknownAttributes().isIDAttribute(entry.getKey())) {
                attribute.getOwnerElement().setIdAttributeNode(attribute, true);
            }
        }
    }
View Full Code Here

        }
    }

    /** {@inheritDoc} */
    protected void marshallElementContent(XMLObject xmlObject, Element domElement) throws MarshallingException {
        AttributeValueType attributeValue = (AttributeValueType) xmlObject;

        if (attributeValue.getValue() != null) {
            XMLHelper.appendTextContent(domElement, attributeValue.getValue());
        }
    }
View Full Code Here

                AttributeDesignatorType.SUBJECT_ATTRIBUTE_DESIGNATOR_ELEMENT_NAME, attribute);

       
        String attributeDataType =  (matchFunctionDatatype == null ?attribute.getDataType() : matchFunctionDatatype);
       
        AttributeValueType policyAttributeValue = PolicyAttributeValueHelper.build(attributeDataType,
                CtxAttributeTypeHelper.getFirstValue(attribute));

        subjectMatch.setSubjectAttributeDesignator(designator);
        subjectMatch.setAttributeValue(policyAttributeValue);
        subjectMatch.setMatchId(matchFunctionId);
View Full Code Here

        return subjectMatch;
    }

    public static AttributeType getAttribute(SubjectMatchType subjectMatch) {

        AttributeValueType policyAttributeValue = subjectMatch.getAttributeValue();

        AttributeDesignatorType designator = subjectMatch.getSubjectAttributeDesignator();
        if (designator == null) { // TODO: throw exception
            log.error("DESIGNATOR IS MISSING");
        }

        return CtxAttributeTypeHelper.build(designator.getAttributeId(), policyAttributeValue.getDataType(), policyAttributeValue
                .getValue());

    }
View Full Code Here

        AttributeDesignatorType designator = AttributeDesignatorHelper.build(
                AttributeDesignatorType.RESOURCE_ATTRIBUTE_DESIGNATOR_ELEMENT_NAME, attribute);

        String attributeDataType =  (matchFunctionDatatype == null ?attribute.getDataType() : matchFunctionDatatype);
       
        AttributeValueType policyAttributeValue = PolicyAttributeValueHelper.build(attributeDataType,
                CtxAttributeTypeHelper.getFirstValue(attribute));

        resourceMatch.setResourceAttributeDesignator(designator);
        resourceMatch.setAttributeValue(policyAttributeValue);
        resourceMatch.setMatchId(matchFunctionId);
View Full Code Here

        return resultList;
    }

    public static AttributeType getAttribute(ResourceMatchType resourceMatch) {

        AttributeValueType policyAttributeValue = resourceMatch.getAttributeValue();
        String attributeId = resourceMatch.getResourceAttributeDesignator().getAttributeId();
        return CtxAttributeTypeHelper.build(attributeId, policyAttributeValue.getDataType(), policyAttributeValue.getValue());

    }
View Full Code Here

    private PolicyAttributeValueHelper() {}

    public static AttributeValueType build(String type, String value) {

        AttributeValueType attributeValue = (AttributeValueType) builderFactory.getBuilder(elementQName)
                .buildObject(elementQName);

        attributeValue.setDataType(type);
        attributeValue.setValue(value);

        return attributeValue;
    }
View Full Code Here

TOP

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

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.