Package org.jboss.security.xacml.sunxacml.ctx

Examples of org.jboss.security.xacml.sunxacml.ctx.Attribute


                try {
                    URI attrId =
                        new URI(node.getAttributes().
                                getNamedItem("AttributeId").getNodeValue());
                    AttributeValue attrValue = attrFactory.createValue(node);
                    assignments.add(new Attribute(attrId, null, null,
                                                  attrValue));
                } catch (URISyntaxException use) {
                    throw new ParsingException("Error parsing URI", use);
                } catch (UnknownIdentifierException uie) {
                    throw new ParsingException("Unknown AttributeId", uie);
View Full Code Here


        indenter.in();
       
        Iterator it = assignments.iterator();

        while (it.hasNext()) {
            Attribute attr = (Attribute)(it.next());
            /*out.println(indenter.makeString() +
                        "<AttributeAssignment AttributeId=\"" +
                        attr.getId().toString() + "\" DataType=\"" +
                        attr.getType().toString() + "\">" +
                        attr.getValue().encode() +
                        "</AttributeAssignment>");*/
           
            StringBuilder str = new StringBuilder();
            str.append(indenter.makeString());
            str.append("<AttributeAssignment AttributeId=\"");
            str.append(attr.getId().toString() + "\" DataType=\"");
            str.append(attr.getType().toString() + "\">");
            List<AttributeValue> attrValues = attr.getValues();
            if(attrValues != null)
            {
               for(AttributeValue val: attrValues)
               {
                  str.append(val.encodeWithTags(true));
View Full Code Here

            // iterate over the set of attributes
            Iterator attrIterator = subject.getAttributesAsList().iterator();

            while (attrIterator.hasNext()) {
                Attribute attr = (Attribute)(attrIterator.next());
                String id = attr.getId().toString();

                if (categoryMap.containsKey(id)) {
                    // add to the existing set of Attributes w/this id
                    List existingIds = (List)(categoryMap.get(id));
                    existingIds.add(attr);
View Full Code Here

                System.err.println("Resource may contain only one " +
                                   "resource-scope Attribute");
                throw new ParsingException("too many resource-scope attrs");
            }

            Attribute attr = (Attribute)(set.iterator().next());
            AttributeValue attrValue = attr.getValue();

            // scope must be a string, so throw an exception otherwise
            if (! attrValue.getType().toString().
                equals(StringAttribute.identifier))
                throw new ParsingException("scope attr must be a string");
View Full Code Here

     * each entry with all attributes that have that id
     */
    private void mapAttributes(List input, Map output) {
        Iterator it = input.iterator();
        while (it.hasNext()) {
            Attribute attr = (Attribute)(it.next());
            String id = attr.getId().toString();

            if (output.containsKey(id)) {
                List set = (List)(output.get(id));
                set.add(attr);
            } else {
View Full Code Here

    public void setResourceId(AttributeValue resourceId) {
        this.resourceId = resourceId;

        // there will always be exactly one value for this attribute
        Set attrSet = (Set)(resourceMap.get(RESOURCE_ID));
        Attribute attr = (Attribute)(attrSet.iterator().next());
       
        // remove the old value...
        attrSet.remove(attr);

        // ...and insert the new value
        attrSet.add(new Attribute(attr.getId(), attr.getIssuer(),
                                  attr.getIssueInstant(), resourceId));
    }
View Full Code Here

        // now go through each, considering each Attribute object
        List attributes = new ArrayList();
        Iterator it = attrSet.iterator();

        while (it.hasNext()) {
            Attribute attr = (Attribute)(it.next());

            // make sure the type and issuer are correct
            if ((attr.getType().equals(type)) &&
                ((issuer == null) ||
                 ((attr.getIssuer() != null) &&
                  (attr.getIssuer().equals(issuer.toString()))))) {

                // if we got here, then we found a match, so we want to pull
                // out the values and put them in out list
                attributes.addAll(attr.getValues());
            }
        }

        // see if we found any acceptable attributes
        if (attributes.size() == 0) {
View Full Code Here

            // iterate over the set of attributes
            Iterator attrIterator = subject.getAttributes().iterator();

            while (attrIterator.hasNext()) {
                Attribute attr = (Attribute)(attrIterator.next());
                String id = attr.getId().toString();

                if (categoryMap.containsKey(id)) {
                    // add to the existing set of Attributes w/this id
                    Set existingIds = (Set)(categoryMap.get(id));
                    existingIds.add(attr);
View Full Code Here

                System.err.println("Resource may contain only one " +
                                   "resource-scope Attribute");
                throw new ParsingException("too many resource-scope attrs");
            }

            Attribute attr = (Attribute)(set.iterator().next());
            AttributeValue attrValue = attr.getValue();

            // scope must be a string, so throw an exception otherwise
            if (! attrValue.getType().toString().
                equals(StringAttribute.identifier))
                throw new ParsingException("scope attr must be a string");
View Full Code Here

     * each entry with all attributes that have that id
     */
    private void mapAttributes(Set input, Map output) {
        Iterator it = input.iterator();
        while (it.hasNext()) {
            Attribute attr = (Attribute)(it.next());
            String id = attr.getId().toString();

            if (output.containsKey(id)) {
                Set set = (Set)(output.get(id));
                set.add(attr);
            } else {
View Full Code Here

TOP

Related Classes of org.jboss.security.xacml.sunxacml.ctx.Attribute

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.