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.opends.server.admin.std.server;
017
018
019
020import org.forgerock.opendj.config.server.ConfigException;
021import org.opends.server.admin.server.ConfigurationAddListener;
022import org.opends.server.admin.server.ConfigurationChangeListener;
023import org.opends.server.admin.server.ConfigurationDeleteListener;
024import org.opends.server.admin.std.meta.BackendCfgDefn.WritabilityMode;
025
026
027
028/**
029 * A server-side interface for querying Pluggable Backend settings.
030 * <p>
031 * A Pluggable Backend stores application data in a pluggable
032 * database.
033 */
034public interface PluggableBackendCfg extends BackendCfg {
035
036  /**
037   * Gets the configuration class associated with this Pluggable Backend.
038   *
039   * @return Returns the configuration class associated with this Pluggable Backend.
040   */
041  Class<? extends PluggableBackendCfg> configurationClass();
042
043
044
045  /**
046   * Register to be notified when this Pluggable Backend is changed.
047   *
048   * @param listener
049   *          The Pluggable Backend configuration change listener.
050   */
051  void addPluggableChangeListener(ConfigurationChangeListener<PluggableBackendCfg> listener);
052
053
054
055  /**
056   * Deregister an existing Pluggable Backend configuration change listener.
057   *
058   * @param listener
059   *          The Pluggable Backend configuration change listener.
060   */
061  void removePluggableChangeListener(ConfigurationChangeListener<PluggableBackendCfg> listener);
062
063
064
065  /**
066   * Gets the "compact-encoding" property.
067   * <p>
068   * Indicates whether the backend should use a compact form when
069   * encoding entries by compressing the attribute descriptions and
070   * object class sets.
071   * <p>
072   * Note that this property applies only to the entries themselves
073   * and does not impact the index data.
074   *
075   * @return Returns the value of the "compact-encoding" property.
076   */
077  boolean isCompactEncoding();
078
079
080
081  /**
082   * Gets the "entries-compressed" property.
083   * <p>
084   * Indicates whether the backend should attempt to compress entries
085   * before storing them in the database.
086   * <p>
087   * Note that this property applies only to the entries themselves
088   * and does not impact the index data. Further, the effectiveness of
089   * the compression is based on the type of data contained in the
090   * entry.
091   *
092   * @return Returns the value of the "entries-compressed" property.
093   */
094  boolean isEntriesCompressed();
095
096
097
098  /**
099   * Gets the "index-entry-limit" property.
100   * <p>
101   * Specifies the maximum number of entries that is allowed to match
102   * a given index key before that particular index key is no longer
103   * maintained.
104   * <p>
105   * This property is analogous to the ALL IDs threshold in the Sun
106   * Java System Directory Server. Note that this is the default limit
107   * for the backend, and it may be overridden on a per-attribute
108   * basis.A value of 0 means there is no limit.
109   *
110   * @return Returns the value of the "index-entry-limit" property.
111   */
112  int getIndexEntryLimit();
113
114
115
116  /**
117   * Gets the "index-filter-analyzer-enabled" property.
118   * <p>
119   * Indicates whether to gather statistical information about the
120   * search filters processed by the directory server while evaluating
121   * the usage of indexes.
122   * <p>
123   * Analyzing indexes requires gathering search filter usage patterns
124   * from user requests, especially for values as specified in the
125   * filters and subsequently looking the status of those values into
126   * the index files. When a search requests is processed, internal or
127   * user generated, a first phase uses indexes to find potential
128   * entries to be returned. Depending on the search filter, if the
129   * index of one of the specified attributes matches too many entries
130   * (exceeds the index entry limit), the search becomes non-indexed.
131   * In any case, all entries thus gathered (or the entire DIT) are
132   * matched against the filter for actually returning the search
133   * result.
134   *
135   * @return Returns the value of the "index-filter-analyzer-enabled" property.
136   */
137  boolean isIndexFilterAnalyzerEnabled();
138
139
140
141  /**
142   * Gets the "index-filter-analyzer-max-filters" property.
143   * <p>
144   * The maximum number of search filter statistics to keep.
145   * <p>
146   * When the maximum number of search filter is reached, the least
147   * used one will be deleted.
148   *
149   * @return Returns the value of the "index-filter-analyzer-max-filters" property.
150   */
151  int getIndexFilterAnalyzerMaxFilters();
152
153
154
155  /**
156   * Gets the "preload-time-limit" property.
157   * <p>
158   * Specifies the length of time that the backend is allowed to spend
159   * "pre-loading" data when it is initialized.
160   * <p>
161   * The pre-load process is used to pre-populate the database cache,
162   * so that it can be more quickly available when the server is
163   * processing requests. A duration of zero means there is no
164   * pre-load.
165   *
166   * @return Returns the value of the "preload-time-limit" property.
167   */
168  long getPreloadTimeLimit();
169
170
171
172  /**
173   * Gets the "writability-mode" property.
174   * <p>
175   * Specifies the behavior that the backend should use when
176   * processing write operations.
177   *
178   * @return Returns the value of the "writability-mode" property.
179   */
180  WritabilityMode getWritabilityMode();
181
182
183
184  /**
185   * Lists the Backend Indexes.
186   *
187   * @return Returns an array containing the names of the
188   *         Backend Indexes.
189   */
190  String[] listBackendIndexes();
191
192
193
194  /**
195   * Gets the named Backend Index.
196   *
197   * @param name
198   *          The name of the Backend Index to retrieve.
199   * @return Returns the named Backend Index.
200   * @throws ConfigException
201   *           If the Backend Index could not be found or it
202   *           could not be successfully decoded.
203   */
204  BackendIndexCfg getBackendIndex(String name) throws ConfigException;
205
206
207
208  /**
209   * Registers to be notified when new Backend Indexes are added.
210   *
211   * @param listener
212   *          The Backend Index configuration add listener.
213   * @throws ConfigException
214   *          If the add listener could not be registered.
215   */
216  void addBackendIndexAddListener(ConfigurationAddListener<BackendIndexCfg> listener) throws ConfigException;
217
218
219
220  /**
221   * Deregisters an existing Backend Index configuration add listener.
222   *
223   * @param listener
224   *          The Backend Index configuration add listener.
225   */
226  void removeBackendIndexAddListener(ConfigurationAddListener<BackendIndexCfg> listener);
227
228
229
230  /**
231   * Registers to be notified when existing Backend Indexes are deleted.
232   *
233   * @param listener
234   *          The Backend Index configuration delete listener.
235   * @throws ConfigException
236   *          If the delete listener could not be registered.
237   */
238  void addBackendIndexDeleteListener(ConfigurationDeleteListener<BackendIndexCfg> listener) throws ConfigException;
239
240
241
242  /**
243   * Deregisters an existing Backend Index configuration delete listener.
244   *
245   * @param listener
246   *          The Backend Index configuration delete listener.
247   */
248  void removeBackendIndexDeleteListener(ConfigurationDeleteListener<BackendIndexCfg> listener);
249
250
251
252  /**
253   * Lists the Backend VLV Indexes.
254   *
255   * @return Returns an array containing the names of the
256   *         Backend VLV Indexes.
257   */
258  String[] listBackendVLVIndexes();
259
260
261
262  /**
263   * Gets the named Backend VLV Index.
264   *
265   * @param name
266   *          The name of the Backend VLV Index to retrieve.
267   * @return Returns the named Backend VLV Index.
268   * @throws ConfigException
269   *           If the Backend VLV Index could not be found or it
270   *           could not be successfully decoded.
271   */
272  BackendVLVIndexCfg getBackendVLVIndex(String name) throws ConfigException;
273
274
275
276  /**
277   * Registers to be notified when new Backend VLV Indexes are added.
278   *
279   * @param listener
280   *          The Backend VLV Index configuration add listener.
281   * @throws ConfigException
282   *          If the add listener could not be registered.
283   */
284  void addBackendVLVIndexAddListener(ConfigurationAddListener<BackendVLVIndexCfg> listener) throws ConfigException;
285
286
287
288  /**
289   * Deregisters an existing Backend VLV Index configuration add listener.
290   *
291   * @param listener
292   *          The Backend VLV Index configuration add listener.
293   */
294  void removeBackendVLVIndexAddListener(ConfigurationAddListener<BackendVLVIndexCfg> listener);
295
296
297
298  /**
299   * Registers to be notified when existing Backend VLV Indexes are deleted.
300   *
301   * @param listener
302   *          The Backend VLV Index configuration delete listener.
303   * @throws ConfigException
304   *          If the delete listener could not be registered.
305   */
306  void addBackendVLVIndexDeleteListener(ConfigurationDeleteListener<BackendVLVIndexCfg> listener) throws ConfigException;
307
308
309
310  /**
311   * Deregisters an existing Backend VLV Index configuration delete listener.
312   *
313   * @param listener
314   *          The Backend VLV Index configuration delete listener.
315   */
316  void removeBackendVLVIndexDeleteListener(ConfigurationDeleteListener<BackendVLVIndexCfg> listener);
317
318}