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.codehaus.plexus.redback.rbac.Operation;
22 import org.codehaus.plexus.redback.rbac.Permission;
23 import org.codehaus.plexus.redback.rbac.RBACManager;
24 import org.codehaus.plexus.redback.rbac.RBACManagerListener;
25 import org.codehaus.plexus.redback.rbac.RbacManagerException;
26 import org.codehaus.plexus.redback.rbac.RbacObjectInvalidException;
27 import org.codehaus.plexus.redback.rbac.RbacObjectNotFoundException;
28 import org.codehaus.plexus.redback.rbac.Resource;
29 import org.codehaus.plexus.redback.rbac.Role;
30 import org.codehaus.plexus.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
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 )
200 return false; //To change body of implemented methods use File | Settings | File Templates.
203 public Operation saveOperation( Operation operation )
204 throws RbacObjectInvalidException, RbacManagerException
206 return null; //To change body of implemented methods use File | Settings | File Templates.
209 public Operation getOperation( String operationName )
210 throws RbacObjectNotFoundException, RbacManagerException
212 return null; //To change body of implemented methods use File | Settings | File Templates.
215 public List<Operation> getAllOperations()
216 throws RbacManagerException
218 return null; //To change body of implemented methods use File | Settings | File Templates.
221 public void removeOperation( Operation operation )
222 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
224 //To change body of implemented methods use File | Settings | File Templates.
227 public void removeOperation( String operationName )
228 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
230 //To change body of implemented methods use File | Settings | File Templates.
233 public Resource createResource( String identifier )
234 throws RbacManagerException
236 return null; //To change body of implemented methods use File | Settings | File Templates.
239 public boolean resourceExists( String identifier )
241 return false; //To change body of implemented methods use File | Settings | File Templates.
244 public boolean resourceExists( Resource resource )
246 return false; //To change body of implemented methods use File | Settings | File Templates.
249 public Resource saveResource( Resource resource )
250 throws RbacObjectInvalidException, RbacManagerException
252 return null; //To change body of implemented methods use File | Settings | File Templates.
255 public Resource getResource( String resourceIdentifier )
256 throws RbacObjectNotFoundException, RbacManagerException
258 return null; //To change body of implemented methods use File | Settings | File Templates.
261 public List<Resource> getAllResources()
262 throws RbacManagerException
264 return null; //To change body of implemented methods use File | Settings | File Templates.
267 public void removeResource( Resource resource )
268 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
270 //To change body of implemented methods use File | Settings | File Templates.
273 public void removeResource( String resourceIdentifier )
274 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
276 //To change body of implemented methods use File | Settings | File Templates.
279 public UserAssignment createUserAssignment( String principal )
280 throws RbacManagerException
282 return null; //To change body of implemented methods use File | Settings | File Templates.
285 public boolean userAssignmentExists( String principal )
287 return false; //To change body of implemented methods use File | Settings | File Templates.
290 public boolean userAssignmentExists( UserAssignment assignment )
292 return false; //To change body of implemented methods use File | Settings | File Templates.
295 public UserAssignment saveUserAssignment( UserAssignment userAssignment )
296 throws RbacObjectInvalidException, RbacManagerException
298 return null; //To change body of implemented methods use File | Settings | File Templates.
301 public UserAssignment getUserAssignment( String principal )
302 throws RbacObjectNotFoundException, RbacManagerException
304 return null; //To change body of implemented methods use File | Settings | File Templates.
307 public List<UserAssignment> getAllUserAssignments()
308 throws RbacManagerException
310 return null; //To change body of implemented methods use File | Settings | File Templates.
313 public List<UserAssignment> getUserAssignmentsForRoles( Collection<String> roleNames )
314 throws RbacManagerException
316 return null; //To change body of implemented methods use File | Settings | File Templates.
319 public void removeUserAssignment( UserAssignment userAssignment )
320 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
322 //To change body of implemented methods use File | Settings | File Templates.
325 public void removeUserAssignment( String principal )
326 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
328 //To change body of implemented methods use File | Settings | File Templates.
331 public Collection<Role> getAssignedRoles( String principal )
332 throws RbacObjectNotFoundException, RbacManagerException
334 return null; //To change body of implemented methods use File | Settings | File Templates.
337 public Collection<Role> getAssignedRoles( UserAssignment userAssignment )
338 throws RbacObjectNotFoundException, RbacManagerException
340 return null; //To change body of implemented methods use File | Settings | File Templates.
343 public Collection<Role> getEffectivelyUnassignedRoles( String principal )
344 throws RbacManagerException, RbacObjectNotFoundException
346 return null; //To change body of implemented methods use File | Settings | File Templates.
349 public Collection<Role> getEffectivelyAssignedRoles( String principal )
350 throws RbacObjectNotFoundException, RbacManagerException
352 return null; //To change body of implemented methods use File | Settings | File Templates.
355 public Collection<Role> getUnassignedRoles( String principal )
356 throws RbacManagerException, RbacObjectNotFoundException
358 return null; //To change body of implemented methods use File | Settings | File Templates.
361 public Set<Permission> getAssignedPermissions( String principal )
362 throws RbacObjectNotFoundException, RbacManagerException
364 return null; //To change body of implemented methods use File | Settings | File Templates.
367 public Map<String, List<Permission>> getAssignedPermissionMap( String principal )
368 throws RbacObjectNotFoundException, RbacManagerException
370 return null; //To change body of implemented methods use File | Settings | File Templates.
373 public List<Role> getAllAssignableRoles()
374 throws RbacManagerException, RbacObjectNotFoundException
376 return null; //To change body of implemented methods use File | Settings | File Templates.
379 public Resource getGlobalResource()
380 throws RbacManagerException
382 return null; //To change body of implemented methods use File | Settings | File Templates.
385 public void eraseDatabase()
387 //To change body of implemented methods use File | Settings | File Templates.