@SuppressWarnings("unchecked") public Collection<ACL> getACLs() { Map<String, Object> context = new HashMap<String, Object>(); context.put("resource", "ALL"); return (Collection<ACL>) this.registration.getPolicy(null, PolicyRegistration.ACL, context); }
@Override public void undeploy(DeploymentUnit unit) { unit.removeAttachment(JACC_ATTACHMENT_NAME); // unregister any XACML or ACL policies associated with the deployment unit. String contextId = unit.getSimpleName(); if (this.policyRegistration != null) { this.policyRegistration.deRegisterPolicy(contextId, PolicyRegistration.XACML); this.policyRegistration.deRegisterPolicy(contextId, PolicyRegistration.ACL); } }
JAXBElement<?> policyConfig = (JAXBElement<?>) unit.getAttachment(XACML_ATTACHMENT_NAME); if(policyConfig != null) this.policyRegistration.registerPolicyConfig(contextId, xacmlType, policyConfig); this.policyRegistration.registerPolicyConfig(contextId, aclType, aclConfig);
public ACL getACL(Resource resource) { String resourceString = Util.getResourceAsString(resource); Map<String, Object> context = new HashMap<String, Object>(); context.put("resource", resourceString); return (ACL) this.registration.getPolicy(null, PolicyRegistration.ACL, context); }