KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > webman > acl > db > PolicyDBInterface


1 package de.webman.acl.db;
2
3 import de.webman.acl.db.queries.*;
4
5 /**
6  * $Header: /cvsroot/webman-cms/source/webman/de/webman/acl/db/PolicyDBInterface.java,v 1.1 2001/08/20 08:25:08 mischa Exp $
7  *
8  * Database interface for policies.
9  *
10  * @version 0.10
11  * @since 0.10
12  * @author © 2000 Team-Konzept
13  */

14 public class PolicyDBInterface
15     extends ObjectDBInterface
16 {
17
18     // Constants
19

20     /**
21      * The table name.
22      */

23     public static final String JavaDoc TABLE_NAME = "WM_POLICY";
24
25     /**
26      * The primary key name.
27      */

28     public static final String JavaDoc PRIMARY_KEY_NAME = "WM_POLICY_ID";
29
30     /**
31      * Column value constant.
32      */

33     public static final String JavaDoc MODE_ALLOW = "A";
34
35     /**
36      * Column value constant.
37      */

38     public static final String JavaDoc MODE_DENY = "D";
39
40     /**
41      * Selection class.
42      */

43     public static final Class JavaDoc WM_POLICY_SELECT_ALL = PolicySelectAll.class;
44
45     /**
46      * Selection class.
47      */

48     public static final Class JavaDoc WM_POLICY_SELECT_BY_USER = PolicySelectByUser.class;
49
50     /**
51      * Selection class.
52      */

53     public static final Class JavaDoc WM_POLICY_SELECT_BY_USER_CONTEXT = PolicySelectByUserContext.class;
54
55     /**
56      * Selection class.
57      */

58     public static final Class JavaDoc WM_POLICY_SELECT_BY_USER_CONTEXT_TYPE = PolicySelectByUserContextType.class;
59
60     /**
61      * Selection class.
62      */

63     public static final Class JavaDoc WM_POLICY_SELECT_BY_USER_CONTEXT_TYPE_REFERENCE = PolicySelectByUserContextTypeReference.class;
64
65     /**
66      * Selection class.
67      */

68     public static final Class JavaDoc WM_POLICY_SELECT_BY_USER_ROLE_CONTEXT_TYPE_REFERENCE = PolicySelectByUserRoleContextTypeReference.class;
69
70     /**
71      * Selection class.
72      */

73     public static final Class JavaDoc WM_POLICY_SELECT_BY_CONTENT_TREE = PolicySelectByContentTree.class;
74
75     /**
76      * Selection class.
77      */

78     public static final Class JavaDoc WM_POLICY_SELECT_BY_SITE_TREE = PolicySelectBySiteTree.class;
79
80     /**
81      * Selection class.
82      */

83     public static final Class JavaDoc WM_POLICY_SELECT_BY_ATOMIC_EVENT = PolicySelectByAtomicEvent.class;
84
85     /**
86      * Selection class.
87      */

88     public static final Class JavaDoc WM_POLICY_SELECT_BY_CONTENT_TREE_EVENT = PolicySelectByContentTreeEvent.class;
89
90     /**
91      * Selection class.
92      */

93     public static final Class JavaDoc WM_POLICY_SELECT_BY_SITE_TREE_EVENT = PolicySelectBySiteTreeEvent.class;
94
95     /**
96      * Singleton instance.
97      */

98     private static final PolicyDBInterface INSTANCE = new PolicyDBInterface();
99
100
101     // Constructors
102

103     /**
104      * Inhibits instantiation from outside.
105      */

106     private PolicyDBInterface ()
107     {
108         super(PolicyInsert.class,
109               PolicyUpdate.class,
110               PolicySelect.class,
111               PolicyDelete.class,
112               new Class JavaDoc[1],
113               new Class JavaDoc[1],
114               null);
115     }
116
117
118     // Instance
119

120     /**
121      * Returns the singleton instance of the database interface.
122      *
123      * @return the singleton instance of the database interface.
124      */

125     public static final PolicyDBInterface getInstance ()
126     {
127         return INSTANCE;
128     }
129
130
131     // Method implementations
132

133     /**
134      * Returns the name of the database table.
135      *
136      * @return the name of the database table.
137      */

138     public final String JavaDoc getTableName ()
139     {
140         return TABLE_NAME;
141     }
142
143     /**
144      * Returns the name of the primary key.
145      *
146      * @return the name of the primary key.
147      */

148     public final String JavaDoc getPrimaryKeyName ()
149     {
150         return PRIMARY_KEY_NAME;
151     }
152
153     /**
154      * Returns the name of the dependent key.
155      *
156      * @return the name of the dependent key.
157      */

158     public final String JavaDoc getDependentKeyName ()
159     {
160         return null;
161     }
162
163     /**
164      * Returns the query for selection of all objects.
165      *
166      * @return the query for selection of all objects.
167      */

168     public final Class JavaDoc getSelectAllQuery ()
169     {
170         return WM_POLICY_SELECT_ALL;
171     }
172
173     /**
174      * Returns the query for selection of all dependent objects.
175      *
176      * @return the query for selection of all dependent objects.
177      */

178     public final Class JavaDoc getSelectDependentQuery ()
179     {
180         return null;
181     }
182
183     /**
184      * Returns the query for insertion of all dependent objects.
185      *
186      * @return the query for insertion of all dependent objects.
187      */

188     public final Class JavaDoc getInsertDependentQuery ()
189     {
190         return null;
191     }
192
193 }
194
Popular Tags