Package com.dotmarketing.business

Examples of com.dotmarketing.business.DotCacheAdministrator


     * To add a new DOM tree related to the portletId to the cache
     * @param portletId The value is used as a key to identify the DOM tree
     * @param doc The DOM tree to be stored into the cache.
     */
    public static void add(String porletId, List<MenuItem> menus) {
      DotCacheAdministrator cache = CacheLocator.getCacheAdministrator();
      cache.put(getPrimaryGroup() + porletId, menus, getPrimaryGroup());
    }
View Full Code Here


     * To retrieve a DOM tree from the cache
     * @param portletId
     * @return
     */
    public static List<MenuItem> get(String porletId) {
      DotCacheAdministrator cache = CacheLocator.getCacheAdministrator();
      List<MenuItem> menus = null;
      try{
        menus = ( List<MenuItem> ) cache.get(getPrimaryGroup() + porletId,getPrimaryGroup());
      }catch (DotCacheException e) {
      Logger.debug(NavMenuCache.class, "Cache Entry not found", e);
      }
    return menus;
    }
View Full Code Here

    /**
     * To invalidate (remove) the DOM tree entry related to this portletId from the cache
     * @param portletId
     */
    public static void invalidate(String porletId) {
      DotCacheAdministrator cache = CacheLocator.getCacheAdministrator();
      cache.remove(getPrimaryGroup() + porletId,getPrimaryGroup());
    }
View Full Code Here

      DotCacheAdministrator cache = CacheLocator.getCacheAdministrator();
      cache.remove(getPrimaryGroup() + porletId,getPrimaryGroup());
    }
   
    public static void clearCache(){
    DotCacheAdministrator cache = CacheLocator.getCacheAdministrator();
      //clear the cache
      cache.flushGroup(getPrimaryGroup());
  }
View Full Code Here

    public abstract Folder getFolderByPathAndHost(String path, Host host);

    public abstract void removeFolder(Folder f, Identifier id);

    public  void clearCache(){
    DotCacheAdministrator cache = CacheLocator.getCacheAdministrator();
      //clear the cache
      cache.flushGroup(getPrimaryGroup());
  }
View Full Code Here

     * @param clientkey The key is used to identify the submitter of the rating in this case we are using the long lived cookie set in the
     * browser of every dotcms frontend user
     * @param rating The rating to store in the cache
     */
    public static void addToRatingCache(Rating rating) {
      DotCacheAdministrator cache = CacheLocator.getCacheAdministrator();
      cache.put(getPrimaryGroup() + rating.getLongLiveCookiesId() + "-" + rating.getIdentifier(), rating, getPrimaryGroup());
    }
View Full Code Here

      DotCacheAdministrator cache = CacheLocator.getCacheAdministrator();
      cache.put(getPrimaryGroup() + rating.getLongLiveCookiesId() + "-" + rating.getIdentifier(), rating, getPrimaryGroup());
    }
   
    public static void removeRating(Rating rating) {
      DotCacheAdministrator cache = CacheLocator.getCacheAdministrator();
      cache.remove(getPrimaryGroup() + rating.getLongLiveCookiesId() + "-" + rating.getIdentifier(), getPrimaryGroup());
    }
View Full Code Here

     * @param identifier
     * @param longLiveCookie
     * @return
     */
    public static Rating getRatingFromCache(String identifier, String longLivedCookie) {
      DotCacheAdministrator cache = CacheLocator.getCacheAdministrator();
      Rating rt = null;
      try{
        rt = (Rating) cache.get(getPrimaryGroup() + longLivedCookie + "-" + identifier,getPrimaryGroup());
      }catch (DotCacheException e) {
      Logger.debug(RatingCache.class, "Cache Entry not found", e);
      }
    if(rt == null) {
      rt = RatingsFactory.getRatingByLongCookieId(identifier, longLivedCookie);
View Full Code Here

      addToRatingCache(rt);
    }
    return rt;
    }
    public static void clearCache(){
    DotCacheAdministrator cache = CacheLocator.getCacheAdministrator();
      //clear the cache
      cache.flushGroup(getPrimaryGroup());
  }
View Full Code Here

* @author Jason Tesser
*/
public class FieldsCache {

    public static void addFields(Structure st, List<Field> fields){
      DotCacheAdministrator cache = CacheLocator.getCacheAdministrator();
    // we use the identifier uri for our mappings.
    String inode = st.getInode();
    cache.put(getPrimaryGroup() + inode, fields,getPrimaryGroup());
        cache.put(getPrimaryGroup() + st.getVelocityVarName(), fields, getPrimaryGroup());
  }
View Full Code Here

TOP

Related Classes of com.dotmarketing.business.DotCacheAdministrator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.