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.client;
027
028
029
030import java.util.Collection;
031import org.opends.server.admin.client.AuthorizationException;
032import org.opends.server.admin.client.CommunicationException;
033import org.opends.server.admin.client.ConcurrentModificationException;
034import org.opends.server.admin.client.IllegalManagedObjectNameException;
035import org.opends.server.admin.client.ManagedObjectDecodingException;
036import org.opends.server.admin.client.OperationRejectedException;
037import org.opends.server.admin.DefinitionDecodingException;
038import org.opends.server.admin.ManagedObjectDefinition;
039import org.opends.server.admin.ManagedObjectNotFoundException;
040import org.opends.server.admin.PropertyException;
041import org.opends.server.admin.std.meta.BackendCfgDefn.WritabilityMode;
042import org.opends.server.admin.std.server.BackendIndexCfg;
043import org.opends.server.admin.std.server.BackendVLVIndexCfg;
044import org.opends.server.admin.std.server.PluggableBackendCfg;
045
046
047
048/**
049 * A client-side interface for reading and modifying Pluggable Backend
050 * settings.
051 * <p>
052 * A Pluggable Backend stores application data in a pluggable
053 * database.
054 */
055public interface PluggableBackendCfgClient extends BackendCfgClient {
056
057  /**
058   * Get the configuration definition associated with this Pluggable Backend.
059   *
060   * @return Returns the configuration definition associated with this Pluggable Backend.
061   */
062  ManagedObjectDefinition<? extends PluggableBackendCfgClient, ? extends PluggableBackendCfg> definition();
063
064
065
066  /**
067   * Gets the "compact-encoding" property.
068   * <p>
069   * Indicates whether the backend should use a compact form when
070   * encoding entries by compressing the attribute descriptions and
071   * object class sets.
072   * <p>
073   * Note that this property applies only to the entries themselves
074   * and does not impact the index data.
075   *
076   * @return Returns the value of the "compact-encoding" property.
077   */
078  boolean isCompactEncoding();
079
080
081
082  /**
083   * Sets the "compact-encoding" property.
084   * <p>
085   * Indicates whether the backend should use a compact form when
086   * encoding entries by compressing the attribute descriptions and
087   * object class sets.
088   * <p>
089   * Note that this property applies only to the entries themselves
090   * and does not impact the index data.
091   *
092   * @param value The value of the "compact-encoding" property.
093   * @throws PropertyException
094   *           If the new value is invalid.
095   */
096  void setCompactEncoding(Boolean value) throws PropertyException;
097
098
099
100  /**
101   * Gets the "entries-compressed" property.
102   * <p>
103   * Indicates whether the backend should attempt to compress entries
104   * before storing them in the database.
105   * <p>
106   * Note that this property applies only to the entries themselves
107   * and does not impact the index data. Further, the effectiveness of
108   * the compression is based on the type of data contained in the
109   * entry.
110   *
111   * @return Returns the value of the "entries-compressed" property.
112   */
113  boolean isEntriesCompressed();
114
115
116
117  /**
118   * Sets the "entries-compressed" property.
119   * <p>
120   * Indicates whether the backend should attempt to compress entries
121   * before storing them in the database.
122   * <p>
123   * Note that this property applies only to the entries themselves
124   * and does not impact the index data. Further, the effectiveness of
125   * the compression is based on the type of data contained in the
126   * entry.
127   *
128   * @param value The value of the "entries-compressed" property.
129   * @throws PropertyException
130   *           If the new value is invalid.
131   */
132  void setEntriesCompressed(Boolean value) throws PropertyException;
133
134
135
136  /**
137   * Gets the "index-entry-limit" property.
138   * <p>
139   * Specifies the maximum number of entries that is allowed to match
140   * a given index key before that particular index key is no longer
141   * maintained.
142   * <p>
143   * This property is analogous to the ALL IDs threshold in the Sun
144   * Java System Directory Server. Note that this is the default limit
145   * for the backend, and it may be overridden on a per-attribute
146   * basis.A value of 0 means there is no limit.
147   *
148   * @return Returns the value of the "index-entry-limit" property.
149   */
150  int getIndexEntryLimit();
151
152
153
154  /**
155   * Sets the "index-entry-limit" property.
156   * <p>
157   * Specifies the maximum number of entries that is allowed to match
158   * a given index key before that particular index key is no longer
159   * maintained.
160   * <p>
161   * This property is analogous to the ALL IDs threshold in the Sun
162   * Java System Directory Server. Note that this is the default limit
163   * for the backend, and it may be overridden on a per-attribute
164   * basis.A value of 0 means there is no limit.
165   *
166   * @param value The value of the "index-entry-limit" property.
167   * @throws PropertyException
168   *           If the new value is invalid.
169   */
170  void setIndexEntryLimit(Integer value) throws PropertyException;
171
172
173
174  /**
175   * Gets the "index-filter-analyzer-enabled" property.
176   * <p>
177   * Indicates whether to gather statistical information about the
178   * search filters processed by the directory server while evaluating
179   * the usage of indexes.
180   * <p>
181   * Analyzing indexes requires gathering search filter usage patterns
182   * from user requests, especially for values as specified in the
183   * filters and subsequently looking the status of those values into
184   * the index files. When a search requests is processed, internal or
185   * user generated, a first phase uses indexes to find potential
186   * entries to be returned. Depending on the search filter, if the
187   * index of one of the specified attributes matches too many entries
188   * (exceeds the index entry limit), the search becomes non-indexed.
189   * In any case, all entries thus gathered (or the entire DIT) are
190   * matched against the filter for actually returning the search
191   * result.
192   *
193   * @return Returns the value of the "index-filter-analyzer-enabled" property.
194   */
195  boolean isIndexFilterAnalyzerEnabled();
196
197
198
199  /**
200   * Sets the "index-filter-analyzer-enabled" property.
201   * <p>
202   * Indicates whether to gather statistical information about the
203   * search filters processed by the directory server while evaluating
204   * the usage of indexes.
205   * <p>
206   * Analyzing indexes requires gathering search filter usage patterns
207   * from user requests, especially for values as specified in the
208   * filters and subsequently looking the status of those values into
209   * the index files. When a search requests is processed, internal or
210   * user generated, a first phase uses indexes to find potential
211   * entries to be returned. Depending on the search filter, if the
212   * index of one of the specified attributes matches too many entries
213   * (exceeds the index entry limit), the search becomes non-indexed.
214   * In any case, all entries thus gathered (or the entire DIT) are
215   * matched against the filter for actually returning the search
216   * result.
217   *
218   * @param value The value of the "index-filter-analyzer-enabled" property.
219   * @throws PropertyException
220   *           If the new value is invalid.
221   */
222  void setIndexFilterAnalyzerEnabled(Boolean value) throws PropertyException;
223
224
225
226  /**
227   * Gets the "index-filter-analyzer-max-filters" property.
228   * <p>
229   * The maximum number of search filter statistics to keep.
230   * <p>
231   * When the maximum number of search filter is reached, the least
232   * used one will be deleted.
233   *
234   * @return Returns the value of the "index-filter-analyzer-max-filters" property.
235   */
236  int getIndexFilterAnalyzerMaxFilters();
237
238
239
240  /**
241   * Sets the "index-filter-analyzer-max-filters" property.
242   * <p>
243   * The maximum number of search filter statistics to keep.
244   * <p>
245   * When the maximum number of search filter is reached, the least
246   * used one will be deleted.
247   *
248   * @param value The value of the "index-filter-analyzer-max-filters" property.
249   * @throws PropertyException
250   *           If the new value is invalid.
251   */
252  void setIndexFilterAnalyzerMaxFilters(Integer value) throws PropertyException;
253
254
255
256  /**
257   * Gets the "preload-time-limit" property.
258   * <p>
259   * Specifies the length of time that the backend is allowed to spend
260   * "pre-loading" data when it is initialized.
261   * <p>
262   * The pre-load process is used to pre-populate the database cache,
263   * so that it can be more quickly available when the server is
264   * processing requests. A duration of zero means there is no
265   * pre-load.
266   *
267   * @return Returns the value of the "preload-time-limit" property.
268   */
269  long getPreloadTimeLimit();
270
271
272
273  /**
274   * Sets the "preload-time-limit" property.
275   * <p>
276   * Specifies the length of time that the backend is allowed to spend
277   * "pre-loading" data when it is initialized.
278   * <p>
279   * The pre-load process is used to pre-populate the database cache,
280   * so that it can be more quickly available when the server is
281   * processing requests. A duration of zero means there is no
282   * pre-load.
283   *
284   * @param value The value of the "preload-time-limit" property.
285   * @throws PropertyException
286   *           If the new value is invalid.
287   */
288  void setPreloadTimeLimit(Long value) throws PropertyException;
289
290
291
292  /**
293   * Gets the "writability-mode" property.
294   * <p>
295   * Specifies the behavior that the backend should use when
296   * processing write operations.
297   *
298   * @return Returns the value of the "writability-mode" property.
299   */
300  WritabilityMode getWritabilityMode();
301
302
303
304  /**
305   * Sets the "writability-mode" property.
306   * <p>
307   * Specifies the behavior that the backend should use when
308   * processing write operations.
309   *
310   * @param value The value of the "writability-mode" property.
311   * @throws PropertyException
312   *           If the new value is invalid.
313   */
314  void setWritabilityMode(WritabilityMode value) throws PropertyException;
315
316
317
318  /**
319   * Lists the Backend Indexes.
320   *
321   * @return Returns an array containing the names of the Backend
322   *         Indexes.
323   * @throws ConcurrentModificationException
324   *           If this Pluggable Backend has been removed from the
325   *           server by another client.
326   * @throws AuthorizationException
327   *           If the server refuses to list the Backend Indexes
328   *           because the client does not have the correct privileges.
329   * @throws CommunicationException
330   *           If the client cannot contact the server due to an
331   *           underlying communication problem.
332   */
333  String[] listBackendIndexes() throws ConcurrentModificationException,
334      AuthorizationException, CommunicationException;
335
336
337
338  /**
339   * Gets the named Backend Index.
340   *
341   * @param name
342   *           The name of the Backend Index to retrieve.
343   * @return Returns the named Backend Index.
344   * @throws DefinitionDecodingException
345   *           If the named Backend Index was found but its type could
346   *           not be determined.
347   * @throws ManagedObjectDecodingException
348   *           If the named Backend Index was found but one or more of
349   *           its properties could not be decoded.
350   * @throws ManagedObjectNotFoundException
351   *           If the named Backend Index was not found on the server.
352   * @throws ConcurrentModificationException
353   *           If this Pluggable Backend has been removed from the
354   *           server by another client.
355   * @throws AuthorizationException
356   *           If the server refuses to retrieve the named Backend
357   *           Index because the client does not have the correct
358   *           privileges.
359   * @throws CommunicationException
360   *           If the client cannot contact the server due to an
361   *           underlying communication problem.
362   */
363  BackendIndexCfgClient getBackendIndex(String name)
364      throws DefinitionDecodingException, ManagedObjectDecodingException,
365      ManagedObjectNotFoundException, ConcurrentModificationException,
366      AuthorizationException, CommunicationException;
367
368
369
370  /**
371   * Creates a new Backend Index. The new Backend Index will initially
372   * not contain any property values (including mandatory properties).
373   * Once the Backend Index has been configured it can be added to the
374   * server using the {@link #commit()} method.
375   *
376   * @param <C>
377   *          The type of the Backend Index being created.
378   * @param d
379   *          The definition of the Backend Index to be created.
380   * @param name
381   *          The name of the new Backend Index.
382   * @param exceptions
383   *          An optional collection in which to place any {@link
384   *          PropertyException}s that occurred whilst attempting to
385   *          determine the default values of the Backend Index. This
386   *          argument can be <code>null<code>.
387   * @return Returns a new Backend Index configuration instance.
388   * @throws IllegalManagedObjectNameException
389   *          If the name of the new Backend Index is invalid.
390   */
391  <C extends BackendIndexCfgClient> C createBackendIndex(
392      ManagedObjectDefinition<C, ? extends BackendIndexCfg> d, String name, Collection<PropertyException> exceptions) throws IllegalManagedObjectNameException;
393
394
395
396  /**
397   * Removes the named Backend Index.
398   *
399   * @param name
400   *          The name of the Backend Index to remove.
401   * @throws ManagedObjectNotFoundException
402   *           If the Backend Index does not exist.
403   * @throws OperationRejectedException
404   *           If the server refuses to remove the Backend Index due
405   *           to some server-side constraint which cannot be satisfied
406   *           (for example, if it is referenced by another managed
407   *           object).
408   * @throws ConcurrentModificationException
409   *           If this Pluggable Backend has been removed from the
410   *           server by another client.
411   * @throws AuthorizationException
412   *           If the server refuses to remove the Backend Index
413   *           because the client does not have the correct privileges.
414   * @throws CommunicationException
415   *           If the client cannot contact the server due to an
416   *           underlying communication problem.
417   */
418  void removeBackendIndex(String name)
419      throws ManagedObjectNotFoundException, OperationRejectedException,
420      ConcurrentModificationException, AuthorizationException,
421      CommunicationException;
422
423
424
425  /**
426   * Lists the Backend VLV Indexes.
427   *
428   * @return Returns an array containing the names of the Backend VLV
429   *         Indexes.
430   * @throws ConcurrentModificationException
431   *           If this Pluggable Backend has been removed from the
432   *           server by another client.
433   * @throws AuthorizationException
434   *           If the server refuses to list the Backend VLV Indexes
435   *           because the client does not have the correct privileges.
436   * @throws CommunicationException
437   *           If the client cannot contact the server due to an
438   *           underlying communication problem.
439   */
440  String[] listBackendVLVIndexes() throws ConcurrentModificationException,
441      AuthorizationException, CommunicationException;
442
443
444
445  /**
446   * Gets the named Backend VLV Index.
447   *
448   * @param name
449   *           The name of the Backend VLV Index to retrieve.
450   * @return Returns the named Backend VLV Index.
451   * @throws DefinitionDecodingException
452   *           If the named Backend VLV Index was found but its type
453   *           could not be determined.
454   * @throws ManagedObjectDecodingException
455   *           If the named Backend VLV Index was found but one or
456   *           more of its properties could not be decoded.
457   * @throws ManagedObjectNotFoundException
458   *           If the named Backend VLV Index was not found on the
459   *           server.
460   * @throws ConcurrentModificationException
461   *           If this Pluggable Backend has been removed from the
462   *           server by another client.
463   * @throws AuthorizationException
464   *           If the server refuses to retrieve the named Backend VLV
465   *           Index because the client does not have the correct
466   *           privileges.
467   * @throws CommunicationException
468   *           If the client cannot contact the server due to an
469   *           underlying communication problem.
470   */
471  BackendVLVIndexCfgClient getBackendVLVIndex(String name)
472      throws DefinitionDecodingException, ManagedObjectDecodingException,
473      ManagedObjectNotFoundException, ConcurrentModificationException,
474      AuthorizationException, CommunicationException;
475
476
477
478  /**
479   * Creates a new Backend VLV Index. The new Backend VLV Index will
480   * initially not contain any property values (including mandatory
481   * properties). Once the Backend VLV Index has been configured it can
482   * be added to the server using the {@link #commit()} method.
483   *
484   * @param <C>
485   *          The type of the Backend VLV Index being created.
486   * @param d
487   *          The definition of the Backend VLV Index to be created.
488   * @param name
489   *          The name of the new Backend VLV Index.
490   * @param exceptions
491   *          An optional collection in which to place any {@link
492   *          PropertyException}s that occurred whilst attempting to
493   *          determine the default values of the Backend VLV Index.
494   *          This argument can be <code>null<code>.
495   * @return Returns a new Backend VLV Index configuration instance.
496   * @throws IllegalManagedObjectNameException
497   *          If the name of the new Backend VLV Index is invalid.
498   */
499  <C extends BackendVLVIndexCfgClient> C createBackendVLVIndex(
500      ManagedObjectDefinition<C, ? extends BackendVLVIndexCfg> d, String name, Collection<PropertyException> exceptions) throws IllegalManagedObjectNameException;
501
502
503
504  /**
505   * Removes the named Backend VLV Index.
506   *
507   * @param name
508   *          The name of the Backend VLV Index to remove.
509   * @throws ManagedObjectNotFoundException
510   *           If the Backend VLV Index does not exist.
511   * @throws OperationRejectedException
512   *           If the server refuses to remove the Backend VLV Index
513   *           due to some server-side constraint which cannot be
514   *           satisfied (for example, if it is referenced by another
515   *           managed object).
516   * @throws ConcurrentModificationException
517   *           If this Pluggable Backend has been removed from the
518   *           server by another client.
519   * @throws AuthorizationException
520   *           If the server refuses to remove the Backend VLV Index
521   *           because the client does not have the correct privileges.
522   * @throws CommunicationException
523   *           If the client cannot contact the server due to an
524   *           underlying communication problem.
525   */
526  void removeBackendVLVIndex(String name)
527      throws ManagedObjectNotFoundException, OperationRejectedException,
528      ConcurrentModificationException, AuthorizationException,
529      CommunicationException;
530
531}