Class FilterDynamicSchemaProcessor
- java.lang.Object
-
- mondrian.spi.impl.FilterDynamicSchemaProcessor
-
- All Implemented Interfaces:
DynamicSchemaProcessor
- Direct Known Subclasses:
LocalizingDynamicSchemaProcessor
public class FilterDynamicSchemaProcessor extends Object implements DynamicSchemaProcessor
Implementation ofDynamicSchemaProcessor
which allows a derived class to easily process a schema file.Mondrian's default mechanism for loading schema files, if no DynamicSchemaProcessor is specified, is to use Apache VFS (virtual file system) to resolve the URL to a stream, and to read the contents of the stream into a string.
FilterDynamicSchemaProcessor implements exactly the same mechanism, but makes it easy for a derived class to override the mechanism. For example:
- To redirect to a different URL, override the
processSchema(String, mondrian.olap.Util.PropertyList)
method. - To process the contents of the URL, override the
filter(String, mondrian.olap.Util.PropertyList, java.io.InputStream)
method.
- Since:
- Mar 30, 2007
- Author:
- jhyde
-
-
Constructor Summary
Constructors Constructor Description FilterDynamicSchemaProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
filter(String catalog, Util.PropertyList connectInfo)
Reads the contents of a catalog and returns the result as a string.protected String
filter(String schemaUrl, Util.PropertyList connectInfo, InputStream stream)
Reads the contents of a schema as a stream and returns the result as a string.String
processCatalog(String catalog, Util.PropertyList connectInfo)
Modifies a Mondrian catalog.String
processSchema(String schemaUrl, Util.PropertyList connectInfo)
Modifies a Mondrian schema.
-
-
-
Method Detail
-
processSchema
public String processSchema(String schemaUrl, Util.PropertyList connectInfo) throws Exception
Modifies a Mondrian schema.An implementation should generally interpret the URL string as an Apache VFS (virtual file system) URL.
FilterDynamicSchemaProcessor's implementation of this method reads from the URL supplied (that is, it does not perform URL translation) and passes it through the
filter(java.lang.String, mondrian.olap.Util.PropertyList)
method.- Specified by:
processSchema
in interfaceDynamicSchemaProcessor
- Parameters:
schemaUrl
- The URL of the catalog.connectInfo
- Connection properties.- Returns:
- Returns the modified schema.
- Throws:
Exception
- if an error occurs.
-
processCatalog
public String processCatalog(String catalog, Util.PropertyList connectInfo) throws Exception
Modifies a Mondrian catalog.An implementation should process catalog and apply dynamic changes
FilterDynamicSchemaProcessor's implementation of this method use catalog supplied and passes it through the
filter(java.lang.String, mondrian.olap.Util.PropertyList)
method.- Specified by:
processCatalog
in interfaceDynamicSchemaProcessor
- Parameters:
catalog
- The URL of the catalog.connectInfo
- Connection properties.- Returns:
- Returns the modified schema.
- Throws:
Exception
- if an error occurs.
-
filter
protected String filter(String catalog, Util.PropertyList connectInfo)
Reads the contents of a catalog and returns the result as a string.The default implementation returns the contents of the catalog unchanged.
- Parameters:
catalog
- the catalog contentconnectInfo
- Connection properties- Returns:
- the modified catalog
-
filter
protected String filter(String schemaUrl, Util.PropertyList connectInfo, InputStream stream) throws Exception
Reads the contents of a schema as a stream and returns the result as a string.The default implementation returns the contents of the schema unchanged.
- Parameters:
schemaUrl
- the URL of the catalogconnectInfo
- Connection propertiesstream
- Schema contents represented as a stream- Returns:
- the modified schema
- Throws:
Exception
- if an error occurs
-
-