Package org.jboss.security.xacml.sunxacml.attr

Examples of org.jboss.security.xacml.sunxacml.attr.StringAttribute


         // now get the value
         try
         {
            Node child = root.getFirstChild();
            if(child == null)
               return new StringAttribute("");
           //get the type of the node
            short nodetype = child.getNodeType();

            // now see if we have (effectively) a simple string value
            if ((nodetype == Node.TEXT_NODE) || (nodetype == Node.CDATA_SECTION_NODE) ||
                (nodetype == Node.COMMENT_NODE))
            {
                return new StringAttribute(child.getNodeValue());
            }
           
            return AttributeFactory.getInstance().createValue(child, type);
         }
         catch (UnknownIdentifierException uie)
View Full Code Here


            while ((startIndex <= endIndex) &&
                   Character.isWhitespace(str.charAt(endIndex)))
                endIndex--;
            String strResult = str.substring(startIndex, endIndex+1);

            result = new EvaluationResult(new StringAttribute(strResult));
            break;
        }
        case ID_STRING_NORMALIZE_TO_LOWER_CASE: {
            String str = ((StringAttribute) argValues[0]).getValue();

            // Convert string to lower case
            String strResult = str.toLowerCase();

            result = new EvaluationResult(new StringAttribute(strResult));
            break;
        }
        }

        return result;
View Full Code Here

            String str = ((StringAttribute)argValues[0]).getValue();

            for (int i = 1; i < argValues.length; i++)
                str += ((StringAttribute)(argValues[i])).getValue();

            result = new EvaluationResult(new StringAttribute(str));

            break;
        }

        return result;
View Full Code Here

       
        } */
       
        //SECURITY-162: Relax resource-id requirement
        if(this.resourceId == null)
           this.resourceId = new StringAttribute("");
       
        // see if a resource-scope attribute was included
        if (resourceMap.containsKey(RESOURCE_SCOPE)) {
            Set set = (Set)(resourceMap.get(RESOURCE_SCOPE));

View Full Code Here

        // finally, look for the subject who has the role-mapping defined,
        // and if they're the identified subject, add their role
        BagAttribute returnBag = null;
        Iterator it = bag.iterator();
        while (it.hasNext()) {
            StringAttribute attr = (StringAttribute)(it.next());
            if (attr.getValue().equals("Julius Hibbert")) {
                Set set = new HashSet();
                set.add(new StringAttribute("Physician"));
                returnBag = new BagAttribute(attributeType, set);
                break;
            }
        }
View Full Code Here

       
        } */
       
        //SECURITY-162: Relax resource-id requirement
        if(this.resourceId == null)
           this.resourceId = new StringAttribute("");
       
        // see if a resource-scope attribute was included
        if (resourceMap.containsKey(RESOURCE_SCOPE)) {
            Set set = (Set)(resourceMap.get(RESOURCE_SCOPE));

View Full Code Here

            String str = ((StringAttribute)argValues[0]).getValue();

            for (int i = 1; i < argValues.length; i++)
                str += ((StringAttribute)(argValues[i])).getValue();

            result = new EvaluationResult(new StringAttribute(str));

            break;
        }

        return result;
View Full Code Here

      //refer to the src/resources/security/xacml/test1/request.xml

      //Create the subject set
      URI subjectAttrUri = new URI("urn:oasis:names:tc:xacml:1.0:subject:subject-id");
      Set subjectAttributeValues = new HashSet();
      subjectAttributeValues.add(new StringAttribute("Anil Saldhana"));
      Attribute subjectAttr = new Attribute(subjectAttrUri, new URI(StringAttribute.identifier), null, null,
            subjectAttributeValues);
      Set subjectAttrSet = new HashSet();
      subjectAttrSet.add(subjectAttr);
      Set subjectSet = new HashSet();
      subjectSet.add(new Subject(subjectAttrSet));

      //Create the resource set
      URI resourceUri = new URI("urn:oasis:names:tc:xacml:1.0:resource:resource-id");
      Set resourceAttributeValues = new HashSet();
      resourceAttributeValues.add(new StringAttribute("http://jboss.com/developers/payroll/anilsaldhana"));
      Attribute resourceAttr = new Attribute(resourceUri, new URI(StringAttribute.identifier), null, null,
            resourceAttributeValues);
      Set resourceSet = new HashSet();
      resourceSet.add(resourceAttr);

      //Create the action set
      URI actionUri = new URI("urn:oasis:names:tc:xacml:1.0:action:action-id");
      Set actionAttributeValues = new HashSet();
      actionAttributeValues.add(new StringAttribute("read"));
      Attribute actionAttr = new Attribute(actionUri, new URI(StringAttribute.identifier), null, null,
            actionAttributeValues);
      Set actionSet = new HashSet();
      actionSet.add(actionAttr);
View Full Code Here

      // and if there is a match, add their role
      BagAttribute returnBag = null;
      Iterator it = bag.iterator();
      while (it.hasNext())
      {
         StringAttribute attr = (StringAttribute) (it.next());
         if (attr.getValue().equals("Anil Saldhana"))
         {
            Set set = new HashSet();
            set.add(new StringAttribute("Developer"));
            returnBag = new BagAttribute(attributeType, set);
            break;
         }
      }
View Full Code Here

    * @throws Exception
    */
   public void testAttributeTypeInCTR() throws Exception
   {
      URI RESOURCE_URI = new URI("urn:oasis:names:tc:xacml:1.0:resource:resource-id");
      AttributeValue attributeValue = new StringAttribute("TestAttribute");
     
      Attribute attribute = new Attribute(RESOURCE_URI, "somepackage" ,
            new DateTimeAttribute(), attributeValue);
     
      assertNotNull("Attribute type", attribute.getType());
View Full Code Here

TOP

Related Classes of org.jboss.security.xacml.sunxacml.attr.StringAttribute

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.