Package com.sun.xacml.attr

Examples of com.sun.xacml.attr.StringAttribute


    }

    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

        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

    protected AttributeValue createAttributeValueFromObject(Serializable object) {
        AttributeValue retVal = null;

        if (object instanceof String)
            retVal = new StringAttribute((String) object);
        if (object instanceof URI)
            retVal = new AnyURIAttribute((URI) object);
        if (object instanceof Boolean)
            retVal = ((Boolean) object) ? BooleanAttribute.getTrueInstance() : BooleanAttribute
                    .getFalseInstance();
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

    }

    private AttributeValue getAttribute(final String value, String type) throws ParsingException,
            ParseException, URISyntaxException {
        if (StringAttribute.identifier.equals(type)) {
            return new StringAttribute(value);
        }
        if (IntegerAttribute.identifier.equals(type)) {
            return new IntegerAttribute(Long.parseLong(value));
        }
        if (BooleanAttribute.identifier.equals(type)) {
View Full Code Here

      String username = principal.getName();
     
      //Create the subject set
      URI subjectAttrUri = new URI(XACMLConstants.SUBJECT_IDENTIFIER);
      Attribute subjectAttr = new Attribute(subjectAttrUri,null,null,
            new StringAttribute(username));
      Set<Attribute> subjectAttrSet = new HashSet<Attribute>();
      subjectAttrSet.add(subjectAttr);
      subjectAttrSet.addAll(getXACMLRoleSet(roles));
     
      Set<Subject> subjectSet = new HashSet<Subject>();
      subjectSet.add(new Subject(subjectAttrSet));
     
      //Create the resource set
      URI resourceUri = new URI(XACMLConstants.RESOURCE_IDENTIFIER);
      Attribute resourceAttr = new Attribute(resourceUri,null,null,
            new StringAttribute(ejbName));
      Set<Attribute> resourceSet = new HashSet<Attribute>();
      resourceSet.add(resourceAttr);
     
      //Create the action set
      Set<Attribute> actionSet = new HashSet<Attribute>();
      actionSet.add(new Attribute(new URI(XACMLConstants.ACTION_IDENTIFIER),
             null,null, new StringAttribute(action)));
     
     
      //TODO: Get hold of the invocation arguments and populate in the xacml request
     
      //Create the Environment set
View Full Code Here

      String username = principal.getName();
     
      //Create the subject set
      URI subjectAttrUri = new URI(XACMLConstants.SUBJECT_IDENTIFIER);
      Attribute subjectAttr = new Attribute(subjectAttrUri,null,null,
            new StringAttribute(username));
      Set<Attribute> subjectAttrSet = new HashSet<Attribute>();
      subjectAttrSet.add(subjectAttr);
      subjectAttrSet.addAll(getXACMLRoleSet(roles));
     
      Set<Subject> subjectSet = new HashSet<Subject>();
      subjectSet.add(new Subject(subjectAttrSet));
     
      //Create the resource set
      URI resourceUri = new URI(XACMLConstants.RESOURCE_IDENTIFIER);
      Attribute resourceAttr = new Attribute(resourceUri,null,null,
            new StringAttribute(ejbName));
      Set<Attribute> resourceSet = new HashSet<Attribute>();
      resourceSet.add(resourceAttr);
     
      //Create the action set
      Set<Attribute> actionSet = new HashSet<Attribute>();
      actionSet.add(new Attribute(new URI(XACMLConstants.ACTION_IDENTIFIER),
             null,null, new StringAttribute(action)));
     
      //TODO: Get hold of the invocation arguments and populate in the xacml request
     
      //Create the Environment set
      Set<Attribute> environSet = new HashSet<Attribute>();
View Full Code Here

   }
  
   private Attribute getRoleAttribute(String roleName) throws URISyntaxException
   {
      URI roleURI = new URI(XACMLConstants.SUBJECT_ROLE_IDENTIFIER);
      return new Attribute(roleURI,null,null, new StringAttribute(roleName));
   }
View Full Code Here

TOP

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