@Override public void removeLanguageKeys(String langCode, String countryCode) { DotCacheAdministrator cache = CacheLocator.getCacheAdministrator(); String languageKey = getPrimaryGroup() + "_Keys_" + (countryCode != null ? langCode + "_" + countryCode : langCode); cache.remove(languageKey, getPrimaryGroup()); }
public void removeLanguage(Language l) { DotCacheAdministrator cache = CacheLocator.getCacheAdministrator(); long id = l.getId(); String idSt = String.valueOf(l.getId()); String languageKey = l.getLanguageCode() + "-" + l.getCountryCode(); cache.remove(getPrimaryGroup() + id, getPrimaryGroup()); cache.remove(getPrimaryGroup() + idSt, getPrimaryGroup()); cache.remove(getPrimaryGroup() + languageKey, getPrimaryGroup()); }
@Override public void setLanguageKeys(String langCode, String countryCode, List<LanguageKey> keys) { DotCacheAdministrator cache = CacheLocator.getCacheAdministrator(); String languageKey = getPrimaryGroup() + "_Keys_" + (countryCode != null ? langCode + "_" + countryCode : langCode); cache.put(languageKey, keys, getPrimaryGroup()); }
public boolean hasLanguage(long id) { DotCacheAdministrator cache = CacheLocator.getCacheAdministrator(); Language l = null; try { l = (Language) cache.get(getPrimaryGroup() + id, getPrimaryGroup()); } catch (DotCacheException e) { Logger.debug(LanguageCacheImpl.class, "Cache Entry not found", e); } return l != null; }
public Language getLanguageById(String id) { DotCacheAdministrator cache = CacheLocator.getCacheAdministrator(); Language f = null; try { f = (Language) cache.get(getPrimaryGroup() + id, getPrimaryGroup()); } catch (DotCacheException e) { Logger.debug(LanguageCacheImpl.class, "Cache Entry not found", e); } return f; }
@Override public List<LanguageKey> getLanguageKeys(String langCode, String countryCode) throws DotCacheException { DotCacheAdministrator cache = CacheLocator.getCacheAdministrator(); String languageKey = getPrimaryGroup() + "_Keys_" + (countryCode != null ? langCode + "_" + countryCode : langCode); return (List<LanguageKey>) cache.get(languageKey, getPrimaryGroup()); }
public boolean hasLanguage(String languageCode, String countryCode) { DotCacheAdministrator cache = CacheLocator.getCacheAdministrator(); String languageKey = languageCode + "-" + countryCode; Language l = null; try { l = (Language) cache.get(getPrimaryGroup() + languageKey, getPrimaryGroup()); } catch (DotCacheException e) { Logger.debug(LanguageCacheImpl.class, "Cache Entry not found", e); } return l != null; }
/* (non-Javadoc) * @see com.dotmarketing.business.PermissionCache#remove(java.lang.String) */ protected void remove(String key) { key = primaryGroup + key; try { cache.remove(key, primaryGroup); } catch (Exception e) { Logger.debug(this, "Cache not able to be removed", e); } }
@Override protected Link add(String key, Link menuLink) { key = primaryGroup + key; // Add the key to the cache cache.put(key, menuLink, primaryGroup); return menuLink; }
@Override protected Link get(String key) { key = primaryGroup + key; Link menuLink = null; try { menuLink = (Link) cache.get(key, primaryGroup); } catch (DotCacheException e) { Logger.debug(this, "Cache Entry not found", e); } return menuLink; }
/* (non-Javadoc) * @see com.dotmarketing.business.PermissionCache#clearCache() */ public void clearCache() { // clear the cache cache.flushGroup(primaryGroup); }
public void clearCache() { DotCacheAdministrator cache = CacheLocator.getCacheAdministrator(); // clear the cache cache.flushGroup(getPrimaryGroup()); }
public static void flushCache() { DotCacheAdministrator cache = CacheLocator.getCacheAdministrator(); cache.flushAll(); }