Interface MemberSource
- All Known Subinterfaces:
mondrian.rolap.MemberReader,RolapCubeHierarchy.RolapCubeHierarchyMemberReader
- All Known Implementing Classes:
NoCacheMemberReader,RolapCubeHierarchy.CacheRolapCubeHierarchyMemberReader,RolapCubeHierarchy.NoCacheRolapCubeHierarchyMemberReader,RolapCubeHierarchy.RolapCubeSqlMemberSource,SmartMemberReader,SubstitutingMemberReader
MemberSource has the basic operations to read the members of a
hierarchy.
A MemberSource may optionally support writeback to a
MemberCache. During the initialization of a
MemberSource, the consumer calls setCache(mondrian.rolap.MemberCache); the return
value indicates whether the MemberSource supports
cache-writeback.
A custom member reader is a user-defined class which implements
the operations to retrieve members. It either implements the
MemberSource interface, or the derived interface
MemberReader, which has more operations. In addition to the interface
methods, the class must have a constructor which takes parameters
( and
throws no exceptions. To declare a hierarchy based upon the class, use the
RolapHierarchy, Properties)memberReaderClass attribute of the
<Hierarchy> element in your XML schema file; the
properties constructor parameter is populated from any
- Since:
- 21 December, 2001
- Author:
- jhyde
- See Also:
-
MemberReaderMemberCache
-
Method Summary
Modifier and TypeMethodDescriptionReturns the hierarchy that this source is reading for.voidgetMemberChildren(List<RolapMember> parentMembers, List<RolapMember> children) Returns all members which are a child of one of the members inparentMembers, sorted by ordinal.voidgetMemberChildren(RolapMember parentMember, List<RolapMember> children) Writes all childrenparentMembertochildren.intReturns an estimate of number of members in this hierarchy.Returns all members of this hierarchy, sorted by ordinal.Returns all members of this hierarchy which do not have a parent, sorted by ordinal.lookupMember(List<Id.Segment> uniqueNameParts, boolean failIfNotFound) Finds a member based upon its unique name.booleansetCache(mondrian.rolap.MemberCache cache) Sets the cache which thisMemberSourcewill write to.
-
Method Details
-
getHierarchy
RolapHierarchy getHierarchy()Returns the hierarchy that this source is reading for. -
setCache
boolean setCache(mondrian.rolap.MemberCache cache) Sets the cache which thisMemberSourcewill write to.Cache-writeback is optional (for example,
SqlMemberSourcesupports it, andArrayMemberSourcedoes not), and the return value from this method indicates whether this object supports it.If this method returns
true, thegetMembers(),getRootMembers()andgetMemberChildren(mondrian.rolap.RolapMember, java.util.List<mondrian.rolap.RolapMember>)methods must write to the cache, in addition to returning members as a return value.- Parameters:
cache- TheMemberCachewhich the caller would like thisMemberSourceto write to.- Returns:
- Whether this
MemberSourcesupports cache-writeback.
-
getMembers
List<RolapMember> getMembers()Returns all members of this hierarchy, sorted by ordinal.If this object
supports cache-writeaback, also writes these members to the cache. -
getRootMembers
List<RolapMember> getRootMembers()Returns all members of this hierarchy which do not have a parent, sorted by ordinal.If this object
supports cache-writeback, also writes these members to the cache.- Returns:
ListofRolapMembers
-
getMemberChildren
Writes all childrenparentMembertochildren.If this object
supports cache-writeback, also writes these members to the cache. -
getMemberChildren
Returns all members which are a child of one of the members inparentMembers, sorted by ordinal.If this object
supports cache-writeaback, also writes these members to the cache. -
getMemberCount
int getMemberCount()Returns an estimate of number of members in this hierarchy. -
lookupMember
Finds a member based upon its unique name.
-