OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

xacml-dev message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: RBAC : execution error running sample request builder


Hi ,

Using the given Samplerequest builder i tried to create a new request 
builder for xacml request(request.xml)  and i am getting .could any body 
help me ,where i am going wrong.it will be of great help to me.

"Exception in thread "main" java.lang.NoClassDefFoundError: SampleRequest"

here is my java class

SampleRequest.java
---------------------------

import com.sun.xacml.EvaluationCtx;
import com.sun.xacml.Indenter;

import com.sun.xacml.attr.AnyURIAttribute;
import com.sun.xacml.attr.StringAttribute;

import com.sun.xacml.ctx.Attribute;
import com.sun.xacml.ctx.RequestCtx;
import com.sun.xacml.ctx.Subject;

import java.net.URI;
import java.net.URISyntaxException;

import java.util.HashSet;
import java.util.Set;

public class SampleRequest
{

    public static Set setupSubjects() throws URISyntaxException {
        HashSet attributes = new HashSet();

        // setup the id and value for the requesting subject
        URI subjectId =
            new URI("urn:oasis:names:tc:xacml:1.0:subject:role");
        StringAttribute value = new StringAttribute("tutor");

        // create the subject section with two attributes, the first with
        // the subject's identity...
        attributes.add(new Attribute(subject-id, null, null, value));
        // ...and the second with the subject's group membership
        attributes.add(new Attribute(module-id, null, null, value);

        // bundle the attributes in a Subject with the default category
        HashSet subjects = new HashSet();
        subjects.add(new Subject(attributes));

        return subjects;
    }

    public static Set setupResource() throws URISyntaxException {
        HashSet resource = new HashSet();

        // the resource being requested
        AnyURIAttribute value =
            new AnyURIAttribute(new 
URI("http://www.example.com/services/course-catalogue.html";));

        // create the resource using a standard, required identifier for
        // the resource being requested
        resource.add(new Attribute(new URI(EvaluationCtx.RESOURCE_ID),
                                   null, null, value));

        return resource;
    }

    public static Set setupAction() throws URISyntaxException {
        HashSet action = new HashSet();

        // this is a standard URI that can optionally be used to specify
        // the action being requested
        URI actionId =
            new URI("urn:oasis:names:tc:xacml:1.0:action:action-id");

        // create the action
        action.add(new Attribute(action-id, null, null,
                                 new StringAttribute("modify")));

        return action;
    }

    public static void main(String [] args) throws Exception {
        // create the new Request...note that the Environment must be 
specified
        // using a valid Set, even if that Set is empty
        RequestCtx request =
            new RequestCtx(setupSubjects(), setupResource(),
                           setupAction(), new HashSet());

        // encode the Request and print it to standard out
        request.encode(System.out, new Indenter());
    }

}

here is my request.xml

request.xml
-----------------
<?xml version="1.0" encoding="UTF-8" ?>
- <Request xmlns="urn:oasis:names:tc:xacml:1.0:context" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
- <Subject 
SubjectCategory="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject">
- <Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:subject:role" 
DataType="http://www.w3.org/2001/XMLSchema#any URI">
  <AttributeValue>tutor</AttributeValue>
  </Attribute>
- <Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id" 
DataType="http://www.w3.org/2001/XMLSchema#string";>
  <AttributeValue>Anne2003</AttributeValue>
  </Attribute>
- <Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:subject:module-id" 
DataType="http://www.w3.org/2001/XMLSchema#string";>
  <AttributeValue>FNS2003</AttributeValue>
  </Attribute>
  </Subject>
- <Resource>
- <Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" 
DataType="http://www.w3.org/2001/XMLSchema#anyURI";>
  
<AttributeValue>http://www.example.com/services/course-catalogue.html</AttributeValue>
  </Attribute>
  </Resource>
- <Action>
- <Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" 
DataType="http://www.w3.org/2001/XMLSchema#string";>
  <AttributeValue>modify</AttributeValue>
  </Attribute>
  </Action>
  </Request>

Regards
Nafees




[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]