Package com.dotmarketing.business

Examples of com.dotmarketing.business.DotCacheAdministrator


public class StructureCache {

  public static final String MASTER_STRUCTURE = "dotMaster_Structure";
 
    public static void addStructure(Structure st){
      DotCacheAdministrator cache = CacheLocator.getCacheAdministrator();
    // we use the identifier uri for our mappings.
    String inode = st.getInode();
        String structureName = st.getName();
        String velocityVarName = st.getVelocityVarName();
    cache.put(getPrimaryGroup() + inode, st, getPrimaryGroup());
        cache.put(getPrimaryGroup() + structureName, st, getPrimaryGroup());
        cache.put(getPrimaryGroup() + velocityVarName, st, getPrimaryGroup());
        if (UtilMethods.isSet(velocityVarName))
          cache.put(getPrimaryGroup() + velocityVarName.toLowerCase(), st, getPrimaryGroup());
  }
View Full Code Here


        }
        return st;
  }*/

    public static Structure getStructureByInode(String inode) {
      DotCacheAdministrator cache = CacheLocator.getCacheAdministrator();
      Structure st = null;
      try{
        st = (Structure) cache.get(getPrimaryGroup() + inode,getPrimaryGroup());
      }catch (DotCacheException e) {
      Logger.debug(StructureCache.class,"Cache Entry not found", e);
      }
        if (st == null) {
            st = StructureFactory.getStructureByInode(inode);
View Full Code Here

     *
     * @deprecated getting the structure by its name might not be safe, since the
     * structure name can be changed by the user, use getStructureByVelocityVarName
     */
    public static Structure getStructureByName(String name) {
      DotCacheAdministrator cache = CacheLocator.getCacheAdministrator();
        Structure st = null;
        try{
          st = (Structure) cache.get(getPrimaryGroup() + name,getPrimaryGroup());
        }catch (DotCacheException e) {
      Logger.debug(StructureCache.class,"Cache Entry not found", e);
      }
        if (st == null) {
            st = StructureFactory.getStructureByType(name);
View Full Code Here

     * @param variableName Name of the structure
     * @return The structure from cache
     *
     */
    public static Structure getStructureByVelocityVarName(String variableName) {
      DotCacheAdministrator cache = CacheLocator.getCacheAdministrator();
        Structure st = null;
        try{
          st = (Structure) cache.get(getPrimaryGroup() + variableName,getPrimaryGroup());
        }catch (DotCacheException e) {
      Logger.debug(StructureCache.class,"Cache Entry not found", e);
      }
        if (st == null) {
            st = StructureFactory.getStructureByVelocityVarName(variableName);
View Full Code Here

    /*public boolean hasStructureByInode (long inode) {
        return getStructureByInode(inode) != null;
    }*/
   
    public static void removeStructure(Structure st) {
      DotCacheAdministrator cache = CacheLocator.getCacheAdministrator();
        String inode = st.getInode();
        String structureName = st.getName();
        cache.remove(getPrimaryGroup() + inode,getPrimaryGroup());
        cache.remove(getPrimaryGroup() + structureName,getPrimaryGroup());
        clearURLMasterPattern();
    }
View Full Code Here

        cache.remove(getPrimaryGroup() + structureName,getPrimaryGroup());
        clearURLMasterPattern();
    }

    public static String getURLMasterPattern() throws DotCacheException {
      DotCacheAdministrator cache = CacheLocator.getCacheAdministrator();
    return (String)cache.get(getPrimaryGroup() + MASTER_STRUCTURE,getPrimaryGroup());
    }
View Full Code Here

    return (String)cache.get(getPrimaryGroup() + MASTER_STRUCTURE,getPrimaryGroup());
    }
   
    public static void clearURLMasterPattern(){
      synchronized (StructureCache.MASTER_STRUCTURE) {
        DotCacheAdministrator cache = CacheLocator.getCacheAdministrator();
          cache.remove(getPrimaryGroup() + MASTER_STRUCTURE,getPrimaryGroup())
    }
    }
View Full Code Here

          cache.remove(getPrimaryGroup() + MASTER_STRUCTURE,getPrimaryGroup())
    }
    }
   
    public static void addURLMasterPattern(String pattern){
      DotCacheAdministrator cache = CacheLocator.getCacheAdministrator();
        cache.put(getPrimaryGroup() + MASTER_STRUCTURE, pattern, getPrimaryGroup());
  }
View Full Code Here

      DotCacheAdministrator cache = CacheLocator.getCacheAdministrator();
        cache.put(getPrimaryGroup() + MASTER_STRUCTURE, pattern, getPrimaryGroup());
  }
   
    public static void addContainerStructures(List<ContainerStructure> containerStructures, String containerIdentifier){
      DotCacheAdministrator cache = CacheLocator.getCacheAdministrator();
        cache.put(getContainerStructureGroup() + containerIdentifier, containerStructures, getContainerStructureGroup());
  }
View Full Code Here

        cache.put(getContainerStructureGroup() + containerIdentifier, containerStructures, getContainerStructureGroup());
  }
   
    @SuppressWarnings("unchecked")
  public static List<ContainerStructure> getContainerStructures(String containerIdentifier){
      DotCacheAdministrator cache = CacheLocator.getCacheAdministrator();
      List<ContainerStructure> containerStructures = null;
     
    try{
      containerStructures = (List<ContainerStructure>) cache.get(getContainerStructureGroup() + containerIdentifier, getContainerStructureGroup());
      return containerStructures;
     
    } catch (DotCacheException e) {
      Logger.debug(StructureCache.class, "Cache Entry not found", e);
      return null;
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.