Examples of SubjectAttributeDesignatorType


Examples of org.jboss.security.xacml.core.model.policy.SubjectAttributeDesignatorType

   }

   public static SubjectAttributeDesignatorType createSubjectAttributeDesignatorType(String id, String dataType,
         String issuer, boolean mustBePresent, String subjectCategory)
   {
      SubjectAttributeDesignatorType adt = new SubjectAttributeDesignatorType();
      adt.setAttributeId(id);
      adt.setDataType(dataType);
      if (issuer != null)
         adt.setIssuer(issuer);
      adt.setMustBePresent(mustBePresent);
      if (subjectCategory != null)
         adt.setSubjectCategory(subjectCategory);
      return adt;
   }
View Full Code Here

Examples of org.jboss.security.xacml.core.model.policy.SubjectAttributeDesignatorType

      permitRuleConditionType.setExpression(jaxbElementFunctionType);

      ApplyType permitRuleApplyType = new ApplyType();
      permitRuleApplyType.setFunctionId(XACMLConstants.FUNCTION_STRING_IS_IN);

      SubjectAttributeDesignatorType sadt = PolicyAttributeFactory.createSubjectAttributeDesignatorType(
            XACMLConstants.ATTRIBUTEID_ROLE, XMLSchemaConstants.DATATYPE_STRING, null, false, null);
      JAXBElement<SubjectAttributeDesignatorType> sadtElement = objectFactory.createSubjectAttributeDesignator(sadt);
      AttributeValueType avt = PolicyAttributeFactory.createStringAttributeType("developer");
      JAXBElement<AttributeValueType> jaxbAVT = objectFactory.createAttributeValue(avt);
      permitRuleApplyType.getExpression().add(jaxbAVT);
View Full Code Here

Examples of org.jboss.security.xacml.core.model.policy.SubjectAttributeDesignatorType

      assertEquals("Issuer?", "org.jboss", adt.getIssuer());
   }

   public void testCreateSubjectAttributeDesignatorType1() throws Exception
   {
      SubjectAttributeDesignatorType adt = PolicyAttributeFactory.createSubjectAttributeDesignatorType(
            XACMLConstants.ATTRIBUTEID_ACTION_ID, XMLSchemaConstants.DATATYPE_STRING, null, false, null);
      assertEquals("AttributeId?", XACMLConstants.ATTRIBUTEID_ACTION_ID, adt.getAttributeId());
      assertEquals("DataType?", XMLSchemaConstants.DATATYPE_STRING, adt.getDataType());
      assertEquals("MustBePresent?", false, adt.isMustBePresent());
      assertNull("Issuer?", adt.getIssuer());
      assertEquals("SubjectCategory?", XACMLConstants.ATTRIBUTEID_ACCESS_SUBJECT, adt.getSubjectCategory());
   }
View Full Code Here

Examples of org.jboss.security.xacml.core.model.policy.SubjectAttributeDesignatorType

      assertEquals("SubjectCategory?", XACMLConstants.ATTRIBUTEID_ACCESS_SUBJECT, adt.getSubjectCategory());
   }

   public void testCreateSubjectAttributeDesignatorType2() throws Exception
   {
      SubjectAttributeDesignatorType adt = PolicyAttributeFactory.createSubjectAttributeDesignatorType(
            XACMLConstants.ATTRIBUTEID_CURRENT_DATE, XMLSchemaConstants.DATATYPE_DATE, "org.jboss", true,
            XACMLConstants.ATTRIBUTEID_CODEBASE);
      assertEquals("AttributeId?", XACMLConstants.ATTRIBUTEID_CURRENT_DATE, adt.getAttributeId());
      assertEquals("DataType?", XMLSchemaConstants.DATATYPE_DATE, adt.getDataType());
      assertEquals("MustBePresent?", true, adt.isMustBePresent());
      assertEquals("Issuer?", "org.jboss", adt.getIssuer());
      assertEquals("SubjectCategory?", XACMLConstants.ATTRIBUTEID_CODEBASE, adt.getSubjectCategory());
   }
View Full Code Here

Examples of org.jboss.security.xacml.core.model.policy.SubjectAttributeDesignatorType

   }

   public static SubjectAttributeDesignatorType createSubjectAttributeDesignatorType(String id, String dataType,
         String issuer, boolean mustBePresent, String subjectCategory)
   {
      SubjectAttributeDesignatorType adt = new SubjectAttributeDesignatorType();
      adt.setAttributeId(id);
      adt.setDataType(dataType);
      if (issuer != null)
         adt.setIssuer(issuer);
      adt.setMustBePresent(mustBePresent);
      if (subjectCategory != null)
         adt.setSubjectCategory(subjectCategory);
      return adt;
   }
View Full Code Here

Examples of org.jboss.security.xacml.core.model.policy.SubjectAttributeDesignatorType

      return adt;
   }
  
   public static SubjectAttributeDesignatorType createSubjectAttributeDesignatorType(String id, String dataType)
   {
      SubjectAttributeDesignatorType adt = new SubjectAttributeDesignatorType();
      adt.setAttributeId(id);
      adt.setDataType(dataType);
      return adt;
   }
View Full Code Here

Examples of org.opensaml.xacml.policy.SubjectAttributeDesignatorType

   
    /** {@inheritDoc} */
    protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException {
       
        if(attribute.getLocalName().equals(SubjectAttributeDesignatorType.SUBJECT_CATEGORY_ATTRIB_NAME)){
            SubjectAttributeDesignatorType subjectAttributeDesignatorType = (SubjectAttributeDesignatorType) xmlObject;
            subjectAttributeDesignatorType.setSubjectCategory(DatatypeHelper.
                    safeTrimOrNullString(attribute.getValue()));
        } else {
            super.processAttribute(xmlObject, attribute);
        }
    }
View Full Code Here

Examples of org.opensaml.xacml.policy.SubjectAttributeDesignatorType

        super();
    }
   
    /** {@inheritDoc} */
    protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {      
        SubjectAttributeDesignatorType subjectAttributeDesignatorType = (SubjectAttributeDesignatorType) xmlObject;
       
        if(!DatatypeHelper.isEmpty(subjectAttributeDesignatorType.getSubjectCategory())){           
            domElement.setAttribute(SubjectAttributeDesignatorType.SUBJECT_CATEGORY_ATTRIB_NAME,
                    subjectAttributeDesignatorType.getSubjectCategory());
        }
        super.marshallAttributes(xmlObject, domElement);
    }
View Full Code Here

Examples of org.opensaml.xacml.policy.SubjectAttributeDesignatorType

   
    /** {@inheritDoc} */
    protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException {
       
        if(attribute.getLocalName().equals(SubjectAttributeDesignatorType.SUBJECT_CATEGORY_ATTRIB_NAME)){
            SubjectAttributeDesignatorType subjectAttributeDesignatorType = (SubjectAttributeDesignatorType) xmlObject;
            subjectAttributeDesignatorType.setSubjectCategory(DatatypeHelper.
                    safeTrimOrNullString(attribute.getValue()));
        } else {
            super.processAttribute(xmlObject, attribute);
        }
    }
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.