Esempio n. 1
0
 @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());
 }
Esempio n. 2
0
 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());
 }
Esempio n. 3
0
 @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());
 }
Esempio n. 4
0
 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;
 }
Esempio n. 5
0
 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;
 }
Esempio n. 6
0
 @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());
 }
Esempio n. 7
0
 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;
 }
Esempio n. 8
0
 /* (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);
   }
 }
Esempio n. 9
0
  @Override
  protected Link add(String key, Link menuLink) {
    key = primaryGroup + key;

    // Add the key to the cache
    cache.put(key, menuLink, primaryGroup);

    return menuLink;
  }
Esempio n. 10
0
 @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;
 }
Esempio n. 11
0
 /* (non-Javadoc)
  * @see com.dotmarketing.business.PermissionCache#clearCache()
  */
 public void clearCache() {
   // clear the cache
   cache.flushGroup(primaryGroup);
 }
Esempio n. 12
0
 public void clearCache() {
   DotCacheAdministrator cache = CacheLocator.getCacheAdministrator();
   // clear the cache
   cache.flushGroup(getPrimaryGroup());
 }
Esempio n. 13
0
 public static void flushCache() {
   DotCacheAdministrator cache = CacheLocator.getCacheAdministrator();
   cache.flushAll();
 }