View Javadoc

1   /*
2    * Copyright (c) 2004 UNINETT FAS
3    *
4    * This program is free software; you can redistribute it and/or modify it
5    * under the terms of the GNU General Public License as published by the Free
6    * Software Foundation; either version 2 of the License, or (at your option)
7    * any later version.
8    *
9    * This program is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11   * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12   * more details.
13   *
14   * You should have received a copy of the GNU General Public License along with
15   * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
16   * Place - Suite 330, Boston, MA 02111-1307, USA.
17   *
18   */
19  
20  package no.feide.moria.directory.index;
21  
22  /***
23   * This is the interface used to access an underlying index implementation.
24   */
25  public interface DirectoryManagerIndex {
26  
27      /***
28       * Looks up one or more backend references from a given logical ID,
29       * typically a username.
30       * @param id
31       *            The logical ID.
32       * @return One or more backend references , or <code>null</code> if no
33       *         such reference was found.
34       */
35      IndexedReference[] getReferences(String id);
36  
37  
38      /***
39       * Return the related realm of a given logical ID, typically a username.
40       * @param id
41       *            The logical ID.
42       * @return The realm, or <code>null</code> if the realm could not be
43       *         resolved.
44       */
45      String getRealm(String id);
46  
47  
48      /***
49       * Return the username associated with a certain search base.
50       * @param base
51       *            The search base.
52       * @return The username. May be an empty string if <code>base</code> is
53       *         unknown.
54       */
55      String getUsername(String base);
56  
57  
58      /***
59       * Return the password associated with a certain search base.
60       * @param base
61       *            The search base.
62       * @return The password. May be an empty string if <code>base</code> is
63       *         unknown.
64       */
65      String getPassword(String base);
66  
67  }