KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tonbeller > jpivot > olap > model > OlapModel


1 /*
2  * ====================================================================
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) 2003-2004 TONBELLER AG.
7  * All Rights Reserved.
8  * You must accept the terms of that agreement to use this software.
9  * ====================================================================
10  *
11  *
12  */

13 package com.tonbeller.jpivot.olap.model;
14
15 import javax.servlet.ServletContext JavaDoc;
16
17 import com.tonbeller.jpivot.core.Model;
18
19 /**
20  * Provides access to extensions, result and metadata. It does not specify
21  * what data are displayed (the query). Supports navigations thru Extensions.
22  *
23  * @see com.tonbeller.jpivot.core.Extension
24  * @see com.tonbeller.jpivot.olap.model.Result
25  */

26 public interface OlapModel extends Model {
27
28   /**
29    * thrown if too many result positions would be returned
30    * @see OlapModel#getResult()
31    */

32   public class ResultTooLargeException extends RuntimeException JavaDoc {
33     public ResultTooLargeException() {
34       super();
35     }
36     public ResultTooLargeException(Throwable JavaDoc cause) {
37       super(cause);
38     }
39     public ResultTooLargeException(String JavaDoc message, Throwable JavaDoc cause) {
40       super(message, cause);
41     }
42   }
43
44   /**
45    * thrown if the result can not be computed because the cube is
46    * empty.
47    * @see OlapModel#getResult()
48    */

49   public class EmptyCubeException extends RuntimeException JavaDoc {
50     public EmptyCubeException() {
51       super();
52     }
53     public EmptyCubeException(Throwable JavaDoc cause) {
54       super(cause);
55     }
56     public EmptyCubeException(String JavaDoc message, Throwable JavaDoc cause) {
57       super(message, cause);
58     }
59   }
60     
61   /**
62    * runs the query and returns the result
63    */

64   public Result getResult() throws OlapException;
65   
66   /**
67    * @return all dimensions of the cube for navigation
68    */

69   Dimension[] getDimensions();
70
71   /**
72    * @return all measures of the cube for navigation
73    */

74   Member[] getMeasures();
75   
76   /**
77    * called once after creation. E.g. open DB connection
78    */

79   void initialize() throws OlapException;
80
81   /**
82    * called once when the not used any longer. E.g. close DB connection
83    *
84    */

85   void destroy();
86   
87   /**
88    * @return an ID string for this model
89    */

90   String JavaDoc getID();
91   
92   /**
93    * sets an ID string for this model
94    */

95   void setID(String JavaDoc ID);
96   
97   /**
98    * store a servlet context to the model
99    */

100   void setServletContext(ServletContext JavaDoc servletContext);
101   
102 }
103
Popular Tags