Package org.jboss.security.xacml.core.model.context

Examples of org.jboss.security.xacml.core.model.context.AttributeType


    private SubjectType createSubject(String reqTradeAppr, String reqCreditAppr, int buyPrice) {
        // Create a subject type
        SubjectType subject = new SubjectType();
        subject.setSubjectCategory("urn:oasis:names:tc:xacml:1.0:subject-category:access-subject");
        // create the subject attributes
        AttributeType attSubjectID = RequestAttributeFactory.createStringAttributeType(
                "urn:oasis:names:tc:xacml:1.0:subject:subject-id", "xacml20.interop.com", "123456");
        subject.getAttribute().add(attSubjectID);

        AttributeType attUserName = RequestAttributeFactory.createStringAttributeType(
                "urn:xacml:2.0:interop:example:subject:user-name", "xacml20.interop.com", "John Smith");
        subject.getAttribute().add(attUserName);

        AttributeType attBuyNumShares = RequestAttributeFactory.createIntegerAttributeType(
                "urn:xacml:2.0:interop:example:subject:buy-num-shares", "xacml20.interop.com", 1000);
        subject.getAttribute().add(attBuyNumShares);

        AttributeType attBuyOfferShare = RequestAttributeFactory.createIntegerAttributeType(
                "urn:xacml:2.0:interop:example:subject:buy-offer-price", "xacml20.interop.com", buyPrice);
        subject.getAttribute().add(attBuyOfferShare);

        AttributeType attRequestExtCred = RequestAttributeFactory.createStringAttributeType(
                "urn:xacml:2.0:interop:example:subject:req-credit-ext-approval", "xacml20.interop.com", reqCreditAppr);
        subject.getAttribute().add(attRequestExtCred);

        AttributeType attRequestTradeApproval = RequestAttributeFactory.createStringAttributeType(
                "urn:xacml:2.0:interop:example:subject:req-trade-approval", "xacml20.interop.com", reqTradeAppr);
        subject.getAttribute().add(attRequestTradeApproval);

        return subject;
    }
View Full Code Here


     * @return
     */
    private ResourceType createResource() {
        ResourceType resourceType = new ResourceType();

        AttributeType attResourceID = RequestAttributeFactory.createStringAttributeType(
                "urn:oasis:names:tc:xacml:1.0:resource:resource-id", "xacml20.interop.com", "CustomerAccount");
        resourceType.getAttribute().add(attResourceID);

        AttributeType attOwnerID = RequestAttributeFactory.createStringAttributeType(
                "urn:xacml:2.0:interop:example:resource:owner-id", "xacml20.interop.com", "123456");
        resourceType.getAttribute().add(attOwnerID);

        AttributeType attOwnerName = RequestAttributeFactory.createStringAttributeType(
                "urn:xacml:2.0:interop:example:resource:owner-name", "xacml20.interop.com", "John Smith");
        resourceType.getAttribute().add(attOwnerName);

        AttributeType attAccountStatus = RequestAttributeFactory.createStringAttributeType(
                "urn:xacml:2.0:interop:example:resource:account-status", "xacml20.interop.com", "Active");
        resourceType.getAttribute().add(attAccountStatus);

        AttributeType attCreditLine = RequestAttributeFactory.createIntegerAttributeType(
                "urn:xacml:2.0:interop:example:resource:credit-line", "xacml20.interop.com", 15000);
        resourceType.getAttribute().add(attCreditLine);

        AttributeType attCurrentCredit = RequestAttributeFactory.createIntegerAttributeType(
                "urn:xacml:2.0:interop:example:resource:current-credit", "xacml20.interop.com", 10000);
        resourceType.getAttribute().add(attCurrentCredit);

        AttributeType attTradeLimit = RequestAttributeFactory.createIntegerAttributeType(
                "urn:xacml:2.0:interop:example:resource:trade-limit", "xacml20.interop.com", 10000);
        resourceType.getAttribute().add(attTradeLimit);
        return resourceType;
    }
View Full Code Here

     *
     * @return
     */
    private ActionType createAction() {
        final ActionType actionType = new ActionType();
        final AttributeType attActionID = RequestAttributeFactory.createStringAttributeType(
                "urn:oasis:names:tc:xacml:1.0:action:action-id", "xacml20.interop.com", "Buy");
        actionType.getAttribute().add(attActionID);
        return actionType;
    }
View Full Code Here

      return getBareAttributeType(attrID, issuer, value.toString(), XMLSchemaConstants.DATATYPE_YEARMONTHDURATION);
   }

   private static AttributeType getBareAttributeType(String attrID, String issuer, Object value, String dataType)
   {
      AttributeType attributeType = new AttributeType();
      attributeType.setAttributeId(attrID);
      attributeType.setDataType(dataType);
      if (issuer != null)
         attributeType.setIssuer(issuer);
      AttributeValueType avt = new AttributeValueType();
      avt.getContent().add(value);
      attributeType.getAttributeValue().add(avt);
      return attributeType;
   }
View Full Code Here

      if(rolesList != null)
      {
         for(Role role:rolesList)
         {
            String roleName = role.getRoleName();
            AttributeType attSubjectID = RequestAttributeFactory.createStringAttributeType(
                  XACMLConstants.ATTRIBUTEID_ROLE, "jboss.org", roleName);
            subject.getAttribute().add(attSubjectID);
         }
      }
