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