From c42f15b18d5464ca62dfdf0cfa9de2e3d78bcf12 Mon Sep 17 00:00:00 2001
From: coulbeck <coulbeck@localhost>
Date: Fri, 07 Sep 2007 18:08:46 +0000
Subject: [PATCH] Handle the base DN of the trust store backend properly, taking it from the configuration entry instead of hard-wiring it.
---
opends/src/server/org/opends/server/backends/TrustStoreBackend.java | 28 +++++++++-------------------
1 files changed, 9 insertions(+), 19 deletions(-)
diff --git a/opends/src/server/org/opends/server/backends/TrustStoreBackend.java b/opends/src/server/org/opends/server/backends/TrustStoreBackend.java
index 32ef62d..5621508 100644
--- a/opends/src/server/org/opends/server/backends/TrustStoreBackend.java
+++ b/opends/src/server/org/opends/server/backends/TrustStoreBackend.java
@@ -150,29 +150,19 @@
public void initializeBackend()
throws ConfigException, InitializationException
{
+ DN configEntryDN = configuration.dn();
+
// Create the set of base DNs that we will handle. In this case, it's just
// the DN of the base trust store entry.
- try
+ SortedSet<DN> baseDNSet = configuration.getBackendBaseDN();
+ if (baseDNSet.size() != 1)
{
- // FIXME -- Deal with this more correctly.
- baseDN = DN.decode(DN_TRUST_STORE_ROOT);
- this.baseDNs = new DN[] {baseDN};
+ Message message = ERR_TRUSTSTORE_REQUIRES_ONE_BASE_DN.get(
+ String.valueOf(configEntryDN));
+ throw new InitializationException(message);
}
- catch (Exception e)
- {
- if (debugEnabled())
- {
- TRACER.debugCaught(DebugLogLevel.ERROR, e);
- }
-
- Message message =
- ERR_TRUSTSTORE_CANNOT_DECODE_TRUSTSTORE_ROOT_DN.get(
- getExceptionMessage(e));
- throw new InitializationException(message, e);
- }
-
-
- DN configEntryDN = configuration.dn();
+ baseDN = baseDNSet.first();
+ baseDNs = new DN[] {baseDN};
// Get the path to the trust store file.
trustStoreFile = configuration.getTrustStoreFile();
--
Gitblit v1.10.0