Examples of AttributeValueType


Examples of org.opensaml.xacml.ctx.AttributeValueType

    ) {
        if (attributeValueTypeBuilder == null) {
            attributeValueTypeBuilder = (XACMLObjectBuilder<AttributeValueType>)
                builderFactory.getBuilder(AttributeValueType.DEFAULT_ELEMENT_NAME);
        }
        AttributeValueType attributeValue = attributeValueTypeBuilder.buildObject();
        attributeValue.setValue(value);
       
        return attributeValue;
    }
View Full Code Here

Examples of org.opensaml.xacml.ctx.AttributeValueType

    private static CtxAttributeValueHelper instance = new CtxAttributeValueHelper();

    private CtxAttributeValueHelper() {}

    public static AttributeValueType build(String value) {
        AttributeValueType attributeValue = (AttributeValueType) builderFactory.getBuilder(elementQName)
                .buildObject(elementQName);
       
        attributeValue.setValue(value);
       
        return attributeValue;
    }
View Full Code Here

Examples of org.opensaml.xacml.ctx.AttributeValueType

        String resource = getResource(message);
        String actionToUse = getAction(message);
       
        // Subject
        List<AttributeType> attributes = new ArrayList<AttributeType>();
        AttributeValueType subjectIdAttributeValue =
            RequestComponentBuilder.createAttributeValueType(principal.getName());
        AttributeType subjectIdAttribute =
            RequestComponentBuilder.createAttributeType(
                    XACMLConstants.SUBJECT_ID,
                    XACMLConstants.XS_STRING,
                    issuer,
                    Collections.singletonList(subjectIdAttributeValue)
            );
        attributes.add(subjectIdAttribute);
       
        for (String role : roles) {
            AttributeValueType subjectRoleAttributeValue =
                RequestComponentBuilder.createAttributeValueType(role);
            AttributeType subjectRoleAttribute =
                RequestComponentBuilder.createAttributeType(
                        XACMLConstants.SUBJECT_ROLE,
                        XACMLConstants.XS_ANY_URI,
                        issuer,
                        Collections.singletonList(subjectRoleAttributeValue)
                );
            attributes.add(subjectRoleAttribute);
        }
        SubjectType subjectType = RequestComponentBuilder.createSubjectType(attributes, null);
       
        // Resource
        AttributeValueType resourceAttributeValue =
            RequestComponentBuilder.createAttributeValueType(resource);
        AttributeType resourceAttribute =
            RequestComponentBuilder.createAttributeType(
                    XACMLConstants.RESOURCE_ID,
                    XACMLConstants.XS_STRING,
                    null,
                    Collections.singletonList(resourceAttributeValue)
            );
        attributes.clear();
        attributes.add(resourceAttribute);
        ResourceType resourceType = RequestComponentBuilder.createResourceType(attributes, null);
       
        // Action
        AttributeValueType actionAttributeValue =
            RequestComponentBuilder.createAttributeValueType(actionToUse);
        AttributeType actionAttribute =
            RequestComponentBuilder.createAttributeType(
                    XACMLConstants.ACTION_ID,
                    XACMLConstants.XS_STRING,
                    null,
                    Collections.singletonList(actionAttributeValue)
            );
        attributes.clear();
        attributes.add(actionAttribute);
        ActionType actionType = RequestComponentBuilder.createActionType(attributes);
       
        // Environment
        attributes.clear();
        if (sendDateTime) {
            DateTime dateTime = new DateTime();
            AttributeValueType environmentAttributeValue =
                RequestComponentBuilder.createAttributeValueType(dateTime.toString());
            AttributeType environmentAttribute =
                RequestComponentBuilder.createAttributeType(
                        XACMLConstants.CURRENT_DATETIME,
                        XACMLConstants.XS_DATETIME,
View Full Code Here

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

Examples of org.opensaml.xacml.policy.AttributeValueType

    }

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

Examples of org.opensaml.xacml.policy.AttributeValueType

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

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

Examples of org.opensaml.xacml.policy.AttributeValueType

        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

Examples of org.opensaml.xacml.policy.AttributeValueType

        }
    }

    /** {@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

Examples of org.opensaml.xacml.policy.AttributeValueType

                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

Examples of org.opensaml.xacml.policy.AttributeValueType

        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
TOP
Copyright © 2018 www.massapi.com. 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.