opendj-config-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/PersistitBackendConfiguration.xml
@@ -22,7 +22,7 @@ ! CDDL HEADER END ! ! ! Copyright 2014 ForgeRock AS. ! Copyright 2014-2015 ForgeRock AS. ! --> <adm:managed-object name="persistit-backend" plural-name="persistit-backends" package="org.forgerock.opendj.server.config" @@ -43,7 +43,7 @@ <adm:default-behavior> <adm:defined> <adm:value> org.opends.server.backends.pluggable.BackendImpl org.opends.server.backends.persistit.PitBackend </adm:value> </adm:defined> </adm:default-behavior> @@ -185,7 +185,7 @@ </adm:description> <adm:default-behavior> <adm:defined> <adm:value>false</adm:value> <adm:value>true</adm:value> </adm:defined> </adm:default-behavior> <adm:syntax> opendj3-server-dev/src/admin/defn/org/opends/server/admin/std/PersistitBackendConfiguration.xml
@@ -22,7 +22,7 @@ ! CDDL HEADER END ! ! ! Copyright 2014 ForgeRock AS. ! Copyright 2014-2015 ForgeRock AS. ! --> <adm:managed-object name="persistit-backend" plural-name="persistit-backends" package="org.opends.server.admin.std" @@ -43,7 +43,7 @@ <adm:default-behavior> <adm:defined> <adm:value> org.opends.server.backends.pluggable.BackendImpl org.opends.server.backends.persistit.PitBackend </adm:value> </adm:defined> </adm:default-behavior> opendj3-server-dev/src/server/org/opends/server/backends/persistit/PitBackend.java
New file @@ -0,0 +1,44 @@ /* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License, Version 1.0 only * (the "License"). You may not use this file except in compliance * with the License. * * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt * or http://forgerock.org/license/CDDLv1.0.html. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at legal-notices/CDDLv1_0.txt. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: * Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END * * * Copyright 2015 ForgeRock AS */ package org.opends.server.backends.persistit; import org.opends.server.backends.pluggable.BackendImpl; import org.opends.server.backends.pluggable.spi.Storage; /** * Class defined in the configuration for this backend type. */ public class PitBackend extends BackendImpl { /** {@inheritDoc} */ @Override protected Storage newStorageInstance() { return new PersistItStorage(); } } opendj3-server-dev/src/server/org/opends/server/backends/pluggable/BackendImpl.java
@@ -53,6 +53,7 @@ import org.opends.server.api.DiskSpaceMonitorHandler; import org.opends.server.api.MonitorProvider; import org.opends.server.backends.VerifyConfig; import org.opends.server.backends.pluggable.spi.Storage; import org.opends.server.backends.pluggable.spi.StorageRuntimeException; import org.opends.server.backends.pluggable.spi.WriteOperation; import org.opends.server.backends.pluggable.spi.WriteableStorage; @@ -64,7 +65,7 @@ * This is an implementation of a Directory Server Backend which stores entries * locally in a Berkeley DB JE database. */ public class BackendImpl extends Backend<PersistitBackendCfg> implements public abstract class BackendImpl extends Backend<PersistitBackendCfg> implements ConfigurationChangeListener<PersistitBackendCfg>, AlertGenerator, DiskSpaceMonitorHandler { @@ -758,9 +759,16 @@ BackupManager backupManager = new BackupManager(getBackendID()); File parentDir = getFileForPath(cfg.getDBDirectory()); File backendDir = new File(parentDir, cfg.getBackendId()); // Storage storage = newStorageInstance(); // backupConfig.setFilesToBackupFilter(storage.getFilesToBackupFilter()); backupManager.createBackup(backendDir, backupConfig); } /** * Returns the storage corresponding to the backend class defined in the configuration. * @return the storage corresponding to the backend class defined in the configuration */ protected abstract Storage newStorageInstance(); /** {@inheritDoc} */ opendj3-server-dev/src/server/org/opends/server/backends/pluggable/RootContainer.java
@@ -46,11 +46,11 @@ import org.forgerock.opendj.config.server.ConfigException; import org.opends.server.admin.server.ConfigurationChangeListener; import org.opends.server.admin.std.server.PersistitBackendCfg; import org.opends.server.api.Backend; import org.opends.server.api.CompressedSchema; import org.opends.server.backends.persistit.PersistItStorage; import org.opends.server.backends.pluggable.spi.ReadOperation; import org.opends.server.backends.pluggable.spi.ReadableStorage; import org.opends.server.backends.pluggable.spi.Storage; import org.opends.server.backends.pluggable.spi.StorageRuntimeException; import org.opends.server.backends.pluggable.spi.WriteOperation; import org.opends.server.backends.pluggable.spi.WriteableStorage; @@ -119,7 +119,7 @@ private final File backendDirectory; /** The backend to which this entry root container belongs. */ private final Backend<?> backend; private final BackendImpl backend; /** The backend configuration. */ private PersistitBackendCfg config; /** The database environment monitor for this JE environment. */ @@ -143,7 +143,7 @@ * @param backend A reference to the JE back end that is creating this * root container. */ public RootContainer(Backend<?> backend, PersistitBackendCfg config) public RootContainer(BackendImpl backend, PersistitBackendCfg config) { this.backend = backend; this.config = config; @@ -161,7 +161,7 @@ * * @return the underlying storage engine */ PersistItStorage getStorage() Storage getStorage() { return storage; } @@ -401,7 +401,7 @@ try { storage = new PersistItStorage(); storage = (PersistItStorage) backend.newStorageInstance(); storage.initialize(config); storage.open(); storage.write(new WriteOperation()