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