KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > tigris > scarab > test > mocks > MockSecurityService


1 package org.tigris.scarab.test.mocks;
2
3 /* ================================================================
4  * Copyright (c) 2000-2003 CollabNet. All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are
8  * met:
9  *
10  * 1. Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  *
13  * 2. Redistributions in binary form must reproduce the above copyright
14  * notice, this list of conditions and the following disclaimer in the
15  * documentation and/or other materials provided with the distribution.
16  *
17  * 3. The end-user documentation included with the redistribution, if
18  * any, must include the following acknowlegement: "This product includes
19  * software developed by CollabNet <http://www.collab.net/>."
20  * Alternately, this acknowlegement may appear in the software itself, if
21  * and wherever such third-party acknowlegements normally appear.
22  *
23  * 4. The hosted project names must not be used to endorse or promote
24  * products derived from this software without prior written
25  * permission. For written permission, please contact info@collab.net.
26  *
27  * 5. Products derived from this software may not use the "Tigris" or
28  * "Scarab" names nor may "Tigris" or "Scarab" appear in their names without
29  * prior written permission of CollabNet.
30  *
31  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
32  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
33  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
34  * IN NO EVENT SHALL COLLAB.NET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
35  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
37  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
38  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
39  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
40  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
41  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42  *
43  * ====================================================================
44  *
45  * This software consists of voluntary contributions made by many
46  * individuals on behalf of CollabNet.
47  */

48
49 import java.util.Map JavaDoc;
50
51 import org.apache.commons.configuration.BaseConfiguration;
52 import org.apache.commons.configuration.Configuration;
53 import org.apache.fulcrum.InitializationException;
54 import org.apache.fulcrum.ServiceBroker;
55 import org.apache.fulcrum.ServiceException;
56 import org.apache.fulcrum.security.SecurityService;
57 import org.apache.fulcrum.security.entity.Group;
58 import org.apache.fulcrum.security.entity.Permission;
59 import org.apache.fulcrum.security.entity.Role;
60 import org.apache.fulcrum.security.entity.User;
61 import org.apache.fulcrum.security.util.AccessControlList;
62 import org.apache.fulcrum.security.util.DataBackendException;
63 import org.apache.fulcrum.security.util.EntityExistsException;
64 import org.apache.fulcrum.security.util.GroupSet;
65 import org.apache.fulcrum.security.util.PasswordMismatchException;
66 import org.apache.fulcrum.security.util.PermissionSet;
67 import org.apache.fulcrum.security.util.RoleSet;
68 import org.apache.fulcrum.security.util.UnknownEntityException;
69 import org.apache.log4j.Category;
70 import org.apache.torque.util.Criteria;
71
72 /**
73  * @author Eric Pugh
74  *
75  */

