Class AbstractIndexManager

java.lang.Object
com.jalios.jcms.AbstractIndexManager
Direct Known Subclasses:
AccessControlListIndexManager, CategoryIndexManager, DataIndexManager, GroupIndexManager, PublicationIndexManager

public abstract class AbstractIndexManager extends Object
This abstract class provides generic methods to manage data indices.
Since:
jcms-6.0.0
Author:
Olivier Dedieu
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Collection to store previoulsy computed information associated to Data and DBData
    static class 
    Pseudo map to store previoulsy computed information associated to Data and DBData
    static class 
    Pseudo Set to store previoulsy computed information associated to Data and DBData
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected Channel
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected <K extends Data, T>
    boolean
    addIndexWithSet(Map<K,Set<T>> index, K key, Collection<T> values)
    Associates each item of the given collection of value to the given key in the given index.
    protected <K extends Data, T>
    boolean
    addIndexWithSet(Map<K,Set<T>> index, K key, T value)
    Associates the given value to the given key in the given index.
    protected <K extends Data, V>
    void
    clearIndex(Map<K,V> index, K key)
    Remove the map at the given key in the given index.
    protected <K extends Data, X, Y>
    Map<X,Y>
    getIndexWithMap(Map<K,Map<X,Y>> index, K key)
    Returns the map associated to the given key in the given index.
    protected <K extends Data, X, Y>
    Y
    getIndexWithMap(Map<K,Map<X,Y>> index, K key, X name)
    Returns the value associated to the given name for the given key in the given index.
    protected <K extends Data, T>
    Set<T>
    getIndexWithSet(Map<K,Set<T>> index, K key)
    Returns the set associated to the given key in the given index.
    protected <T extends Data>
    T
    Retrieve the orignal Data from the given one (typically if the given data is a clone of an original data)
    protected <K extends Data, T>
    boolean
    isUndefinedIndexWithSet(Map<K,Set<T>> index, K key)
    Returns true is key is null or if no index (even empty) is stored in the given index.
    protected <K extends Data, X, Y>
    void
    putIndexWithMap(Map<K,Map<X,Y>> index, K key, X name, Y value)
    Associates the given value to the given name at the given key in the given index.
    protected <K extends Data, X, Y>
    Y
    removeIndexWithMap(Map<K,Map<X,Y>> index, K key, X name)
    Remove the given name at the given key in the given index.
    protected <K extends Data, T>
    boolean
    removeIndexWithSet(Map<K,Set<T>> index, K key, Collection<T> values)
    Removes the given values for the given key in the given index.
    protected <K extends Data, T>
    boolean
    removeIndexWithSet(Map<K,Set<T>> index, K key, T value)
    Removes the given value for the given key in the given index.
    protected <K extends Data, T>
    void
    setIndexWithSet(Map<K,Set<T>> index, K key, Set<T> set)
    Associates the given set to the given key in the given index.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • channel

      protected Channel channel
  • Constructor Details

    • AbstractIndexManager

      public AbstractIndexManager()
  • Method Details

    • getOriginalData

      protected <T extends Data> T getOriginalData(T data)
      Retrieve the orignal Data from the given one (typically if the given data is a clone of an original data)
      Parameters:
      data - the data (may be a clone of the original)
      Returns:
      the original data.
      Since:
      jcms-6.0.0
    • getIndexWithSet

      protected <K extends Data, T> Set<T> getIndexWithSet(Map<K,Set<T>> index, K key)
      Returns the set associated to the given key in the given index.
      Parameters:
      index - the index
      key - the key
      Returns:
      the set associated to the given key in the given index.
      Since:
      jcms-6.0.0
    • isUndefinedIndexWithSet

      protected <K extends Data, T> boolean isUndefinedIndexWithSet(Map<K,Set<T>> index, K key)
      Returns true is key is null or if no index (even empty) is stored in the given index.
      Parameters:
      index - the index
      key - the key
      Returns:
      true if no index is associated to this key (or key is null).
      Since:
      jcms-6.1.0
    • setIndexWithSet

      protected <K extends Data, T> void setIndexWithSet(Map<K,Set<T>> index, K key, Set<T> set)
      Associates the given set to the given key in the given index.
      Parameters:
      index - the index
      key - the key
      set - the set
      Since:
      jcms-6.0.0
    • addIndexWithSet

      protected <K extends Data, T> boolean addIndexWithSet(Map<K,Set<T>> index, K key, T value)
      Associates the given value to the given key in the given index.
      Parameters:
      index - the index
      key - the key
      value - the value
      Returns:
      true if this set did not already contain the specified value.
      Since:
      jcms-6.0.0
    • addIndexWithSet

      protected <K extends Data, T> boolean addIndexWithSet(Map<K,Set<T>> index, K key, Collection<T> values)
      Associates each item of the given collection of value to the given key in the given index.
      Parameters:
      index - the index
      key - the key
      values - the values
      Returns:
      true if this set changed as a result of the call
      Since:
      jcms-9.0.5 JCMS-5821
    • removeIndexWithSet

      protected <K extends Data, T> boolean removeIndexWithSet(Map<K,Set<T>> index, K key, T value)
      Removes the given value for the given key in the given index.
      Parameters:
      index - the index
      key - the key
      value - the value
      Returns:
      true if this set did not already contain the specified value.
      Since:
      jcms-6.0.0
    • removeIndexWithSet

      protected <K extends Data, T> boolean removeIndexWithSet(Map<K,Set<T>> index, K key, Collection<T> values)
      Removes the given values for the given key in the given index.
      Parameters:
      index - the index
      key - the key
      values - the values to remove
      Returns:
      true if this set changed as a result of the call
      Since:
      jcms-9.0.5 JCMS-5821
    • getIndexWithMap

      protected <K extends Data, X, Y> Map<X,Y> getIndexWithMap(Map<K,Map<X,Y>> index, K key)
      Returns the map associated to the given key in the given index.
      Parameters:
      index - the index
      key - the key
      Returns:
      the map associated to the given key in the given index.
      Since:
      jcms-6.0.0
    • getIndexWithMap

      protected <K extends Data, X, Y> Y getIndexWithMap(Map<K,Map<X,Y>> index, K key, X name)
      Returns the value associated to the given name for the given key in the given index.
      Parameters:
      index - the index
      key - the key
      name - the name
      Returns:
      the value associated to the given name for the given key in the given index.
      Since:
      jcms-6.0.0
    • putIndexWithMap

      protected <K extends Data, X, Y> void putIndexWithMap(Map<K,Map<X,Y>> index, K key, X name, Y value)
      Associates the given value to the given name at the given key in the given index.
      Parameters:
      index - the index
      key - the key
      name - the name
      value - the value
      Since:
      jcms-6.0.0
    • removeIndexWithMap

      protected <K extends Data, X, Y> Y removeIndexWithMap(Map<K,Map<X,Y>> index, K key, X name)
      Remove the given name at the given key in the given index.
      Parameters:
      index - the index
      key - the key
      name - the name
      Returns:
      the removed value
      Since:
      jcms-6.0.0
    • clearIndex

      protected <K extends Data, V> void clearIndex(Map<K,V> index, K key)
      Remove the map at the given key in the given index.
      Parameters:
      index - the index
      key - the key
      Since:
      jcms-6.0.0