com.dotmarketing.portlets.categories.business
Class CategoryCache

java.lang.Object
  extended by com.dotmarketing.portlets.categories.business.CategoryCache
All Implemented Interfaces:
Cachable
Direct Known Subclasses:
CategoryCacheImpl

public abstract class CategoryCache
extends java.lang.Object
implements Cachable

Since:
1.5.1.1
Author:
David Torres

Constructor Summary
CategoryCache()
           
 
Method Summary
protected abstract  void addChild(Categorizable parentId, Category child, java.util.List<Category> children)
          Sets the list of children based on the given parent id/inode
protected abstract  void addParent(Categorizable child, Category parent, java.util.List<Category> parents)
          Sets the list of parent categories of the given child id/inode
abstract  void clearCache()
          Removes all entries from cache
protected abstract  void clearChildrenCache()
          Removes all the child entries from the cache
protected abstract  Category get(java.lang.String id)
          This method get a category object from the cache based on the passed inode, if the object does not exist in cache a null value is returned
protected abstract  Category getByKey(java.lang.String catKey)
          This method get a category object from the cache based on the passed inode, if the object does not exist in cache a null value is returned
abstract  java.lang.String getCategoryByKeyGroup()
          use to get the group name used in the cache
abstract  java.lang.String getCategoryChildrenGroup()
          use to get the group name used in the cache
abstract  java.lang.String getCategoryParentsGroup()
          use to get the group name used in the cache
protected abstract  java.util.List<java.lang.String> getChildren(Categorizable parentId)
          Retrieves children categories of the given id(inode or identifier) this method can be used to associate not only children of categories but also children of other type of entities
protected abstract  java.util.List<java.lang.String> getParents(Categorizable childId)
          Retrieves the list of parents categories associated to the given id/inode
protected abstract  void put(Category object)
          This method puts a category object in cache using the category inode as key this method also triggers the removal of children and parents from the cache
protected abstract  void putChildren(Categorizable parentId, java.util.List<Category> children)
          Sets the list of children based on the given parent id/inode
protected abstract  void putParents(Categorizable child, java.util.List<Category> parents)
          Sets the list of parent categories of the given child id/inode
protected abstract  void remove(Category object)
          This method removes the category entry from the cache based on the category inode
protected abstract  void removeChild(Categorizable parentId, Category child)
          Removes the list of children categories based using the given parent id/inode
protected abstract  void removeChildren(Categorizable parent)
          Removes the list of children categories based using the given parent category
protected abstract  void removeChildren(java.lang.String parentId)
          Removes the list of children categories based using the given parent id/inode
protected abstract  void removeParent(Categorizable child, Category parent)
          Sets the list of parent categories of the given child id/inode
protected abstract  void removeParents(Categorizable child)
          Removes the parents associated to the given children category
protected abstract  void removeParents(java.lang.String childId)
          Removes the parents associated to the given children category
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.dotmarketing.business.Cachable
getGroups, getPrimaryGroup
 

Constructor Detail

CategoryCache

public CategoryCache()
Method Detail

remove

protected abstract void remove(Category object)
                        throws DotDataException,
                               DotCacheException
This method removes the category entry from the cache based on the category inode

Parameters:
object -
Throws:
DotDataException
DotCacheException

get

protected abstract Category get(java.lang.String id)
                         throws DotDataException
This method get a category object from the cache based on the passed inode, if the object does not exist in cache a null value is returned

Parameters:
id -
Returns:
Throws:
DotDataException

getByKey

protected abstract Category getByKey(java.lang.String catKey)
                              throws DotDataException
This method get a category object from the cache based on the passed inode, if the object does not exist in cache a null value is returned

Parameters:
id -
Returns:
Throws:
DotDataException

put

protected abstract void put(Category object)
                     throws DotDataException,
                            DotCacheException
This method puts a category object in cache using the category inode as key this method also triggers the removal of children and parents from the cache

