View Javadoc

1   /*
2    * $Header: /cvsroot/jdbforms/dbforms/src/org/dbforms/interfaces/IDbEventInterceptor.java,v 1.1 2005/11/29 19:18:37 hkollmann Exp $
3    * $Revision: 1.1 $
4    * $Date: 2005/11/29 19:18:37 $
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.interfaces;
25  
26  import java.util.Map;
27  
28  import org.dbforms.config.MultipleValidationException;
29  import org.dbforms.config.ValidationException;
30  
31  
32  
33  /***
34   * <p>
35   * This interface intercepts Database Operations DbForms is about to perform
36   * </p>
37   * 
38   * <p>
39   * As the names indicate
40   * </p>
41   * - the preXxx() methods get called before the respective database operation
42   * is performed, - the postXxx() methods get called after the operation was
43   * finished.
44   */
45  /***
46   * DOCUMENT ME!
47   *
48   * @author $author$
49   * @version $Revision: 1.1 $
50   */
51  public interface IDbEventInterceptor {
52     /*** DOCUMENT ME! */
53     public static final int PRE_INSERT = 0;
54  
55     /*** DOCUMENT ME! */
56     public static final int POST_INSERT = 1;
57  
58     /*** DOCUMENT ME! */
59     public static final int PRE_UPDATE = 2;
60  
61     /*** DOCUMENT ME! */
62     public static final int POST_UPDATE = 3;
63  
64     /*** DOCUMENT ME! */
65     public static final int PRE_DELETE = 4;
66  
67     /*** DOCUMENT ME! */
68     public static final int POST_DELETE = 5;
69  
70     /*** DOCUMENT ME! */
71     public static final int PRE_SELECT = 6;
72  
73     /*** DOCUMENT ME! */
74     public static final int POST_SELECT = 7;
75  
76     /*** DOCUMENT ME! */
77     public static final int PRE_ADDROW = 8;
78  
79     /*** DOCUMENT ME! */
80     public static final int POST_ADDROW = 9;
81  
82     /*** The constant defined for granting the operation */
83     public static final int GRANT_OPERATION = 0;
84  
85     /*** The constant defined for not granting the operation */
86     public static final int DENY_OPERATION = 1;
87  
88     /***
89      * The constant defined for ignoring an operation after processing
90      * interceptors.
91      */
92     public static final int IGNORE_OPERATION = 2;
93  
94     /***
95      * DOCUMENT ME!
96      *
97      * @param params DOCUMENT ME!
98      */
99     public void setParameterMap(Map params);
100 
101 
102    /***
103     * DOCUMENT ME!
104     *
105     * @return DOCUMENT ME!
106     */
107    public Map getParameterMap();
108 
109 
110    /***
111     * DOCUMENT ME!
112     *
113     * @param data DOCUMENT ME!
114     */
115    public void postAddRow(DbEventInterceptorData data);
116 
117 
118    /***
119     * DOCUMENT ME!
120     *
121     * @param data DOCUMENT ME!
122     */
123    public void postDelete(DbEventInterceptorData data);
124 
125 
126    /***
127     * DOCUMENT ME!
128     *
129     * @param data DOCUMENT ME!
130     */
131    public void postInsert(DbEventInterceptorData data);
132 
133 
134    /***
135     * DOCUMENT ME!
136     *
137     * @param data DOCUMENT ME!
138     */
139    public void postSelect(DbEventInterceptorData data);
140 
141 
142    /***
143     * DOCUMENT ME!
144     *
145     * @param data DOCUMENT ME!
146     */
147    public void postUpdate(DbEventInterceptorData data);
148 
149 
150    /***
151     * DOCUMENT ME!
152     *
153     * @param data DOCUMENT ME!
154     *
155     * @return DOCUMENT ME!
156     *
157     * @throws ValidationException DOCUMENT ME!
158     * @throws MultipleValidationException DOCUMENT ME!
159     */
160    public int preAddRow(DbEventInterceptorData data)
161                  throws ValidationException, MultipleValidationException;
162 
163 
164    /***
165     * DOCUMENT ME!
166     *
167     * @param data DOCUMENT ME!
168     *
169     * @return DOCUMENT ME!
170     *
171     * @throws ValidationException DOCUMENT ME!
172     * @throws MultipleValidationException DOCUMENT ME!
173     */
174    public int preDelete(DbEventInterceptorData data)
175                  throws ValidationException, MultipleValidationException;
176 
177 
178    /***
179     * DOCUMENT ME!
180     *
181     * @param data DOCUMENT ME!
182     *
183     * @return DOCUMENT ME!
184     *
185     * @throws ValidationException DOCUMENT ME!
186     * @throws MultipleValidationException DOCUMENT ME!
187     */
188    public int preInsert(DbEventInterceptorData data)
189                  throws ValidationException, MultipleValidationException;
190 
191 
192    /***
193     * DOCUMENT ME!
194     *
195     * @param data DOCUMENT ME!
196     *
197     * @return DOCUMENT ME!
198     *
199     * @throws ValidationException DOCUMENT ME!
200     * @throws MultipleValidationException DOCUMENT ME!
201     */
202    public int preSelect(DbEventInterceptorData data)
203                  throws ValidationException, MultipleValidationException;
204 
205 
206    /***
207     * DOCUMENT ME!
208     *
209     * @param data DOCUMENT ME!
210     *
211     * @return DOCUMENT ME!
212     *
213     * @throws ValidationException DOCUMENT ME!
214     * @throws MultipleValidationException DOCUMENT ME!
215     */
216    public int preUpdate(DbEventInterceptorData data)
217                  throws ValidationException, MultipleValidationException;
218 }