001    /*
002    // $Id: Catalog.java 404 2011-03-18 21:54:56Z lucboudreau $
003    // This software is subject to the terms of the Eclipse Public License v1.0
004    // Agreement, available at the following URL:
005    // http://www.eclipse.org/legal/epl-v10.html.
006    // Copyright (C) 2006-2010 Julian Hyde
007    // All Rights Reserved.
008    // You must accept the terms of that agreement to use this software.
009    */
010    package org.olap4j.metadata;
011    
012    import org.olap4j.OlapConnection;
013    import org.olap4j.OlapException;
014    import org.olap4j.OlapDatabaseMetaData;
015    
016    /**
017     * <p>Catalogs are the second element of the hierarchy of metadata objects.
018     * A Catalog contains one or more {@link Schema}s and has a parent
019     * {@link Database}.</p>
020     *
021     * <p>Some OLAP servers may only have one Catalog. Mondrian is one such
022     * OLAP server; its sole catalog is called "LOCALDB".
023     *
024     * <p>To obtain the collection of catalogs in the current server, call the
025     * {@link OlapConnection#getOlapCatalogs()} method.
026     *
027     * <p>The hierarchy of metadata objects, rooted at the connection from which
028     * they are accessed, is as follows:
029     * <blockquote>
030     * <ul>
031     * <li type="circle">{@link org.olap4j.OlapConnection}<ul>
032     *     <li type="circle">{@link Database}<ul>
033     *         <li type="circle">{@link Catalog}<ul>
034     *             <li type="circle">{@link Schema}<ul>
035     *                 <li type="circle">{@link Cube}<ul>
036     *                     <li type="circle">{@link Dimension}<ul>
037     *                         <li type="circle">{@link Hierarchy}<ul>
038     *                             <li type="circle">{@link Level}<ul>
039     *                                 <li type="circle">{@link Member}</li>
040     *                                 <li type="circle">{@link Property}</li>
041     *                             </ul></li>
042     *                         </ul></li>
043     *                     </ul></li>
044     *                 <li type="circle">{@link NamedSet}</li>
045     *                 </ul></li>
046     *             <li type="circle">{@link Dimension} (shared)</li>
047     *             </ul></li>
048     *         </ul></li>
049     *     </ul></li>
050     *  </ul>
051     * </blockquote>
052     * </p>
053     *
054     * @author jhyde
055     * @version $Id: Catalog.java 404 2011-03-18 21:54:56Z lucboudreau $
056     * @since Oct 24, 2006
057     */
058    public interface Catalog {
059        /**
060         * Returns a list of {@link Schema} objects which belong to
061         * this <code>Catalog</code>.
062         *
063         * <p>The caller should assume that the list is immutable;
064         * if the caller modifies the list, behavior is undefined.</p>
065         *
066         * @see org.olap4j.OlapDatabaseMetaData#getSchemas
067         * @return List of Schema in this <code>Catalog</code>
068         * @throws OlapException if error occurs
069         */
070        NamedList<Schema> getSchemas() throws OlapException;
071    
072        /**
073         * Returns the name of this Catalog.
074         *
075         * @return name of this Catalog
076         */
077        String getName();
078    
079        /**
080         * Retrieves the metadata describing the OLAP server that this Catalog
081         * belongs to.
082         *
083         * @return metadata describing the OLAP server
084         */
085        OlapDatabaseMetaData getMetaData();
086    
087        /**
088         * Returns the parent database of this catalog.
089         * @return A Database object to which this catalog belongs.
090         */
091        Database getDatabase();
092    }
093    
094    // End Catalog.java