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
44 public void addListener( RBACManagerListener listener )
46 //To change body of implemented methods use File | Settings | File Templates.
49 public void removeListener( RBACManagerListener listener )
51 //To change body of implemented methods use File | Settings | File Templates.
54 public Role createRole( String name )
56 return null; //To change body of implemented methods use File | Settings | File Templates.
59 public boolean roleExists( String name )
61 return false; //To change body of implemented methods use File | Settings | File Templates.
64 public boolean roleExists( Role role )
66 return false; //To change body of implemented methods use File | Settings | File Templates.
69 public Role saveRole( Role role )
70 throws RbacObjectInvalidException, RbacManagerException
72 return null; //To change body of implemented methods use File | Settings | File Templates.
75 public void saveRoles( Collection<Role> roles )
76 throws RbacObjectInvalidException, RbacManagerException
78 //To change body of implemented methods use File | Settings | File Templates.
81 public Role getRole( String roleName )
82 throws RbacObjectNotFoundException, RbacManagerException
84 return null; //To change body of implemented methods use File | Settings | File Templates.
87 public Map<String, Role> getRoles( Collection<String> roleNames )
88 throws RbacObjectNotFoundException, RbacManagerException
90 return null; //To change body of implemented methods use File | Settings | File Templates.
93 public void addChildRole( Role role, Role childRole )
94 throws RbacObjectInvalidException, RbacManagerException
96 //To change body of implemented methods use File | Settings | File Templates.
99 public Map<String, Role> getChildRoles( Role role )
100 throws RbacManagerException
102 return null; //To change body of implemented methods use File | Settings | File Templates.
105 public Map<String, Role> getParentRoles( Role role )
106 throws RbacManagerException
108 return null; //To change body of implemented methods use File | Settings | File Templates.
111 public List<Role> getAllRoles()
112 throws RbacManagerException
114 return null; //To change body of implemented methods use File | Settings | File Templates.
117 public Set<Role> getEffectiveRoles( Role role )
118 throws RbacObjectNotFoundException, RbacManagerException
120 return null; //To change body of implemented methods use File | Settings | File Templates.
123 public void removeRole( Role role )
124 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
126 //To change body of implemented methods use File | Settings | File Templates.
129 public void removeRole( String roleName )
130 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
132 //To change body of implemented methods use File | Settings | File Templates.
135 public Permission createPermission( String name )
136 throws RbacManagerException
138 return null; //To change body of implemented methods use File | Settings | File Templates.
141 public Permission createPermission( String name, String operationName, String resourceIdentifier )
142 throws RbacManagerException
144 return null; //To change body of implemented methods use File | Settings | File Templates.
147 public boolean permissionExists( String name )
149 return false; //To change body of implemented methods use File | Settings | File Templates.
152 public boolean permissionExists( Permission permission )
154 return false; //To change body of implemented methods use File | Settings | File Templates.
157 public Permission savePermission( Permission permission )
158 throws RbacObjectInvalidException, RbacManagerException
160 return null; //To change body of implemented methods use File | Settings | File Templates.
163 public Permission getPermission( String permissionName )
164 throws RbacObjectNotFoundException, RbacManagerException
166 return null; //To change body of implemented methods use File | Settings | File Templates.
169 public List<Permission> getAllPermissions()
170 throws RbacManagerException
172 return null; //To change body of implemented methods use File | Settings | File Templates.
175 public void removePermission( Permission permission )
176 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
178 //To change body of implemented methods use File | Settings | File Templates.
181 public void removePermission( String permissionName )
182 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
184 //To change body of implemented methods use File | Settings | File Templates.
187 public Operation createOperation( String name )
188 throws RbacManagerException
190 return null; //To change body of implemented methods use File | Settings | File Templates.
193 public boolean operationExists( String name )
195 return false; //To change body of implemented methods use File | Settings | File Templates.
198 public boolean operationExists( Operation operation )
203 public Operation saveOperation( Operation operation )
204 throws RbacObjectInvalidException, RbacManagerException
209 public Operation getOperation( String operationName )
210 throws RbacObjectNotFoundException, RbacManagerException
215 public List<Operation> getAllOperations()
216 throws RbacManagerException
221 public void removeOperation( Operation operation )
222 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
226 public void removeOperation( String operationName )
227 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
231 public Resource createResource( String identifier )
232 throws RbacManagerException
237 public boolean resourceExists( String identifier )
239 return false; //To change body of implemented methods use File | Settings | File Templates.
242 public boolean resourceExists( Resource resource )
244 return false; //To change body of implemented methods use File | Settings | File Templates.
247 public Resource saveResource( Resource resource )
248 throws RbacObjectInvalidException, RbacManagerException
250 return null; //To change body of implemented methods use File | Settings | File Templates.
253 public Resource getResource( String resourceIdentifier )
254 throws RbacObjectNotFoundException, RbacManagerException
256 return null; //To change body of implemented methods use File | Settings | File Templates.
259 public List<Resource> getAllResources()
260 throws RbacManagerException
262 return null; //To change body of implemented methods use File | Settings | File Templates.
265 public void removeResource( Resource resource )
266 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
268 //To change body of implemented methods use File | Settings | File Templates.
271 public void removeResource( String resourceIdentifier )
272 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
274 //To change body of implemented methods use File | Settings | File Templates.
277 public UserAssignment createUserAssignment( String principal )
278 throws RbacManagerException
280 return null; //To change body of implemented methods use File | Settings | File Templates.
283 public boolean userAssignmentExists( String principal )
285 return false; //To change body of implemented methods use File | Settings | File Templates.
288 public boolean userAssignmentExists( UserAssignment assignment )
290 return false; //To change body of implemented methods use File | Settings | File Templates.
293 public UserAssignment saveUserAssignment( UserAssignment userAssignment )
294 throws RbacObjectInvalidException, RbacManagerException
296 return null; //To change body of implemented methods use File | Settings | File Templates.
299 public UserAssignment getUserAssignment( String principal )
300 throws RbacObjectNotFoundException, RbacManagerException
302 return null; //To change body of implemented methods use File | Settings | File Templates.
305 public List<UserAssignment> getAllUserAssignments()
306 throws RbacManagerException
308 return null; //To change body of implemented methods use File | Settings | File Templates.
311 public List<UserAssignment> getUserAssignmentsForRoles( Collection<String> roleNames )
312 throws RbacManagerException
314 return null; //To change body of implemented methods use File | Settings | File Templates.
317 public void removeUserAssignment( UserAssignment userAssignment )
318 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
320 //To change body of implemented methods use File | Settings | File Templates.
323 public void removeUserAssignment( String principal )
324 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
326 //To change body of implemented methods use File | Settings | File Templates.
329 public Collection<Role> getAssignedRoles( String principal )
330 throws RbacObjectNotFoundException, RbacManagerException
332 return null; //To change body of implemented methods use File | Settings | File Templates.
335 public Collection<Role> getAssignedRoles( UserAssignment userAssignment )
336 throws RbacObjectNotFoundException, RbacManagerException
338 return null; //To change body of implemented methods use File | Settings | File Templates.
341 public Collection<Role> getEffectivelyUnassignedRoles( String principal )
342 throws RbacManagerException, RbacObjectNotFoundException
344 return null; //To change body of implemented methods use File | Settings | File Templates.
347 public Collection<Role> getEffectivelyAssignedRoles( String principal )
348 throws RbacObjectNotFoundException, RbacManagerException
350 return null; //To change body of implemented methods use File | Settings | File Templates.
353 public Collection<Role> getUnassignedRoles( String principal )
354 throws RbacManagerException, RbacObjectNotFoundException
356 return null; //To change body of implemented methods use File | Settings | File Templates.
359 public Set<Permission> getAssignedPermissions( String principal )
360 throws RbacObjectNotFoundException, RbacManagerException
362 return null; //To change body of implemented methods use File | Settings | File Templates.
365 public Map<String, List<Permission>> getAssignedPermissionMap( String principal )
366 throws RbacObjectNotFoundException, RbacManagerException
368 return null; //To change body of implemented methods use File | Settings | File Templates.
371 public List<Role> getAllAssignableRoles()
372 throws RbacManagerException, RbacObjectNotFoundException
374 return null; //To change body of implemented methods use File | Settings | File Templates.
377 public Resource getGlobalResource()
378 throws RbacManagerException
380 return null; //To change body of implemented methods use File | Settings | File Templates.
383 public void eraseDatabase()
385 //To change body of implemented methods use File | Settings | File Templates.