Package org.opensaml.xacml.ctx

Examples of org.opensaml.xacml.ctx.AttributeValueType


    /** {@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(DatatypeHelper.safeTrimOrNullString(elementContent));
    }
View Full Code Here

        super();
    }

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

        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

    ) {
        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

    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

        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

TOP

Related Classes of org.opensaml.xacml.ctx.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.