KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > mondrian > olap > MondrianServer


1 /*
2 // $Id: //open/mondrian/src/main/mondrian/olap/MondrianServer.java#4 $
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-2007 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  * Interface by which to control an instance of Mondrian.
14  *
15  * <p>Typically, there is only one instance of Mondrian per JVM. However, you
16  * access a MondrianServer via the {@link #forConnection} method for future
17  * expansion.
18  *
19  * @author jhyde
20  * @version $Id: //open/mondrian/src/main/mondrian/olap/MondrianServer.java#4 $
21  * @since Jun 25, 2006
22  */

23 public abstract class MondrianServer {
24     private static MondrianServer instance = new MondrianServerImpl();
25
26     /**
27      * Returns the MondrianServer which hosts a given connection.
28      * @param connection Connection
29      */

30     public static MondrianServer forConnection(Connection connection) {
31         // Mondrian server is currently a singleton, so the connection is
32
// irrelevant.
33
Util.discard(connection);
34         return instance;
35     }
36
37     /**
38      * Flushes the cache which maps schema URLs to metadata.
39      *
40      * <p>This cache is referenced only when creating a new connection, so
41      * existing connections will continue to use the same schema definition.
42      *
43      * @deprecated Use {@link CacheControl#flushSchemaCache()}.
44      */

45     public abstract void flushSchemaCache();
46
47     /**
48      * Flushes the cache which contains cached aggregate values.
49      *
50      * <p>Typically, you would do this when records in the fact table have been
51      * modified.
52      *
53      * <p>Note that flushing the data cache may have serious performance
54      * implications for all connections to this Mondrian server. Aggregate data
55      * for all cubes in all schemas will be flushed.
56      *
57      * @deprecated Use {@link CacheControl#flush(CacheControl.CellRegion)}.
58      */

59     public abstract void flushDataCache();
60
61     /**
62      * Returns the version of this MondrianServer.
63      */

64     public abstract MondrianVersion getVersion();
65
66     /**
67      * Description of the version of the server.
68      */

69     public interface MondrianVersion {
70         /**
71          * Returns the version string, for example "2.3.0".
72          */

73         String JavaDoc getVersionString();
74     }
75 }
76
77 // End MondrianServer.java
78
Popular Tags