/** * Get a descriptor from the cache. * * @param wikiAlias Alias of the wiki to get * @return the descriptor related to the alias or null if there is no corresponding descriptor in the cache */ public DefaultWikiDescriptor getFromAlias(String wikiAlias) { return wikiAliasCache.get(wikiAlias); }
/** * Get a descriptor from the cache. * * @param wikiId Id of the wiki to get * @return the descriptor related to the id or null if there is no corresponding descriptor in the cache */ public DefaultWikiDescriptor getFromId(String wikiId) { return wikiIdCache.get(wikiId); }
@Override public IconSet get(DocumentReference documentReference) { return cache.get(getKeyFromDocument(documentReference)); }
@Override public T get(LESSResourceReference lessResourceReference, SkinReference skin, ColorThemeReference colorTheme) { return cache.get(cacheKeyFactory.getCacheKey(lessResourceReference, skin, colorTheme, isContextHandled)); }
public Object getFromCache(String key) throws XWikiCacheNeedsRefreshException { Object value = this.cache.get(key); if (value == null) { throw new XWikiCacheNeedsRefreshException(); } return value; }
@Override public IconSet get(String name) { return cache.get(getKeyFromName(name)); }
/** * {@inheritDoc} * * @see com.xpn.xwiki.internal.cache.DocumentCache#get(org.xwiki.model.reference.DocumentReference, * java.lang.Object[]) */ public C get(DocumentReference documentReference, Object... extensions) { return this.cache.get(getKey(documentReference, extensions)); }
/** * Retrieve an entry from the cache directly the internal cache. Used during unit test only. * @param entryKey the key to be retrieved. * @return the entry stored in the internal cache or Null if no entry was found. */ SecurityEntry get(String entryKey) { SecurityCacheEntry entry = cache.get(entryKey); return (entry != null) ? entry.getEntry() : null; }
@Override public T get(String fileName, String wiki, String fileSystemSkin, String colorTheme) { return cache.get(getCacheKey(fileName, wiki, fileSystemSkin, colorTheme)); }
/** * @param reference the reference requested. * @return a security cache entry corresponding to given reference, null if none is available in the cache. */ private SecurityCacheEntry getEntry(SecurityReference reference) { readLock.lock(); try { return cache.get(getEntryKey(reference)); } finally { readLock.unlock(); } }
@Override public PatientSpecificity getSpecificity(Patient patient) { String key = getCacheKey(patient); PatientSpecificity result = this.cache.get(key); if (result == null) { double score = getScore(patient); if (score != -1.0) { // getScore populates the cache result = this.cache.get(key); } } return result; }
/** * @param userReference the user reference requested. * @param reference the reference requested. * @return a security cache entry corresponding to the given user and reference, null if none is available * in the cache. */ private SecurityCacheEntry getEntry(UserSecurityReference userReference, SecurityReference reference) { readLock.lock(); try { return cache.get(getEntryKey(userReference, reference)); } finally { readLock.unlock(); } }
@Override public PatientSpecificity getSpecificity(Patient patient) { String key = getCacheKey(patient); PatientSpecificity result = this.cache.get(key); if (result == null) { double score = getScore(patient); if (score != -1.0) { // getScore populates the cache result = this.cache.get(key); } } return result; }
/** * @param userReference the user reference requested. * @param wiki the wiki context of the shadow reference to retrieve. * @return a security cache entry corresponding to the given user and reference, null if none is available * in the cache. */ private SecurityCacheEntry getShadowEntry(SecurityReference userReference, SecurityReference wiki) { readLock.lock(); try { return cache.get(getShadowEntryKey(userReference, wiki)); } finally { readLock.unlock(); } }
/** * {@inheritDoc} * * @see com.xpn.xwiki.internal.cache.DocumentCache#remove(java.lang.Object, * org.xwiki.model.reference.DocumentReference, java.lang.Object[]) */ public void remove(C data, DocumentReference documentReference, Object... extensions) { String key = getKey(documentReference, extensions); this.cache.remove(key); String documentReferenceString = serializer.serialize(documentReference); Collection<String> keys = mappingCache.get(documentReferenceString); if (keys != null) { keys.remove(key); } }
private VocabularyTerm cacheTerm(String id, SolrDocument doc) { Cache<VocabularyTerm> cache = this.externalServicesAccess.getTermCache(this); VocabularyTerm term = cache.get(id); if (term == null) { term = new SolrVocabularyTerm(doc, this); cache.set(id, term); } return term; } }
@Override public Set<NotificationFilterPreference> getFilterPreferences(DocumentReference user) throws NotificationException { if (user == null) { return Collections.EMPTY_SET; } String userId = serializer.serialize(user); Set<NotificationFilterPreference> preferences = cache.get(userId); if (preferences != null) { return preferences; } preferences = modelBridge.getFilterPreferences(user); cache.set(userId, preferences); return preferences; }
public SyndFeed getFeed(String sfeed, boolean ignoreInvalidFeeds, boolean force, XWikiContext context) throws IOException { SyndFeed feed = null; prepareCache(context); if (!force) { feed = this.feedCache.get(sfeed); } if (feed == null) { feed = getFeedForce(sfeed, ignoreInvalidFeeds, context); } if (feed != null) { this.feedCache.set(sfeed, feed); } return feed; }
public boolean exists(XWikiDocument doc, XWikiContext context) throws XWikiException { String key = getKey(doc, context); initCache(context); try { Boolean result = getPageExistCache().get(key); if (result != null) { return result; } } catch (Exception e) { } boolean result = this.store.exists(doc, context); getPageExistCache().set(key, new Boolean(result)); return result; }