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.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;
33 import java.util.Collection;
34 import java.util.List;
39 * @author Olivier Lamy
41 @Service("rbacManager#cached")
42 public class TestRBACManager implements RBACManager
45 public void initialize()
47 //To change body of implemented methods use File | Settings | File Templates.
50 public void addListener( RBACManagerListener listener )
52 //To change body of implemented methods use File | Settings | File Templates.
55 public void removeListener( RBACManagerListener listener )
57 //To change body of implemented methods use File | Settings | File Templates.
60 public Role createRole( String name )
62 return null; //To change body of implemented methods use File | Settings | File Templates.
65 public boolean roleExists( String name )
67 return false; //To change body of implemented methods use File | Settings | File Templates.
70 public boolean roleExists( Role role )
72 return false; //To change body of implemented methods use File | Settings | File Templates.
75 public Role saveRole( Role role )
76 throws RbacObjectInvalidException, RbacManagerException
78 return null; //To change body of implemented methods use File | Settings | File Templates.
81 public void saveRoles( Collection<Role> roles )
82 throws RbacObjectInvalidException, RbacManagerException
84 //To change body of implemented methods use File | Settings | File Templates.
87 public Role getRole( String roleName )
88 throws RbacObjectNotFoundException, RbacManagerException
90 return null; //To change body of implemented methods use File | Settings | File Templates.
93 public Map<String, Role> getRoles( Collection<String> roleNames )
94 throws RbacObjectNotFoundException, RbacManagerException
96 return null; //To change body of implemented methods use File | Settings | File Templates.
99 public void addChildRole( Role role, Role childRole )
100 throws RbacObjectInvalidException, RbacManagerException
102 //To change body of implemented methods use File | Settings | File Templates.
105 public Map<String, Role> getChildRoles( Role role )
106 throws RbacManagerException
108 return null; //To change body of implemented methods use File | Settings | File Templates.
111 public Map<String, Role> getParentRoles( Role role )
112 throws RbacManagerException
114 return null; //To change body of implemented methods use File | Settings | File Templates.
117 public List<Role> getAllRoles()
118 throws RbacManagerException
120 return null; //To change body of implemented methods use File | Settings | File Templates.
123 public Set<Role> getEffectiveRoles( Role role )
124 throws RbacObjectNotFoundException, RbacManagerException
126 return null; //To change body of implemented methods use File | Settings | File Templates.
129 public void removeRole( Role role )
130 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
132 //To change body of implemented methods use File | Settings | File Templates.
135 public void removeRole( String roleName )
136 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
138 //To change body of implemented methods use File | Settings | File Templates.
141 public Permission createPermission( String name )
142 throws RbacManagerException
144 return null; //To change body of implemented methods use File | Settings | File Templates.
147 public Permission createPermission( String name, String operationName, String resourceIdentifier )
148 throws RbacManagerException
150 return null; //To change body of implemented methods use File | Settings | File Templates.
153 public boolean permissionExists( String name )
155 return false; //To change body of implemented methods use File | Settings | File Templates.
158 public boolean permissionExists( Permission permission )
160 return false; //To change body of implemented methods use File | Settings | File Templates.
163 public Permission savePermission( Permission permission )
164 throws RbacObjectInvalidException, RbacManagerException
166 return null; //To change body of implemented methods use File | Settings | File Templates.
169 public Permission getPermission( String permissionName )
170 throws RbacObjectNotFoundException, RbacManagerException
172 return null; //To change body of implemented methods use File | Settings | File Templates.
175 public List<Permission> getAllPermissions()
176 throws RbacManagerException
178 return null; //To change body of implemented methods use File | Settings | File Templates.
181 public void removePermission( Permission permission )
182 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
184 //To change body of implemented methods use File | Settings | File Templates.
187 public void removePermission( String permissionName )
188 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
190 //To change body of implemented methods use File | Settings | File Templates.
193 public Operation createOperation( String name )
194 throws RbacManagerException
196 return null; //To change body of implemented methods use File | Settings | File Templates.
199 public boolean operationExists( String name )
201 return false; //To change body of implemented methods use File | Settings | File Templates.
204 public boolean operationExists( Operation operation )
209 public Operation saveOperation( Operation operation )
210 throws RbacObjectInvalidException, RbacManagerException
215 public Operation getOperation( String operationName )
216 throws RbacObjectNotFoundException, RbacManagerException
221 public List<Operation> getAllOperations()
222 throws RbacManagerException
227 public void removeOperation( Operation operation )
228 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
232 public void removeOperation( String operationName )
233 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
237 public Resource createResource( String identifier )
238 throws RbacManagerException
243 public boolean resourceExists( String identifier )
245 return false; //To change body of implemented methods use File | Settings | File Templates.
248 public boolean resourceExists( Resource resource )
250 return false; //To change body of implemented methods use File | Settings | File Templates.
253 public Resource saveResource( Resource resource )
254 throws RbacObjectInvalidException, RbacManagerException
256 return null; //To change body of implemented methods use File | Settings | File Templates.
259 public Resource getResource( String resourceIdentifier )
260 throws RbacObjectNotFoundException, RbacManagerException
262 return null; //To change body of implemented methods use File | Settings | File Templates.
265 public List<Resource> getAllResources()
266 throws RbacManagerException
268 return null; //To change body of implemented methods use File | Settings | File Templates.
271 public void removeResource( Resource resource )
272 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
274 //To change body of implemented methods use File | Settings | File Templates.
277 public void removeResource( String resourceIdentifier )
278 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
280 //To change body of implemented methods use File | Settings | File Templates.
283 public UserAssignment createUserAssignment( String principal )
284 throws RbacManagerException
286 return null; //To change body of implemented methods use File | Settings | File Templates.
289 public boolean userAssignmentExists( String principal )
291 return false; //To change body of implemented methods use File | Settings | File Templates.
294 public boolean userAssignmentExists( UserAssignment assignment )
296 return false; //To change body of implemented methods use File | Settings | File Templates.
299 public UserAssignment saveUserAssignment( UserAssignment userAssignment )
300 throws RbacObjectInvalidException, RbacManagerException
302 return null; //To change body of implemented methods use File | Settings | File Templates.
305 public UserAssignment getUserAssignment( String principal )
306 throws RbacObjectNotFoundException, RbacManagerException
308 return null; //To change body of implemented methods use File | Settings | File Templates.
311 public List<UserAssignment> getAllUserAssignments()
312 throws RbacManagerException
314 return null; //To change body of implemented methods use File | Settings | File Templates.
317 public List<UserAssignment> getUserAssignmentsForRoles( Collection<String> roleNames )
318 throws RbacManagerException
320 return null; //To change body of implemented methods use File | Settings | File Templates.
323 public void removeUserAssignment( UserAssignment userAssignment )
324 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
326 //To change body of implemented methods use File | Settings | File Templates.
329 public void removeUserAssignment( String principal )
330 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
332 //To change body of implemented methods use File | Settings | File Templates.
335 public Collection<Role> getAssignedRoles( String principal )
336 throws RbacObjectNotFoundException, RbacManagerException
338 return null; //To change body of implemented methods use File | Settings | File Templates.
341 public Collection<Role> getAssignedRoles( UserAssignment userAssignment )
342 throws RbacObjectNotFoundException, RbacManagerException
344 return null; //To change body of implemented methods use File | Settings | File Templates.
347 public Collection<Role> getEffectivelyUnassignedRoles( String principal )
348 throws RbacManagerException, RbacObjectNotFoundException
350 return null; //To change body of implemented methods use File | Settings | File Templates.
353 public Collection<Role> getEffectivelyAssignedRoles( String principal )
354 throws RbacObjectNotFoundException, RbacManagerException
356 return null; //To change body of implemented methods use File | Settings | File Templates.
359 public Collection<Role> getUnassignedRoles( String principal )
360 throws RbacManagerException, RbacObjectNotFoundException
362 return null; //To change body of implemented methods use File | Settings | File Templates.
365 public Set<Permission> getAssignedPermissions( String principal )
366 throws RbacObjectNotFoundException, RbacManagerException
368 return null; //To change body of implemented methods use File | Settings | File Templates.
371 public Map<String, List<Permission>> getAssignedPermissionMap( String principal )
372 throws RbacObjectNotFoundException, RbacManagerException
374 return null; //To change body of implemented methods use File | Settings | File Templates.
377 public List<Role> getAllAssignableRoles()
378 throws RbacManagerException, RbacObjectNotFoundException
380 return null; //To change body of implemented methods use File | Settings | File Templates.
383 public Resource getGlobalResource()
384 throws RbacManagerException
386 return null; //To change body of implemented methods use File | Settings | File Templates.
389 public void eraseDatabase()
391 //To change body of implemented methods use File | Settings | File Templates.