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

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


     * Creates a {@link ResourceType} with several attributes.
     *
     * @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


            subject.getAttribute().add(attSubjectID);
         }
      }

      //Create a resource type
      ResourceType resourceType = new ResourceType();
      resourceType.getAttribute().add(
            RequestAttributeFactory.createStringAttributeType(
                  XACMLConstants.ATTRIBUTEID_RESOURCE_ID,
                  null,
                  ejbName));
View Full Code Here

            subject.getAttribute().add(attSubjectID);
         }
      }

      //Create a resource type
      ResourceType resourceType = new ResourceType();
      resourceType.getAttribute().add(
            RequestAttributeFactory.createAnyURIAttributeType(
                  XACMLConstants.ATTRIBUTEID_RESOURCE_ID,
                  null,
                  new URI(request.getRequestURI())));
View Full Code Here

            RequestAttributeFactory.createStringAttributeType(XACMLConstants.ATTRIBUTEID_SUBJECT_ID, null, principal
                  .getName()));
      requestType.getSubject().add(subject);

      //create the Resource of the request
      ResourceType resource = new ResourceType();
      resource.getAttribute()
            .add(
                  RequestAttributeFactory.createStringAttributeType(XACMLConstants.ATTRIBUTEID_RESOURCE_ID, null,
                        resourceId));
      for (String confidentialityCode : confidentialityCodes)
      {
         resource.getAttribute().add(
               RequestAttributeFactory.createStringAttributeType(CONFIDENTIALITY_CODE, null, confidentialityCode));
      }
      for (String consentedId : consentedIds)
      {
         resource.getAttribute().add(
               RequestAttributeFactory.createStringAttributeType(CONSENTED_SUBJECT_ID, null, consentedId));
      }
      resource.getAttribute().add(RequestAttributeFactory.createStringAttributeType(RESOURCE_TYPE, null, resourceType));
      for (String resourcePermission : resourcePermissions)
      {
         resource.getAttribute().add(
               RequestAttributeFactory.createStringAttributeType(HL7_RESOURCE_PERMISSION, null, resourcePermission));
      }
      requestType.getResource().add(resource);

      //create the Action of the request - avoid NPE
View Full Code Here

      return subject;
   }

   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

               XACMLConstants.ATTRIBUTEID_ROLE, "jboss.org", rolePrincipal.getName());
         subject.getAttribute().add(attSubjectID);
      }

      //Create a resource type
      ResourceType resourceType = new ResourceType();
      resourceType.getAttribute().add(
            RequestAttributeFactory.createAnyURIAttributeType(XACMLConstants.ATTRIBUTEID_RESOURCE_ID, null, new URI(
                  request.getRequestURI())));

      //Create an action type
      ActionType actionType = new ActionType();
View Full Code Here

      return subject;
   }

   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

    // Subject
    SubjectType subject = new SubjectType();
    subject.getAttribute().add(RequestAttributeFactory.createStringAttributeType(SUBJECT_IDENTIFIER_SSN, "jboss_org", fodselsNr));

    // Resources
    ResourceType resourceType = new ResourceType();
    resourceType.getAttribute().add(RequestAttributeFactory.createStringAttributeType(RESOURCE_IDENTIFIER_ORGNR, "jboss_org", orgNr));
    resourceType.getAttribute().add(RequestAttributeFactory.createStringAttributeType(RESOURCE_IDENTIFIER_SERVICECODE, "jboss_org", serviceCode));
    resourceType.getAttribute().add(RequestAttributeFactory.createStringAttributeType(RESOURCE_IDENTIFIER_SERVICEEDITIONCODE, "jboss_org", serviceEditionCode));

    // Action
    ActionType actionType = new ActionType();
    actionType.getAttribute().add(RequestAttributeFactory.createStringAttributeType(ACTION_IDENTIFIER, "jboss.org", "Read"));
View Full Code Here

            subject.getAttribute().add(attSubjectID);
         }
      }

      //Create a resource type
      ResourceType resourceType = new ResourceType();
      resourceType.getAttribute().add(
            RequestAttributeFactory.createStringAttributeType(
                  XACMLConstants.ATTRIBUTEID_RESOURCE_ID,
                  null,
                  ejbName));
View Full Code Here

        return subject;
    }

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

        AttributeType attResourceID = RequestAttributeFactory.createStringAttributeType(
                "urn:va:xacml:2.0:interop:rsa8:resource:hl7:type", issuer,
                "urn:va:xacml:2.0:interop:rsa8:resource:hl7:medical-record");

        // Create a multi-valued attribute - hl7 permissions
        AttributeType multi = new AttributeType();
        multi.setAttributeId("urn:va:xacml:2.0:interop:rsa8:subject:hl7:permission");
        multi.setDataType("http://www.w3.org/2001/XMLSchema#string");

        if (issuer != null)
            multi.setIssuer(issuer);

        multi.getAttributeValue().add(createAttributeValueType("urn:va:xacml:2.0:interop:rsa8:hl7:prd-010"));
        multi.getAttributeValue().add(createAttributeValueType("urn:va:xacml:2.0:interop:rsa8:hl7:prd-012"));
        multi.getAttributeValue().add(createAttributeValueType("urn:va:xacml:2.0:interop:rsa8:hl7:prd-005"));
        multi.getAttributeValue().add(createAttributeValueType("urn:va:xacml:2.0:interop:rsa8:hl7:prd-003"));

        AttributeType attConfidentialityCode = RequestAttributeFactory.createStringAttributeType(
                "urn:va:xacml:2.0:interop:rsa8:resource:hl7:confidentiality-code", issuer, "MA");

        AttributeType attDissentedSubjectId = RequestAttributeFactory.createStringAttributeType(
                "urn:va:xacml:2.0:interop:rsa8:resource:hl7:radiology:dissented-subject-id", issuer, "Doctor, Bob I");

        // Add the attributes into the resource
        resourceType.getAttribute().add(attResourceID);
        resourceType.getAttribute().add(multi);
        resourceType.getAttribute().add(attConfidentialityCode);
        resourceType.getAttribute().add(attDissentedSubjectId);
        return resourceType;
    }
View Full Code Here

TOP

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

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.