Package com.jalios.jcms
Class AbstractIndexManager
- java.lang.Object
 - 
- com.jalios.jcms.AbstractIndexManager
 
 
- 
- Direct Known Subclasses:
 AccessControlListIndexManager,CategoryIndexManager,DataIndexManager,GroupIndexManager,PublicationIndexManager
public abstract class AbstractIndexManager extends java.lang.ObjectThis 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 classAbstractIndexManager.DataIndex<D extends Data,C>Collection to store previoulsy computed information associated to Data and DBDatastatic classAbstractIndexManager.DataIndexMap<D extends Data,K,V>Pseudo map to store previoulsy computed information associated to Data and DBDatastatic classAbstractIndexManager.DataIndexSet<D extends Data,E>Pseudo Set to store previoulsy computed information associated to Data and DBData 
- 
Constructor Summary
Constructors Constructor Description AbstractIndexManager() 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <K extends Data,T>
booleanaddIndexWithSet(java.util.Map<K,java.util.Set<T>> index, K key, java.util.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>
booleanaddIndexWithSet(java.util.Map<K,java.util.Set<T>> index, K key, T value)Associates the given value to the given key in the given index.protected <K extends Data,V>
voidclearIndex(java.util.Map<K,V> index, K key)Remove the map at the given key in the given index.protected <K extends Data,X,Y>
java.util.Map<X,Y>getIndexWithMap(java.util.Map<K,java.util.Map<X,Y>> index, K key)Returns the map associated to the given key in the given index.protected <K extends Data,X,Y>
YgetIndexWithMap(java.util.Map<K,java.util.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>
java.util.Set<T>getIndexWithSet(java.util.Map<K,java.util.Set<T>> index, K key)Returns the set associated to the given key in the given index.protected <T extends Data>
TgetOriginalData(T data)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>
booleanisUndefinedIndexWithSet(java.util.Map<K,java.util.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>
voidputIndexWithMap(java.util.Map<K,java.util.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>
YremoveIndexWithMap(java.util.Map<K,java.util.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>
booleanremoveIndexWithSet(java.util.Map<K,java.util.Set<T>> index, K key, java.util.Collection<T> values)Removes the given values for the given key in the given index.protected <K extends Data,T>
booleanremoveIndexWithSet(java.util.Map<K,java.util.Set<T>> index, K key, T value)Removes the given value for the given key in the given index.protected <K extends Data,T>
voidsetIndexWithSet(java.util.Map<K,java.util.Set<T>> index, K key, java.util.Set<T> set)Associates the given set to the given key in the given index. 
 - 
 
- 
- 
Field Detail
- 
channel
protected Channel channel
 
 - 
 
- 
Method Detail
- 
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> java.util.Set<T> getIndexWithSet(java.util.Map<K,java.util.Set<T>> index, K key)
Returns the set associated to the given key in the given index.- Parameters:
 index- the indexkey- 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(java.util.Map<K,java.util.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 indexkey- 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(java.util.Map<K,java.util.Set<T>> index, K key, java.util.Set<T> set)
Associates the given set to the given key in the given index.- Parameters:
 index- the indexkey- the keyset- the set- Since:
 - jcms-6.0.0
 
 
- 
addIndexWithSet
protected <K extends Data,T> boolean addIndexWithSet(java.util.Map<K,java.util.Set<T>> index, K key, T value)
Associates the given value to the given key in the given index.- Parameters:
 index- the indexkey- the keyvalue- 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(java.util.Map<K,java.util.Set<T>> index, K key, java.util.Collection<T> values)
Associates each item of the given collection of value to the given key in the given index.- Parameters:
 index- the indexkey- the keyvalues- the values- Returns:
 trueif this set changed as a result of the call- Since:
 - jcms-9.0.5 JCMS-5821
 
 
- 
removeIndexWithSet
protected <K extends Data,T> boolean removeIndexWithSet(java.util.Map<K,java.util.Set<T>> index, K key, T value)
Removes the given value for the given key in the given index.- Parameters:
 index- the indexkey- the keyvalue- 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(java.util.Map<K,java.util.Set<T>> index, K key, java.util.Collection<T> values)
Removes the given values for the given key in the given index.- Parameters:
 index- the indexkey- the keyvalues- the values to remove- Returns:
 trueif this set changed as a result of the call- Since:
 - jcms-9.0.5 JCMS-5821
 
 
- 
getIndexWithMap
protected <K extends Data,X,Y> java.util.Map<X,Y> getIndexWithMap(java.util.Map<K,java.util.Map<X,Y>> index, K key)
Returns the map associated to the given key in the given index.- Parameters:
 index- the indexkey- 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(java.util.Map<K,java.util.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 indexkey- the keyname- 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(java.util.Map<K,java.util.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 indexkey- the keyname- the namevalue- the value- Since:
 - jcms-6.0.0
 
 
- 
removeIndexWithMap
protected <K extends Data,X,Y> Y removeIndexWithMap(java.util.Map<K,java.util.Map<X,Y>> index, K key, X name)
Remove the given name at the given key in the given index.- Parameters:
 index- the indexkey- the keyname- the name- Returns:
 - the removed value
 - Since:
 - jcms-6.0.0
 
 
- 
clearIndex
protected <K extends Data,V> void clearIndex(java.util.Map<K,V> index, K key)
Remove the map at the given key in the given index.- Parameters:
 index- the indexkey- the key- Since:
 - jcms-6.0.0
 
 
 - 
 
 -