public void invalidateAll() { if (isCacheEnabled()) { synchronized (this) { long count = sizeCounter.getCount(); sizeCounter.dec(count); invalidationsCounter.inc(count); // caches may be null if we're called for invalidation during a hot-reload Cache cache = getEntryCache(); if (cache != null) { cache.invalidateAll(); } cache = getEntryCacheWithoutReferences(); if (cache != null) { cache.invalidateAll(); } } } }
public void invalidate(String... entryIds) { invalidate(Arrays.asList(entryIds)); }
public Cache getEntryCacheWithoutReferences() { if (entryCacheWithoutReferences == null) { entryCacheWithoutReferences = getCacheService().getCache( entryCacheWithoutReferencesName); } return entryCacheWithoutReferences; }
DirectoryCache cache = directory.getCache(); log.error("Session: " + session + "Vocabulary " + directoryName + " entry: " + entryId + " == Entry KO: directoryCache" + directory.getCache() + " / entryCache: " + directory.getCache().getEntryCache() + " / entryCacheWithoutReferences: " + directory.getCache().getEntryCacheWithoutReferences()); Cache entryCache = cache.getEntryCache(); try { DocumentModel deprecatedEntry = BaseSession.createEntryModel(null, schema, entryId, null, true);
public DocumentModel getEntry(String entryId, EntrySource source) { return getEntry(entryId, source, true); }
@Override public void invalidateDirectoryCache() { DirectoryService dirService = Framework.getService(DirectoryService.class); getCache().invalidateAll(); // and also invalidates the cache from the source directories for (SourceDescriptor src : getDescriptor().sources) { for (SubDirectoryDescriptor sub : src.subDirectories) { Directory dir = dirService.getDirectory(sub.name); if (dir != null) { dir.invalidateDirectoryCache(); } } } }
@Override public DocumentModel getEntry(String id, boolean fetchReferences) { if (!hasPermission(SecurityConstants.READ)) { return null; } if (readAllColumns) { // bypass cache when reading all columns return getEntryFromSource(id, fetchReferences); } return directory.getCache().getEntry(id, this, fetchReferences); }
public void invalidate(List<String> entryIds) { if (isCacheEnabled()) { synchronized (this) { for (String entryId : entryIds) { sizeCounter.dec(); invalidationsCounter.inc(); // caches may be null if we're called for invalidation during a hot-reload Cache cache = getEntryCache(); if (cache != null) { cache.invalidate(entryId); } cache = getEntryCacheWithoutReferences(); if (cache != null) { cache.invalidate(entryId); } } } } }
cacheKeys.add(userNameLowerCase); userDirectory.getCache().invalidate(cacheKeys);
public Cache getEntryCache() { if (entryCache == null) { entryCache = getCacheService().getCache(entryCacheName); } return entryCache; }
public DocumentModel getEntry(String entryId, EntrySource source, boolean fetchReferences) { if (!isCacheEnabled()) { return source.getEntryFromSource(entryId, fetchReferences); } else if (isCacheEnabled() && (getEntryCache() == null || getEntryCacheWithoutReferences() == null)) { if (log.isDebugEnabled()) { if (getEntryCache() == null) { log.debug(String.format( "The cache '%s' is undefined for directory '%s', it will be created with the default cache configuration", entryCacheName, name)); if (getEntryCacheWithoutReferences() == null) { log.debug(String.format( "The cache '%s' is undefined for directory '%s', it will be created with the default cache configuration", Cache cache = fetchReferences ? getEntryCache() : getEntryCacheWithoutReferences(); Serializable entry = cache.get(entryId); if (CACHE_MISS.equals(entry)) {