de.topicmapslab.majortom.index.core
Class BaseCachedScopeIndexImpl<T extends de.topicmapslab.majortom.model.store.ITopicMapStore>

java.lang.Object
  extended by de.topicmapslab.majortom.index.IndexImpl<T>
      extended by de.topicmapslab.majortom.index.core.BaseCachedIndexImpl<T>
          extended by de.topicmapslab.majortom.index.core.BaseCachedScopeIndexImpl<T>
All Implemented Interfaces:
de.topicmapslab.majortom.model.event.ITopicMapListener, org.tmapi.index.Index
Direct Known Subclasses:
CachedScopeIndexImpl, PagedScopeIndexImpl

public abstract class BaseCachedScopeIndexImpl<T extends de.topicmapslab.majortom.model.store.ITopicMapStore>
extends BaseCachedIndexImpl<T>
implements de.topicmapslab.majortom.model.event.ITopicMapListener

Implementation of IPagedScopedIndex

Author:
Sven Krosse

Field Summary
private  java.util.Map<ScopesCacheKey,java.util.Collection<? extends org.tmapi.core.Construct>> cachedConstructs
          Cache containing all constructs
private  java.util.Map<ScopesCacheKey,java.util.Collection<de.topicmapslab.majortom.model.core.IScope>> cachedScopes
          Cache containing the scopes of specific constructs
private  java.util.Map<ScopesCacheKey,java.util.Collection<org.tmapi.core.Topic>> cachedThemes
          Cache containing the themes of specific constructs
private  java.util.Map<java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable>,java.util.Set<ScopesCacheKey>> cacheKeys
          Caching map for all cache keys depends on the given class
private  java.util.Map<ScopesCacheKey,java.lang.Long> cacheNumberOfConstructs
          Cache containing the number of matching constructs
private  java.util.Map<java.util.Collection<? extends org.tmapi.core.Topic>,de.topicmapslab.majortom.model.core.IScope> scopesByThemes
          Cache containing the scope of a set of themes
 
Constructor Summary
BaseCachedScopeIndexImpl(T store)
          constructor
 
Method Summary
protected
<X extends org.tmapi.core.Construct>
void
cache(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz, java.lang.Object filter, boolean multiMatch, java.util.Collection<X> values)
          Internal method to add the constructs valid in the given theme of the specified construct type to internal cache
protected
<X extends org.tmapi.core.Construct>
void
cache(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz, java.lang.Object filter, boolean multiMatch, java.lang.Integer offset, java.lang.Integer limit, java.util.Comparator<X> comparator, java.util.Collection<X> values)
          Internal method to add the constructs valid in the given theme of the specified construct type to internal cache
protected  void cacheNumberOfConstructs(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz, java.lang.Object filter, java.lang.Boolean matchall, long number)
          Store the number of constructs into cache
protected  void cacheScope(java.util.Collection<? extends org.tmapi.core.Topic> themes, de.topicmapslab.majortom.model.core.IScope scope)
          Internal method to add the scopes of the specified construct type to internal cache.
protected  void cacheScopes(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz, java.util.Collection<de.topicmapslab.majortom.model.core.IScope> values)
          Internal method to add the scopes of the specified construct type to internal cache.
protected  void cacheScopes(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz, java.lang.Integer offset, java.lang.Integer limit, java.util.Comparator<de.topicmapslab.majortom.model.core.IScope> comparator, java.util.Collection<de.topicmapslab.majortom.model.core.IScope> values)
          Internal method to add the scopes of the specified construct type to internal cache.
protected  void cacheScopes(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz, java.lang.Object filter, boolean multiMatch, java.util.Collection<de.topicmapslab.majortom.model.core.IScope> values)
          Internal method to add the scopes of the specified construct type to internal cache.
protected  void cacheScopes(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz, java.lang.Object filter, boolean multiMatch, java.lang.Integer offset, java.lang.Integer limit, java.util.Comparator<de.topicmapslab.majortom.model.core.IScope> comparator, java.util.Collection<de.topicmapslab.majortom.model.core.IScope> values)
          Internal method to add the scopes of the specified construct type to internal cache.
protected  void cacheThemes(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz, java.util.Collection<org.tmapi.core.Topic> values)
          Internal method to add the themes of the specified construct type to internal cache.
protected  void cacheThemes(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz, java.lang.Integer offset, java.lang.Integer limit, java.util.Comparator<org.tmapi.core.Topic> comparator, java.util.Collection<org.tmapi.core.Topic> values)
          Internal method to add the themes of the specified construct type to internal cache.
 void clear()
          Removed any cached content from internal cache
