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 org.forgerock.opendj.config.server.ConfigException;
021import org.forgerock.opendj.config.server.ConfigurationAddListener;
022import org.forgerock.opendj.config.server.ConfigurationChangeListener;
023import org.forgerock.opendj.config.server.ConfigurationDeleteListener;
024import org.forgerock.opendj.server.config.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 "cipher-key-length" property.
067   * <p>
068   * Specifies the key length in bits for the preferred cipher.
069   *
070   * @return Returns the value of the "cipher-key-length" property.
071   */
072  int getCipherKeyLength();
073
074
075
076  /**
077   * Gets the "cipher-transformation" property.
078   * <p>
079   * Specifies the cipher for the directory server. The syntax is
080   * "algorithm/mode/padding".
081   * <p>
082   * The full transformation is required: specifying only an algorithm
083   * and allowing the cipher provider to supply the default mode and
084   * padding is not supported, because there is no guarantee these
085   * default values are the same among different implementations. Some
086   * cipher algorithms, including RC4 and ARCFOUR, do not have a mode
087   * or padding, and hence must be specified using NONE for the mode
088   * field and NoPadding for the padding field. For example,
089   * RC4/NONE/NoPadding.
090   *
091   * @return Returns the value of the "cipher-transformation" property.
092   */
093  String getCipherTransformation();
094
095
096
097  /**
098   * Gets the "compact-encoding" property.
099   * <p>
100   * Indicates whether the backend should use a compact form when
101   * encoding entries by compressing the attribute descriptions and
102   * object class sets.
103   * <p>
104   * Note that this property applies only to the entries themselves
105   * and does not impact the index data.
106   *
107   * @return Returns the value of the "compact-encoding" property.
108   */
109  boolean isCompactEncoding();
110
111
112
113  /**
114   * Gets the "confidentiality-enabled" property.
115   * <p>
116   * Indicates whether the backend should make entries in database
117   * files readable only by Directory Server.
118   * <p>
119   * Confidentiality is achieved by enrypting entries before writing
120   * them to the underlying storage. Entry encryption will protect data
121   * on disk from unauthorised parties reading the files; for complete
122   * protection, also set confidentiality for sensitive attributes
123   * indexes. The property cannot be set to false if some of the
124   * indexes have confidentiality set to true.
125   *
126   * @return Returns the value of the "confidentiality-enabled" property.
127   */
128  boolean isConfidentialityEnabled();
129
130
131
132  /**
133   * Gets the "entries-compressed" property.
134   * <p>
135   * Indicates whether the backend should attempt to compress entries
136   * before storing them in the database.
137   * <p>
138   * Note that this property applies only to the entries themselves
139   * and does not impact the index data. Further, the effectiveness of
140   * the compression is based on the type of data contained in the
141   * entry.
142   *
143   * @return Returns the value of the "entries-compressed" property.
144   */
145  boolean isEntriesCompressed();
146
147
148
149  /**
150   * Gets the "import-offheap-memory-size" property.
151   * <p>
152   * Specifies the amount of off-heap memory dedicated to the online
153   * operation (import-ldif, rebuild-index).
154   *
155   * @return Returns the value of the "import-offheap-memory-size" property.
156   */
157  Long getImportOffheapMemorySize();
158
159
160
161  /**
162   * Gets the "index-entry-limit" property.
163   * <p>
164   * Specifies the maximum number of entries that is allowed to match
165   * a given index key before that particular index key is no longer
166   * maintained.
167   * <p>
168   * This property is analogous to the ALL IDs threshold in the Sun
169   * Java System Directory Server. Note that this is the default limit
170   * for the backend, and it may be overridden on a per-attribute
171   * basis.A value of 0 means there is no limit.
172   *
173   * @return Returns the value of the "index-entry-limit" property.
174   */
175  int getIndexEntryLimit();
176
177
178
179  /**
180   * Gets the "index-filter-analyzer-enabled" property.
181   * <p>
182   * Indicates whether to gather statistical information about the
183   * search filters processed by the directory server while evaluating
184   * the usage of indexes.
185   * <p>
186   * Analyzing indexes requires gathering search filter usage patterns
187   * from user requests, especially for values as specified in the
188   * filters and subsequently looking the status of those values into
189   * the index files. When a search requests is processed, internal or
190   * user generated, a first phase uses indexes to find potential
191   * entries to be returned. Depending on the search filter, if the
192   * index of one of the specified attributes matches too many entries
193   * (exceeds the index entry limit), the search becomes non-indexed.
194   * In any case, all entries thus gathered (or the entire DIT) are
195   * matched against the filter for actually returning the search
196   * result.
197   *
198   * @return Returns the value of the "index-filter-analyzer-enabled" property.
199   */
200  boolean isIndexFilterAnalyzerEnabled();
201
202
203
204  /**
205   * Gets the "index-filter-analyzer-max-filters" property.
206   * <p>
207   * The maximum number of search filter statistics to keep.
208   * <p>
209   * When the maximum number of search filter is reached, the least
210   * used one will be deleted.
211   *
212   * @return Returns the value of the "index-filter-analyzer-max-filters" property.
213   */
214  int getIndexFilterAnalyzerMaxFilters();
215
216
217
218  /**
219   * Gets the "preload-time-limit" property.
220   * <p>
221   * Specifies the length of time that the backend is allowed to spend
222   * "pre-loading" data when it is initialized.
223   * <p>
224   * The pre-load process is used to pre-populate the database cache,
225   * so that it can be more quickly available when the server is
226   * processing requests. A duration of zero means there is no
227   * pre-load.
228   *
229   * @return Returns the value of the "preload-time-limit" property.
230   */
231  long getPreloadTimeLimit();
232
233
234
235  /**
236   * Gets the "writability-mode" property.
237   * <p>
238   * Specifies the behavior that the backend should use when
239   * processing write operations.
240   *
241   * @return Returns the value of the "writability-mode" property.
242   */
243  WritabilityMode getWritabilityMode();
244
245
246
247  /**
248   * Lists the Backend Indexes.
249   *
250   * @return Returns an array containing the names of the
251   *         Backend Indexes.
252   */
253  String[] listBackendIndexes();
254
255
256
257  /**
258   * Gets the named Backend Index.
259   *
260   * @param name
261   *          The name of the Backend Index to retrieve.
262   * @return Returns the named Backend Index.
263   * @throws ConfigException
264   *           If the Backend Index could not be found or it
265   *           could not be successfully decoded.
266   */
267  BackendIndexCfg getBackendIndex(String name) throws ConfigException;
268
269
270
271  /**
272   * Registers to be notified when new Backend Indexes are added.
273   *
274   * @param listener
275   *          The Backend Index configuration add listener.
276   * @throws ConfigException
277   *          If the add listener could not be registered.
278   */
279  void addBackendIndexAddListener(ConfigurationAddListener<BackendIndexCfg> listener) throws ConfigException;
280
281
282
283  /**
284   * Deregisters an existing Backend Index configuration add listener.
285   *
286   * @param listener
287   *          The Backend Index configuration add listener.
288   */
289  void removeBackendIndexAddListener(ConfigurationAddListener<BackendIndexCfg> listener);
290
291
292
293  /**
294   * Registers to be notified when existing Backend Indexes are deleted.
295   *
296   * @param listener
297   *          The Backend Index configuration delete listener.
298   * @throws ConfigException
299   *          If the delete listener could not be registered.
300   */
301  void addBackendIndexDeleteListener(ConfigurationDeleteListener<BackendIndexCfg> listener) throws ConfigException;
302
303
304
305  /**
306   * Deregisters an existing Backend Index configuration delete listener.
307   *
308   * @param listener
309   *          The Backend Index configuration delete listener.
310   */
311  void removeBackendIndexDeleteListener(ConfigurationDeleteListener<BackendIndexCfg> listener);
312
313
314
315  /**
316   * Lists the Backend VLV Indexes.
317   *
318   * @return Returns an array containing the names of the
319   *         Backend VLV Indexes.
320   */
321  String[] listBackendVLVIndexes();
322
323
324
325  /**
326   * Gets the named Backend VLV Index.
327   *
328   * @param name
329   *          The name of the Backend VLV Index to retrieve.
330   * @return Returns the named Backend VLV Index.
331   * @throws ConfigException
332   *           If the Backend VLV Index could not be found or it
333   *           could not be successfully decoded.
334   */
335  BackendVLVIndexCfg getBackendVLVIndex(String name) throws ConfigException;
336
337
338
339  /**
340   * Registers to be notified when new Backend VLV Indexes are added.
341   *
342   * @param listener
343   *          The Backend VLV Index configuration add listener.
344   * @throws ConfigException
345   *          If the add listener could not be registered.
346   */
347  void addBackendVLVIndexAddListener(ConfigurationAddListener<BackendVLVIndexCfg> listener) throws ConfigException;
348
349
350
351  /**
352   * Deregisters an existing Backend VLV Index configuration add listener.
353   *
354   * @param listener
355   *          The Backend VLV Index configuration add listener.
356   */
357  void removeBackendVLVIndexAddListener(ConfigurationAddListener<BackendVLVIndexCfg> listener);
358
359
360
361  /**
362   * Registers to be notified when existing Backend VLV Indexes are deleted.
363   *
364   * @param listener
365   *          The Backend VLV Index configuration delete listener.
366   * @throws ConfigException
367   *          If the delete listener could not be registered.
368   */
369  void addBackendVLVIndexDeleteListener(ConfigurationDeleteListener<BackendVLVIndexCfg> listener) throws ConfigException;
370
371
372
373  /**
374   * Deregisters an existing Backend VLV Index configuration delete listener.
375   *
376   * @param listener
377   *          The Backend VLV Index configuration delete listener.
378   */
379  void removeBackendVLVIndexDeleteListener(ConfigurationDeleteListener<BackendVLVIndexCfg> listener);
380
381}