private void clearCacheIncludingChildren(ObjectIdentity objectIdentity) { Assert.notNull(objectIdentity, "ObjectIdentity required"); List<ObjectIdentity> children = findChildren(objectIdentity); if (children != null) { for (ObjectIdentity child : children) { clearCacheIncludingChildren(child); } } aclCache.evictFromCache(objectIdentity); }
aclCache.evictFromCache(objectIdentity);
private void clearCacheIncludingChildren(ObjectIdentity objectIdentity) { Assert.notNull(objectIdentity, "ObjectIdentity required"); List<ObjectIdentity> children = findChildren(objectIdentity); if (children != null) { for (ObjectIdentity child : children) { clearCacheIncludingChildren(child); } } aclCache.evictFromCache(objectIdentity); }
@Override @Transactional(propagation = Propagation.REQUIRES_NEW) public void removeAcl(ISecuredObject<?> securedObject) { ObjectIdentityImpl objectIdentity = new ObjectIdentityImpl(securedObject.getSecuredClass(), securedObject.getIdForACL()); aclCache.evictFromCache(objectIdentity); aclService.deleteAcl(objectIdentity, false); }
@Transactional public void deleteAcl(ObjectIdentity objectIdentity, boolean deleteChildren) throws ChildrenExistException { AclSecuredClassDescriptionData aclClass = aclSecuredClassDao.load(objectIdentity.getType()); if (aclClass == null) { return; } // No need to check for nulls, as guaranteed non-null by // ObjectIdentity.getIdentifier() interface contract String identifier = objectIdentity.getIdentifier().toString(); long id = (Long.valueOf(identifier)).longValue(); AclSecuredObjectIdentityData aclObjectIdentity = aclObjectIdentityDao.findByObjectId(aclClass.getId(), id); if (aclObjectIdentity != null) { removeAcl(aclObjectIdentity); aclCache.evictFromCache(objectIdentity); } }
@Transactional public MutableAcl updateAcl(MutableAcl acl) throws NotFoundException { // Delete this ACL's ACEs in the acl_entry table // long oid = ((Long) acl.getId()).longValue(); AclSecuredObjectIdentityData aclo = updateAclObjectIdentity(acl); aclEntryDao.deleteByIdentityId(aclo.getId()); aclCache.evictFromCache(acl.getObjectIdentity()); // Create this ACL's ACEs in the acl_entry table createRecords(acl); // Retrieve the ACL via superclass (ensures cache registration, proper // retrieval etc) return (MutableAcl) readAclById(acl.getObjectIdentity()); }
aclCache.evictFromCache(objectIdentity);
@Transactional(propagation = Propagation.REQUIRES_NEW) private void removeAclRecords(Long aclId, String className, SpringAclSid sid) { // we need to remove also the superclass object identity ACLs Class<? extends ISecuredObject<?>> clazz = SecuredClassHelper.getSecuredClass(className); while (!isTopParentClass(clazz)) { if (isHibernateProxy(clazz)) { clazz = getSecuredSuperClass(clazz); continue; } ObjectIdentityImpl objectIdentity = new ObjectIdentityImpl(clazz, aclId); if (sid != null) { aclEntryDao.deleteByIdentityIdAndSid(aclId, clazz, sid, clazz.getName()); } else { aclService.deleteAcl(objectIdentity, false); } aclEntryDao.deleteByIdentityIdAndSid(aclId, clazz, sid); aclCache.evictFromCache(objectIdentity); //aclService.readAclById(objectIdentity); // update cache clazz = getSecuredSuperClass(clazz); } }
@Transactional(propagation = Propagation.REQUIRES_NEW) private void removeAclRecords(Class<? extends ISecuredObject<?>> securedClass, SpringAclSid sid) { // we need to remove also the superclass object identity ACLs Class<? extends ISecuredObject<?>> superClass = securedClass; while (!isTopParentClass(superClass)) { if (isHibernateProxy(superClass)) { superClass = getSecuredSuperClass(superClass); continue; } aclEntryDao.deleteByClassnameAndSid(superClass, sid); List<AclEntryData> entries = aclEntryDao.findByClassnameAndSid(superClass, sid); for (AclEntryData entry : entries) { aclCache.evictFromCache(entry.getObjectIdentity()); aclService.readAclById((ObjectIdentity) entry.getObjectIdentity()); // update // cache } superClass = getSecuredSuperClass(superClass); } }