com.dotmarketing.portlets.categories.business
Class CategoryCacheImpl

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

public class CategoryCacheImpl
extends CategoryCache

Since:
1.5.1.1
Author:
David Torres, Jason Tesser

Constructor Summary
CategoryCacheImpl()
           
 
Method Summary
protected  void addChild(Categorizable parent, Category child, java.util.List<Category> children)
          Sets the list of children based on the given parent id/inode
protected  void addParent(Categorizable child, Category parent, java.util.List<Category> parents)
          Sets the list of parent categories of the given child id/inode
protected  void clearCache()
          Removes all entries from cache
protected  void clearChildrenCache()
          Removes all the child entries from the cache
protected  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  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
 java.lang.String getCategoryByKeyGroup()
          use to get the group name used in the cache
 java.lang.String getCategoryChildrenGroup()
          use to get the group name used in the cache
 java.lang.String getCategoryParentsGroup()
          use to get the group name used in the cache
protected  java.util.List<java.lang.String> getChildren(Categorizable parent)
          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
 java.lang.String[] getGroups()
          Use to get all groups the concrete cache belongs to
protected  java.util.List<java.lang.String> getParents(Categorizable child)
          Retrieves the list of parents categories associated to the given id/inode
 java.lang.String getPrimaryGroup()
          Use to get the primary group/region for the concrete cache
protected  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
 void putChildren(Categorizable parent, java.util.List<Category> children)
          Sets the list of children based on the given parent id/inode
protected  void putParents(Categorizable child, java.util.List<Category> parents)
          Sets the list of parent categories of the given child id/inode
protected  void remove(Category object)
          This method removes the category entry from the cache based on the category inode
protected  void removeChild(Categorizable parent, Category child)
          Removes the list of children categories based using the given parent id/inode
protected  void removeChildren(Categorizable parent)
          Removes the list of children categories based using the given parent id/inode
protected  void removeParent(Categorizable child, Category parent)
          Sets the list of parent categories of the given child id/inode
protected  void removeParents(Categorizable child)
          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
 

Constructor Detail

CategoryCacheImpl

public CategoryCacheImpl()
Method Detail

get

protected Category get(java.lang.String id)
                throws DotDataException
Description copied from class: CategoryCache
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

Specified by:
get in class CategoryCache
Returns:
Throws:
DotDataException

getChildren

protected java.util.List<java.lang.String> getChildren(Categorizable parent)
                                                throws DotDataException
Description copied from class: CategoryCache
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

Specified by:
getChildren in class CategoryCache
Returns:
Throws:
DotDataException

getParents

protected java.util.List<java.lang.String> getParents(Categorizable child)
                                               throws DotDataException
Description copied from class: CategoryCache
Retrieves the list of parents categories associated to the given id/inode

Specified by:
getParents in class CategoryCache
Returns:
Throws:
DotDataException

put

protected void put(Category object)
            throws DotDataException,
                   DotCacheException
Description copied from class: CategoryCache
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

Specified by:
put in class CategoryCache
Throws:
DotDataException
DotCacheException

putChildren

public void putChildren(Categorizable parent,
                        java.util.List<Category> children)
                 throws DotDataException,
                        DotCacheException
Description copied from class: CategoryCache
Sets the list of children based on the given parent id/inode

Specified by:
putChildren in class CategoryCache
Throws:
DotDataException
DotCacheException

putParents

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

Specified by:
putParents in class CategoryCache
Throws:
DotDataException
DotCacheException

remove

protected void remove(Category object)
               throws DotDataException,
                      DotCacheException
Description copied from class: CategoryCache
This method removes the category entry from the cache based on the category inode

Specified by:
remove in class CategoryCache
Throws:
DotDataException
DotCacheException

removeChildren

protected void removeChildren(Categorizable parent)
                       throws DotDataException,
                              DotCacheException
Description copied from class: CategoryCache
Removes the list of children categories based using the given parent id/inode

Specified by:
removeChildren in class CategoryCache
Throws:
DotDataException
DotCacheException

removeParents

protected void removeParents(Categorizable child)
                      throws DotDataException,
                             DotCacheException
Description copied from class: CategoryCache
Removes the parents associated to the given children category

Specified by:
removeParents in class CategoryCache
Throws:
DotDataException
DotCacheException

addChild

protected void addChild(Categorizable parent,
                        Category child,
                        java.util.List<Category> children)
                 throws DotDataException,
                        DotCacheException
Description copied from class: CategoryCache
Sets the list of children based on the given parent id/inode

Specified by:
addChild in class CategoryCache
Throws:
DotDataException
DotCacheException

addParent

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

Specified by:
addParent in class CategoryCache
Throws:
DotDataException
DotCacheException

removeChild

protected void removeChild(Categorizable parent,
                           Category child)
                    throws DotDataException,
                           DotCacheException
Description copied from class: CategoryCache
Removes the list of children categories based using the given parent id/inode

Specified by:
removeChild in class CategoryCache
Throws:
DotDataException
DotCacheException

removeParent

protected void removeParent(Categorizable child,
                            Category parent)
                     throws DotDataException,
                            DotCacheException
Description copied from class: CategoryCache
Sets the list of parent categories of the given child id/inode

Specified by:
removeParent in class CategoryCache
Throws:
DotDataException
DotCacheException

getByKey

protected Category getByKey(java.lang.String catKey)
                     throws DotDataException
Description copied from class: CategoryCache
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

Specified by:
getByKey in class CategoryCache
Returns:
Throws:
DotDataException

clearCache

protected void clearCache()
Description copied from class: CategoryCache
Removes all entries from cache

Specified by:
clearCache in class CategoryCache

clearChildrenCache

protected void clearChildrenCache()
Description copied from class: CategoryCache
Removes all the child entries from the cache

Specified by:
clearChildrenCache in class CategoryCache

getGroups

public java.lang.String[] getGroups()
Description copied from interface: Cachable
Use to get all groups the concrete cache belongs to

Returns:

getPrimaryGroup

public java.lang.String getPrimaryGroup()
Description copied from interface: Cachable
Use to get the primary group/region for the concrete cache

Returns:

getCategoryByKeyGroup

public java.lang.String getCategoryByKeyGroup()
Description copied from class: CategoryCache
use to get the group name used in the cache

Specified by:
getCategoryByKeyGroup in class CategoryCache
Returns:

getCategoryChildrenGroup

public java.lang.String getCategoryChildrenGroup()
Description copied from class: CategoryCache
use to get the group name used in the cache

Specified by:
getCategoryChildrenGroup in class CategoryCache
Returns:

getCategoryParentsGroup

public java.lang.String getCategoryParentsGroup()
Description copied from class: CategoryCache
use to get the group name used in the cache

Specified by:
getCategoryParentsGroup in class CategoryCache
Returns:


Copyright © 2010 dotCMS Inc. All Rights Reserved.