View Javadoc
1   package org.apache.archiva.consumers.lucene.test;
2   /*
3    * Licensed to the Apache Software Foundation (ASF) under one
4    * or more contributor license agreements.  See the NOTICE file
5    * distributed with this work for additional information
6    * regarding copyright ownership.  The ASF licenses this file
7    * to you under the Apache License, Version 2.0 (the
8    * "License"); you may not use this file except in compliance
9    * with the License.  You may obtain a copy of the License at
10   *
11   *   http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing,
14   * software distributed under the License is distributed on an
15   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16   * KIND, either express or implied.  See the License for the
17   * specific language governing permissions and limitations
18   * under the License.
19   */
20  
21  import org.apache.archiva.redback.rbac.Operation;
22  import org.apache.archiva.redback.rbac.Permission;
23  import org.apache.archiva.redback.rbac.RBACManager;
24  import org.apache.archiva.redback.rbac.RbacManagerException;
25  import org.apache.archiva.redback.rbac.RbacObjectInvalidException;
26  import org.apache.archiva.redback.rbac.RbacObjectNotFoundException;
27  import org.apache.archiva.redback.rbac.Resource;
28  import org.apache.archiva.redback.rbac.Role;
29  import org.apache.archiva.redback.rbac.UserAssignment;
30  import org.apache.archiva.redback.rbac.RBACManagerListener;
31  import org.springframework.stereotype.Service;
32  
33  import java.util.Collection;
34  import java.util.List;
35  import java.util.Map;
36  import java.util.Set;
37  
38  /**
39   * @author Olivier Lamy
40   */
41  @Service("rbacManager#cached")
42  public class TestRBACManager implements RBACManager
43  {
44  
45      @Override
46      public void initialize()
47      {
48  
49      }
50  
51      @Override
52      public boolean isFinalImplementation()
53      {
54          return false;
55      }
56  
57      @Override
58      public String getDescriptionKey()
59      {
60          return "archiva.redback.rbacmanager.test";
61      }
62  
63      @Override
64      public void addListener( RBACManagerListener listener )
65      {
66  
67      }
68  
69      @Override
70      public void removeListener( RBACManagerListener listener )
71      {
72  
73      }
74  
75      @Override
76      public Role createRole( String name )
77      {
78          return null;
79      }
80  
81      @Override
82      public boolean roleExists( String name )
83      {
84          return false;
85      }
86  
87      @Override
88      public boolean roleExists( Role role )
89      {
90          return false;
91      }
92  
93      @Override
94      public Role saveRole( Role role )
95          throws RbacObjectInvalidException, RbacManagerException
96      {
97          return null;
98      }
99  
100     @Override
101     public void saveRoles( Collection<Role> roles )
102         throws RbacObjectInvalidException, RbacManagerException
103     {
104 
105     }
106 
107     @Override
108     public Role getRole( String roleName )
109         throws RbacObjectNotFoundException, RbacManagerException
110     {
111         return null;
112     }
113 
114     @Override
115     public Map<String, Role> getRoles( Collection<String> roleNames )
116         throws RbacObjectNotFoundException, RbacManagerException
117     {
118         return null;  //To change body of implemented methods use File | Settings | File Templates.
119     }
120 
121     @Override
122     public void addChildRole( Role role, Role childRole )
123         throws RbacObjectInvalidException, RbacManagerException
124     {
125         //To change body of implemented methods use File | Settings | File Templates.
126     }
127 
128     @Override
129     public Map<String, Role> getChildRoles( Role role )
130         throws RbacManagerException
131     {
132         return null;  //To change body of implemented methods use File | Settings | File Templates.
133     }
134 
135     @Override
136     public Map<String, Role> getParentRoles( Role role )
137         throws RbacManagerException
138     {
139         return null;  //To change body of implemented methods use File | Settings | File Templates.
140     }
141 
142     @Override
143     public List<Role> getAllRoles()
144         throws RbacManagerException
145     {
146         return null;  //To change body of implemented methods use File | Settings | File Templates.
147     }
148 
149     @Override
150     public Set<Role> getEffectiveRoles( Role role )
151         throws RbacObjectNotFoundException, RbacManagerException
152     {
153         return null;  //To change body of implemented methods use File | Settings | File Templates.
154     }
155 
156     @Override
157     public void removeRole( Role role )
158         throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
159     {
160         //To change body of implemented methods use File | Settings | File Templates.
161     }
162 
163     @Override
164     public void removeRole( String roleName )
165         throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
166     {
167         //To change body of implemented methods use File | Settings | File Templates.
168     }
169 
170     @Override
171     public Permission createPermission( String name )
172         throws RbacManagerException
173     {
174         return null;  //To change body of implemented methods use File | Settings | File Templates.
175     }
176 
177     @Override
178     public Permission createPermission( String name, String operationName, String resourceIdentifier )
179         throws RbacManagerException
180     {
181         return null;  //To change body of implemented methods use File | Settings | File Templates.
182     }
183 
184     @Override
185     public boolean permissionExists( String name )
186     {
187         return false;  //To change body of implemented methods use File | Settings | File Templates.
188     }
189 
190     @Override
191     public boolean permissionExists( Permission permission )
192     {
193         return false;  //To change body of implemented methods use File | Settings | File Templates.
194     }
195 
196     @Override
197     public Permission savePermission( Permission permission )
198         throws RbacObjectInvalidException, RbacManagerException
199     {
200         return null;  //To change body of implemented methods use File | Settings | File Templates.
201     }
202 
203     @Override
204     public Permission getPermission( String permissionName )
205         throws RbacObjectNotFoundException, RbacManagerException
206     {
207         return null;  //To change body of implemented methods use File | Settings | File Templates.
208     }
209 
210     @Override
211     public List<Permission> getAllPermissions()
212         throws RbacManagerException
213     {
214         return null;  //To change body of implemented methods use File | Settings | File Templates.
215     }
216 
217     @Override
218     public void removePermission( Permission permission )
219         throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
220     {
221         //To change body of implemented methods use File | Settings | File Templates.
222     }
223 
224     @Override
225     public void removePermission( String permissionName )
226         throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
227     {
228         //To change body of implemented methods use File | Settings | File Templates.
229     }
230 
231     @Override
232     public Operation createOperation( String name )
233         throws RbacManagerException
234     {
235         return null;  //To change body of implemented methods use File | Settings | File Templates.
236     }
237 
238     @Override
239     public boolean operationExists( String name )
240     {
241         return false;  //To change body of implemented methods use File | Settings | File Templates.
242     }
243 
244     @Override
245     public boolean operationExists( Operation operation )
246     {
247         return false;
248     }
249 
250     @Override
251     public Operation saveOperation( Operation operation )
252         throws RbacObjectInvalidException, RbacManagerException
253     {
254         return null;
255     }
256 
257     @Override
258     public Operation getOperation( String operationName )
259         throws RbacObjectNotFoundException, RbacManagerException
260     {
261         return null;
262     }
263 
264     @Override
265     public List<Operation> getAllOperations()
266         throws RbacManagerException
267     {
268         return null;
269     }
270 
271     @Override
272     public void removeOperation( Operation operation )
273         throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
274     {
275     }
276 
277     @Override
278     public void removeOperation( String operationName )
279         throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
280     {
281     }
282 
283     @Override
284     public Resource createResource( String identifier )
285         throws RbacManagerException
286     {
287         return null;
288     }
289 
290     @Override
291     public boolean resourceExists( String identifier )
292     {
293         return false;  //To change body of implemented methods use File | Settings | File Templates.
294     }
295 
296     @Override
297     public boolean resourceExists( Resource resource )
298     {
299         return false;  //To change body of implemented methods use File | Settings | File Templates.
300     }
301 
302     @Override
303     public Resource saveResource( Resource resource )
304         throws RbacObjectInvalidException, RbacManagerException
305     {
306         return null;  //To change body of implemented methods use File | Settings | File Templates.
307     }
308 
309     @Override
310     public Resource getResource( String resourceIdentifier )
311         throws RbacObjectNotFoundException, RbacManagerException
312     {
313         return null;  //To change body of implemented methods use File | Settings | File Templates.
314     }
315 
316     @Override
317     public List<Resource> getAllResources()
318         throws RbacManagerException
319     {
320         return null;  //To change body of implemented methods use File | Settings | File Templates.
321     }
322 
323     @Override
324     public void removeResource( Resource resource )
325         throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
326     {
327         //To change body of implemented methods use File | Settings | File Templates.
328     }
329 
330     @Override
331     public void removeResource( String resourceIdentifier )
332         throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
333     {
334         //To change body of implemented methods use File | Settings | File Templates.
335     }
336 
337     @Override
338     public UserAssignment createUserAssignment( String principal )
339         throws RbacManagerException
340     {
341         return null;  //To change body of implemented methods use File | Settings | File Templates.
342     }
343 
344     @Override
345     public boolean userAssignmentExists( String principal )
346     {
347         return false;  //To change body of implemented methods use File | Settings | File Templates.
348     }
349 
350     @Override
351     public boolean userAssignmentExists( UserAssignment assignment )
352     {
353         return false;  //To change body of implemented methods use File | Settings | File Templates.
354     }
355 
356     @Override
357     public UserAssignment saveUserAssignment( UserAssignment userAssignment )
358         throws RbacObjectInvalidException, RbacManagerException
359     {
360         return null;  //To change body of implemented methods use File | Settings | File Templates.
361     }
362 
363     @Override
364     public UserAssignment getUserAssignment( String principal )
365         throws RbacObjectNotFoundException, RbacManagerException
366     {
367         return null;  //To change body of implemented methods use File | Settings | File Templates.
368     }
369 
370     @Override
371     public List<UserAssignment> getAllUserAssignments()
372         throws RbacManagerException
373     {
374         return null;  //To change body of implemented methods use File | Settings | File Templates.
375     }
376 
377     @Override
378     public List<UserAssignment> getUserAssignmentsForRoles( Collection<String> roleNames )
379         throws RbacManagerException
380     {
381         return null;  //To change body of implemented methods use File | Settings | File Templates.
382     }
383 
384     @Override
385     public void removeUserAssignment( UserAssignment userAssignment )
386         throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
387     {
388         //To change body of implemented methods use File | Settings | File Templates.
389     }
390 
391     @Override
392     public void removeUserAssignment( String principal )
393         throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
394     {
395         //To change body of implemented methods use File | Settings | File Templates.
396     }
397 
398     @Override
399     public Collection<Role> getAssignedRoles( String principal )
400         throws RbacObjectNotFoundException, RbacManagerException
401     {
402         return null;  //To change body of implemented methods use File | Settings | File Templates.
403     }
404 
405     @Override
406     public Collection<Role> getAssignedRoles( UserAssignment userAssignment )
407         throws RbacObjectNotFoundException, RbacManagerException
408     {
409         return null;  //To change body of implemented methods use File | Settings | File Templates.
410     }
411 
412     @Override
413     public Collection<Role> getEffectivelyUnassignedRoles( String principal )
414         throws RbacManagerException, RbacObjectNotFoundException
415     {
416         return null;  //To change body of implemented methods use File | Settings | File Templates.
417     }
418 
419     @Override
420     public Collection<Role> getEffectivelyAssignedRoles( String principal )
421         throws RbacObjectNotFoundException, RbacManagerException
422     {
423         return null;  //To change body of implemented methods use File | Settings | File Templates.
424     }
425 
426     @Override
427     public Collection<Role> getUnassignedRoles( String principal )
428         throws RbacManagerException, RbacObjectNotFoundException
429     {
430         return null;  //To change body of implemented methods use File | Settings | File Templates.
431     }
432 
433     @Override
434     public Set<Permission> getAssignedPermissions( String principal )
435         throws RbacObjectNotFoundException, RbacManagerException
436     {
437         return null;  //To change body of implemented methods use File | Settings | File Templates.
438     }
439 
440     @Override
441     public Map<String, List<Permission>> getAssignedPermissionMap( String principal )
442         throws RbacObjectNotFoundException, RbacManagerException
443     {
444         return null;  //To change body of implemented methods use File | Settings | File Templates.
445     }
446 
447     @Override
448     public List<Role> getAllAssignableRoles()
449         throws RbacManagerException, RbacObjectNotFoundException
450     {
451         return null;  //To change body of implemented methods use File | Settings | File Templates.
452     }
453 
454     @Override
455     public Resource getGlobalResource()
456         throws RbacManagerException
457     {
458         return null;  //To change body of implemented methods use File | Settings | File Templates.
459     }
460 
461     @Override
462     public void eraseDatabase()
463     {
464         //To change body of implemented methods use File | Settings | File Templates.
465     }
466 
467     @Override
468     public boolean isReadOnly()
469     {
470         return false;
471     }
472 }