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.client; 017 018 019 020import org.forgerock.opendj.config.ManagedObjectDefinition; 021import org.forgerock.opendj.config.PropertyException; 022import org.forgerock.opendj.server.config.server.PDBBackendCfg; 023 024 025 026/** 027 * A client-side interface for reading and modifying PDB Backend 028 * settings. 029 * <p> 030 * A PDB Backend stores application data in a Persistit database. 031 */ 032public interface PDBBackendCfgClient extends PluggableBackendCfgClient { 033 034 /** 035 * Get the configuration definition associated with this PDB Backend. 036 * 037 * @return Returns the configuration definition associated with this PDB Backend. 038 */ 039 ManagedObjectDefinition<? extends PDBBackendCfgClient, ? extends PDBBackendCfg> definition(); 040 041 042 043 /** 044 * Gets the "db-cache-percent" property. 045 * <p> 046 * Specifies the percentage of JVM memory to allocate to the 047 * database cache. 048 * <p> 049 * Specifies the percentage of memory available to the JVM that 050 * should be used for caching database contents. Note that this is 051 * only used if the value of the db-cache-size property is set to "0 052 * MB". Otherwise, the value of that property is used instead to 053 * control the cache size configuration. 054 * 055 * @return Returns the value of the "db-cache-percent" property. 056 */ 057 int getDBCachePercent(); 058 059 060 061 /** 062 * Sets the "db-cache-percent" property. 063 * <p> 064 * Specifies the percentage of JVM memory to allocate to the 065 * database cache. 066 * <p> 067 * Specifies the percentage of memory available to the JVM that 068 * should be used for caching database contents. Note that this is 069 * only used if the value of the db-cache-size property is set to "0 070 * MB". Otherwise, the value of that property is used instead to 071 * control the cache size configuration. 072 * 073 * @param value The value of the "db-cache-percent" property. 074 * @throws PropertyException 075 * If the new value is invalid. 076 */ 077 void setDBCachePercent(Integer value) throws PropertyException; 078 079 080 081 /** 082 * Gets the "db-cache-size" property. 083 * <p> 084 * The amount of JVM memory to allocate to the database cache. 085 * <p> 086 * Specifies the amount of memory that should be used for caching 087 * database contents. A value of "0 MB" indicates that the 088 * db-cache-percent property should be used instead to specify the 089 * cache size. 090 * 091 * @return Returns the value of the "db-cache-size" property. 092 */ 093 long getDBCacheSize(); 094 095 096 097 /** 098 * Sets the "db-cache-size" property. 099 * <p> 100 * The amount of JVM memory to allocate to the database cache. 101 * <p> 102 * Specifies the amount of memory that should be used for caching 103 * database contents. A value of "0 MB" indicates that the 104 * db-cache-percent property should be used instead to specify the 105 * cache size. 106 * 107 * @param value The value of the "db-cache-size" property. 108 * @throws PropertyException 109 * If the new value is invalid. 110 */ 111 void setDBCacheSize(Long value) throws PropertyException; 112 113 114 115 /** 116 * Gets the "db-checkpointer-wakeup-interval" property. 117 * <p> 118 * Specifies the maximum length of time that may pass between 119 * checkpoints. 120 * <p> 121 * This setting controls the elapsed time between attempts to write 122 * a checkpoint to the journal. A longer interval allows more updates 123 * to accumulate in buffers before they are required to be written to 124 * disk, but also potentially causes recovery from an abrupt 125 * termination (crash) to take more time. 126 * 127 * @return Returns the value of the "db-checkpointer-wakeup-interval" property. 128 */ 129 long getDBCheckpointerWakeupInterval(); 130 131 132 133 /** 134 * Sets the "db-checkpointer-wakeup-interval" property. 135 * <p> 136 * Specifies the maximum length of time that may pass between 137 * checkpoints. 138 * <p> 139 * This setting controls the elapsed time between attempts to write 140 * a checkpoint to the journal. A longer interval allows more updates 141 * to accumulate in buffers before they are required to be written to 142 * disk, but also potentially causes recovery from an abrupt 143 * termination (crash) to take more time. 144 * 145 * @param value The value of the "db-checkpointer-wakeup-interval" property. 146 * @throws PropertyException 147 * If the new value is invalid. 148 */ 149 void setDBCheckpointerWakeupInterval(Long value) throws PropertyException; 150 151 152 153 /** 154 * Gets the "db-directory" property. 155 * <p> 156 * Specifies the path to the filesystem directory that is used to 157 * hold the Persistit database files containing the data for this 158 * backend. 159 * <p> 160 * The path may be either an absolute path or a path relative to the 161 * directory containing the base of the OpenDJ directory server 162 * installation. The path may be any valid directory path in which 163 * the server has appropriate permissions to read and write files and 164 * has sufficient space to hold the database contents. 165 * 166 * @return Returns the value of the "db-directory" property. 167 */ 168 String getDBDirectory(); 169 170 171 172 /** 173 * Sets the "db-directory" property. 174 * <p> 175 * Specifies the path to the filesystem directory that is used to 176 * hold the Persistit database files containing the data for this 177 * backend. 178 * <p> 179 * The path may be either an absolute path or a path relative to the 180 * directory containing the base of the OpenDJ directory server 181 * installation. The path may be any valid directory path in which 182 * the server has appropriate permissions to read and write files and 183 * has sufficient space to hold the database contents. 184 * 185 * @param value The value of the "db-directory" property. 186 * @throws PropertyException 187 * If the new value is invalid. 188 */ 189 void setDBDirectory(String value) throws PropertyException; 190 191 192 193 /** 194 * Gets the "db-directory-permissions" property. 195 * <p> 196 * Specifies the permissions that should be applied to the directory 197 * containing the server database files. 198 * <p> 199 * They should be expressed as three-digit octal values, which is 200 * the traditional representation for UNIX file permissions. The 201 * three digits represent the permissions that are available for the 202 * directory's owner, group members, and other users (in that order), 203 * and each digit is the octal representation of the read, write, and 204 * execute bits. Note that this only impacts permissions on the 205 * database directory and not on the files written into that 206 * directory. On UNIX systems, the user's umask controls permissions 207 * given to the database files. 208 * 209 * @return Returns the value of the "db-directory-permissions" property. 210 */ 211 String getDBDirectoryPermissions(); 212 213 214 215 /** 216 * Sets the "db-directory-permissions" property. 217 * <p> 218 * Specifies the permissions that should be applied to the directory 219 * containing the server database files. 220 * <p> 221 * They should be expressed as three-digit octal values, which is 222 * the traditional representation for UNIX file permissions. The 223 * three digits represent the permissions that are available for the 224 * directory's owner, group members, and other users (in that order), 225 * and each digit is the octal representation of the read, write, and 226 * execute bits. Note that this only impacts permissions on the 227 * database directory and not on the files written into that 228 * directory. On UNIX systems, the user's umask controls permissions 229 * given to the database files. 230 * 231 * @param value The value of the "db-directory-permissions" property. 232 * @throws PropertyException 233 * If the new value is invalid. 234 */ 235 void setDBDirectoryPermissions(String value) throws PropertyException; 236 237 238 239 /** 240 * Gets the "db-txn-no-sync" property. 241 * <p> 242 * Indicates whether database writes should be primarily written to 243 * an internal buffer but not immediately written to disk. 244 * <p> 245 * Setting the value of this configuration attribute to "true" may 246 * improve write performance but could cause the most recent changes 247 * to be lost if the OpenDJ directory server or the underlying JVM 248 * exits abnormally, or if an OS or hardware failure occurs (a 249 * behavior similar to running with transaction durability disabled 250 * in the Sun Java System Directory Server). 251 * 252 * @return Returns the value of the "db-txn-no-sync" property. 253 */ 254 boolean isDBTxnNoSync(); 255 256 257 258 /** 259 * Sets the "db-txn-no-sync" property. 260 * <p> 261 * Indicates whether database writes should be primarily written to 262 * an internal buffer but not immediately written to disk. 263 * <p> 264 * Setting the value of this configuration attribute to "true" may 265 * improve write performance but could cause the most recent changes 266 * to be lost if the OpenDJ directory server or the underlying JVM 267 * exits abnormally, or if an OS or hardware failure occurs (a 268 * behavior similar to running with transaction durability disabled 269 * in the Sun Java System Directory Server). 270 * 271 * @param value The value of the "db-txn-no-sync" property. 272 * @throws PropertyException 273 * If the new value is invalid. 274 */ 275 void setDBTxnNoSync(Boolean value) throws PropertyException; 276 277 278 279 /** 280 * Gets the "disk-full-threshold" property. 281 * <p> 282 * Full disk threshold to limit database updates 283 * <p> 284 * When the available free space on the disk used by this database 285 * instance falls below the value specified, no updates are permitted 286 * and the server returns an UNWILLING_TO_PERFORM error. Updates are 287 * allowed again as soon as free space rises above the threshold. 288 * 289 * @return Returns the value of the "disk-full-threshold" property. 290 */ 291 long getDiskFullThreshold(); 292 293 294 295 /** 296 * Sets the "disk-full-threshold" property. 297 * <p> 298 * Full disk threshold to limit database updates 299 * <p> 300 * When the available free space on the disk used by this database 301 * instance falls below the value specified, no updates are permitted 302 * and the server returns an UNWILLING_TO_PERFORM error. Updates are 303 * allowed again as soon as free space rises above the threshold. 304 * 305 * @param value The value of the "disk-full-threshold" property. 306 * @throws PropertyException 307 * If the new value is invalid. 308 */ 309 void setDiskFullThreshold(Long value) throws PropertyException; 310 311 312 313 /** 314 * Gets the "disk-low-threshold" property. 315 * <p> 316 * Low disk threshold to limit database updates 317 * <p> 318 * Specifies the "low" free space on the disk. When the available 319 * free space on the disk used by this database instance falls below 320 * the value specified, protocol updates on this database are 321 * permitted only by a user with the BYPASS_LOCKDOWN privilege. 322 * 323 * @return Returns the value of the "disk-low-threshold" property. 324 */ 325 long getDiskLowThreshold(); 326 327 328 329 /** 330 * Sets the "disk-low-threshold" property. 331 * <p> 332 * Low disk threshold to limit database updates 333 * <p> 334 * Specifies the "low" free space on the disk. When the available 335 * free space on the disk used by this database instance falls below 336 * the value specified, protocol updates on this database are 337 * permitted only by a user with the BYPASS_LOCKDOWN privilege. 338 * 339 * @param value The value of the "disk-low-threshold" property. 340 * @throws PropertyException 341 * If the new value is invalid. 342 */ 343 void setDiskLowThreshold(Long value) throws PropertyException; 344 345 346 347 /** 348 * Gets the "java-class" property. 349 * <p> 350 * Specifies the fully-qualified name of the Java class that 351 * provides the backend implementation. 352 * 353 * @return Returns the value of the "java-class" property. 354 */ 355 String getJavaClass(); 356 357 358 359 /** 360 * Sets the "java-class" property. 361 * <p> 362 * Specifies the fully-qualified name of the Java class that 363 * provides the backend implementation. 364 * 365 * @param value The value of the "java-class" property. 366 * @throws PropertyException 367 * If the new value is invalid. 368 */ 369 void setJavaClass(String value) throws PropertyException; 370 371}