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.ConfigurationChangeListener;
021
022
023
024/**
025 * A server-side interface for querying PDB Backend settings.
026 * <p>
027 * A PDB Backend stores application data in a Persistit database.
028 */
029public interface PDBBackendCfg extends PluggableBackendCfg {
030
031  /**
032   * Gets the configuration class associated with this PDB Backend.
033   *
034   * @return Returns the configuration class associated with this PDB Backend.
035   */
036  Class<? extends PDBBackendCfg> configurationClass();
037
038
039
040  /**
041   * Register to be notified when this PDB Backend is changed.
042   *
043   * @param listener
044   *          The PDB Backend configuration change listener.
045   */
046  void addPDBChangeListener(ConfigurationChangeListener<PDBBackendCfg> listener);
047
048
049
050  /**
051   * Deregister an existing PDB Backend configuration change listener.
052   *
053   * @param listener
054   *          The PDB Backend configuration change listener.
055   */
056  void removePDBChangeListener(ConfigurationChangeListener<PDBBackendCfg> listener);
057
058
059
060  /**
061   * Gets the "db-cache-percent" property.
062   * <p>
063   * Specifies the percentage of JVM memory to allocate to the
064   * database cache.
065   * <p>
066   * Specifies the percentage of memory available to the JVM that
067   * should be used for caching database contents. Note that this is
068   * only used if the value of the db-cache-size property is set to "0
069   * MB". Otherwise, the value of that property is used instead to
070   * control the cache size configuration.
071   *
072   * @return Returns the value of the "db-cache-percent" property.
073   */
074  int getDBCachePercent();
075
076
077
078  /**
079   * Gets the "db-cache-size" property.
080   * <p>
081   * The amount of JVM memory to allocate to the database cache.
082   * <p>
083   * Specifies the amount of memory that should be used for caching
084   * database contents. A value of "0 MB" indicates that the
085   * db-cache-percent property should be used instead to specify the
086   * cache size.
087   *
088   * @return Returns the value of the "db-cache-size" property.
089   */
090  long getDBCacheSize();
091
092
093
094  /**
095   * Gets the "db-checkpointer-wakeup-interval" property.
096   * <p>
097   * Specifies the maximum length of time that may pass between
098   * checkpoints.
099   * <p>
100   * This setting controls the elapsed time between attempts to write
101   * a checkpoint to the journal. A longer interval allows more updates
102   * to accumulate in buffers before they are required to be written to
103   * disk, but also potentially causes recovery from an abrupt
104   * termination (crash) to take more time.
105   *
106   * @return Returns the value of the "db-checkpointer-wakeup-interval" property.
107   */
108  long getDBCheckpointerWakeupInterval();
109
110
111
112  /**
113   * Gets the "db-directory" property.
114   * <p>
115   * Specifies the path to the filesystem directory that is used to
116   * hold the Persistit database files containing the data for this
117   * backend.
118   * <p>
119   * The path may be either an absolute path or a path relative to the
120   * directory containing the base of the OpenDJ directory server
121   * installation. The path may be any valid directory path in which
122   * the server has appropriate permissions to read and write files and
123   * has sufficient space to hold the database contents.
124   *
125   * @return Returns the value of the "db-directory" property.
126   */
127  String getDBDirectory();
128
129
130
131  /**
132   * Gets the "db-directory-permissions" property.
133   * <p>
134   * Specifies the permissions that should be applied to the directory
135   * containing the server database files.
136   * <p>
137   * They should be expressed as three-digit octal values, which is
138   * the traditional representation for UNIX file permissions. The
139   * three digits represent the permissions that are available for the
140   * directory's owner, group members, and other users (in that order),
141   * and each digit is the octal representation of the read, write, and
142   * execute bits. Note that this only impacts permissions on the
143   * database directory and not on the files written into that
144   * directory. On UNIX systems, the user's umask controls permissions
145   * given to the database files.
146   *
147   * @return Returns the value of the "db-directory-permissions" property.
148   */
149  String getDBDirectoryPermissions();
150
151
152
153  /**
154   * Gets the "db-txn-no-sync" property.
155   * <p>
156   * Indicates whether database writes should be primarily written to
157   * an internal buffer but not immediately written to disk.
158   * <p>
159   * Setting the value of this configuration attribute to "true" may
160   * improve write performance but could cause the most recent changes
161   * to be lost if the OpenDJ directory server or the underlying JVM
162   * exits abnormally, or if an OS or hardware failure occurs (a
163   * behavior similar to running with transaction durability disabled
164   * in the Sun Java System Directory Server).
165   *
166   * @return Returns the value of the "db-txn-no-sync" property.
167   */
168  boolean isDBTxnNoSync();
169
170
171
172  /**
173   * Gets the "disk-full-threshold" property.
174   * <p>
175   * Full disk threshold to limit database updates
176   * <p>
177   * When the available free space on the disk used by this database
178   * instance falls below the value specified, no updates are permitted
179   * and the server returns an UNWILLING_TO_PERFORM error. Updates are
180   * allowed again as soon as free space rises above the threshold.
181   *
182   * @return Returns the value of the "disk-full-threshold" property.
183   */
184  long getDiskFullThreshold();
185
186
187
188  /**
189   * Gets the "disk-low-threshold" property.
190   * <p>
191   * Low disk threshold to limit database updates
192   * <p>
193   * Specifies the "low" free space on the disk. When the available
194   * free space on the disk used by this database instance falls below
195   * the value specified, protocol updates on this database are
196   * permitted only by a user with the BYPASS_LOCKDOWN privilege.
197   *
198   * @return Returns the value of the "disk-low-threshold" property.
199   */
200  long getDiskLowThreshold();
201
202
203
204  /**
205   * Gets the "java-class" property.
206   * <p>
207   * Specifies the fully-qualified name of the Java class that
208   * provides the backend implementation.
209   *
210   * @return Returns the value of the "java-class" property.
211   */
212  String getJavaClass();
213
214}