Package com.sun.xacml.attr

Examples of com.sun.xacml.attr.StringAttribute


      Iterator<Principal> iter = roles != null ? roles.iterator(): null;
      while(iter != null && iter.hasNext())
      {
         Principal role = (Principal)iter.next();
         Attribute roleAttr = new Attribute(roleURI,null,null,
               new StringAttribute(role.getName()));
           roleset.add(roleAttr)
      }
      return roleset;
   }
View Full Code Here


      Principal principal = request.getUserPrincipal();
      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 subjectAttrSet = new HashSet();
      subjectAttrSet.add(subjectAttr);
      subjectAttrSet.addAll(getXACMLRoleSet(roles));
     
      Set subjectSet = new HashSet();
      subjectSet.add(new Subject(subjectAttrSet));
     
      //Create the resource set
      URI resourceUri = new URI(XACMLConstants.RESOURCE_IDENTIFIER);
      Attribute resourceAttr = new Attribute(resourceUri,null,null,
            new AnyURIAttribute(new URI(request.getRequestURI())));
      Set resourceSet = new HashSet();
      resourceSet.add(resourceAttr);
     
      //Create the action set
      Set actionSet = new HashSet();
      actionSet.add(new Attribute(new URI(XACMLConstants.ACTION_IDENTIFIER),
             null,null, new StringAttribute(action)));
     
      Enumeration enumer = request.getParameterNames();
      while(enumer.hasMoreElements())
      {
         String paramName = (String)enumer.nextElement();
         String paramValue = request.getParameter(paramName);
         URI actionUri = new URI(actionURIBase + paramName);
         Attribute actionAttr = new Attribute(actionUri,null,null,
               new StringAttribute(paramValue));
         actionSet.add(actionAttr);
      }
      //Create the Environment set
      Set environSet = new HashSet();
      //Current time
View Full Code Here

         Principal role = (Principal)iter.next();
         if(role instanceof SimplePrincipal)
         {
            SimplePrincipal sp = (SimplePrincipal)role;
            Attribute roleAttr = new Attribute(roleURI,null,null,
                new StringAttribute(sp.getName()));
            roleset.add(roleAttr);
         }
      }
      return roleset;
   }
View Full Code Here

/*  78 */     RequestCtx requestCtx = null;
/*  79 */     Principal principal = request.getUserPrincipal();
/*  80 */     String username = principal.getName();
/*     */
/*  82 */     URI subjectAttrUri = new URI("urn:oasis:names:tc:xacml:1.0:subject:subject-id");
/*  83 */     Attribute subjectAttr = new Attribute(subjectAttrUri, null, null, new StringAttribute(username));
/*     */
/*  85 */     Set subjectAttrSet = new HashSet();
/*  86 */     subjectAttrSet.add(subjectAttr);
/*  87 */     subjectAttrSet.addAll(getXACMLRoleSet(roles));
/*     */
/*  89 */     Set subjectSet = new HashSet();
/*  90 */     subjectSet.add(new Subject(subjectAttrSet));
/*     */
/*  93 */     URI resourceUri = new URI("urn:oasis:names:tc:xacml:1.0:resource:resource-id");
/*  94 */     Attribute resourceAttr = new Attribute(resourceUri, null, null, new AnyURIAttribute(new URI(request.getRequestURI())));
/*     */
/*  96 */     Set resourceSet = new HashSet();
/*  97 */     resourceSet.add(resourceAttr);
/*     */
/* 100 */     Set actionSet = new HashSet();
/* 101 */     actionSet.add(new Attribute(new URI("urn:oasis:names:tc:xacml:1.0:action:action-id"), null, null, new StringAttribute(action)));
/*     */
/* 104 */     Enumeration enumer = request.getParameterNames();
/* 105 */     while (enumer.hasMoreElements())
/*     */     {
/* 107 */       String paramName = (String)enumer.nextElement();
/* 108 */       String paramValue = request.getParameter(paramName);
/* 109 */       URI actionUri = new URI(actionURIBase + paramName);
/* 110 */       Attribute actionAttr = new Attribute(actionUri, null, null, new StringAttribute(paramValue));
/*     */
/* 112 */       actionSet.add(actionAttr);
/*     */     }
/*     */
/* 115 */     Set environSet = new HashSet();
View Full Code Here

/*     */     {
/* 143 */       Principal role = (Principal)iter.next();
/* 144 */       if ((role instanceof SimplePrincipal))
/*     */       {
/* 146 */         SimplePrincipal sp = (SimplePrincipal)role;
/* 147 */         Attribute roleAttr = new Attribute(roleURI, null, null, new StringAttribute(sp.getName()));
/*     */
/* 149 */         roleset.add(roleAttr);
/*     */       }
/*     */     }
/* 152 */     return roleset;
View Full Code Here

/*     */
/*  66 */     RequestCtx requestCtx = null;
/*  67 */     String username = principal.getName();
/*     */
/*  70 */     URI subjectAttrUri = new URI("urn:oasis:names:tc:xacml:1.0:subject:subject-id");
/*  71 */     Attribute subjectAttr = new Attribute(subjectAttrUri, null, null, new StringAttribute(username));
/*     */
/*  73 */     Set subjectAttrSet = new HashSet();
/*  74 */     subjectAttrSet.add(subjectAttr);
/*  75 */     subjectAttrSet.addAll(getXACMLRoleSet(roles));
/*     */
/*  77 */     Set subjectSet = new HashSet();
/*  78 */     subjectSet.add(new Subject(subjectAttrSet));
/*     */
/*  81 */     URI resourceUri = new URI("urn:oasis:names:tc:xacml:1.0:resource:resource-id");
/*  82 */     Attribute resourceAttr = new Attribute(resourceUri, null, null, new StringAttribute(ejbName));
/*     */
/*  84 */     Set resourceSet = new HashSet();
/*  85 */     resourceSet.add(resourceAttr);
/*     */
/*  88 */     Set actionSet = new HashSet();
/*  89 */     actionSet.add(new Attribute(new URI("urn:oasis:names:tc:xacml:1.0:action:action-id"), null, null, new StringAttribute(action)));
/*     */
/*  96 */     Set environSet = new HashSet();
/*     */
/*  98 */     URI currentTimeUri = new URI("urn:oasis:names:tc:xacml:1.0:environment:current-time");
/*  99 */     Attribute currentTimeAttr = new Attribute(currentTimeUri, null, null, new TimeAttribute());
View Full Code Here

/* 120 */     Set roleset = new HashSet();
/* 121 */     Iterator iter = roles != null ? roles.iterator() : null;
/* 122 */     while ((iter != null) && (iter.hasNext()))
/*     */     {
/* 124 */       Principal role = (Principal)iter.next();
/* 125 */       Attribute roleAttr = new Attribute(roleURI, null, null, new StringAttribute(role.getName()));
/*     */
/* 127 */       roleset.add(roleAttr);
/*     */     }
/* 129 */     return roleset;
/*     */   }
View Full Code Here

    }

    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

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.