Package org.opensaml.xacml.policy

Examples of org.opensaml.xacml.policy.ObligationType


/** UnMarshaller for {@link org.opensaml.xacml.policy.ObligationType}. */
public class ObligationTypeUnmarshaller extends AbstractXACMLObjectUnmarshaller {

    /** {@inheritDoc} */
    protected void processChildElement(XMLObject parentObject, XMLObject childObject) throws UnmarshallingException {
        ObligationType obligation = (ObligationType) parentObject;

        if (childObject instanceof AttributeAssignmentType) {
            obligation.getAttributeAssignments().add((AttributeAssignmentType) childObject);
        } else {
            super.processChildElement(parentObject, childObject);
        }
    }
View Full Code Here


    }

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

        ObligationType obligation = (ObligationType) xmlObject;

        if (attribute.getLocalName().equals(ObligationType.OBLIGATION_ID_ATTRIB_NAME)) {
            obligation.setObligationId(attribute.getValue());
        } else  if (attribute.getLocalName().equals(ObligationType.FULFILL_ON_ATTRIB_NAME)) {
            if (attribute.getValue().equals(EffectType.Permit.toString())) {
                obligation.setFulfillOn(EffectType.Permit);
            } else {
                obligation.setFulfillOn(EffectType.Deny);
            }
        } else {
            super.processAttribute(xmlObject, attribute);
        }
       
View Full Code Here

        super();
    }

    /** {@inheritDoc} */
    protected void marshallAttributes(XMLObject samlElement, Element domElement) throws MarshallingException {
        ObligationType obligation = (ObligationType) samlElement;

        if (!DatatypeHelper.isEmpty(obligation.getObligationId())) {
            domElement.setAttributeNS(null, ObligationType.OBLIGATION_ID_ATTRIB_NAME, obligation.getObligationId());
        }
        if (obligation.getFulfillOn() != null) {
            if (obligation.getFulfillOn().equals(EffectType.Deny)) {
                domElement.setAttributeNS(null, ObligationType.FULFILL_ON_ATTRIB_NAME, EffectType.Deny.toString());
            } else {
                domElement.setAttributeNS(null, ObligationType.FULFILL_ON_ATTRIB_NAME, EffectType.Permit.toString());
            }                    
        }
View Full Code Here

    private static final ObligationHelper instance = new ObligationHelper();

    private ObligationHelper() {}

    public static ObligationType build(String obligationId, EffectType effect) {
        ObligationType obligation = (ObligationType) builderFactory.getBuilder(elementQName).buildObject(elementQName);
        obligation.setObligationId(obligationId);
        obligation.setFulfillOn(effect);
        return obligation;
    }
View Full Code Here

  protected boolean removeObligations(ObligationsType ob){
   
    if (ob == null)
      return false;
   
    ObligationType toBeRemoved = null;
   
    for (ObligationType o: ob.getObligations()){
      if (o.getObligationId().equals(obligationId)){
        toBeRemoved = o;
        break;
View Full Code Here

TOP

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

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.