1 package org.apache.archiva.redback.rbac.ldap;
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.common.ldap.MappingException;
23 import java.util.List;
27 * will map ldap group to redback role
29 * @author Olivier Lamy
32 public interface LdapRoleMapper
35 * @param role redback role
36 * @return corresponding LDAP group
38 String getLdapGroup( String role )
39 throws MappingException;
42 //String getLdapGroup( String role, String resource );
46 * @return all LDAP groups
48 List<String> getAllGroups()
49 throws MappingException;
53 * @return the base dn which contains all ldap groups
58 * @return the class used for group usually groupOfUniqueNames
60 String getLdapGroupClass();
63 * @param group ldap group
64 * @return uids of group members
65 * @throws MappingException
67 List<String> getGroupsMember( String group )
68 throws MappingException;
70 List<String> getGroups( String username )
71 throws MappingException;
74 * add mapping redback role <-> ldap group
76 * @param role redback role
77 * @param ldapGroup ldap group
79 void addLdapMapping( String role, String ldapGroup )
80 throws MappingException;
85 * @param role redback role
87 void removeLdapMapping( String role )
88 throws MappingException;
91 * @return Map of corresponding Redback role (key) and LDAP group (value)
93 Map<String, String> getLdapGroupMappings()
94 throws MappingException;