KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > mondrian > olap > Schema


1 /*
2 // $Id: //open/mondrian/src/main/mondrian/olap/Schema.java#13 $
3 // This software is subject to the terms of the Common Public License
4 // Agreement, available at the following URL:
5 // http://www.opensource.org/licenses/cpl.html.
6 // Copyright (C) 2006-2006 Julian Hyde
7 // All Rights Reserved.
8 // You must accept the terms of that agreement to use this software.
9 */

10 package mondrian.olap;
11
12 /**
13  * A <code>Schema</code> is a collection of cubes, shared dimensions, and roles.
14  *
15  * @author jhyde
16  * @version $Id: //open/mondrian/src/main/mondrian/olap/Schema.java#13 $
17  */

18 public interface Schema {
19
20     /**
21      * returns the next available ordinal. Ths should not be part of the public
22      * API but this is temporary, will be removed with the "compiled expressions".
23      */

24     int getNextDimensionOrdinal();
25
26     /**
27      * Returns the name of this schema.
28      * @post return != null
29      * @post return.length() > 0
30      */

31     String JavaDoc getName();
32     /**
33      * Finds a cube called <code>cube</code> in this schema; if no cube
34      * exists, <code>failIfNotFound</code> controls whether to raise an error
35      * or return <code>null</code>.
36      */

37     Cube lookupCube(String JavaDoc cube,boolean failIfNotFound);
38
39     /**
40      * Returns a list of all cubes in this schema.
41      */

42     Cube[] getCubes();
43
44     /**
45      * Returns a list of shared dimensions in this schema.
46      */

47     Hierarchy[] getSharedHierarchies();
48
49     /**
50      * Creates a dimension in the given cube by parsing an XML string. The XML
51      * string must be either a &lt;Dimension&gt; or a &lt;DimensionUsage&gt;.
52      * Returns the dimension created.
53      */

54     Dimension createDimension(Cube cube, String JavaDoc xml);
55
56     /**
57      * Creates a cube by parsing an XML string. Returns the cube created.
58      */

59     Cube createCube(String JavaDoc xml);
60
61     /**
62      * Removes a cube.
63      *
64      * @return Whether cube was removed
65      */

66     boolean removeCube(String JavaDoc cubeName);
67
68     /**
69      * Creates a {@link SchemaReader} without any access control.
70      */

71     SchemaReader getSchemaReader();
72
73     /**
74      * Finds a role with a given name in the current catalog, or returns
75      * <code>null</code> if no such role exists.
76      */

77     Role lookupRole(String JavaDoc role);
78
79     /**
80      * Returns this schema's function table.
81      */

82     FunTable getFunTable();
83
84     /**
85      * Returns this schema's parameters.
86      */

87     Parameter[] getParameters();
88 }
89
90 // End Schema.java
91
Popular Tags