Package mondrian.spi.impl
Class DataSourceChangeListenerImpl
java.lang.Object
mondrian.spi.impl.DataSourceChangeListenerImpl
- All Implemented Interfaces:
DataSourceChangeListener
Default implementation of a data source change listener
that always returns that the datasource is unchanged.
A change listener can be specified in the connection string. It is used
to ask what is changed in the datasource (e.g. database).
Everytime mondrian has to decide whether it will use data from cache, it
will call the change listener. When the change listener tells mondrian
the datasource has changed for a dimension, cube, ... then mondrian will
flush the cache and read from database again.
It is specified in the connection string, like this:
Jdbc=jdbc:odbc:MondrianFoodMart; JdbcUser=ziggy; JdbcPassword=stardust;
DataSourceChangeListener=com.acme.MyChangeListener;
This class should be called in mondrian before any data is read, so
even before cache is build. This way, the plugin is able to register
the first timestamp mondrian tries to read the datasource.- Since:
- Dec 12, 2006
- Author:
- Bart Pappyn
-
Constructor Summary
ConstructorDescriptionCreates a new instance of DataSourceChangeListenerImpl -
Method Summary
Modifier and TypeMethodDescriptiongetTableName
(RolapHierarchy hierarchy) boolean
isAggregationChanged
(AggregationKey aggregation) Checks if the given aggregation has changed since the previous time this function was called.boolean
isHierarchyChanged
(RolapHierarchy hierarchy) Checks if the given hierarchy has changed since the previous time this function was called.
-
Constructor Details
-
DataSourceChangeListenerImpl
public DataSourceChangeListenerImpl()Creates a new instance of DataSourceChangeListenerImpl
-
-
Method Details
-
isHierarchyChanged
Description copied from interface:DataSourceChangeListener
Checks if the given hierarchy has changed since the previous time this function was called. The first time, this function will be called when the cache is still empty. This is because the plugin is able to register the first timestamp the function was accessed. It is highly recommended to optimize the plugin and minimize the time needed to evaluate this function, because this plugin is called many times for each mondrian query.- Specified by:
isHierarchyChanged
in interfaceDataSourceChangeListener
-
isAggregationChanged
Description copied from interface:DataSourceChangeListener
Checks if the given aggregation has changed since the previous time this function was called. The first time, this function will be called when the cache is still empty. This is because the plugin is able to register the first timestamp the function was accessed.- Specified by:
isAggregationChanged
in interfaceDataSourceChangeListener
-
getTableName
-