mondrian.rolap
Interface MemberSource
- All Known Subinterfaces:
- MemberReader, RolapCubeHierarchy.RolapCubeHierarchyMemberReader
- All Known Implementing Classes:
- ArrayMemberSource, CacheMemberReader, DelegatingMemberReader, MeasureMemberSource, NoCacheMemberReader, RestrictedMemberReader, RolapCubeHierarchy.CacheRolapCubeHierarchyMemberReader, RolapCubeHierarchy.NoCacheRolapCubeHierarchyMemberReader, RolapCubeHierarchy.RolapCubeSqlMemberSource, SmartMemberReader, SqlMemberSource, SubstitutingMemberReader
public interface MemberSource
A 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
(RolapHierarchy
, Properties
)
and
throws no exceptions. To declare a hierarchy based upon the class, use the
memberReaderClass
attribute of the
<Hierarchy>
element in your XML schema file; the
properties
constructor parameter is populated from any
<Param name="..." value="..."> child elements.
- Since:
- 21 December, 2001
- Author:
- jhyde
- See Also:
MemberReader
,
MemberCache
-
-
getHierarchy
RolapHierarchy getHierarchy()
- Returns the hierarchy that this source is reading for.
setCache
boolean setCache(MemberCache cache)
- Sets the cache which this
MemberSource
will write to.
Cache-writeback is optional (for example, SqlMemberSource
supports it, and ArrayMemberSource
does not), and the return
value from this method indicates whether this object supports it.
If this method returns true
, the getMembers()
,
getRootMembers()
and getMemberChildren(mondrian.rolap.RolapMember, java.util.List)
methods must
write to the cache, in addition to returning members as a return value.
- Parameters:
cache
- The MemberCache
which the caller would like
this MemberSource
to write to.
- Returns:
- Whether this
MemberSource
supports 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:
List
of RolapMember
s
getMemberChildren
void getMemberChildren(RolapMember parentMember,
List<RolapMember> children)
- Writes all children
parentMember
to children
.
If this object supports cache-writeback
, also
writes these members to the cache.
getMemberChildren
void getMemberChildren(List<RolapMember> parentMembers,
List<RolapMember> children)
- Returns all members which are a child of one of the members in
parentMembers
, 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
RolapMember lookupMember(List<Id.Segment> uniqueNameParts,
boolean failIfNotFound)
- Finds a member based upon its unique name.