Package org.opensaml.xacml.policy

Examples of org.opensaml.xacml.policy.AttributeDesignatorType


        attributeValue = prepareForAssignment(attributeValue, value);
    }

    /** {@inheritDoc} */
    public void setEnvironmentAttributeDesignator(AttributeDesignatorType attribute) {
        AttributeDesignatorType currentDesignator = getEnvironmentAttributeDesignator();
        if (currentDesignator != null) {
            attributeChoice.remove(currentDesignator);
        }

        attributeChoice.add(attribute);
View Full Code Here


        attributeValue = prepareForAssignment(attributeValue, value);
    }

    /** {@inheritDoc} */
    public void setActionAttributeDesignator(AttributeDesignatorType attribute) {
        AttributeDesignatorType currentDesignator = getActionAttributeDesignator();
        if (currentDesignator != null) {
            attributeChoice.remove(currentDesignator);
        }

        attributeChoice.add(attribute);
View Full Code Here

        attributeValue = prepareForAssignment(attributeValue, value);
    }

    /** {@inheritDoc} */
    public void setSubjectAttributeDesignator(AttributeDesignatorType attribute) {
        AttributeDesignatorType currentDesignator = getSubjectAttributeDesignator();
        if (currentDesignator != null) {
            attributeChoice.remove(currentDesignator);
        }

        attributeChoice.add(attribute);
View Full Code Here

        attributeValue = prepareForAssignment(attributeValue, value);
    }

    /** {@inheritDoc} */
    public void setResourceAttributeDesignator(AttributeDesignatorType attribute) {
        AttributeDesignatorType currentDesignator = getResourceAttributeDesignator();
        if (currentDesignator != null) {
            attributeChoice.remove(currentDesignator);
        }

        attributeChoice.add(attribute);
View Full Code Here

    }
   
    /** {@inheritDoc} */
    protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException {
       
        AttributeDesignatorType attributeDesignatorType = (AttributeDesignatorType) xmlObject;
       
        if (attribute.getLocalName().equals(AttributeDesignatorType.ATTRIBUTE_ID_ATTRIB_NAME)){
            attributeDesignatorType.setAttribtueId(DatatypeHelper.safeTrimOrNullString(attribute.getValue()));
        } else  if (attribute.getLocalName().equals(AttributeDesignatorType.DATA_TYPE_ATTRIB_NAME)){
            attributeDesignatorType.setDataType(DatatypeHelper.safeTrimOrNullString(attribute.getValue()));
        } else  if (attribute.getLocalName().equals(AttributeDesignatorType.ISSUER_ATTRIB_NAME)){
            attributeDesignatorType.setIssuer(DatatypeHelper.safeTrimOrNullString(attribute.getValue()));
        } else  if (attribute.getLocalName().equals(AttributeDesignatorType.MUST_BE_PRESENT_ATTRIB_NAME)){
            if (attribute.getValue().equals("True") || attribute.getValue().equals("true")) {
                attributeDesignatorType.setMustBePresentXSBoolean(XSBooleanValue.valueOf("1"));
            } else {
                attributeDesignatorType.setMustBePresentXSBoolean(XSBooleanValue.valueOf("0"));
            }         
        } else {
            super.processAttribute(xmlObject, attribute);
        }
    }
View Full Code Here

    }

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

  if (!DatatypeHelper.isEmpty(attributeDesignatorType.getAttributeId())) {
      domElement.setAttribute(
        AttributeDesignatorType.ATTRIBUTE_ID_ATTRIB_NAME,
        attributeDesignatorType.getAttributeId());
  }
  if (!DatatypeHelper.isEmpty(attributeDesignatorType.getDataType())) {
      domElement.setAttribute(
        AttributeDesignatorType.DATA_TYPE_ATTRIB_NAME,
        attributeDesignatorType.getDataType());
  }
  if (!DatatypeHelper.isEmpty(attributeDesignatorType.getIssuer())) {
      domElement.setAttribute(AttributeDesignatorType.ISSUER_ATTRIB_NAME,
        attributeDesignatorType.getIssuer());
  }
  if (attributeDesignatorType.getMustBePresentXSBoolean() != null) {
      domElement.setAttribute(
        AttributeDesignatorType.MUST_BE_PRESENT_ATTRIB_NAME,
        Boolean.toString(attributeDesignatorType
          .getMustBePresentXSBoolean().getValue()));
  }

    }
View Full Code Here

            return null;
        }

        SubjectMatchType subjectMatch = build();

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

       
        String attributeDataType =  (matchFunctionDatatype == null ?attribute.getDataType() : matchFunctionDatatype);
       
View Full Code Here

    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

            return null;
        }

        ResourceMatchType resourceMatch = build();

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

        String attributeDataType =  (matchFunctionDatatype == null ?attribute.getDataType() : matchFunctionDatatype);
       
        AttributeValueType policyAttributeValue = PolicyAttributeValueHelper.build(attributeDataType,
View Full Code Here

    private AttributeDesignatorHelper() {}

    public static AttributeDesignatorType build(QName designatorType, AttributeType attribute) {
       
        AttributeDesignatorType attributeDesignator = (AttributeDesignatorType) Configuration
                .getBuilderFactory().getBuilder(designatorType).buildObject(designatorType);
       
        attributeDesignator.setAttribtueId(attribute.getAttributeID());
        attributeDesignator.setDataType(attribute.getDataType());
       
        return attributeDesignator;
    }
View Full Code Here

TOP

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

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.