private EnvironmentType getEnvironmentType() { EnvironmentType environmentType = new EnvironmentType(); environmentType.getAttribute().add( RequestAttributeFactory.createDateTimeAttributeType( XACMLConstants.ATTRIBUTEID_CURRENT_TIME, null)); return environmentType; }
private ActionType getActionType(String action) { String actionID_NS = XACMLConstants.ATTRIBUTEID_ACTION_ID; AttributeType actionAttribute = RequestAttributeFactory.createStringAttributeType( actionID_NS , "jboss.org", action ); ActionType actionType = new ActionType(); actionType.getAttribute().add( actionAttribute ); return actionType; }
RequestAttributeFactory.createStringAttributeType( XACMLConstants.ATTRIBUTEID_SUBJECT_ID, "jboss.org", AttributeType attSubjectID = RequestAttributeFactory.createStringAttributeType( XACMLConstants.ATTRIBUTEID_ROLE, "jboss.org", roleName); subject.getAttribute().add(attSubjectID); RequestAttributeFactory.createAnyURIAttributeType( XACMLConstants.ATTRIBUTEID_RESOURCE_ID, null, RequestAttributeFactory.createStringAttributeType( XACMLConstants.ATTRIBUTEID_ACTION_ID, "jboss.org", URI actionUri = new URI(actionURIBase + paramName); actionType.getAttribute().add( RequestAttributeFactory.createStringAttributeType( actionUri.toASCIIString(), "jboss.org", environmentType.getAttribute().add( RequestAttributeFactory.createDateTimeAttributeType( XACMLConstants.ATTRIBUTEID_CURRENT_TIME, null));
RequestAttributeFactory.createStringAttributeType( XACMLConstants.ATTRIBUTEID_SUBJECT_ID, "jboss.org", principal.getName())); AttributeType attSubjectID = RequestAttributeFactory.createStringAttributeType( XACMLConstants.ATTRIBUTEID_ROLE, "jboss.org", roleName); subject.getAttribute().add(attSubjectID); RequestAttributeFactory.createStringAttributeType( XACMLConstants.ATTRIBUTEID_RESOURCE_ID, null, RequestAttributeFactory.createStringAttributeType( XACMLConstants.ATTRIBUTEID_ACTION_ID, "jboss.org", RequestAttributeFactory.createDateTimeAttributeType( XACMLConstants.ATTRIBUTEID_CURRENT_TIME, null));
RequestAttributeFactory.createStringAttributeType( XACMLConstants.ATTRIBUTEID_SUBJECT_ID, "jboss.org", AttributeType attSubjectID = RequestAttributeFactory.createStringAttributeType( XACMLConstants.ATTRIBUTEID_ROLE, "jboss.org", roleName); subject.getAttribute().add(attSubjectID); RequestAttributeFactory.createAnyURIAttributeType( XACMLConstants.ATTRIBUTEID_RESOURCE_ID, null, RequestAttributeFactory.createStringAttributeType( XACMLConstants.ATTRIBUTEID_ACTION_ID, "jboss.org", URI actionUri = new URI(actionURIBase + paramName); actionType.getAttribute().add( RequestAttributeFactory.createStringAttributeType( actionUri.toASCIIString(), "jboss.org", environmentType.getAttribute().add( RequestAttributeFactory.createDateTimeAttributeType( XACMLConstants.ATTRIBUTEID_CURRENT_TIME, null));
private ResourceType getResourceType(String ejbName) { String resourceID_NS = XACMLConstants.ATTRIBUTEID_RESOURCE_ID; ResourceType resourceType = new ResourceType(); AttributeType resourceAttribute = RequestAttributeFactory.createStringAttributeType( resourceID_NS, null, ejbName ); resourceType.getAttribute().add( resourceAttribute ); return resourceType; }
private SubjectType getSubjectType( Principal principal, RoleGroup callerRoles ) { String subjectID_NS = XACMLConstants.ATTRIBUTEID_SUBJECT_ID; String roleID_NS = XACMLConstants.ATTRIBUTEID_ROLE; String principalName = principal.getName(); //Create a subject type SubjectType subject = new SubjectType(); AttributeType attribute = RequestAttributeFactory.createStringAttributeType( subjectID_NS, "jboss.org", principalName ); subject.getAttribute().add( attribute ); Collection<Role> rolesList = callerRoles.getRoles(); if(rolesList != null) { for(Role role:rolesList) { String roleName = role.getRoleName(); AttributeType attSubjectID = RequestAttributeFactory.createStringAttributeType( roleID_NS , "jboss.org", roleName ); subject.getAttribute().add(attSubjectID); } } return subject; } private void safeClose(OutputStream os)