This project has retired. For details please refer to its Attic page.
LdapController xref
View Javadoc

1   package org.apache.archiva.redback.users.ldap.ctl;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   * http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import org.apache.archiva.redback.common.ldap.user.LdapUser;
23  import org.apache.archiva.redback.users.User;
24  import org.apache.archiva.redback.common.ldap.MappingException;
25  import org.apache.archiva.redback.users.ldap.LdapUserQuery;
26  
27  import javax.naming.directory.DirContext;
28  import java.util.Collection;
29  import java.util.List;
30  import java.util.Map;
31  
32  /**
33   *
34   */
35  public interface LdapController
36  {
37  
38      void removeUser( String principal, DirContext context )
39          throws LdapControllerException;
40  
41      void updateUser( User user, DirContext context )
42          throws LdapControllerException, MappingException;
43  
44      boolean userExists( String key, DirContext context )
45          throws LdapControllerException;
46  
47      Collection<User> getUsers( DirContext context )
48          throws LdapControllerException, MappingException;
49  
50      void createUser( User user, DirContext context, boolean encodePasswordIfChanged )
51          throws LdapControllerException, MappingException;
52  
53      LdapUser getUser( String key, DirContext context )
54          throws LdapControllerException, MappingException;
55  
56      List<User> getUsersByQuery( LdapUserQuery query, DirContext context )
57          throws LdapControllerException, MappingException;
58  
59      void initialize();
60  
61      /**
62       * @param dirContext
63       * @return Map key == username and value == list of role names
64       * @throws LdapControllerException
65       */
66      Map<String, Collection<String>> findUsersWithRoles( DirContext dirContext )
67          throws LdapControllerException;
68  }