KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > slide > content > AbstractContentInterceptor


1 /*
2  * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/content/AbstractContentInterceptor.java,v 1.5 2004/07/28 09:37:57 ib Exp $
3  * $Revision: 1.5 $
4  * $Date: 2004/07/28 09:37:57 $
5  *
6  * ====================================================================
7  *
8  * Copyright 1999-2002 The Apache Software Foundation
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  *
22  */

23
24 package org.apache.slide.content;
25
26 import java.util.Hashtable JavaDoc;
27 import org.apache.slide.common.NamespaceAccessToken;
28 import org.apache.slide.common.SlideToken;
29 import org.apache.slide.common.ServiceAccessException;
30 import org.apache.slide.lock.ObjectLockedException;
31 import org.apache.slide.security.AccessDeniedException;
32 import org.apache.slide.structure.LinkedObjectNotFoundException;
33 import org.apache.slide.structure.ObjectNotFoundException;
34
35 /**
36  * Provides a basic implementation of the <code>ContentInterceptor</code>
37  * interface.
38  *
39  * <p>
40  * This implementation does nothing but store the parameters and the
41  * NamespaceAccessToken, and provide empty implementations of the various
42  * hook methods. You can extend this class instead of implementing the
43  * <code>ContentInterceptor</code> interface directly, and only override
44  * the methods required for your specific interceptor to operate.
45  * </p>
46  *
47  */

48 public abstract class AbstractContentInterceptor
49     implements ContentInterceptor {
50     
51     
52     // ----------------------------------------------------- Instance Variables
53

54     
55     /**
56      * The namespace access token.
57      */

58     private NamespaceAccessToken nat;
59     
60     
61     /**
62      * Hashtable containing the configuration parameters.
63      */

64     private Hashtable JavaDoc parameters;
65     
66     
67     // ----------------------------------------------------------- Constructors
68

69     
70     /**
71      * Default constructor.
72      */

73     public AbstractContentInterceptor() {
74         
75     }
76     
77     
78     // -------------------------------------- ContentInterceptor Implementation
79

80     
81     /**
82      * Does nothing.
83      */

84     public void preStoreContent
85         (SlideToken token, NodeRevisionDescriptors revisionDescriptors,
86          NodeRevisionDescriptor revisionDescriptor,
87          NodeRevisionContent revisionContent)
88         throws AccessDeniedException, ObjectNotFoundException,
89                LinkedObjectNotFoundException, ObjectLockedException,
90                ServiceAccessException {
91         
92     }
93     
94     
95     /**
96      * Does nothing.
97      */

98     public void postStoreContent
99         (SlideToken token, NodeRevisionDescriptors revisionDescriptors,
100          NodeRevisionDescriptor revisionDescriptor,
101          NodeRevisionContent revisionContent)
102         throws AccessDeniedException, ObjectNotFoundException,
103                LinkedObjectNotFoundException, ObjectLockedException,
104                ServiceAccessException {
105         
106     }
107     
108     
109     /**
110      * Does nothing.
111      */

112     public void preRetrieveContent
113         (SlideToken token, NodeRevisionDescriptors revisionDescriptors,
114          NodeRevisionNumber revisionNumber,
115          NodeRevisionDescriptor revisionDescriptor)
116         throws AccessDeniedException, ObjectNotFoundException,
117                LinkedObjectNotFoundException, ObjectLockedException,
118                ServiceAccessException {
119         
120     }
121     
122     
123     /**
124      * Does nothing.
125      */

126     public void postRetrieveContent
127         (SlideToken token, NodeRevisionDescriptors revisionDescriptors,
128          NodeRevisionDescriptor revisionDescriptor,
129          NodeRevisionContent revisionContent)
130         throws AccessDeniedException, ObjectNotFoundException,
131                LinkedObjectNotFoundException, ObjectLockedException,
132                ServiceAccessException {
133         
134     }
135     
136     
137     /**
138      * Does nothing.
139      */

140     public void preRemoveContent
141         (SlideToken token, NodeRevisionDescriptors revisionDescriptors,
142          NodeRevisionDescriptor revisionDescriptor)
143         throws AccessDeniedException, ObjectNotFoundException,
144                LinkedObjectNotFoundException, ObjectLockedException,
145                ServiceAccessException {
146         
147     }
148     
149     
150     /**
151      * Does nothing.
152      */

153     public void postRemoveContent
154         (SlideToken token, NodeRevisionDescriptors revisionDescriptors,
155          NodeRevisionDescriptor revisionDescriptor)
156         throws AccessDeniedException, ObjectNotFoundException,
157                LinkedObjectNotFoundException, ObjectLockedException,
158                ServiceAccessException {
159         
160     }
161     
162     
163     /**
164      * Implemented to store the namespace access token as instance variable.
165      */

166     public void setNamespace
167         (NamespaceAccessToken nat) {
168         
169         this.nat = nat;
170     }
171     
172     
173     /**
174      * Implemented to store the parameter Hashtable as instance variable.
175      */

176     public void setParameters
177         (Hashtable JavaDoc parameters) {
178         
179         this.parameters = parameters;
180     }
181     
182     
183     // ------------------------------------------------------ Protected Methods
184

185     
186     /**
187      * Returns the namespace access token.
188      *
189      * @return the <code>NamespaceAccessToken</code> object, or
190      * <code>null</code> if the interceptor has not been initialized
191      */

192     protected NamespaceAccessToken getNamespace() {
193         
194         return nat;
195     }
196     
197     
198     /**
199      * Returns the value of the specified parameter.
200      *
201      * @param name name of the parameter to be retrieved
202      * @return value of the parameter, or <code>null</code> if the parameter
203      * was not provided
204      */

205     protected String JavaDoc getParameter
206         (String JavaDoc name) {
207         
208         return (String JavaDoc)parameters.get(name);
209     }
210     
211     
212     /**
213      * Returns a Hashtable containing the configuration parameters of the
214      * interceptor.
215      *
216      * @return configuration parameters of the interceptor, or
217      * <code>null</code> if the interceptor has not been initialized
218      */

219     protected Hashtable JavaDoc getParameters() {
220         
221         return parameters;
222     }
223     
224     
225 }
226
227
Popular Tags