public abstract class DelegatingSchemaReader extends Object implements SchemaReader
DelegatingSchemaReader
implements SchemaReader
by
delegating all methods to an underlying SchemaReader
.
It is a convenient base class if you want to override just a few of
SchemaReader
's methods.
Modifier and Type | Field and Description |
---|---|
protected SchemaReader |
schemaReader |
Modifier | Constructor and Description |
---|---|
protected |
DelegatingSchemaReader(SchemaReader schemaReader)
Creates a DelegatingSchemaReader.
|
Modifier and Type | Method and Description |
---|---|
int |
compareMembersHierarchically(Member m1,
Member m2)
Compares a pair of
Member s according to their order in a prefix
traversal. |
Member |
getCalculatedMember(List<Id.Segment> nameParts)
Looks up a calculated member by name.
|
List<Member> |
getCalculatedMembers()
Returns the list of calculated members.
|
List<Member> |
getCalculatedMembers(Hierarchy hierarchy)
Returns a list of calculated members in a given hierarchy.
|
List<Member> |
getCalculatedMembers(Level level)
Returns a list of calculated members in a given level.
|
int |
getChildrenCountFromCache(Member member)
Returns number of children parent of a member,
if the information can be retrieved from cache, otherwise -1.
|
Cube |
getCube()
Returns the default cube in which to look for dimensions etc.
|
List<Dimension> |
getCubeDimensions(Cube cube)
Returns the accessible dimensions of a cube.
|
Cube[] |
getCubes()
Returns the list of accessible cubes.
|
DataSource |
getDataSource()
Returns the data source.
|
List<Hierarchy> |
getDimensionHierarchies(Dimension dimension)
Returns the accessible hierarchies of a dimension.
|
OlapElement |
getElementChild(OlapElement parent,
Id.Segment name)
Looks up the child of
parent name , returning
null if no element is found. |
OlapElement |
getElementChild(OlapElement parent,
Id.Segment name,
MatchType matchType)
Looks up the child of
parent called name , or
an approximation according to matchType , returning
null if no element is found. |
Member |
getHierarchyDefaultMember(Hierarchy hierarchy)
Returns the default member of a hierarchy.
|
List<Level> |
getHierarchyLevels(Hierarchy hierarchy)
Returns the accessible levels of a hierarchy.
|
List<Member> |
getHierarchyRootMembers(Hierarchy hierarchy)
Returns an array of the root members of
hierarchy . |
Member |
getLeadMember(Member member,
int n)
Returns a member
n further along in the same level from
member . |
int |
getLevelCardinality(Level level,
boolean approximate,
boolean materialize)
Returns the number of members in a level, returning an approximation if
acceptable.
|
List<Member> |
getLevelMembers(Level level,
boolean includeCalculated)
Returns the members of a level, optionally including calculated members.
|
List<Member> |
getLevelMembers(Level level,
Evaluator context)
Returns the members of a level, optionally filtering out members which
are empty.
|
void |
getMemberAncestors(Member member,
List<Member> ancestorList)
Returns a list of ancestors of
member , in depth order. |
Member |
getMemberByUniqueName(List<Id.Segment> uniqueNameParts,
boolean failIfNotFound)
Finds a member based upon its unique name, requiring an exact match.
|
Member |
getMemberByUniqueName(List<Id.Segment> uniqueNameParts,
boolean failIfNotFound,
MatchType matchType)
Finds a member based upon its unique name.
|
List<Member> |
getMemberChildren(List<Member> members)
Returns direct children of each element of
members . |
List<Member> |
getMemberChildren(List<Member> members,
Evaluator context)
Returns direct children of each element of
members
which is not empty in context . |
List<Member> |
getMemberChildren(Member member)
Returns direct children of
member . |
List<Member> |
getMemberChildren(Member member,
Evaluator context)
Returns direct children of
member , optimized
for NON EMPTY. |
Map<? extends Member,Access> |
getMemberChildrenWithDetails(Member member,
Evaluator evaluator)
Similar to
SchemaReader.getMemberChildren(Member, Evaluator)
but returns a map of the grand-children and their access details
and costs more to invoke because of the access controls. |
int |
getMemberDepth(Member member)
Returns the depth of a member.
|
Member |
getMemberParent(Member member)
Returns the parent of
member . |
void |
getMemberRange(Level level,
Member startMember,
Member endMember,
List<Member> list)
Appends to
list all members between startMember
and endMember (inclusive) which belong to
level . |
NamedSet |
getNamedSet(List<Id.Segment> nameParts)
Looks up a set by name.
|
List<NameResolver.Namespace> |
getNamespaces()
Returns a list of namespaces to search when resolving elements by name.
|
NativeEvaluator |
getNativeSetEvaluator(FunDef fun,
Exp[] args,
Evaluator evaluator,
Calc calc)
Returns an object which can evaluate an expression in native SQL, or
null if this is not possible.
|
Parameter |
getParameter(String name)
Returns the definition of a parameter with a given name, or null if not
found.
|
void |
getParentChildContributingChildren(Member dataMember,
Hierarchy hierarchy,
List<Member> list)
Returns a list of contributing children of a member of a parent-child
hierarchy.
|
Role |
getRole()
Returns the access-control profile that this
SchemaReader
is implementing. |
RolapSchema |
getSchema()
Returns the schema.
|
boolean |
isDrillable(Member member)
Returns whether a member has visible children.
|
boolean |
isVisible(Member member)
Returns whether a member is visible.
|
OlapElement |
lookupCompound(OlapElement parent,
List<Id.Segment> names,
boolean failIfNotFound,
int category)
Looks up an MDX object by name.
|
OlapElement |
lookupCompound(OlapElement parent,
List<Id.Segment> names,
boolean failIfNotFound,
int category,
MatchType matchType)
Looks up an MDX object by name, specifying how to
match if no object exactly matches the name.
|
OlapElement |
lookupCompoundInternal(OlapElement parent,
List<Id.Segment> names,
boolean failIfNotFound,
int category,
MatchType matchType) |
Member |
lookupMemberChildByName(Member member,
Id.Segment memberName,
MatchType matchType)
Finds a child of a member with a given name.
|
List<Member> |
lookupMemberChildrenByNames(Member parent,
List<Id.NameSegment> childNames,
MatchType matchType)
Finds a list of child members with the given names.
|
Member |
substitute(Member member)
Substitutes a member with an equivalent member which enforces the
access control policy of this SchemaReader.
|
SchemaReader |
withLocus()
Returns a schema reader that automatically assigns a locus to each
operation.
|
SchemaReader |
withoutAccessControl()
Returns a similar schema reader that has no access control.
|
protected final SchemaReader schemaReader
protected DelegatingSchemaReader(SchemaReader schemaReader)
schemaReader
- Parent reader to delegate unhandled calls topublic RolapSchema getSchema()
SchemaReader
getSchema
in interface SchemaReader
public Role getRole()
SchemaReader
SchemaReader
is implementing.getRole
in interface SchemaReader
public Cube getCube()
SchemaReader
getCube
in interface SchemaReader
public List<Dimension> getCubeDimensions(Cube cube)
SchemaReader
getCubeDimensions
in interface SchemaReader
public List<Hierarchy> getDimensionHierarchies(Dimension dimension)
SchemaReader
getDimensionHierarchies
in interface SchemaReader
public List<Member> getHierarchyRootMembers(Hierarchy hierarchy)
SchemaReader
hierarchy
.getHierarchyRootMembers
in interface SchemaReader
hierarchy
- HierarchySchemaReader.getCalculatedMembers(Hierarchy)
public Member getMemberParent(Member member)
SchemaReader
member
.getMemberParent
in interface SchemaReader
member
- Memberpublic Member substitute(Member member)
SchemaReader
substitute
in interface SchemaReader
public List<Member> getMemberChildren(Member member)
SchemaReader
member
.getMemberChildren
in interface SchemaReader
public List<Member> getMemberChildren(List<Member> members)
SchemaReader
members
.getMemberChildren
in interface SchemaReader
members
- Array of memberspublic void getParentChildContributingChildren(Member dataMember, Hierarchy hierarchy, List<Member> list)
SchemaReader
getParentChildContributingChildren
in interface SchemaReader
dataMember
- Data member for a member of the parent-child hierarcyhierarchy
- Hierarchylist
- List of members to populatepublic int getMemberDepth(Member member)
SchemaReader
This may not be the same as
member.
for three reasons:getLevel
().
getDepth
()
getMemberDepth
in interface SchemaReader
public final Member getMemberByUniqueName(List<Id.Segment> uniqueNameParts, boolean failIfNotFound)
SchemaReader
This method is equivalent to calling
SchemaReader.getMemberByUniqueName(java.util.List, boolean, MatchType)
with MatchType.EXACT
.
getMemberByUniqueName
in interface SchemaReader
uniqueNameParts
- Unique name of memberfailIfNotFound
- Whether to throw an error, as opposed to returning
null
, if there is no such member.public Member getMemberByUniqueName(List<Id.Segment> uniqueNameParts, boolean failIfNotFound, MatchType matchType)
SchemaReader
getMemberByUniqueName
in interface SchemaReader
uniqueNameParts
- Unique name of memberfailIfNotFound
- Whether to throw an error, as opposed to returning
null
, if there is no such member.matchType
- indicates the match mode; if not specified, EXACTpublic final OlapElement lookupCompound(OlapElement parent, List<Id.Segment> names, boolean failIfNotFound, int category)
SchemaReader
Resolves a name such as '[Products].[Product Department].[Produce]' by resolving the components ('Products', and so forth) one at a time.
lookupCompound
in interface SchemaReader
parent
- Parent element to search innames
- Exploded compound name, such as {"Products",
"Product Department", "Produce"}failIfNotFound
- If the element is not found, determines whether
to return null or throw an errorcategory
- Type of returned element, a Category
value;
Category.Unknown
if it doesn't matter.public final OlapElement lookupCompound(OlapElement parent, List<Id.Segment> names, boolean failIfNotFound, int category, MatchType matchType)
SchemaReader
Resolves a name such as '[Products].[Product Department].[Produce]' by resolving the components ('Products', and so forth) one at a time.
lookupCompound
in interface SchemaReader
parent
- Parent element to search innames
- Exploded compound name, such as {"Products",
"Product Department", "Produce"}failIfNotFound
- If the element is not found, determines whether
to return null or throw an errorcategory
- Type of returned element, a Category
value;
Category.Unknown
if it doesn't matter.matchType
- indicates the match mode; if not specified, EXACTpublic List<NameResolver.Namespace> getNamespaces()
SchemaReader
For example, a schema reader from the perspective of a cube will return cube and schema namespaces.
getNamespaces
in interface SchemaReader
public OlapElement lookupCompoundInternal(OlapElement parent, List<Id.Segment> names, boolean failIfNotFound, int category, MatchType matchType)
public Member getCalculatedMember(List<Id.Segment> nameParts)
SchemaReader
getCalculatedMember
in interface SchemaReader
public NamedSet getNamedSet(List<Id.Segment> nameParts)
SchemaReader
getNamedSet
in interface SchemaReader
public void getMemberRange(Level level, Member startMember, Member endMember, List<Member> list)
SchemaReader
list
all members between startMember
and endMember
(inclusive) which belong to
level
.getMemberRange
in interface SchemaReader
public Member getLeadMember(Member member, int n)
SchemaReader
n
further along in the same level from
member
.getLeadMember
in interface SchemaReader
public int compareMembersHierarchically(Member m1, Member m2)
SchemaReader
Member
s according to their order in a prefix
traversal. (that is, it
is an ancestor or a earlier), is a sibling, or comes later in a prefix
traversal.compareMembersHierarchically
in interface SchemaReader
m1
is an ancestor, an earlier
sibling of an ancestor, or a descendent of an earlier sibling, of
m2
;
zero if m1
is a sibling of m2
;
a positive integer if m1
comes later in the prefix
traversal then m2
.public OlapElement getElementChild(OlapElement parent, Id.Segment name)
SchemaReader
parent
name
, returning
null if no element is found.
Always equivalent to
getElementChild(parent, name, MatchType.EXACT)
.
getElementChild
in interface SchemaReader
parent
- Parent element to search inname
- Compound in compound name, such as "[Product]" or "&[1]"public OlapElement getElementChild(OlapElement parent, Id.Segment name, MatchType matchType)
SchemaReader
parent
called name
, or
an approximation according to matchType
, returning
null if no element is found.getElementChild
in interface SchemaReader
parent
- Parent element to search inname
- Compound in compound name, such as "[Product]" or "&[1]"matchType
- Match typepublic List<Member> getLevelMembers(Level level, boolean includeCalculated)
SchemaReader
getLevelMembers
in interface SchemaReader
public List<Level> getHierarchyLevels(Hierarchy hierarchy)
SchemaReader
getHierarchyLevels
in interface SchemaReader
hierarchy
- Hierarchypublic Member getHierarchyDefaultMember(Hierarchy hierarchy)
SchemaReader
getHierarchyDefaultMember
in interface SchemaReader
hierarchy
- Hierarchypublic boolean isDrillable(Member member)
SchemaReader
isDrillable
in interface SchemaReader
public boolean isVisible(Member member)
SchemaReader
isVisible
in interface SchemaReader
public Cube[] getCubes()
SchemaReader
getCubes
in interface SchemaReader
public List<Member> getCalculatedMembers(Hierarchy hierarchy)
SchemaReader
getCalculatedMembers
in interface SchemaReader
public List<Member> getCalculatedMembers(Level level)
SchemaReader
getCalculatedMembers
in interface SchemaReader
public List<Member> getCalculatedMembers()
SchemaReader
getCalculatedMembers
in interface SchemaReader
public int getChildrenCountFromCache(Member member)
SchemaReader
getChildrenCountFromCache
in interface SchemaReader
public int getLevelCardinality(Level level, boolean approximate, boolean materialize)
SchemaReader
getLevelCardinality
in interface SchemaReader
level
- Levelapproximate
- Whether an approximation is acceptablematerialize
- Whether to go to disk if no approximation
for the count is available and the members are not in
cache. If false, returns Integer.MIN_VALUE
if value
is not in cache.public List<Member> getLevelMembers(Level level, Evaluator context)
SchemaReader
getLevelMembers
in interface SchemaReader
level
- Levelcontext
- Context for filteringpublic List<Member> getMemberChildren(Member member, Evaluator context)
SchemaReader
member
, optimized
for NON EMPTY.
If context == null
then
there is no context and all members are returned - then
its identical to SchemaReader.getMemberChildren(Member)
.
If context
is not null, the resulting members
may be restricted to those members that have a
non empty row in the fact table for context
.
Wether or not optimization is possible depends
on the SchemaReader implementation.
getMemberChildren
in interface SchemaReader
public List<Member> getMemberChildren(List<Member> members, Evaluator context)
SchemaReader
members
which is not empty in context
.getMemberChildren
in interface SchemaReader
members
- Array of memberscontext
- Evaluation contextpublic void getMemberAncestors(Member member, List<Member> ancestorList)
SchemaReader
member
, in depth order.
For example, for [Store].[USA].[CA], returns {[Store].[USA], [Store].[All Stores]}.
getMemberAncestors
in interface SchemaReader
member
- MemberancestorList
- List of ancestorspublic Member lookupMemberChildByName(Member member, Id.Segment memberName, MatchType matchType)
SchemaReader
lookupMemberChildByName
in interface SchemaReader
public List<Member> lookupMemberChildrenByNames(Member parent, List<Id.NameSegment> childNames, MatchType matchType)
SchemaReader
lookupMemberChildrenByNames
in interface SchemaReader
public NativeEvaluator getNativeSetEvaluator(FunDef fun, Exp[] args, Evaluator evaluator, Calc calc)
SchemaReader
getNativeSetEvaluator
in interface SchemaReader
fun
- Functionargs
- Arguments to the functionevaluator
- Evaluator, provides contextcalc
- the calc to be natively evaluatedpublic Parameter getParameter(String name)
SchemaReader
getParameter
in interface SchemaReader
public DataSource getDataSource()
SchemaReader
getDataSource
in interface SchemaReader
public SchemaReader withoutAccessControl()
SchemaReader
withoutAccessControl
in interface SchemaReader
public SchemaReader withLocus()
SchemaReader
It is less efficient; use this only if the operation is occurring outside the context of a statement. If you get the internal error "no locus", that's a sign you should use this method.
withLocus
in interface SchemaReader
public Map<? extends Member,Access> getMemberChildrenWithDetails(Member member, Evaluator evaluator)
SchemaReader
SchemaReader.getMemberChildren(Member, Evaluator)
but returns a map of the grand-children and their access details
and costs more to invoke because of the access controls.
Called by RolapHierarchy
when determining the lowest access
level of a Role within a hierarchy.getMemberChildrenWithDetails
in interface SchemaReader
Copyright © 2019 Hitachi Vantara. All rights reserved.