Package com.sun.xacml.ctx

Examples of com.sun.xacml.ctx.Attribute


        }

        Set<Attribute> subjectAttributes = new HashSet<Attribute>(1 + role.getAttributes().size());

        AttributeValue roleAttributeValue = new AnyURIAttribute(roleURI);
        Attribute roleAttribute = new Attribute(XACMLConstants.RoleAttributeURI, null, null,
                roleAttributeValue);
        subjectAttributes.add(roleAttribute);

        for (Attribute attr : role.getAttributes()) {
            subjectAttributes.add(attr);
View Full Code Here


        subjects.add(subject);

    }

    protected void addAction(Set<Attribute> actions) {
        actions.add(new Attribute(XACMLConstants.ActionAttributeURI, null, null,
                new StringAttribute(action)));
    }
View Full Code Here

        actions.add(new Attribute(XACMLConstants.ActionAttributeURI, null, null,
                new StringAttribute(action)));
    }

    protected void addResource(Set<Attribute> resources, URI id, String resourceName) {
        resources.add(new Attribute(id, null, null, new StringAttribute(resourceName)));
    }
View Full Code Here

    protected void addResource(Set<Attribute> resources, URI id, String resourceName) {
        resources.add(new Attribute(id, null, null, new StringAttribute(resourceName)));
    }

    protected void addGeoserverResource(Set<Attribute> resources) {
        resources.add(new Attribute(XACMLConstants.ResourceAttributeURI, null, null,
                new StringAttribute("GeoServer")));
    }
View Full Code Here

    protected void addOWSService(Set<Attribute> resources) {
        org.geoserver.ows.Request owsRequest = Dispatcher.REQUEST.get();
        if (owsRequest == null)
            return;
        resources.add(new Attribute(XACMLConstants.OWSRequestResourceURI, null, null,
                new StringAttribute(owsRequest.getRequest())));
        resources.add(new Attribute(XACMLConstants.OWSServiceResourceURI, null, null,
                new StringAttribute(owsRequest.getService())));
    }
View Full Code Here

        try {
            geomAttr = new GeometryAttribute(g, srsName, null, GMLVersion.Version3, gmlType);
        } catch (URISyntaxException e) {
            throw new RuntimeException(e);
        }
        resources.add(new Attribute(attributeURI, null, null, geomAttr));
    }
View Full Code Here

                        if (((Geometry) value).getUserData() == null)
                            throw new RuntimeException("Property: " + propertyName
                                    + " : Geometry must have srs name as userdata");
                    }
                    AttributeValue attrValue = createAttributeValueFromObject(value);
                    Attribute xacmlAttr = new Attribute(attr.getId(), null, null, attrValue);
                    role.getAttributes().add(xacmlAttr);
                }
            }
        }
View Full Code Here

    private void checkForObligation(ResponseCtx response) {
        Result result = response.getResults().iterator().next();
        assertNotNull(result);
        Obligation obligation = result.getObligations().iterator().next();
        assertNotNull(obligation);
        Attribute assignment = obligation.getAssignments().iterator().next();
        GeometryAttribute geomAttr = (GeometryAttribute) assignment.getValue();
        assertNotNull(geomAttr.getGeometry());

    }
View Full Code Here

                Log.severe("No obligation with id: " + XACMLConstants.CatalogModeObligationId);
                Log.severe(XACMLUtil.asXMLString(requestCtx));
                return useDefaultMode();
            }

            Attribute catalogModeAssignment = obligation.getAssignments().iterator().next();
            if (catalogModeAssignment == null
                    || CatalogModeMap.containsKey(((StringAttribute) catalogModeAssignment
                            .getValue()).getValue()) == false) {
                Log.severe("No valid catalog mode ");
                Log.severe(XACMLUtil.asXMLString(requestCtx));
                return useDefaultMode();
            }

            String catalogModeKey = ((StringAttribute) catalogModeAssignment.getValue()).getValue();
            mode = CatalogModeMap.get(catalogModeKey);
            return mode;
        }

    }
View Full Code Here

        Set<Attribute> actions = new HashSet<Attribute>(1);
        addAction(actions);

        Set<Attribute> environment = new HashSet<Attribute>(1);
        if (userName != null) {
            environment.add(new Attribute(XACMLConstants.UserEnvironmentURI,null,null,new StringAttribute(userName)));           
        }

       
        RequestCtx ctx = new RequestCtx(subjects, resources, actions, environment);
        return ctx;
View Full Code Here

TOP

Related Classes of com.sun.xacml.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.