1 package org.apache.archiva.redback.common.ldap.role;
2 /*
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
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
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
18 * under the License.
19 */
20
21 import org.apache.archiva.redback.common.ldap.MappingException;
22
23 import java.util.Collection;
24 import java.util.List;
25 import java.util.Map;
26
27 /**
28 * @author Olivier Lamy
29 * @since 2.1
30 */
31 public interface LdapRoleMapperConfiguration
32 {
33 /**
34 * add mapping ldap group <-> redback roles
35 *
36 * @param roles list of Role names
37 * @param ldapGroup ldap group
38 */
39 void addLdapMapping( String ldapGroup, List<String> roles )
40 throws MappingException;
41
42 /**
43 * update an existing mapping
44 * @param ldapGroup
45 * @param roles
46 * @throws MappingException
47 */
48 void updateLdapMapping( String ldapGroup, List<String> roles )
49 throws MappingException;
50
51 /**
52 * remove a mapping
53 *
54 * @param group ldap group
55 */
56 void removeLdapMapping( String group )
57 throws MappingException;
58
59 /**
60 * @return Map of corresponding LDAP group (key) and Redback roles (value)
61 */
62 Map<String, Collection<String>> getLdapGroupMappings()
63 throws MappingException;
64
65 void setLdapGroupMappings( Map<String, List<String>> mappings )
66 throws MappingException;
67 }