protected  void clearCache()
          Clear all caches
private  void clearDependentCache(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable>... classes)
          Clear all caches depending on given classes
 void close()
          
protected  ScopesCacheKey generateScopesCacheKey(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz)
          Generate a cache key for internal cache
protected  ScopesCacheKey generateScopesCacheKey(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz, java.lang.Integer offset, java.lang.Integer limit)
          Generate a cache key for internal cache
protected  ScopesCacheKey generateScopesCacheKey(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz, java.lang.Integer offset, java.lang.Integer limit, java.util.Comparator<?> comparator)
          Generate a cache key for internal cache
protected  ScopesCacheKey generateScopesCacheKey(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz, java.lang.Object filter, boolean multiMatch)
          Generate a cache key for internal cache
protected  ScopesCacheKey generateScopesCacheKey(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz, java.lang.Object filter, boolean multiMatch, java.lang.Integer offset, java.lang.Integer limit)
          Generate a cache key for internal cache
protected  ScopesCacheKey generateScopesCacheKey(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz, java.lang.Object filter, boolean multiMatch, java.lang.Integer offset, java.lang.Integer limit, java.util.Comparator<?> comparator)
          Generate a cache key for internal cache
private  java.util.Set<ScopesCacheKey> getDependentKeys(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz)
          Returns a set containing all dependent cache keys for the given class
 void open()
          
protected
<X extends org.tmapi.core.Construct>
java.util.Collection<X>
read(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz, java.lang.Object filter, boolean multiMatch)
          Internal method to read the constructs valid in the given theme of the specified construct type from the internal cache.
protected
<X extends org.tmapi.core.Construct>
java.util.Collection<X>
read(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz, java.lang.Object filter, boolean multiMatch, java.lang.Integer offset, java.lang.Integer limit, java.util.Comparator<X> comparator)
          Internal method to read the constructs valid in the given theme of the specified construct type from the internal cache.
protected  long readNumberOfConstructs(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz, java.lang.Object filter, java.lang.Boolean matchall)
          Returns the number of constructs from cache
protected  de.topicmapslab.majortom.model.core.IScope readScope(java.util.Collection<? extends org.tmapi.core.Topic> themes)
          Internal method to read the scopes of the specified construct type from the internal cache.
protected  java.util.Collection<de.topicmapslab.majortom.model.core.IScope> readScopes(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz)
          Internal method to read the scopes of the specified construct type from the internal cache.
protected  java.util.Collection<de.topicmapslab.majortom.model.core.IScope> readScopes(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz, java.lang.Integer offset, java.lang.Integer limit, java.util.Comparator<de.topicmapslab.majortom.model.core.IScope> comparator)
          Internal method to read the scopes of the specified construct type from the internal cache.
protected  java.util.Collection<de.topicmapslab.majortom.model.core.IScope> readScopes(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz, java.lang.Object filter, boolean multiMatch)
          Internal method to read the scopes of the specified construct type from the internal cache.
protected  java.util.Collection<de.topicmapslab.majortom.model.core.IScope> readScopes(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz, java.lang.Object filter, boolean multiMatch, java.lang.Integer offset, java.lang.Integer limit, java.util.Comparator<de.topicmapslab.majortom.model.core.IScope> comparator)
          Internal method to read the scopes of the specified construct type from the internal cache.
protected  java.util.Collection<org.tmapi.core.Topic> readThemes(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz)
          Internal method to read the themes of the specified construct type from the internal cache.
protected  java.util.Collection<org.tmapi.core.Topic> readThemes(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz, java.lang.Integer offset, java.lang.Integer limit, java.util.Comparator<org.tmapi.core.Topic> comparator)
          Internal method to read the themes of the specified construct type from the internal cache.
 void topicMapChanged(java.lang.String id, de.topicmapslab.majortom.model.event.TopicMapEventType event, org.tmapi.core.Construct notifier, java.lang.Object newValue, java.lang.Object oldValue)
          
 
Methods inherited from class de.topicmapslab.majortom.index.core.BaseCachedIndexImpl
isCachingEnabled, isOnTransactionContext, isOnTransactionContext, isOnTransactionContext, isOnTransactionContext, isOnTransactionContext
 
Methods inherited from class de.topicmapslab.majortom.index.IndexImpl
getTopicMapStore, isAutoUpdated, isOpen, reindex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cachedScopes

private java.util.Map<ScopesCacheKey,java.util.Collection<de.topicmapslab.majortom.model.core.IScope>> cachedScopes
Cache containing the scopes of specific constructs


scopesByThemes

