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