From 633684322f388e2a82cca4f1f2ead3f515b695f4 Mon Sep 17 00:00:00 2001
From: Fabio Pistolesi <fabio.pistolesi@forgerock.com>
Date: Tue, 23 Jun 2015 14:21:41 +0000
Subject: [PATCH] OPENDJ-2148 CR-7317 "NullPointerException" when running import-ldif online with exclude branch
---
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/BackendImpl.java | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/BackendImpl.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/BackendImpl.java
index e27d70c..c387286 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/BackendImpl.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/BackendImpl.java
@@ -55,6 +55,7 @@
import org.opends.server.api.MonitorProvider;
import org.opends.server.backends.RebuildConfig;
import org.opends.server.backends.VerifyConfig;
+import org.opends.server.backends.pluggable.ImportSuffixCommand.SuffixImportStrategy;
import org.opends.server.backends.pluggable.spi.Storage;
import org.opends.server.backends.pluggable.spi.Storage.AccessMode;
import org.opends.server.backends.pluggable.spi.StorageInUseException;
@@ -664,11 +665,14 @@
{
throw new DirectoryException(getServerErrorResultCode(), ERR_IMPORT_BACKEND_ONLINE.get());
}
- if (importIncludesOrExcludesBranches(cfg.getBaseDN(), importConfig.getIncludeBranches(),
- importConfig.getExcludeBranches()))
+ for (DN dn : cfg.getBaseDN())
{
- // fail-fast to avoid ending up in an unrecoverable state for the server
- throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, ERR_IMPORT_UNSUPPORTED_WITH_BRANCH.get());
+ ImportSuffixCommand openMethod = new ImportSuffixCommand(dn, importConfig);
+ if (openMethod.getSuffixImportStrategy() == SuffixImportStrategy.MERGE_DB_WITH_LDIF)
+ {
+ // fail-fast to avoid ending up in an unrecoverable state for the server
+ throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, ERR_IMPORT_UNSUPPORTED_WITH_BRANCH.get());
+ }
}
try
--
Gitblit v1.10.0