private java.util.Map<java.util.Collection<? extends org.tmapi.core.Topic>,de.topicmapslab.majortom.model.core.IScope> scopesByThemes
Cache containing the scope of a set of themes


cachedThemes

private java.util.Map<ScopesCacheKey,java.util.Collection<org.tmapi.core.Topic>> cachedThemes
Cache containing the themes of specific constructs


cacheNumberOfConstructs

private java.util.Map<ScopesCacheKey,java.lang.Long> cacheNumberOfConstructs
Cache containing the number of matching constructs


cachedConstructs

private java.util.Map<ScopesCacheKey,java.util.Collection<? extends org.tmapi.core.Construct>> cachedConstructs
Cache containing all constructs


cacheKeys

private java.util.Map<java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable>,java.util.Set<ScopesCacheKey>> cacheKeys
Caching map for all cache keys depends on the given class

Constructor Detail

BaseCachedScopeIndexImpl

public BaseCachedScopeIndexImpl(T store)
constructor

Parameters:
store - the store
Method Detail

topicMapChanged

public void topicMapChanged(java.lang.String id,
                            de.topicmapslab.majortom.model.event.TopicMapEventType event,
                            org.tmapi.core.Construct notifier,
                            java.lang.Object newValue,
                            java.lang.Object oldValue)

Specified by:
topicMapChanged in interface de.topicmapslab.majortom.model.event.ITopicMapListener

clearCache

protected final void clearCache()
Clear all caches

Specified by:
clearCache in class BaseCachedIndexImpl<T extends de.topicmapslab.majortom.model.store.ITopicMapStore>

clearDependentCache

private final void clearDependentCache(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable>... classes)
Clear all caches depending on given classes

Parameters:
classes - the classes the cache depends on

readScope

protected final de.topicmapslab.majortom.model.core.IScope readScope(java.util.Collection<? extends org.tmapi.core.Topic> themes)
Internal method to read the scopes of the specified construct type from the internal cache.

Parameters:
themes - the themes
Returns:
the scope or null if the key is unknown

cacheScope

protected final void cacheScope(java.util.Collection<? extends org.tmapi.core.Topic> themes,
                                de.topicmapslab.majortom.model.core.IScope scope)
Internal method to add the scopes of the specified construct type to internal cache.

Parameters:
themes - the themes
scope - the scope to store

cacheScopes

protected final void cacheScopes(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz,
                                 java.lang.Object filter,
                                 boolean multiMatch,
                                 java.util.Collection<de.topicmapslab.majortom.model.core.IScope> values)
Internal method to add the scopes of the specified construct type to internal cache.

Parameters:
clazz - the type of construct
values - the values to store

cacheScopes

protected final void cacheScopes(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz,
                                 java.util.Collection<de.topicmapslab.majortom.model.core.IScope> values)
Internal method to add the scopes of the specified construct type to internal cache.

Parameters:
clazz - the type of construct
values - the values to store

cacheScopes

protected final void cacheScopes(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz,
                                 java.lang.Integer offset,
                                 java.lang.Integer limit,
                                 java.util.Comparator<de.topicmapslab.majortom.model.core.IScope> comparator,
                                 java.util.Collection<de.topicmapslab.majortom.model.core.IScope> values)
Internal method to add the scopes of the specified construct type to internal cache.

Parameters:
clazz - the type of construct
offset - the offset or null
limit - the limit or null
comparator - the comparator or null
values - the values to store

cacheScopes

protected final void cacheScopes(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz,
                                 java.lang.Object filter,
                                 boolean multiMatch,
                                 java.lang.Integer offset,
                                 java.lang.Integer limit,
                                 java.util.Comparator<de.topicmapslab.majortom.model.core.IScope> comparator,
                                 java.util.Collection<de.topicmapslab.majortom.model.core.IScope> values)
Internal method to add the scopes of the specified construct type to internal cache.

Parameters:
clazz - the type of construct
filter - a filter criteria (a theme, a collection, a scope )
multiMatch - flag indicates if the filter is a collection of themes if themes should matching all
offset - the offset or null
limit - the limit or null
comparator - the comparator or null
values - the values to store

readScopes

protected final java.util.Collection<de.topicmapslab.majortom.model.core.IScope> readScopes(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz,
                                                                                            java.lang.Object filter,
                                                                                            boolean multiMatch)
Internal method to read the scopes of the specified construct type from the internal cache.

Parameters:
clazz - the type of construct
filter - a filter criteria (a theme, a collection, a scope )
multiMatch - flag indicates if the filter is a collection of themes if themes should matching all
Returns:
the scopes or null if the key is unknown

readScopes

