1 package org.apache.archiva.consumers.lucene.test;
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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
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.RBACManagerListener;
25 import org.apache.archiva.redback.rbac.RbacManagerException;
26 import org.apache.archiva.redback.rbac.RbacObjectInvalidException;
27 import org.apache.archiva.redback.rbac.RbacObjectNotFoundException;
28 import org.apache.archiva.redback.rbac.Resource;
29 import org.apache.archiva.redback.rbac.Role;
30 import org.apache.archiva.redback.rbac.UserAssignment;
31 import org.springframework.stereotype.Service;
33 import java.util.Collection;
34 import java.util.List;
39 * @author Olivier Lamy
41 @Service("rbacManager#cached")
42 public class TestRBACManager implements RBACManager
46 public void initialize()
52 public boolean isFinalImplementation()
58 public String getDescriptionKey()
60 return "archiva.redback.rbacmanager.test";
64 public void addListener( RBACManagerListener listener )
70 public void removeListener( RBACManagerListener listener )
76 public Role createRole( String name )
82 public Role createRole( String id, String name )
88 public boolean roleExists( String name )
94 public boolean roleExistsById( String id ) throws RbacManagerException
100 public boolean roleExists( Role role )
106 public Role saveRole( Role role )
107 throws RbacObjectInvalidException, RbacManagerException
113 public void saveRoles( Collection<Role> roles )
114 throws RbacObjectInvalidException, RbacManagerException
120 public Role getRole( String roleName )
121 throws RbacObjectNotFoundException, RbacManagerException
127 public Role getRoleById( String id ) throws RbacObjectNotFoundException, RbacManagerException
133 public Map<String, Role> getRoles( Collection<String> roleNames )
134 throws RbacObjectNotFoundException, RbacManagerException
136 return null; //To change body of implemented methods use File | Settings | File Templates.
140 public void addChildRole( Role role, Role childRole )
141 throws RbacObjectInvalidException, RbacManagerException
143 //To change body of implemented methods use File | Settings | File Templates.
147 public Map<String, Role> getChildRoles( Role role )
148 throws RbacManagerException
150 return null; //To change body of implemented methods use File | Settings | File Templates.
154 public Map<String, Role> getParentRoles( Role role )
155 throws RbacManagerException
157 return null; //To change body of implemented methods use File | Settings | File Templates.
161 public List<Role> getAllRoles()
162 throws RbacManagerException
164 return null; //To change body of implemented methods use File | Settings | File Templates.
168 public Set<Role> getEffectiveRoles( Role role )
169 throws RbacObjectNotFoundException, RbacManagerException
171 return null; //To change body of implemented methods use File | Settings | File Templates.
175 public void removeRole( Role role )
176 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
178 //To change body of implemented methods use File | Settings | File Templates.
182 public void removeRole( String roleName )
183 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
185 //To change body of implemented methods use File | Settings | File Templates.
189 public void removeRoleById( String id ) throws RbacObjectNotFoundException, RbacManagerException
195 public Permission createPermission( String name )
196 throws RbacManagerException
198 return null; //To change body of implemented methods use File | Settings | File Templates.
202 public Permission createPermission( String name, String operationName, String resourceIdentifier )
203 throws RbacManagerException
205 return null; //To change body of implemented methods use File | Settings | File Templates.
209 public boolean permissionExists( String name )
211 return false; //To change body of implemented methods use File | Settings | File Templates.
215 public boolean permissionExists( Permission permission )
217 return false; //To change body of implemented methods use File | Settings | File Templates.
221 public Permission savePermission( Permission permission )
222 throws RbacObjectInvalidException, RbacManagerException
224 return null; //To change body of implemented methods use File | Settings | File Templates.
228 public Permission getPermission( String permissionName )
229 throws RbacObjectNotFoundException, RbacManagerException
231 return null; //To change body of implemented methods use File | Settings | File Templates.
235 public List<Permission> getAllPermissions()
236 throws RbacManagerException
238 return null; //To change body of implemented methods use File | Settings | File Templates.
242 public void removePermission( Permission permission )
243 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
245 //To change body of implemented methods use File | Settings | File Templates.
249 public void removePermission( String permissionName )
250 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
252 //To change body of implemented methods use File | Settings | File Templates.
256 public Operation createOperation( String name )
257 throws RbacManagerException
259 return null; //To change body of implemented methods use File | Settings | File Templates.
263 public boolean operationExists( String name )
265 return false; //To change body of implemented methods use File | Settings | File Templates.
269 public boolean operationExists( Operation operation )
275 public Operation saveOperation( Operation operation )
276 throws RbacObjectInvalidException, RbacManagerException
282 public Operation getOperation( String operationName )
283 throws RbacObjectNotFoundException, RbacManagerException
289 public List<Operation> getAllOperations()
290 throws RbacManagerException
296 public void removeOperation( Operation operation )
297 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
302 public void removeOperation( String operationName )
303 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
308 public Resource createResource( String identifier )
309 throws RbacManagerException
315 public boolean resourceExists( String identifier )
317 return false; //To change body of implemented methods use File | Settings | File Templates.
321 public boolean resourceExists( Resource resource )
323 return false; //To change body of implemented methods use File | Settings | File Templates.
327 public Resource saveResource( Resource resource )
328 throws RbacObjectInvalidException, RbacManagerException
330 return null; //To change body of implemented methods use File | Settings | File Templates.
334 public Resource getResource( String resourceIdentifier )
335 throws RbacObjectNotFoundException, RbacManagerException
337 return null; //To change body of implemented methods use File | Settings | File Templates.
341 public List<Resource> getAllResources()
342 throws RbacManagerException
344 return null; //To change body of implemented methods use File | Settings | File Templates.
348 public void removeResource( Resource resource )
349 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
351 //To change body of implemented methods use File | Settings | File Templates.
355 public void removeResource( String resourceIdentifier )
356 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
358 //To change body of implemented methods use File | Settings | File Templates.
362 public UserAssignment createUserAssignment( String principal )
363 throws RbacManagerException
365 return null; //To change body of implemented methods use File | Settings | File Templates.
369 public boolean userAssignmentExists( String principal )
371 return false; //To change body of implemented methods use File | Settings | File Templates.
375 public boolean userAssignmentExists( UserAssignment assignment )
377 return false; //To change body of implemented methods use File | Settings | File Templates.
381 public UserAssignment saveUserAssignment( UserAssignment userAssignment )
382 throws RbacObjectInvalidException, RbacManagerException
384 return null; //To change body of implemented methods use File | Settings | File Templates.
388 public UserAssignment getUserAssignment( String principal )
389 throws RbacObjectNotFoundException, RbacManagerException
391 return null; //To change body of implemented methods use File | Settings | File Templates.
395 public List<UserAssignment> getAllUserAssignments()
396 throws RbacManagerException
398 return null; //To change body of implemented methods use File | Settings | File Templates.
402 public List<UserAssignment> getUserAssignmentsForRoles( Collection<String> roleNames )
403 throws RbacManagerException
405 return null; //To change body of implemented methods use File | Settings | File Templates.
409 public void removeUserAssignment( UserAssignment userAssignment )
410 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
412 //To change body of implemented methods use File | Settings | File Templates.
416 public void removeUserAssignment( String principal )
417 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
419 //To change body of implemented methods use File | Settings | File Templates.
423 public Collection<Role> getAssignedRoles( String principal )
424 throws RbacObjectNotFoundException, RbacManagerException
426 return null; //To change body of implemented methods use File | Settings | File Templates.
430 public Collection<Role> getAssignedRoles( UserAssignment userAssignment )
431 throws RbacObjectNotFoundException, RbacManagerException
433 return null; //To change body of implemented methods use File | Settings | File Templates.
437 public Collection<Role> getEffectivelyUnassignedRoles( String principal )
438 throws RbacManagerException, RbacObjectNotFoundException
440 return null; //To change body of implemented methods use File | Settings | File Templates.
444 public Collection<Role> getEffectivelyAssignedRoles( String principal )
445 throws RbacObjectNotFoundException, RbacManagerException
447 return null; //To change body of implemented methods use File | Settings | File Templates.
451 public Collection<Role> getUnassignedRoles( String principal )
452 throws RbacManagerException, RbacObjectNotFoundException
454 return null; //To change body of implemented methods use File | Settings | File Templates.
458 public Set<Permission> getAssignedPermissions( String principal )
459 throws RbacObjectNotFoundException, RbacManagerException
461 return null; //To change body of implemented methods use File | Settings | File Templates.
465 public Map<String, List<? extends Permission>> getAssignedPermissionMap( String principal )
466 throws RbacObjectNotFoundException, RbacManagerException
468 return null; //To change body of implemented methods use File | Settings | File Templates.
472 public List<Role> getAllAssignableRoles()
473 throws RbacManagerException, RbacObjectNotFoundException
475 return null; //To change body of implemented methods use File | Settings | File Templates.
479 public Resource getGlobalResource()
480 throws RbacManagerException
482 return null; //To change body of implemented methods use File | Settings | File Templates.
486 public void eraseDatabase()
488 //To change body of implemented methods use File | Settings | File Templates.
492 public boolean isReadOnly()