View Full Code Here

      if(rolesList != null)
      {
         for(Role role:rolesList)
         {
            String roleName = role.getRoleName();
            AttributeType attSubjectID = RequestAttributeFactory.createStringAttributeType(
                  XACMLConstants.ATTRIBUTEID_ROLE, "jboss.org", roleName);
            subject.getAttribute().add(attSubjectID);
         }
      }
View Full Code Here

      return getBareAttributeType(attrID, issuer, value.toString(), XMLSchemaConstants.DATATYPE_YEARMONTHDURATION);
   }

   private static AttributeType getBareAttributeType(String attrID, String issuer, Object value, String dataType)
   {
      AttributeType attributeType = new AttributeType();
      attributeType.setAttributeId(attrID);
      attributeType.setDataType(dataType);
      if (issuer != null)
         attributeType.setIssuer(issuer);
      AttributeValueType avt = new AttributeValueType();
      avt.getContent().add(value);
      attributeType.getAttributeValue().add(avt);
      return attributeType;
   }
View Full Code Here

   {
      //Create a subject type
      SubjectType subject = new SubjectType();
      subject.setSubjectCategory("urn:oasis:names:tc:xacml:1.0:subject-category:access-subject");
      //create the subject attributes
      AttributeType attSubjectID = RequestAttributeFactory.createStringAttributeType(
            "urn:oasis:names:tc:xacml:1.0:subject:subject-id", "xacml20.interop.com", "123456");
      subject.getAttribute().add(attSubjectID);

      AttributeType attUserName = RequestAttributeFactory.createStringAttributeType(
            "urn:xacml:2.0:interop:example:subject:user-name", "xacml20.interop.com", "John Smith");
      subject.getAttribute().add(attUserName);

      AttributeType attBuyNumShares = RequestAttributeFactory.createIntegerAttributeType(
            "urn:xacml:2.0:interop:example:subject:buy-num-shares", "xacml20.interop.com", 1000);
      subject.getAttribute().add(attBuyNumShares);

      AttributeType attBuyOfferShare = RequestAttributeFactory.createIntegerAttributeType(
            "urn:xacml:2.0:interop:example:subject:buy-offer-price", "xacml20.interop.com", 100);
      subject.getAttribute().add(attBuyOfferShare);

      AttributeType attRequestExtCred = RequestAttributeFactory.createStringAttributeType(
            "urn:xacml:2.0:interop:example:subject:req-credit-ext-approval", "xacml20.interop.com", "false");
      subject.getAttribute().add(attRequestExtCred);

      AttributeType attRequestTradeApproval = RequestAttributeFactory.createStringAttributeType(
            "urn:xacml:2.0:interop:example:subject:req-trade-approval", "xacml20.interop.com", "false");
      subject.getAttribute().add(attRequestTradeApproval);

      return subject;
   }
View Full Code Here

   public ResourceType createResource()
   {
      ResourceType resourceType = new ResourceType();

      AttributeType attResourceID = RequestAttributeFactory.createStringAttributeType(
            "urn:oasis:names:tc:xacml:1.0:resource:resource-id", "xacml20.interop.com", "CustomerAccount");
      resourceType.getAttribute().add(attResourceID);

      AttributeType attOwnerID = RequestAttributeFactory.createStringAttributeType(
            "urn:xacml:2.0:interop:example:resource:owner-id", "xacml20.interop.com", "123456");
      resourceType.getAttribute().add(attOwnerID);

      AttributeType attOwnerName = RequestAttributeFactory.createStringAttributeType(
            "urn:xacml:2.0:interop:example:resource:owner-name", "xacml20.interop.com", "John Smith");
      resourceType.getAttribute().add(attOwnerName);

      AttributeType attAccountStatus = RequestAttributeFactory.createStringAttributeType(
            "urn:xacml:2.0:interop:example:resource:account-status", "xacml20.interop.com", "Active");
      resourceType.getAttribute().add(attAccountStatus);

      AttributeType attCreditLine = RequestAttributeFactory.createIntegerAttributeType(
            "urn:xacml:2.0:interop:example:resource:credit-line", "xacml20.interop.com", 15000);
      resourceType.getAttribute().add(attCreditLine);

      AttributeType attCurrentCredit = RequestAttributeFactory.createIntegerAttributeType(
            "urn:xacml:2.0:interop:example:resource:current-credit", "xacml20.interop.com", 10000);
      resourceType.getAttribute().add(attCurrentCredit);

      AttributeType attTradeLimit = RequestAttributeFactory.createIntegerAttributeType(
            "urn:xacml:2.0:interop:example:resource:trade-limit", "xacml20.interop.com", 10000);
      resourceType.getAttribute().add(attTradeLimit);
      return resourceType;
   }
View Full Code Here

   }

   private ActionType createAction()
   {
      ActionType actionType = new ActionType();
      AttributeType attActionID = RequestAttributeFactory.createStringAttributeType(
            "urn:oasis:names:tc:xacml:1.0:action:action-id", "xacml20.interop.com", "Buy");
      actionType.getAttribute().add(attActionID);
      return actionType;
   }
View Full Code Here

TOP

Related Classes of org.jboss.security.xacml.core.model.context.AttributeType

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.