001    /*
002    // $Id: Catalog.java 229 2009-05-08 19:11:29Z jhyde $
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-2008 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.OlapException;
013    import org.olap4j.OlapDatabaseMetaData;
014    
015    /**
016     * Highest level element in the hierarchy of metadata objects.
017     *
018     * <p>A Catalog contains one or more {@link Schema}s.</p>
019     *
020     * <p>Some OLAP servers may only have one Catalog. Mondrian is one such
021     * OLAP server; its sole catalog is called "LOCALDB".
022     *
023     * <p>To obtain the collection of catalogs in the current server, call the
024     * {@link org.olap4j.OlapConnection#getCatalogs()} method.
025     *
026     * <p>The hierarchy of metadata objects, rooted at the connection from which
027     * they are accessed, is as follows:
028     * <blockquote>
029     * <ul>
030     * <li type="circle">{@link org.olap4j.OlapConnection}<ul>
031     *     <li type="circle">{@link Catalog}<ul>
032     *         <li type="circle">{@link Schema}<ul>
033     *             <li type="circle">{@link Cube}<ul>
034     *                 <li type="circle">{@link Dimension}<ul>
035     *                     <li type="circle">{@link Hierarchy}<ul>
036     *                         <li type="circle">{@link Level}<ul>
037     *                             <li type="circle">{@link Member}</li>
038     *                             <li type="circle">{@link Property}</li>
039     *                         </ul></li>
040     *                     </ul></li>
041     *                 </ul></li>
042     *             <li type="circle">{@link NamedSet}</li>
043     *             </ul></li>
044     *         <li type="circle">Dimension (shared)</li>
045     *         </ul></li>
046     *     </ul></li>
047     *  </ul>
048     * </blockquote>
049     * </p>
050     *
051     * @author jhyde
052     * @version $Id: Catalog.java 229 2009-05-08 19:11:29Z jhyde $
053     * @since Oct 24, 2006
054     */
055    public interface Catalog {
056        /**
057         * Returns a list of {@link Schema} objects which belong to
058         * this <code>Catalog</code>.
059         *
060         * <p>The caller should assume that the list is immutable;
061         * if the caller modifies the list, behavior is undefined.</p>
062         *
063         * @see org.olap4j.OlapDatabaseMetaData#getSchemas
064         * @return List of Schema in this <code>Catalog</code>
065         * @throws OlapException if error occurs
066         */
067        NamedList<Schema> getSchemas() throws OlapException;
068    
069        /**
070         * Returns the name of this Catalog.
071         *
072         * @return name of this Catalog
073         */
074        String getName();
075    
076        /**
077         * Retrieves the metadata describing the OLAP server that this Catalog
078         * belongs to.
079         *
080         * @return metadata describing the OLAP server
081         */
082        OlapDatabaseMetaData getMetaData();
083    }
084    
085    // End Catalog.java