public class DefaultRules extends Object
MondrianProperties.AggregateRules
value which normally is
a resource in the jar file (but can be a url).
It is a singleton since it is used to recognize tables independent of
database connection (each RolapSchema
uses the same
instance).
Modifier and Type | Method and Description |
---|---|
boolean |
columnsOK(RolapStar star,
JdbcSchema.Table dbFactTable,
JdbcSchema.Table aggTable,
MessageRecorder msgRecorder)
Uses the
DefaultRecognizer Recognizer to determine if the
given aggTable's columns all match upto the dbFactTable's columns (where
present) making the column usages as a result. |
DefaultDef.AggRule |
getAggRule()
Returns the
DefaultDef.AggRule whose
tag equals this rule's tag. |
DefaultDef.AggRule |
getAggRule(String tag)
Returns the
DefaultDef.AggRule whose
tag equals the parameter tag, or null if not found. |
Recognizer.Matcher |
getFactCountMatcher()
Gets the
Recognizer.Matcher for
columns that should be ignored. |
Recognizer.Matcher |
getForeignKeyMatcher(String foreignKeyName)
Gets the
Recognizer.Matcher for this
foreign key column name. |
Recognizer.Matcher |
getIgnoreMatcher()
Gets the
Recognizer.Matcher for the
fact count column. |
static DefaultRules |
getInstance()
There is a single instance of the
DefaultRecognizer and the
DefaultRules class is a container of that instance. |
Recognizer.Matcher |
getLevelMatcher(String usagePrefix,
String hierarchyName,
String levelName,
String levelColumnName)
Gets a
Recognizer.Matcher for a given
level's hierarchy's name, level name and column name. |
Recognizer.Matcher |
getMeasureMatcher(String measureName,
String measureColumnName,
String aggregateName)
Creates a
Recognizer.Matcher for the
given measure name (symbolic name), column name and aggregate name
(sum, count, etc.). |
Recognizer.Matcher |
getTableMatcher(String tableName)
Gets the
Recognizer.Matcher for this
tableName. |
String |
getTag()
Gets the tag of this rule (this is the value of the
MondrianProperties.AggregateRuleTag property). |
protected static DefaultDef.AggRules |
makeAggRules(File file) |
protected static DefaultDef.AggRules |
makeAggRules(InputStream inStream) |
protected static DefaultDef.AggRules |
makeAggRules(String text,
String name) |
protected static DefaultDef.AggRules |
makeAggRules(URL url) |
protected static org.eigenbase.xom.DOMWrapper |
makeDOMWrapper(File file) |
protected static org.eigenbase.xom.DOMWrapper |
makeDOMWrapper(InputStream inStream) |
protected static org.eigenbase.xom.DOMWrapper |
makeDOMWrapper(String text,
String name) |
protected static org.eigenbase.xom.DOMWrapper |
makeDOMWrapper(URL url) |
boolean |
matchesTableName(String factTableName,
String name)
Returns true if this candidate aggregate table name "matches" the
factTableName.
|
void |
validate(MessageRecorder msgRecorder) |
public static DefaultRules getInstance()
DefaultRecognizer
and the
DefaultRules
class is a container of that instance.protected static DefaultDef.AggRules makeAggRules(File file)
protected static DefaultDef.AggRules makeAggRules(URL url)
protected static DefaultDef.AggRules makeAggRules(InputStream inStream)
protected static DefaultDef.AggRules makeAggRules(String text, String name)
protected static org.eigenbase.xom.DOMWrapper makeDOMWrapper(File file)
protected static org.eigenbase.xom.DOMWrapper makeDOMWrapper(URL url)
protected static org.eigenbase.xom.DOMWrapper makeDOMWrapper(InputStream inStream)
protected static org.eigenbase.xom.DOMWrapper makeDOMWrapper(String text, String name)
public void validate(MessageRecorder msgRecorder)
public String getTag()
MondrianProperties.AggregateRuleTag
property).public DefaultDef.AggRule getAggRule()
DefaultDef.AggRule
whose
tag equals this rule's tag.public DefaultDef.AggRule getAggRule(String tag)
DefaultDef.AggRule
whose
tag equals the parameter tag, or null if not found.tag
- public Recognizer.Matcher getTableMatcher(String tableName)
Recognizer.Matcher
for this
tableName.tableName
- public Recognizer.Matcher getIgnoreMatcher()
Recognizer.Matcher
for the
fact count column.public Recognizer.Matcher getFactCountMatcher()
Recognizer.Matcher
for
columns that should be ignored.Recognizer.Matcher
for
columns that should be ignored.public Recognizer.Matcher getForeignKeyMatcher(String foreignKeyName)
Recognizer.Matcher
for this
foreign key column name.foreignKeyName
- Name of a foreign key columnpublic boolean matchesTableName(String factTableName, String name)
factTableName
- Name of the fact tablename
- candidate aggregate table namepublic Recognizer.Matcher getMeasureMatcher(String measureName, String measureColumnName, String aggregateName)
Recognizer.Matcher
for the
given measure name (symbolic name), column name and aggregate name
(sum, count, etc.).public Recognizer.Matcher getLevelMatcher(String usagePrefix, String hierarchyName, String levelName, String levelColumnName)
Recognizer.Matcher
for a given
level's hierarchy's name, level name and column name.public boolean columnsOK(RolapStar star, JdbcSchema.Table dbFactTable, JdbcSchema.Table aggTable, MessageRecorder msgRecorder)
DefaultRecognizer
Recognizer to determine if the
given aggTable's columns all match upto the dbFactTable's columns (where
present) making the column usages as a result.Copyright © 2020 Hitachi Vantara. All rights reserved.