KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > continuent > sequoia > controller > backend > DatabaseBackendSchemaConstants


1 /**
2  * Sequoia: Database clustering technology.
3  * Copyright (C) 2002-2004 French National Institute For Research In Computer
4  * Science And Control (INRIA).
5  * Copyright (C) 2006 Continuent, Inc.
6  * Contact: sequoia@continuent.org
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  * Initial developer(s): Nicolas Modrzyk.
21  * Contributor(s): Emmanuel Cecchet
22  */

23
24 package org.continuent.sequoia.controller.backend;
25
26 /**
27  * Database schema gathering options stored in an integer called
28  * dynamicPrecision (for backward compatibility reason, this cannot be changed
29  * and is carried in the BackendInfo object).
30  *
31  * @author <a HREF="mailto:Emmanuel.Cecchet@continuent.com">Emmanuel Cecchet
32  * </a>
33  * @author <a HREF="mailto:Nicolas.Modrzyk@inrialpes.fr">Nicolas Modrzyk </a>
34  */

35 public final class DatabaseBackendSchemaConstants
36 {
37   /** Table level for dynamic schema */
38   public static final int FetchTables = 1;
39   /** Column level for dynamic schema */
40   public static final int FetchViews = 2;
41   /** If stored procedures are used, this value is added to the precision value */
42   public static final int FetchStoredProcedures = 4;
43   /** If system tables are used, this value is added to the precision value */
44   public static final int FetchSystemTables = 8;
45   /** If table columns are needed, this value is added to the precision value */
46   public static final int FetchColumns = 16;
47
48   /**
49    * Returns true if the given dynamic precision requires the gathering of
50    * columns.
51    *
52    * @param dynamicPrecision the dynamic precision to check
53    * @return true if columns must be fetched
54    */

55   public static boolean fetchColumns(int dynamicPrecision)
56   {
57     return (dynamicPrecision & FetchColumns) == FetchColumns;
58   }
59
60   /**
61    * Returns true if the given dynamic precision requires the use of Stored
62    * Procedures.
63    *
64    * @param dynamicPrecision the dynamic precision to check
65    * @return true if stored procedures must be used
66    */

67   public static boolean fetchStoredProcedures(int dynamicPrecision)
68   {
69     return (dynamicPrecision & FetchStoredProcedures) == FetchStoredProcedures;
70   }
71
72   /**
73    * Returns true if the given dynamic precision requires the gathering of
74    * system tables.
75    *
76    * @param dynamicPrecision the dynamic precision to check
77    * @return true if system tables must be fetched
78    */

79   public static boolean fetchSystemTables(int dynamicPrecision)
80   {
81     return (dynamicPrecision & FetchSystemTables) == FetchSystemTables;
82   }
83
84   /**
85    * Returns true if the given dynamic precision requires the gathering of
86    * views.
87    *
88    * @param dynamicPrecision the dynamic precision to check
89    * @return true if views must be fetched
90    */

91   public static boolean fetchViews(int dynamicPrecision)
92   {
93     return (dynamicPrecision & FetchViews) == FetchViews;
94   }
95
96 }
Popular Tags