@Test public void testRemoveSecurityRuleEntry() throws Exception { Map<String, SecurityEntry> entries = InsertUsers(); entries.putAll(InsertEntities()); entries.putAll(InsertAccess()); removerTest(entries, new Remover() { @Override public void remove(SecurityReference ref) { securityCache.remove(ref); } }); }
@Override public void remove(UserSecurityReference user, SecurityReference entity) { this.invalidationWriteLock.lock(); try { writeLock.lock(); try { SecurityCacheEntry entry = getEntry(user, entity); if (entry != null) { if (logger.isDebugEnabled()) { logger.debug("Remove outdated access entry for [{}].", getEntryKey(user, entity)); } this.cache.remove(entry.getKey()); } } finally { writeLock.unlock(); } } finally { this.invalidationWriteLock.unlock(); } }
DefaultSecurityCache implements SecurityCache, Initializable { @Override public void remove(UserSecurityReference user, SecurityReference entity) { this.invalidationWriteLock.lock(); try { writeLock.lock(); try { SecurityCacheEntry entry = getEntry(user, entity); if (entry != null) { if (logger.isDebugEnabled()) { logger.debug("Remove outdated access entry for [{}].", getEntryKey(user, entity)); } this.cache.remove(entry.getKey()); } } finally { writeLock.unlock(); } } finally { this.invalidationWriteLock.unlock(); } } }
DefaultSecurityCache implements SecurityCache, Initializable { @Override public void remove(UserSecurityReference user, SecurityReference entity) { this.invalidationWriteLock.lock(); try { writeLock.lock(); try { SecurityCacheEntry entry = getEntry(user, entity); if (entry != null) { if (logger.isDebugEnabled()) { logger.debug("Remove outdated access entry for [{}].", getEntryKey(user, entity)); } this.cache.remove(entry.getKey()); } } finally { writeLock.unlock(); } } finally { this.invalidationWriteLock.unlock(); } }  }
DefaultSecurityCache implements SecurityCache, Initializable { @Override public void remove(UserSecurityReference user, SecurityReference entity) { this.invalidationWriteLock.lock(); try { writeLock.lock(); try { SecurityCacheEntry entry = getEntry(user, entity); if (entry != null) { if (logger.isDebugEnabled()) { logger.debug("Remove outdated access entry for [{}].", getEntryKey(user, entity)); } this.cache.remove(entry.getKey()); } } finally { writeLock.unlock(); } } finally { this.invalidationWriteLock.unlock(); } }  @Override void initialize(); @Override void add(SecurityRuleEntry entry); @Override void add(SecurityRuleEntry entry, Collection<GroupSecurityReference> groups); @Override void add(SecurityShadowEntry entry, Collection<GroupSecurityReference> groups); @Override void add(SecurityAccessEntry entry); @Override void add(SecurityAccessEntry entry, SecurityReference wiki); @Override SecurityAccessEntry get(UserSecurityReference user, SecurityReference entity); @Override SecurityRuleEntry get(SecurityReference entity); @Override void remove(UserSecurityReference user, SecurityReference entity); @Override void remove(SecurityReference entity); @Override Collection<GroupSecurityReference> getImmediateGroupsFor(UserSecurityReference user); @Override Collection<GroupSecurityReference> getGroupsFor(UserSecurityReference user, SecurityReference entityWiki); @Override void suspendInvalidation(); @Override void resumeInvalidation(); }
DefaultSecurityCache implements SecurityCache, Initializable { @Override public void remove(UserSecurityReference user, SecurityReference entity) { this.invalidationWriteLock.lock(); try { writeLock.lock(); try { SecurityCacheEntry entry = getEntry(user, entity); if (entry != null) { if (logger.isDebugEnabled()) { logger.debug("Remove outdated access entry for [{}].", getEntryKey(user, entity)); } this.cache.remove(entry.getKey()); } } finally { writeLock.unlock(); } } finally { this.invalidationWriteLock.unlock(); } }  @Override void initialize(); @Override void add(SecurityRuleEntry entry); @Override void add(SecurityRuleEntry entry, Collection<GroupSecurityReference> groups); @Override void add(SecurityShadowEntry entry, Collection<GroupSecurityReference> groups); @Override void add(SecurityAccessEntry entry); @Override void add(SecurityAccessEntry entry, SecurityReference wiki); @Override SecurityAccessEntry get(UserSecurityReference user, SecurityReference entity); @Override SecurityRuleEntry get(SecurityReference entity); @Override void remove(UserSecurityReference user, SecurityReference entity); @Override void remove(SecurityReference entity); @Override Collection<GroupSecurityReference> getImmediateGroupsFor(UserSecurityReference user); @Override Collection<GroupSecurityReference> getGroupsFor(UserSecurityReference user, SecurityReference entityWiki); @Override void suspendInvalidation(); @Override void resumeInvalidation();  }