001/*
002 * The contents of this file are subject to the terms of the Common Development and
003 * Distribution License (the License). You may not use this file except in compliance with the
004 * License.
005 *
006 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
007 * specific language governing permission and limitations under the License.
008 *
009 * When distributing Covered Software, include this CDDL Header Notice in each file and include
010 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
011 * Header, with the fields enclosed by brackets [] replaced by your own identifying
012 * information: "Portions Copyright [year] [name of copyright owner]".
013 *
014 * Copyright 2008 Sun Microsystems, Inc.
015 */
016package org.forgerock.opendj.server.config.server;
017
018
019
020import java.util.SortedSet;
021import org.forgerock.opendj.config.Configuration;
022import org.forgerock.opendj.config.server.ConfigurationChangeListener;
023import org.forgerock.opendj.ldap.DN;
024import org.forgerock.opendj.server.config.meta.BackendCfgDefn.WritabilityMode;
025
026
027
028/**
029 * A server-side interface for querying Backend settings.
030 * <p>
031 * Backends are responsible for providing access to the underlying
032 * data presented by the server.
033 */
034public interface BackendCfg extends Configuration {
035
036  /**
037   * Gets the configuration class associated with this Backend.
038   *
039   * @return Returns the configuration class associated with this Backend.
040   */
041  Class<? extends BackendCfg> configurationClass();
042
043
044
045  /**
046   * Register to be notified when this Backend is changed.
047   *
048   * @param listener
049   *          The Backend configuration change listener.
050   */
051  void addChangeListener(ConfigurationChangeListener<BackendCfg> listener);
052
053
054
055  /**
056   * Deregister an existing Backend configuration change listener.
057   *
058   * @param listener
059   *          The Backend configuration change listener.
060   */
061  void removeChangeListener(ConfigurationChangeListener<BackendCfg> listener);
062
063
064
065  /**
066   * Gets the "backend-id" property.
067   * <p>
068   * Specifies a name to identify the associated backend.
069   * <p>
070   * The name must be unique among all backends in the server. The
071   * backend ID may not be altered after the backend is created in the
072   * server.
073   *
074   * @return Returns the value of the "backend-id" property.
075   */
076  String getBackendId();
077
078
079
080  /**
081   * Gets the "base-dn" property.
082   * <p>
083   * Specifies the base DN(s) for the data that the backend handles.
084   * <p>
085   * A single backend may be responsible for one or more base DNs.
086   * Note that no two backends may have the same base DN although one
087   * backend may have a base DN that is below a base DN provided by
088   * another backend (similar to the use of sub-suffixes in the Sun
089   * Java System Directory Server). If any of the base DNs is
090   * subordinate to a base DN for another backend, then all base DNs
091   * for that backend must be subordinate to that same base DN.
092   *
093   * @return Returns an unmodifiable set containing the values of the "base-dn" property.
094   */
095  SortedSet<DN> getBaseDN();
096
097
098
099  /**
100   * Gets the "enabled" property.
101   * <p>
102   * Indicates whether the backend is enabled in the server.
103   * <p>
104   * If a backend is not enabled, then its contents are not accessible
105   * when processing operations.
106   *
107   * @return Returns the value of the "enabled" property.
108   */
109  boolean isEnabled();
110
111
112
113  /**
114   * Gets the "java-class" property.
115   * <p>
116   * Specifies the fully-qualified name of the Java class that
117   * provides the backend implementation.
118   *
119   * @return Returns the value of the "java-class" property.
120   */
121  String getJavaClass();
122
123
124
125  /**
126   * Gets the "writability-mode" property.
127   * <p>
128   * Specifies the behavior that the backend should use when
129   * processing write operations.
130   *
131   * @return Returns the value of the "writability-mode" property.
132   */
133  WritabilityMode getWritabilityMode();
134
135}