001/*
002// $Id: Catalog.java 482 2012-01-05 23:27:27Z jhyde $
003//
004// Licensed to Julian Hyde under one or more contributor license
005// agreements. See the NOTICE file distributed with this work for
006// additional information regarding copyright ownership.
007//
008// Julian Hyde licenses this file to you under the Apache License,
009// Version 2.0 (the "License"); you may not use this file except in
010// compliance with the License. You may obtain a copy of the License at:
011//
012// http://www.apache.org/licenses/LICENSE-2.0
013//
014// Unless required by applicable law or agreed to in writing, software
015// distributed under the License is distributed on an "AS IS" BASIS,
016// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017// See the License for the specific language governing permissions and
018// limitations under the License.
019*/
020package org.olap4j.metadata;
021
022import org.olap4j.*;
023
024/**
025 * <p>Catalogs are the second element of the hierarchy of metadata objects.
026 * A Catalog contains one or more {@link Schema}s and has a parent
027 * {@link Database}.</p>
028 *
029 * <p>Some OLAP servers may only have one Catalog. Mondrian is one such
030 * OLAP server; its sole catalog is called "LOCALDB".
031 *
032 * <p>To obtain the collection of catalogs in the current server, call the
033 * {@link OlapConnection#getOlapCatalogs()} method.
034 *
035 * <p>The hierarchy of metadata objects, rooted at the connection from which
036 * they are accessed, is as follows:
037 * <blockquote>
038 * <ul>
039 * <li type="circle">{@link org.olap4j.OlapConnection}<ul>
040 *     <li type="circle">{@link Database}<ul>
041 *         <li type="circle">{@link Catalog}<ul>
042 *             <li type="circle">{@link Schema}<ul>
043 *                 <li type="circle">{@link Cube}<ul>
044 *                     <li type="circle">{@link Dimension}<ul>
045 *                         <li type="circle">{@link Hierarchy}<ul>
046 *                             <li type="circle">{@link Level}<ul>
047 *                                 <li type="circle">{@link Member}</li>
048 *                                 <li type="circle">{@link Property}</li>
049 *                             </ul></li>
050 *                         </ul></li>
051 *                     </ul></li>
052 *                 <li type="circle">{@link NamedSet}</li>
053 *                 </ul></li>
054 *             <li type="circle">{@link Dimension} (shared)</li>
055 *             </ul></li>
056 *         </ul></li>
057 *     </ul></li>
058 *  </ul>
059 * </blockquote>
060 * </p>
061 *
062 * @author jhyde
063 * @version $Id: Catalog.java 482 2012-01-05 23:27:27Z jhyde $
064 * @since Oct 24, 2006
065 */
066public interface Catalog {
067    /**
068     * Returns a list of {@link Schema} objects which belong to
069     * this <code>Catalog</code>.
070     *
071     * <p>The caller should assume that the list is immutable;
072     * if the caller modifies the list, behavior is undefined.</p>
073     *
074     * @see org.olap4j.OlapDatabaseMetaData#getSchemas
075     * @return List of Schema in this <code>Catalog</code>
076     * @throws OlapException if error occurs
077     */
078    NamedList<Schema> getSchemas() throws OlapException;
079
080    /**
081     * Returns the name of this Catalog.
082     *
083     * @return name of this Catalog
084     */
085    String getName();
086
087    /**
088     * Retrieves the metadata describing the OLAP server that this Catalog
089     * belongs to.
090     *
091     * @return metadata describing the OLAP server
092     */
093    OlapDatabaseMetaData getMetaData();
094
095    /**
096     * Returns the parent database of this catalog.
097     * @return A Database object to which this catalog belongs.
098     */
099    Database getDatabase();
100}
101
102// End Catalog.java