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()
50 public boolean isFinalImplementation()
55 public String getDescriptionKey()
57 return "archiva.redback.rbacmanager.test";
60 public void addListener( RBACManagerListener listener )
65 public void removeListener( RBACManagerListener listener )
70 public Role createRole( String name )
75 public boolean roleExists( String name )
80 public boolean roleExists( Role role )
85 public Role saveRole( Role role )
86 throws RbacObjectInvalidException, RbacManagerException
91 public void saveRoles( Collection<Role> roles )
92 throws RbacObjectInvalidException, RbacManagerException
97 public Role getRole( String roleName )
98 throws RbacObjectNotFoundException, RbacManagerException
103 public Map<String, Role> getRoles( Collection<String> roleNames )
104 throws RbacObjectNotFoundException, RbacManagerException
106 return null; //To change body of implemented methods use File | Settings | File Templates.
109 public void addChildRole( Role role, Role childRole )
110 throws RbacObjectInvalidException, RbacManagerException
112 //To change body of implemented methods use File | Settings | File Templates.
115 public Map<String, Role> getChildRoles( Role role )
116 throws RbacManagerException
118 return null; //To change body of implemented methods use File | Settings | File Templates.
121 public Map<String, Role> getParentRoles( Role role )
122 throws RbacManagerException
124 return null; //To change body of implemented methods use File | Settings | File Templates.
127 public List<Role> getAllRoles()
128 throws RbacManagerException
130 return null; //To change body of implemented methods use File | Settings | File Templates.
133 public Set<Role> getEffectiveRoles( Role role )
134 throws RbacObjectNotFoundException, RbacManagerException
136 return null; //To change body of implemented methods use File | Settings | File Templates.
139 public void removeRole( Role role )
140 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
142 //To change body of implemented methods use File | Settings | File Templates.
145 public void removeRole( String roleName )
146 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
148 //To change body of implemented methods use File | Settings | File Templates.
151 public Permission createPermission( String name )
152 throws RbacManagerException
154 return null; //To change body of implemented methods use File | Settings | File Templates.
157 public Permission createPermission( String name, String operationName, String resourceIdentifier )
158 throws RbacManagerException
160 return null; //To change body of implemented methods use File | Settings | File Templates.
163 public boolean permissionExists( String name )
165 return false; //To change body of implemented methods use File | Settings | File Templates.
168 public boolean permissionExists( Permission permission )
170 return false; //To change body of implemented methods use File | Settings | File Templates.
173 public Permission savePermission( Permission permission )
174 throws RbacObjectInvalidException, RbacManagerException
176 return null; //To change body of implemented methods use File | Settings | File Templates.
179 public Permission getPermission( String permissionName )
180 throws RbacObjectNotFoundException, RbacManagerException
182 return null; //To change body of implemented methods use File | Settings | File Templates.
185 public List<Permission> getAllPermissions()
186 throws RbacManagerException
188 return null; //To change body of implemented methods use File | Settings | File Templates.
191 public void removePermission( Permission permission )
192 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
194 //To change body of implemented methods use File | Settings | File Templates.
197 public void removePermission( String permissionName )
198 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
200 //To change body of implemented methods use File | Settings | File Templates.
203 public Operation createOperation( String name )
204 throws RbacManagerException
206 return null; //To change body of implemented methods use File | Settings | File Templates.
209 public boolean operationExists( String name )
211 return false; //To change body of implemented methods use File | Settings | File Templates.
214 public boolean operationExists( Operation operation )
219 public Operation saveOperation( Operation operation )
220 throws RbacObjectInvalidException, RbacManagerException
225 public Operation getOperation( String operationName )
226 throws RbacObjectNotFoundException, RbacManagerException
231 public List<Operation> getAllOperations()
232 throws RbacManagerException
237 public void removeOperation( Operation operation )
238 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
242 public void removeOperation( String operationName )
243 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
247 public Resource createResource( String identifier )
248 throws RbacManagerException
253 public boolean resourceExists( String identifier )
255 return false; //To change body of implemented methods use File | Settings | File Templates.
258 public boolean resourceExists( Resource resource )
260 return false; //To change body of implemented methods use File | Settings | File Templates.
263 public Resource saveResource( Resource resource )
264 throws RbacObjectInvalidException, RbacManagerException
266 return null; //To change body of implemented methods use File | Settings | File Templates.
269 public Resource getResource( String resourceIdentifier )
270 throws RbacObjectNotFoundException, RbacManagerException
272 return null; //To change body of implemented methods use File | Settings | File Templates.
275 public List<Resource> getAllResources()
276 throws RbacManagerException
278 return null; //To change body of implemented methods use File | Settings | File Templates.
281 public void removeResource( Resource resource )
282 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
284 //To change body of implemented methods use File | Settings | File Templates.
287 public void removeResource( String resourceIdentifier )
288 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
290 //To change body of implemented methods use File | Settings | File Templates.
293 public UserAssignment createUserAssignment( String principal )
294 throws RbacManagerException
296 return null; //To change body of implemented methods use File | Settings | File Templates.
299 public boolean userAssignmentExists( String principal )
301 return false; //To change body of implemented methods use File | Settings | File Templates.
304 public boolean userAssignmentExists( UserAssignment assignment )
306 return false; //To change body of implemented methods use File | Settings | File Templates.
309 public UserAssignment saveUserAssignment( UserAssignment userAssignment )
310 throws RbacObjectInvalidException, RbacManagerException
312 return null; //To change body of implemented methods use File | Settings | File Templates.
315 public UserAssignment getUserAssignment( String principal )
316 throws RbacObjectNotFoundException, RbacManagerException
318 return null; //To change body of implemented methods use File | Settings | File Templates.
321 public List<UserAssignment> getAllUserAssignments()
322 throws RbacManagerException
324 return null; //To change body of implemented methods use File | Settings | File Templates.
327 public List<UserAssignment> getUserAssignmentsForRoles( Collection<String> roleNames )
328 throws RbacManagerException
330 return null; //To change body of implemented methods use File | Settings | File Templates.
333 public void removeUserAssignment( UserAssignment userAssignment )
334 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
336 //To change body of implemented methods use File | Settings | File Templates.
339 public void removeUserAssignment( String principal )
340 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
342 //To change body of implemented methods use File | Settings | File Templates.
345 public Collection<Role> getAssignedRoles( String principal )
346 throws RbacObjectNotFoundException, RbacManagerException
348 return null; //To change body of implemented methods use File | Settings | File Templates.
351 public Collection<Role> getAssignedRoles( UserAssignment userAssignment )
352 throws RbacObjectNotFoundException, RbacManagerException
354 return null; //To change body of implemented methods use File | Settings | File Templates.
357 public Collection<Role> getEffectivelyUnassignedRoles( String principal )
358 throws RbacManagerException, RbacObjectNotFoundException
360 return null; //To change body of implemented methods use File | Settings | File Templates.
363 public Collection<Role> getEffectivelyAssignedRoles( String principal )
364 throws RbacObjectNotFoundException, RbacManagerException
366 return null; //To change body of implemented methods use File | Settings | File Templates.
369 public Collection<Role> getUnassignedRoles( String principal )
370 throws RbacManagerException, RbacObjectNotFoundException
372 return null; //To change body of implemented methods use File | Settings | File Templates.
375 public Set<Permission> getAssignedPermissions( String principal )
376 throws RbacObjectNotFoundException, RbacManagerException
378 return null; //To change body of implemented methods use File | Settings | File Templates.
381 public Map<String, List<Permission>> getAssignedPermissionMap( String principal )
382 throws RbacObjectNotFoundException, RbacManagerException
384 return null; //To change body of implemented methods use File | Settings | File Templates.
387 public List<Role> getAllAssignableRoles()
388 throws RbacManagerException, RbacObjectNotFoundException
390 return null; //To change body of implemented methods use File | Settings | File Templates.
393 public Resource getGlobalResource()
394 throws RbacManagerException
396 return null; //To change body of implemented methods use File | Settings | File Templates.
399 public void eraseDatabase()
401 //To change body of implemented methods use File | Settings | File Templates.