Parameters:
object -
Throws:
DotDataException
DotCacheException

getChildren

protected abstract java.util.List<java.lang.String> getChildren(Categorizable parentId)
                                                         throws DotDataException
Retrieves children categories of the given id(inode or identifier) this method can be used to associate not only children of categories but also children of other type of entities

Parameters:
id -
Returns:
Throws:
DotDataException

putChildren

protected abstract void putChildren(Categorizable parentId,
                                    java.util.List<Category> children)
                             throws DotDataException,
                                    DotCacheException
Sets the list of children based on the given parent id/inode

Parameters:
parentId -
children -
Throws:
DotDataException
DotCacheException

addChild

protected abstract void addChild(Categorizable parentId,
                                 Category child,
                                 java.util.List<Category> children)
                          throws DotDataException,
                                 DotCacheException
Sets the list of children based on the given parent id/inode

Parameters:
parentId -
children -
Throws:
DotDataException
DotCacheException

removeChildren

protected abstract void removeChildren(java.lang.String parentId)
                                throws DotDataException,
                                       DotCacheException
Removes the list of children categories based using the given parent id/inode

Parameters:
parentId -
Throws:
DotDataException
DotCacheException

removeChildren

protected abstract void removeChildren(Categorizable parent)
                                throws DotDataException,
                                       DotCacheException
Removes the list of children categories based using the given parent category

Parameters:
parent -
Throws:
DotDataException
DotCacheException

removeChild

protected abstract void removeChild(Categorizable parentId,
                                    Category child)
                             throws DotDataException,
                                    DotCacheException
Removes the list of children categories based using the given parent id/inode

Parameters:
parentId -
children -
Throws:
DotDataException
DotCacheException

getParents

protected abstract java.util.List<java.lang.String> getParents(Categorizable childId)
                                                        throws DotDataException
Retrieves the list of parents categories associated to the given id/inode

Parameters:
id -
Returns:
Throws:
DotDataException

putParents

protected abstract void putParents(Categorizable child,
                                   java.util.List<Category> parents)
                            throws DotDataException,
                                   DotCacheException
Sets the list of parent categories of the given child id/inode

Parameters:
children -
parents -
Throws:
DotDataException
DotCacheException

addParent

protected abstract void addParent(Categorizable child,
                                  Category parent,
                                  java.util.List<Category> parents)
                           throws DotDataException,
                                  DotCacheException
Sets the list of parent categories of the given child id/inode

Parameters:
children -
parents -
Throws:
DotDataException
DotCacheException

removeParents

protected abstract void removeParents(java.lang.String childId)
                               throws DotDataException,
                                      DotCacheException
Removes the parents associated to the given children category

Parameters:
childId -
Throws:
DotDataException
DotCacheException

removeParents

protected abstract void removeParents(Categorizable child)
                               throws DotDataException,
                                      DotCacheException
Removes the parents associated to the given children category

Parameters:
child -
Throws:
DotDataException
DotCacheException

removeParent

protected abstract void removeParent(Categorizable child,
                                     Category parent)
                              throws DotDataException,
                                     DotCacheException
Sets the list of parent categories of the given child id/inode

Parameters:
children -
parents -
Throws:
DotDataException
DotCacheException

clearCache

public abstract void clearCache()
Removes all entries from cache

Specified by:
clearCache in interface Cachable

clearChildrenCache

protected abstract void clearChildrenCache()
Removes all the child entries from the cache


getCategoryByKeyGroup

public abstract java.lang.String getCategoryByKeyGroup()
use to get the group name used in the cache

Returns:

getCategoryChildrenGroup

public abstract java.lang.String getCategoryChildrenGroup()
use to get the group name used in the cache

Returns:

getCategoryParentsGroup

public abstract java.lang.String getCategoryParentsGroup()
use to get the group name used in the cache

Returns:


Copyright © 2013 dotCMS Inc. All Rights Reserved.