001    /*
002    // $Id: Schema.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 java.util.Locale;
013    import java.util.Collection;
014    
015    import org.olap4j.OlapException;
016    
017    /**
018     * A collection of database objects that contain structural information, or
019     * metadata, about a database.
020     *
021     * <p>A Schema belongs to a {@link Catalog} and contains a number of
022     * {@link Cube}s and shared {@link Dimension}s.
023     *
024     * @author jhyde
025     * @version $Id: Schema.java 229 2009-05-08 19:11:29Z jhyde $
026     * @since Oct 13, 2006
027     */
028    public interface Schema {
029        /**
030         * Returns the {@link Catalog} this <code>Schema</code> belongs to.
031         *
032         * @return catalog this schema belongs to
033         */
034        Catalog getCatalog();
035    
036        /**
037         * Returns the name of this Schema.
038         *
039         * @return name of this Schema
040         */
041        String getName();
042    
043        /**
044         * Returns a list of cubes in this <code>Schema</code>.
045         *
046         * <p>The caller should assume that the list is immutable;
047         * if the caller modifies the list, behavior is undefined.</p>
048         *
049         * @see org.olap4j.OlapDatabaseMetaData#getCubes
050         * @return List of cubes in this Schema
051         *
052         * @throws OlapException if database error occurs
053         */
054        NamedList<Cube> getCubes() throws OlapException;
055    
056        /**
057         * Returns a list of shared {@link Dimension} objects in this
058         * <code>Schema</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#getDimensions(String,String,String,String)
064         *
065         * @return list of shared dimensions
066         *
067         * @throws OlapException if database error occurs
068         */
069        NamedList<Dimension> getSharedDimensions() throws OlapException;
070    
071        /**
072         * Returns a collection of {@link java.util.Locale} objects for which this
073         * <code>Schema</code> has been localized.
074         *
075         * <p>Consider the following use case. Suppose one cube is available in
076         * English and French, and in French and Spanish, and both are shown in same
077         * portal. Clients typically say that seeing reports in a mixture of
078         * languages is confusing; the portal would figure out the best common
079         * language, in this case French. This method allows the client to choose
080         * the most appropriate locale.</p>
081         *
082         * <p>The list is advisory: a client is free to choose another locale,
083         * in which case, the server will probably revert to the base locale for
084         * locale-specific behavior such as captions and formatting.
085         *
086         * @see Cube#getSupportedLocales
087         *
088         * @return List of locales for which this <code>Schema</code> has been
089         * localized
090         *
091         * @throws OlapException if database error occurs
092         */
093        Collection<Locale> getSupportedLocales() throws OlapException;
094    }
095    
096    // End Schema.java