KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > dbforms > config > DbEventInterceptor


1 /*
2  * $Header: /cvsroot/jdbforms/dbforms/src/org/dbforms/config/DbEventInterceptor.java,v 1.9 2004/10/20 10:51:26 hkollmann Exp $
3  * $Revision: 1.9 $
4  * $Date: 2004/10/20 10:51:26 $
5  *
6  * DbForms - a Rapid Application Development Framework
7  * Copyright (C) 2001 Joachim Peer <joepeer@excite.com>
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22  */

23
24 package org.dbforms.config;
25
26 import java.util.Map JavaDoc;
27
28
29
30 /**
31  * <p>
32  * This interface intercepts Database Operations DbForms is about to perform
33  * </p>
34  *
35  * <p>
36  * As the names indicate
37  * </p>
38  * - the preXxx() methods get called before the respective database operation
39  * is performed, - the postXxx() methods get called after the operation was
40  * finished.
41  */

42 /**
43  * DOCUMENT ME!
44  *
45  * @author $author$
46  * @version $Revision: 1.9 $
47  */

48 public interface DbEventInterceptor {
49    /** DOCUMENT ME! */
50    public static final int PRE_INSERT = 0;
51
52    /** DOCUMENT ME! */
53    public static final int POST_INSERT = 1;
54
55    /** DOCUMENT ME! */
56    public static final int PRE_UPDATE = 2;
57
58    /** DOCUMENT ME! */
59    public static final int POST_UPDATE = 3;
60
61    /** DOCUMENT ME! */
62    public static final int PRE_DELETE = 4;
63
64    /** DOCUMENT ME! */
65    public static final int POST_DELETE = 5;
66
67    /** DOCUMENT ME! */
68    public static final int PRE_SELECT = 6;
69
70    /** DOCUMENT ME! */
71    public static final int POST_SELECT = 7;
72
73    /** DOCUMENT ME! */
74    public static final int PRE_ADDROW = 8;
75
76    /** DOCUMENT ME! */
77    public static final int POST_ADDROW = 9;
78
79    /** The constant defined for granting the operation */
80    public static final int GRANT_OPERATION = 0;
81
82    /** The constant defined for not granting the operation */
83    public static final int DENY_OPERATION = 1;
84
85    /**
86     * The constant defined for ignoring an operation after processing
87     * interceptors.
88     */

89    public static final int IGNORE_OPERATION = 2;
90
91    /**
92     * DOCUMENT ME!
93     *
94     * @param params DOCUMENT ME!
95     */

96    public void setParameterMap(Map JavaDoc params);
97
98
99    /**
100     * DOCUMENT ME!
101     *
102     * @return DOCUMENT ME!
103     */

104    public Map JavaDoc getParameterMap();
105
106
107    /**
108     * DOCUMENT ME!
109     *
110     * @param data DOCUMENT ME!
111     */

112    public void postAddRow(DbEventInterceptorData data);
113
114
115    /**
116     * DOCUMENT ME!
117     *
118     * @param data DOCUMENT ME!
119     */

120    public void postDelete(DbEventInterceptorData data);
121
122
123    /**
124     * DOCUMENT ME!
125     *
126     * @param data DOCUMENT ME!
127     */

128    public void postInsert(DbEventInterceptorData data);
129
130
131    /**
132     * DOCUMENT ME!
133     *
134     * @param data DOCUMENT ME!
135     */

136    public void postSelect(DbEventInterceptorData data);
137
138
139    /**
140     * DOCUMENT ME!
141     *
142     * @param data DOCUMENT ME!
143     */

144    public void postUpdate(DbEventInterceptorData data);
145
146
147    /**
148     * DOCUMENT ME!
149     *
150     * @param data DOCUMENT ME!
151     *
152     * @return DOCUMENT ME!
153     *
154     * @throws ValidationException DOCUMENT ME!
155     * @throws MultipleValidationException DOCUMENT ME!
156     */

157    public int preAddRow(DbEventInterceptorData data)
158                  throws ValidationException, MultipleValidationException;
159
160
161    /**
162     * DOCUMENT ME!
163     *
164     * @param data DOCUMENT ME!
165     *
166     * @return DOCUMENT ME!
167     *
168     * @throws ValidationException DOCUMENT ME!
169     * @throws MultipleValidationException DOCUMENT ME!
170     */

171    public int preDelete(DbEventInterceptorData data)
172                  throws ValidationException, MultipleValidationException;
173
174
175    /**
176     * DOCUMENT ME!
177     *
178     * @param data DOCUMENT ME!
179     *
180     * @return DOCUMENT ME!
181     *
182     * @throws ValidationException DOCUMENT ME!
183     * @throws MultipleValidationException DOCUMENT ME!
184     */

185    public int preInsert(DbEventInterceptorData data)
186                  throws ValidationException, MultipleValidationException;
187
188
189    /**
190     * DOCUMENT ME!
191     *
192     * @param data DOCUMENT ME!
193     *
194     * @return DOCUMENT ME!
195     *
196     * @throws ValidationException DOCUMENT ME!
197     * @throws MultipleValidationException DOCUMENT ME!
198     */

199    public int preSelect(DbEventInterceptorData data)
200                  throws ValidationException, MultipleValidationException;
201
202
203    /**
204     * DOCUMENT ME!
205     *
206     * @param data DOCUMENT ME!
207     *
208     * @return DOCUMENT ME!
209     *
210     * @throws ValidationException DOCUMENT ME!
211     * @throws MultipleValidationException DOCUMENT ME!
212     */

213    public int preUpdate(DbEventInterceptorData data)
214                  throws ValidationException, MultipleValidationException;
215 }
216
Popular Tags