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 boolean roleExists( String name )
88 public boolean roleExists( Role role )
94 public Role saveRole( Role role )
95 throws RbacObjectInvalidException, RbacManagerException
101 public void saveRoles( Collection<Role> roles )
102 throws RbacObjectInvalidException, RbacManagerException
108 public Role getRole( String roleName )
109 throws RbacObjectNotFoundException, RbacManagerException
115 public Map<String, Role> getRoles( Collection<String> roleNames )
116 throws RbacObjectNotFoundException, RbacManagerException
118 return null; //To change body of implemented methods use File | Settings | File Templates.
122 public void addChildRole( Role role, Role childRole )
123 throws RbacObjectInvalidException, RbacManagerException
125 //To change body of implemented methods use File | Settings | File Templates.
129 public Map<String, Role> getChildRoles( Role role )
130 throws RbacManagerException
132 return null; //To change body of implemented methods use File | Settings | File Templates.
136 public Map<String, Role> getParentRoles( Role role )
137 throws RbacManagerException
139 return null; //To change body of implemented methods use File | Settings | File Templates.
143 public List<Role> getAllRoles()
144 throws RbacManagerException
146 return null; //To change body of implemented methods use File | Settings | File Templates.
150 public Set<Role> getEffectiveRoles( Role role )
151 throws RbacObjectNotFoundException, RbacManagerException
153 return null; //To change body of implemented methods use File | Settings | File Templates.
157 public void removeRole( Role role )
158 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
160 //To change body of implemented methods use File | Settings | File Templates.
164 public void removeRole( String roleName )
165 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
167 //To change body of implemented methods use File | Settings | File Templates.
171 public Permission createPermission( String name )
172 throws RbacManagerException
174 return null; //To change body of implemented methods use File | Settings | File Templates.
178 public Permission createPermission( String name, String operationName, String resourceIdentifier )
179 throws RbacManagerException
181 return null; //To change body of implemented methods use File | Settings | File Templates.
185 public boolean permissionExists( String name )
187 return false; //To change body of implemented methods use File | Settings | File Templates.
191 public boolean permissionExists( Permission permission )
193 return false; //To change body of implemented methods use File | Settings | File Templates.
197 public Permission savePermission( Permission permission )
198 throws RbacObjectInvalidException, RbacManagerException
200 return null; //To change body of implemented methods use File | Settings | File Templates.
204 public Permission getPermission( String permissionName )
205 throws RbacObjectNotFoundException, RbacManagerException
207 return null; //To change body of implemented methods use File | Settings | File Templates.
211 public List<Permission> getAllPermissions()
212 throws RbacManagerException
214 return null; //To change body of implemented methods use File | Settings | File Templates.
218 public void removePermission( Permission permission )
219 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
221 //To change body of implemented methods use File | Settings | File Templates.
225 public void removePermission( String permissionName )
226 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
228 //To change body of implemented methods use File | Settings | File Templates.
232 public Operation createOperation( String name )
233 throws RbacManagerException
235 return null; //To change body of implemented methods use File | Settings | File Templates.
239 public boolean operationExists( String name )
241 return false; //To change body of implemented methods use File | Settings | File Templates.
245 public boolean operationExists( Operation operation )
251 public Operation saveOperation( Operation operation )
252 throws RbacObjectInvalidException, RbacManagerException
258 public Operation getOperation( String operationName )
259 throws RbacObjectNotFoundException, RbacManagerException
265 public List<Operation> getAllOperations()
266 throws RbacManagerException
272 public void removeOperation( Operation operation )
273 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
278 public void removeOperation( String operationName )
279 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
284 public Resource createResource( String identifier )
285 throws RbacManagerException
291 public boolean resourceExists( String identifier )
293 return false; //To change body of implemented methods use File | Settings | File Templates.
297 public boolean resourceExists( Resource resource )
299 return false; //To change body of implemented methods use File | Settings | File Templates.
303 public Resource saveResource( Resource resource )
304 throws RbacObjectInvalidException, RbacManagerException
306 return null; //To change body of implemented methods use File | Settings | File Templates.
310 public Resource getResource( String resourceIdentifier )
311 throws RbacObjectNotFoundException, RbacManagerException
313 return null; //To change body of implemented methods use File | Settings | File Templates.
317 public List<Resource> getAllResources()
318 throws RbacManagerException
320 return null; //To change body of implemented methods use File | Settings | File Templates.
324 public void removeResource( Resource resource )
325 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
327 //To change body of implemented methods use File | Settings | File Templates.
331 public void removeResource( String resourceIdentifier )
332 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
334 //To change body of implemented methods use File | Settings | File Templates.
338 public UserAssignment createUserAssignment( String principal )
339 throws RbacManagerException
341 return null; //To change body of implemented methods use File | Settings | File Templates.
345 public boolean userAssignmentExists( String principal )
347 return false; //To change body of implemented methods use File | Settings | File Templates.
351 public boolean userAssignmentExists( UserAssignment assignment )
353 return false; //To change body of implemented methods use File | Settings | File Templates.
357 public UserAssignment saveUserAssignment( UserAssignment userAssignment )
358 throws RbacObjectInvalidException, RbacManagerException
360 return null; //To change body of implemented methods use File | Settings | File Templates.
364 public UserAssignment getUserAssignment( String principal )
365 throws RbacObjectNotFoundException, RbacManagerException
367 return null; //To change body of implemented methods use File | Settings | File Templates.
371 public List<UserAssignment> getAllUserAssignments()
372 throws RbacManagerException
374 return null; //To change body of implemented methods use File | Settings | File Templates.
378 public List<UserAssignment> getUserAssignmentsForRoles( Collection<String> roleNames )
379 throws RbacManagerException
381 return null; //To change body of implemented methods use File | Settings | File Templates.
385 public void removeUserAssignment( UserAssignment userAssignment )
386 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
388 //To change body of implemented methods use File | Settings | File Templates.
392 public void removeUserAssignment( String principal )
393 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
395 //To change body of implemented methods use File | Settings | File Templates.
399 public Collection<Role> getAssignedRoles( String principal )
400 throws RbacObjectNotFoundException, RbacManagerException
402 return null; //To change body of implemented methods use File | Settings | File Templates.
406 public Collection<Role> getAssignedRoles( UserAssignment userAssignment )
407 throws RbacObjectNotFoundException, RbacManagerException
409 return null; //To change body of implemented methods use File | Settings | File Templates.
413 public Collection<Role> getEffectivelyUnassignedRoles( String principal )
414 throws RbacManagerException, RbacObjectNotFoundException
416 return null; //To change body of implemented methods use File | Settings | File Templates.
420 public Collection<Role> getEffectivelyAssignedRoles( String principal )
421 throws RbacObjectNotFoundException, RbacManagerException
423 return null; //To change body of implemented methods use File | Settings | File Templates.
427 public Collection<Role> getUnassignedRoles( String principal )
428 throws RbacManagerException, RbacObjectNotFoundException
430 return null; //To change body of implemented methods use File | Settings | File Templates.
434 public Set<Permission> getAssignedPermissions( String principal )
435 throws RbacObjectNotFoundException, RbacManagerException
437 return null; //To change body of implemented methods use File | Settings | File Templates.
441 public Map<String, List<? extends Permission>> getAssignedPermissionMap( String principal )
442 throws RbacObjectNotFoundException, RbacManagerException
444 return null; //To change body of implemented methods use File | Settings | File Templates.
448 public List<Role> getAllAssignableRoles()
449 throws RbacManagerException, RbacObjectNotFoundException
451 return null; //To change body of implemented methods use File | Settings | File Templates.
455 public Resource getGlobalResource()
456 throws RbacManagerException
458 return null; //To change body of implemented methods use File | Settings | File Templates.
462 public void eraseDatabase()
464 //To change body of implemented methods use File | Settings | File Templates.
468 public boolean isReadOnly()