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.backend;
21  
22  import org.jdom.Element;
23  
24  /***
25   * The interface to the backend factory.
26   */
27  public interface DirectoryManagerBackendFactory {
28  
29      /***
30       * Sets the backend factory configuration. Must be called before
31       * <code>createBackend()</code> is used.
32       * @param config
33       *            The backend configuration. See details for the actual backend
34       *            implementation used.
35       */
36      void setConfig(final Element config);
37  
38  
39      /***
40       * Creates a new instance of a proper directory manager backend.
41       * @param sessionTicket
42       *            The session ticket belonging to instances of
43       *            <code>DirectoryManagerBackend</code>. Used when logging.
44       *            The actual implementation of
45       *            <code>DirectoryManagerBackend</code> may choose to ignore
46       *            this value, if logging is not an issue. May be
47       *            <code>null</code> or an empty string.
48       * @return A new instance of the backend, tied to the proper reference.
49       */
50      DirectoryManagerBackend createBackend(final String sessionTicket);
51  
52  }