public class MemberNoCacheHelper extends MemberCacheHelper
Constructor and Description |
---|
MemberNoCacheHelper() |
Modifier and Type | Method and Description |
---|---|
void |
checkCacheStatus() |
DataSourceChangeListener |
getChangeListener() |
List<RolapMember> |
getChildrenFromCache(RolapMember member,
MemberChildrenConstraint constraint)
Returns the children of
member if they are currently in the
cache, otherwise returns null. |
List<RolapMember> |
getLevelMembersFromCache(RolapLevel level,
TupleConstraint constraint)
Returns the members of
level if they are currently in the
cache, otherwise returns null. |
RolapMember |
getMember(Object key)
Retrieves the
RolapMember with a given key. |
RolapMember |
getMember(Object key,
boolean mustCheckCacheStatus)
Retrieves the
RolapMember with a given key. |
boolean |
isMutable()
Returns whether the cache supports removing selected items.
|
Object |
makeKey(RolapMember parent,
Object key)
Creates a key with which to
getMember(Object) or
putMember(Object, RolapMember) the
RolapMember with a given parent and key. |
void |
putChildren(RolapMember member,
MemberChildrenConstraint constraint,
List<RolapMember> children)
|
void |
putLevelMembersInCache(RolapLevel level,
TupleConstraint constraint,
List<RolapMember> members)
Deprecated in favor of
MemberCacheHelper.putChildren(RolapLevel, TupleConstraint, List) |
Object |
putMember(Object key,
RolapMember value)
Replaces the
RolapMember with a given key and returns the
previous member if any. |
RolapMember |
removeMember(Object key)
Removes the
RolapMember with a given key from the cache. |
RolapMember |
removeMemberAndDescendants(Object key)
Removes the designated
RolapMember and all its descendants. |
void |
setChangeListener(DataSourceChangeListener listener) |
flushCache, putChildren
public RolapMember getMember(Object key, boolean mustCheckCacheStatus)
RolapMember
with a given key.getMember
in class MemberCacheHelper
key
- cache key, created by makeKey(mondrian.rolap.RolapMember, java.lang.Object)
mustCheckCacheStatus
- If true
, do not check cache statuspublic Object putMember(Object key, RolapMember value)
RolapMember
with a given key and returns the
previous member if any.putMember
in class MemberCacheHelper
key
- cache key, created by makeKey(mondrian.rolap.RolapMember, java.lang.Object)
value
- new memberpublic Object makeKey(RolapMember parent, Object key)
getMember(Object)
or
putMember(Object, RolapMember)
the
RolapMember
with a given parent and key.makeKey
in class MemberCacheHelper
parent
- Parent memberkey
- Key of member within parentpublic RolapMember getMember(Object key)
RolapMember
with a given key.getMember
in class MemberCacheHelper
key
- cache key, created by makeKey(mondrian.rolap.RolapMember, java.lang.Object)
public void checkCacheStatus()
checkCacheStatus
in class MemberCacheHelper
public void putLevelMembersInCache(RolapLevel level, TupleConstraint constraint, List<RolapMember> members)
MemberCacheHelper
MemberCacheHelper.putChildren(RolapLevel, TupleConstraint, List)
putLevelMembersInCache
in class MemberCacheHelper
public List<RolapMember> getChildrenFromCache(RolapMember member, MemberChildrenConstraint constraint)
member
if they are currently in the
cache, otherwise returns null.
The children may be garbage collected as soon as the returned list may be garbage collected.
getChildrenFromCache
in class MemberCacheHelper
member
- the parent memberconstraint
- the condition that was used when the members were
fetched. May be null for all members (no constraint)public void putChildren(RolapMember member, MemberChildrenConstraint constraint, List<RolapMember> children)
putChildren
in class MemberCacheHelper
member
- the parent memberconstraint
- the condition that was used when the members were
fetched. May be null for all members (no constraint)children
- list of childrenpublic List<RolapMember> getLevelMembersFromCache(RolapLevel level, TupleConstraint constraint)
level
if they are currently in the
cache, otherwise returns null.
The members may be garbage collected as soon as the returned list may be garbage collected.
getLevelMembersFromCache
in class MemberCacheHelper
level
- the level whose members should be fetchedconstraint
- the condition that was used when the members were
fetched. May be null for all members (no constraint)public DataSourceChangeListener getChangeListener()
getChangeListener
in class MemberCacheHelper
public void setChangeListener(DataSourceChangeListener listener)
setChangeListener
in class MemberCacheHelper
public boolean isMutable()
removeMember(Object)
and
removeMemberAndDescendants(Object)
methods.
REVIEW: remove isMutable and move removeMember and removeMemberAndDescendants to new interface MutableMemberCache
isMutable
in class MemberCacheHelper
public RolapMember removeMember(Object key)
RolapMember
with a given key from the cache.
Returns the previous member with that key, or null.
Optional operation: see isMutable()
.removeMember
in class MemberCacheHelper
key
- cache key, created by makeKey(mondrian.rolap.RolapMember, java.lang.Object)
public RolapMember removeMemberAndDescendants(Object key)
RolapMember
and all its descendants.
Returns the previous member with that key, or null.
Optional operation: see isMutable()
.removeMemberAndDescendants
in class MemberCacheHelper
key
- cache key, created by makeKey(mondrian.rolap.RolapMember, java.lang.Object)
Copyright © 2018 Hitachi Vantara. All rights reserved.