protected final java.util.Collection<de.topicmapslab.majortom.model.core.IScope> readScopes(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz)
Internal method to read the scopes of the specified construct type from the internal cache.

Parameters:
clazz - the type of construct
Returns:
the scopes or null if the key is unknown

readScopes

protected final java.util.Collection<de.topicmapslab.majortom.model.core.IScope> readScopes(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz,
                                                                                            java.lang.Integer offset,
                                                                                            java.lang.Integer limit,
                                                                                            java.util.Comparator<de.topicmapslab.majortom.model.core.IScope> comparator)
Internal method to read the scopes of the specified construct type from the internal cache.

Parameters:
clazz - the type of construct
offset - the offset or null
limit - the limit or null
comparator - the comparator or null
Returns:
the scopes or null if the key is unknown

readScopes

protected final java.util.Collection<de.topicmapslab.majortom.model.core.IScope> readScopes(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz,
                                                                                            java.lang.Object filter,
                                                                                            boolean multiMatch,
                                                                                            java.lang.Integer offset,
                                                                                            java.lang.Integer limit,
                                                                                            java.util.Comparator<de.topicmapslab.majortom.model.core.IScope> comparator)
Internal method to read the scopes of the specified construct type from the internal cache.

Parameters:
clazz - the type of construct
filter - a filter criteria (a theme, a collection, a scope )
multiMatch - flag indicates if the filter is a collection of themes if themes should matching all
offset - the offset or null
limit - the limit or null
comparator - the comparator or null
Returns:
the scopes or null if the key is unknown

readThemes

protected final java.util.Collection<org.tmapi.core.Topic> readThemes(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz)
Internal method to read the themes of the specified construct type from the internal cache.

Parameters:
clazz - the type of construct
Returns:
the themes or null if the key is unknown

readThemes

protected final java.util.Collection<org.tmapi.core.Topic> readThemes(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz,
                                                                      java.lang.Integer offset,
                                                                      java.lang.Integer limit,
                                                                      java.util.Comparator<org.tmapi.core.Topic> comparator)
Internal method to read the themes of the specified construct type from the internal cache.

Parameters:
clazz - the type of construct
offset - the offset or null
limit - the limit or null
comparator - the comparator or null
Returns:
the themes or null if the key is unknown

cacheThemes

protected final void cacheThemes(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz,
                                 java.util.Collection<org.tmapi.core.Topic> values)
Internal method to add the themes of the specified construct type to internal cache.

Parameters:
clazz - the type of construct
valus - the values to store

cacheThemes

protected final void cacheThemes(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz,
                                 java.lang.Integer offset,
                                 java.lang.Integer limit,
                                 java.util.Comparator<org.tmapi.core.Topic> comparator,
                                 java.util.Collection<org.tmapi.core.Topic> values)
Internal method to add the themes of the specified construct type to internal cache.

Parameters:
clazz - the type of construct
offset - the offset or null
limit - the limit or null
comparator - the comparator or null
valus - the values to store

read

protected final <X extends org.tmapi.core.Construct> java.util.Collection<X> read(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz,
                                                                                  java.lang.Object filter,
                                                                                  boolean multiMatch)
Internal method to read the constructs valid in the given theme of the specified construct type from the internal cache.

Parameters:
clazz - the type of construct
filter - a filter criteria (a theme, a collection, a scope )
multiMatch - flag indicates if the filter is a collection of themes if themes should matching all
Returns:
the constructs or null if the key is unknown

read

protected final <X extends org.tmapi.core.Construct> java.util.Collection<X> read(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz,
                                                                                  java.lang.Object filter,
                                                                                  boolean multiMatch,
                                                                                  java.lang.Integer offset,
                                                                                  java.lang.Integer limit,
                                                                                  java.util.Comparator<X> comparator)
Internal method to read the constructs valid in the given theme of the specified construct type from the internal cache.

Parameters:
clazz - the type of construct
filter - a filter criteria (a theme, a collection, a scope )
multiMatch - flag indicates if the filter is a collection of themes if themes should matching all
offset - the offset or null
limit - the limit or null
comparator - the comparator or null
Returns:
the constructs or null if the key is unknown

cache

protected final <X extends org.tmapi.core.Construct> void cache(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz,
                                                                java.lang.Object filter,
                                                                boolean multiMatch,
                                                                java.util.Collection<X> values)
Internal method to add the constructs valid in the given theme of the specified construct type to internal cache

Parameters:
clazz - the type of construct
filter - a filter criteria (a theme, a collection, a scope )
multiMatch - flag indicates if the filter is a collection of themes if themes should matching all
valus - the values to store

cache

