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