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