protected final <X extends org.tmapi.core.Construct> void cache(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz,
                                                                java.lang.Object filter,
                                                                boolean multiMatch,
                                                                java.lang.Integer offset,
                                                                java.lang.Integer limit,
                                                                java.util.Comparator<X> comparator,
                                                                java.util.Collection<X> values)
Internal method to add the constructs valid in the given theme of the specified construct type to internal cache

Parameters:
clazz - the type of construct
filter - a filter criteria (a theme, a collection, a scope )
multiMatch - flag indicates if the filter is a collection of themes if themes should matching all
offset - the offset or null
limit - the limit or null
comparator - the comparator or null
valus - the values to store

readNumberOfConstructs

protected final long readNumberOfConstructs(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz,
                                            java.lang.Object filter,
                                            java.lang.Boolean matchall)
Returns the number of constructs from cache

Parameters:
clazz - the class
filter - the filter
matchall - flag indicates if the filter is a collection of themes if themes should matching all
Returns:
the number or -1

cacheNumberOfConstructs

protected final void cacheNumberOfConstructs(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz,
                                             java.lang.Object filter,
                                             java.lang.Boolean matchall,
                                             long number)
Store the number of constructs into cache

Parameters:
clazz - the class
filter - the filter
matchall - flag indicates if the filter is a collection of themes if themes should matching all
number - the number

generateScopesCacheKey

protected ScopesCacheKey generateScopesCacheKey(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz)
Generate a cache key for internal cache

Parameters:
clazz - the type of construct
Returns:
the generated key

generateScopesCacheKey

protected ScopesCacheKey generateScopesCacheKey(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz,
                                                java.lang.Integer offset,
                                                java.lang.Integer limit)
Generate a cache key for internal cache

Parameters:
clazz - the type of construct
offset - the offset or null
limit - the limit or null
Returns:
the generated key

generateScopesCacheKey

protected ScopesCacheKey generateScopesCacheKey(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz,
                                                java.lang.Integer offset,
                                                java.lang.Integer limit,
                                                java.util.Comparator<?> comparator)
Generate a cache key for internal cache

Parameters:
clazz - the type of construct
offset - the offset or null
limit - the limit or null
comparator - the comparator or null
Returns:
the generated key

generateScopesCacheKey

protected ScopesCacheKey generateScopesCacheKey(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz,
                                                java.lang.Object filter,
                                                boolean multiMatch)
Generate a cache key for internal cache

Parameters:
clazz - the type of construct
filter - a filter criteria (a theme, a collection, a scope )
multiMatch - flag indicates if the filter is a collection of themes if themes should matching all
Returns:
the generated key

generateScopesCacheKey

protected ScopesCacheKey generateScopesCacheKey(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz,
                                                java.lang.Object filter,
                                                boolean multiMatch,
                                                java.lang.Integer offset,
                                                java.lang.Integer limit)
Generate a cache key for internal cache

Parameters:
clazz - the type of construct
filter - a filter criteria (a theme, a collection, a scope )
multiMatch - flag indicates if the filter is a collection of themes if themes should matching all
offset - the offset or null
limit - the limit or null
Returns:
the generated key

generateScopesCacheKey

protected ScopesCacheKey generateScopesCacheKey(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz,
                                                java.lang.Object filter,
                                                boolean multiMatch,
                                                java.lang.Integer offset,
                                                java.lang.Integer limit,
                                                java.util.Comparator<?> comparator)
Generate a cache key for internal cache

Parameters:
clazz - the type of construct
filter - a filter criteria (a theme, a collection, a scope )
multiMatch - flag indicates if the filter is a collection of themes if themes should matching all
offset - the offset or null
limit - the limit or null
comparator - the comparator or null
Returns:
the generated key

getDependentKeys

private java.util.Set<ScopesCacheKey> getDependentKeys(java.lang.Class<? extends de.topicmapslab.majortom.model.core.IScopable> clazz)
Returns a set containing all dependent cache keys for the given class

Parameters:
clazz - the class
Returns:
a set of depending cache keys

open

public void open()

Specified by:
open in interface org.tmapi.index.Index
Overrides:
open in class BaseCachedIndexImpl<T extends de.topicmapslab.majortom.model.store.ITopicMapStore>

close

public void close()

Specified by:
close in interface org.tmapi.index.Index
Overrides:
close in class BaseCachedIndexImpl<T extends de.topicmapslab.majortom.model.store.ITopicMapStore>

clear

public void clear()
Removed any cached content from internal cache

Overrides:
clear in class BaseCachedIndexImpl<T extends de.topicmapslab.majortom.model.store.ITopicMapStore>