76 public class MockSecurityService implements SecurityService {
77
78     private Configuration configuration;
79     public MockSecurityService() {
80         configuration = new BaseConfiguration();
81         configuration.addProperty("user.class","org.tigris.scarab.om.ScarabUserImpl");
82     }
83
84     public Class JavaDoc getUserClass() throws UnknownEntityException {
85         
86         return null;
87     }
88
89     public User getUserInstance() throws UnknownEntityException {
90         
91         return null;
92     }
93
94     public User getUserInstance(String JavaDoc userName) throws UnknownEntityException {
95         
96         return null;
97     }
98
99     public Class JavaDoc getGroupClass() throws UnknownEntityException {
100         
101         return null;
102     }
103
104     public Group getGroupInstance() throws UnknownEntityException {
105         
106         return null;
107     }
108
109     public Group getGroupInstance(String JavaDoc groupName) throws UnknownEntityException {
110         
111         return null;
112     }
113
114     public Class JavaDoc getPermissionClass() throws UnknownEntityException {
115         
116         return null;
117     }
118
119     public Permission getPermissionInstance() throws UnknownEntityException {
120         
121         return null;
122     }
123
124     public Permission getPermissionInstance(String JavaDoc permName) throws UnknownEntityException {
125         
126         return null;
127     }
128
129     public Class JavaDoc getRoleClass() throws UnknownEntityException {
130         
131         return null;
132     }
133
134     public Role getRoleInstance() throws UnknownEntityException {
135         
136         return null;
137     }
138
139     public Role getRoleInstance(String JavaDoc roleName) throws UnknownEntityException {
140         
141         return null;
142     }
143
144     public Class JavaDoc getAclClass() throws UnknownEntityException {
145         
146         return null;
147     }
148
149     public AccessControlList getAclInstance(Map JavaDoc roles, Map JavaDoc permissions) throws UnknownEntityException {
150         
151         return null;
152     }
153
154     public boolean accountExists(String JavaDoc userName) throws DataBackendException {
155         
156         return false;
157     }
158
159     public boolean accountExists(User user) throws DataBackendException {
160         
161         return false;
162     }
163
164     public User getAuthenticatedUser(String JavaDoc username, String JavaDoc password) throws DataBackendException,
165             UnknownEntityException, PasswordMismatchException {
166         
167         return null;
168     }
169
170     public User getUser(String JavaDoc username) throws DataBackendException, UnknownEntityException {
171         
172         return null;
173     }
174
175     public User[] getUsers(Criteria criteria) throws DataBackendException {
176         
177         return null;
178     }
179
180     public User getAnonymousUser() throws UnknownEntityException {
181         
182         return null;
183     }
184
185     public void saveUser(User user) throws UnknownEntityException, DataBackendException {
186         
187
188     }
189
190     public void addUser(User user, String JavaDoc password) throws DataBackendException, EntityExistsException {
191         
192
193     }
194
195     public void removeUser(User user) throws DataBackendException, UnknownEntityException {
196         
197
198     }
199
200     public String JavaDoc encryptPassword(String JavaDoc password) {
201         
202         return null;
203     }
204
205     public void changePassword(User user, String JavaDoc oldPassword, String JavaDoc newPassword) throws PasswordMismatchException,
206             UnknownEntityException, DataBackendException {
207         
208
209     }
210
211     public void forcePassword(User user, String JavaDoc password) throws UnknownEntityException, DataBackendException {
212         
213
214     }
215
216     public AccessControlList getACL(User user) throws DataBackendException, UnknownEntityException {
217         
218         return null;
219     }
220
221     public PermissionSet getPermissions(Role role) throws DataBackendException, UnknownEntityException {
222         
223         return null;
224     }
225
226     public void grant(User user, Group group, Role role) throws DataBackendException, UnknownEntityException {
227         
228
229     }
230
231     public void revoke(User user, Group group, Role role) throws DataBackendException, UnknownEntityException {
232         
233
234     }
235
236     public void revokeAll(User user) throws DataBackendException, UnknownEntityException {
237         
238
239     }
240
241     public void grant(Role role, Permission permission) throws DataBackendException, UnknownEntityException {
242         
243
244     }
245
246     public void revoke(Role role, Permission permission) throws DataBackendException, UnknownEntityException {
247         
248
249     }
250
251     public void revokeAll(Role role) throws DataBackendException, UnknownEntityException {
252         
253
254     }
255
256     public Group getGlobalGroup() {
257         
258         return null;
259     }
260
261     public Group getNewGroup(String JavaDoc groupName) {
262         
263         return null;
264     }
265
266     public Role getNewRole(String JavaDoc roleName) {
267         
268         return null;
269     }
270
271     public Permission getNewPermission(String JavaDoc permissionName) {
272         
273         return null;
274     }
275
276     public Group getGroup(String JavaDoc name) throws DataBackendException, UnknownEntityException {
277         
278         return null;
279     }
280
281     public Role getRole(String JavaDoc name) throws DataBackendException, UnknownEntityException {
282         
283         return null;
284     }
285
286     public Permission getPermission(String JavaDoc name) throws DataBackendException, UnknownEntityException {
287         
288         return null;
289     }
290
291     public GroupSet getGroups(Criteria criteria) throws DataBackendException {
292         
293         return null;
294     }
295
296     public RoleSet getRoles(Criteria criteria) throws DataBackendException {
297         
298         return null;
299     }
300
301     public PermissionSet getPermissions(Criteria criteria) throws DataBackendException {
302         
303         return null;
304     }
305
306     public GroupSet getAllGroups() throws DataBackendException {
307         
308         return null;
309     }
310
311     public RoleSet getAllRoles() throws DataBackendException {
312         
313         return null;
314     }
315
316     public PermissionSet getAllPermissions() throws DataBackendException {
317         
318         return null;
319     }
320
321     public void saveGroup(Group group) throws DataBackendException, UnknownEntityException {
322         
323
324     }
325
326     public void saveRole(Role role) throws DataBackendException, UnknownEntityException {
327         
328
329     }
330
331     public void savePermission(Permission permission) throws DataBackendException, UnknownEntityException {
332         
333
334     }
335
336     public Group addGroup(Group group) throws DataBackendException, EntityExistsException {
337         
338         return null;
339     }
340
341     public Role addRole(Role role) throws DataBackendException, EntityExistsException {
342         
343         return null;
344     }
345
346     public Permission addPermission(Permission permission) throws DataBackendException, EntityExistsException {
347         
348         return null;
349     }
350
351     public void removeGroup(Group group) throws DataBackendException, UnknownEntityException {
352         
353
354     }
355
356     public void removeRole(Role role) throws DataBackendException, UnknownEntityException {
357         
358
359     }
360
361     public void removePermission(Permission permission) throws DataBackendException, UnknownEntityException {
362         
363
364     }
365
366     public void renameGroup(Group group, String JavaDoc name) throws DataBackendException, UnknownEntityException {
367         
368
369     }
370
371     public void renameRole(Role role, String JavaDoc name) throws DataBackendException, UnknownEntityException {
372         
373
374     }
375
376     public void renamePermission(Permission permission, String JavaDoc name) throws DataBackendException,
377             UnknownEntityException {
378         
379
380     }
381
382     public void init() throws InitializationException {
383         
384
385     }
386
387     public void shutdown() {
388         
389
390     }
391
392     public boolean isInitialized() {
393         
394         return false;
395     }
396
397     public void setServiceBroker(ServiceBroker broker) {
398         
399
400     }
401
402     public void setName(String JavaDoc name) {
403         
404
405     }
406
407     public Configuration getConfiguration() {
408         return configuration;
409     }
410
411     public String JavaDoc getRealPath(String JavaDoc path) {
412         
413         return null;
414     }
415
416     public Category getCategory() {
417         
418         return null;
419     }
420
421     public String JavaDoc getStatus() throws ServiceException {
422         
423         return null;
424     }
425
426 }
427
Popular Tags