/** * {@inheritDoc} */ public Object cacheObjectById(Integer id, InterMineObject obj) { synchronized (cache) { cache.put(id, obj); } return obj; }
/** * {@inheritDoc} */ public Object cacheObjectById(Integer id, InterMineObject obj) { synchronized (cache) { cache.put(id, obj); } return obj; }
/** * Return a map from template name to template query containing superuser templates that are * tagged as public and are valid for the current data model. * @return a map from template name to template query */ public Map<String, ApiTemplate> getValidGlobalTemplates() { // TODO: We should likely also be using a cache for getAspectTemplates() // and getGlobalTemplates() synchronized (globalValidTemplateCache) { if (globalValidTemplateCache.isEmpty()) { Map<String, ApiTemplate> globalTemplates = getGlobalTemplates(); for (Map.Entry<String, ApiTemplate> entry : globalTemplates.entrySet()) { if (entry.getValue().isValid()) { globalValidTemplateCache.put(entry.getKey(), entry.getValue()); } } } return globalValidTemplateCache; } }
/** * Return a map from template name to template query containing superuser templates that are * tagged as public and are valid for the current data model. * @return a map from template name to template query */ public Map<String, ApiTemplate> getValidGlobalTemplates() { // TODO: We should likely also be using a cache for getAspectTemplates() // and getGlobalTemplates() synchronized (globalValidTemplateCache) { if (globalValidTemplateCache.isEmpty()) { Map<String, ApiTemplate> globalTemplates = getGlobalTemplates(); for (Map.Entry<String, ApiTemplate> entry : globalTemplates.entrySet()) { if (entry.getValue().isValid()) { globalValidTemplateCache.put(entry.getKey(), entry.getValue()); } } } return globalValidTemplateCache; } }
savedQueries, bags, savedTemplates, userProfile.getApiKey(), userProfile.getLocalAccount(), userProfile.getSuperuser()); profileCache.put(userProfile.getUsername(), profile);
savedQueries, bags, savedTemplates, userProfile.getApiKey(), userProfile.getLocalAccount(), userProfile.getSuperuser()); profileCache.put(userProfile.getUsername(), profile);