Package mondrian.rolap.aggmatcher
Class DefaultRules
java.lang.Object
mondrian.rolap.aggmatcher.DefaultRules
Container for the default aggregate recognition rules.
It is generated by parsing the default rule xml information found
in the
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).
- Author:
- Richard M. Emberson
-
Method Summary
Modifier and TypeMethodDescriptionbooleancolumnsOK(RolapStar star, JdbcSchema.Table dbFactTable, JdbcSchema.Table aggTable, MessageRecorder msgRecorder) Uses theDefaultRecognizerRecognizer to determine if the given aggTable's columns all match upto the dbFactTable's columns (where present) making the column usages as a result.Returns theDefaultDef.AggRulewhose tag equals this rule's tag.getAggRule(String tag) Returns theDefaultDef.AggRulewhose tag equals the parameter tag, or null if not found.mondrian.rolap.aggmatcher.Recognizer.MatcherGets theRecognizer.Matcherfor columns that should be ignored.mondrian.rolap.aggmatcher.Recognizer.MatchergetForeignKeyMatcher(String foreignKeyName) Gets theRecognizer.Matcherfor this foreign key column name.mondrian.rolap.aggmatcher.Recognizer.MatcherGets theRecognizer.Matcherfor the fact count column.static DefaultRulesThere is a single instance of theDefaultRecognizerand theDefaultRulesclass is a container of that instance.mondrian.rolap.aggmatcher.Recognizer.MatchergetLevelMatcher(String usagePrefix, String hierarchyName, String levelName, String levelColumnName) Gets aRecognizer.Matcherfor a given level's hierarchy's name, level name and column name.mondrian.rolap.aggmatcher.Recognizer.MatchergetMeasureMatcher(String measureName, String measureColumnName, String aggregateName) Creates aRecognizer.Matcherfor the given measure name (symbolic name), column name and aggregate name (sum, count, etc.).mondrian.rolap.aggmatcher.Recognizer.MatchergetTableMatcher(String tableName) Gets theRecognizer.Matcherfor this tableName.getTag()Gets the tag of this rule (this is the value of theMondrianProperties.AggregateRuleTagproperty).protected static DefaultDef.AggRulesmakeAggRules(File file) protected static DefaultDef.AggRulesmakeAggRules(InputStream inStream) protected static DefaultDef.AggRulesmakeAggRules(String text, String name) protected static DefaultDef.AggRulesmakeAggRules(URL url) protected static org.eigenbase.xom.DOMWrappermakeDOMWrapper(File file) protected static org.eigenbase.xom.DOMWrappermakeDOMWrapper(InputStream inStream) protected static org.eigenbase.xom.DOMWrappermakeDOMWrapper(String text, String name) protected static org.eigenbase.xom.DOMWrappermakeDOMWrapper(URL url) booleanmatchesTableName(String factTableName, String name) Returns true if this candidate aggregate table name "matches" the factTableName.voidvalidate(MessageRecorder msgRecorder)
-
Method Details
-
getInstance
There is a single instance of theDefaultRecognizerand theDefaultRulesclass is a container of that instance. -
makeAggRules
-
makeAggRules
-
makeAggRules
-
makeAggRules
-
makeDOMWrapper
-
makeDOMWrapper
-
makeDOMWrapper
-
makeDOMWrapper
-
validate
-
getTag
Gets the tag of this rule (this is the value of theMondrianProperties.AggregateRuleTagproperty). -
getAggRule
Returns theDefaultDef.AggRulewhose tag equals this rule's tag. -
getAggRule
Returns theDefaultDef.AggRulewhose tag equals the parameter tag, or null if not found.- Parameters:
tag-- Returns:
- the AggRule with tag value equal to tag parameter, or null.
-
getTableMatcher
Gets theRecognizer.Matcherfor this tableName.- Parameters:
tableName-
-
getIgnoreMatcher
public mondrian.rolap.aggmatcher.Recognizer.Matcher getIgnoreMatcher()Gets theRecognizer.Matcherfor the fact count column. -
getFactCountMatcher
public mondrian.rolap.aggmatcher.Recognizer.Matcher getFactCountMatcher()Gets theRecognizer.Matcherfor columns that should be ignored.- Returns:
- the
Recognizer.Matcherfor columns that should be ignored.
-
getForeignKeyMatcher
Gets theRecognizer.Matcherfor this foreign key column name.- Parameters:
foreignKeyName- Name of a foreign key column
-
matchesTableName
Returns true if this candidate aggregate table name "matches" the factTableName.- Parameters:
factTableName- Name of the fact tablename- candidate aggregate table name
-
getMeasureMatcher
public mondrian.rolap.aggmatcher.Recognizer.Matcher getMeasureMatcher(String measureName, String measureColumnName, String aggregateName) Creates aRecognizer.Matcherfor the given measure name (symbolic name), column name and aggregate name (sum, count, etc.). -
getLevelMatcher
public mondrian.rolap.aggmatcher.Recognizer.Matcher getLevelMatcher(String usagePrefix, String hierarchyName, String levelName, String levelColumnName) Gets aRecognizer.Matcherfor a given level's hierarchy's name, level name and column name. -
columnsOK
public boolean columnsOK(RolapStar star, JdbcSchema.Table dbFactTable, JdbcSchema.Table aggTable, MessageRecorder msgRecorder) Uses theDefaultRecognizerRecognizer to determine if the given aggTable's columns all match upto the dbFactTable's columns (where present) making the column usages as a result.
-