001    /*
002    // $Id: //open/mondrian/src/main/mondrian/spi/DynamicSchemaProcessor.java#2 $
003    // This software is subject to the terms of the Common Public License
004    // Agreement, available at the following URL:
005    // http://www.opensource.org/licenses/cpl.html.
006    // Copyright (C) 2004-2005 TONBELLER AG
007    // Copyright (C) 2005-2007 Julian Hyde
008    // All Rights Reserved.
009    // You must accept the terms of that agreement to use this software.
010    */
011    package mondrian.spi;
012    
013    import mondrian.olap.Util;
014    
015    /**
016     * A dynamic schema processor is used to dynamically change
017     * a Mondrian schema at runtime.
018     *
019     * <p>Mondrian loads a DynamicSchemaProcessor when it sees the
020     * {@link mondrian.rolap.RolapConnectionProperties#DynamicSchemaProcessor}
021     * keyword in a connect string. The value of that property must be a class
022     * which implements this interface. Rather than loading the schema directly,
023     * Mondrian instantiates the class and calls the
024     * {@link #processSchema(String, mondrian.olap.Util.PropertyList)} method
025     * with the catalog URL and connection properties specified in the connect
026     * string.
027     *
028     * <p>By default, mondrian uses Apache VFS (virtual file system) to resolve
029     * catalog URLs. We recommend that implementations of DynamicSchemaProcessor
030     * do the same.
031     *
032     * <p>If you are writing an implementation of this class, we recommend that
033     * you use {@link mondrian.spi.impl.FilterDynamicSchemaProcessor} as a
034     * base class.
035     *
036     * @author hhaas
037     * @version $Id: //open/mondrian/src/main/mondrian/spi/DynamicSchemaProcessor.java#2 $
038     */
039    public interface DynamicSchemaProcessor {
040    
041        /**
042         * Modifies a Mondrian schema.
043         *
044         * <p>An implementation should generally interpret the URL string as
045         * an Apache VFS (virtual file system) URL.
046         *
047         * @param schemaUrl the URL of the catalog
048         * @param connectInfo Connection properties
049         * @return the modified schema
050         * @throws Exception if an error occurs
051         */
052        public String processSchema(
053            String schemaUrl,
054            Util.PropertyList connectInfo) throws Exception;
055    }
056    
057    // End DynamicSchemaProcessor.java
058