}
catch (DirectoryException de)
{
Message message = ERR_CANNOT_DECODE_BACKEND_BASE_DN.get(
DN_BACKEND_BASE, de.getMessageObject());
throw new ConfigException(message, de);
}
catch (Exception e)
{
Message message = ERR_CANNOT_DECODE_BACKEND_BASE_DN.get(
DN_BACKEND_BASE, getExceptionMessage(e));
throw new ConfigException(message, e);
}
ConfigEntry baseEntry = null;
try
{
baseEntry = DirectoryServer.getConfigEntry(backendBaseDN);
}
catch (ConfigException ce)
{
Message message = ERR_CANNOT_RETRIEVE_BACKEND_BASE_ENTRY.get(
DN_BACKEND_BASE, ce.getMessage());
throw new ConfigException(message, ce);
}
catch (Exception e)
{
Message message = ERR_CANNOT_RETRIEVE_BACKEND_BASE_ENTRY.get(
DN_BACKEND_BASE, getExceptionMessage(e));
throw new ConfigException(message, e);
}
// Iterate through the immediate children, attempting to parse them as
// backends.
TreeMap<String,TreeSet<DN>> backendMap = new TreeMap<String,TreeSet<DN>>();
for (ConfigEntry configEntry : baseEntry.getChildren().values())
{
// Get the backend ID attribute from the entry. If there isn't one, then
// skip the entry.
String backendID = null;
try
{
Message msg = INFO_CONFIG_BACKEND_ATTR_DESCRIPTION_BACKEND_ID.get();
StringConfigAttribute idStub =
new StringConfigAttribute(ATTR_BACKEND_ID, msg,
true, false, true);
StringConfigAttribute idAttr =
(StringConfigAttribute) configEntry.getConfigAttribute(idStub);
if (idAttr == null)
{
continue;
}
else
{
backendID = idAttr.activeValue();
}
}
catch (ConfigException ce)
{
Message message = ERR_CANNOT_DETERMINE_BACKEND_ID.get(
String.valueOf(configEntry.getDN()), ce.getMessage());
throw new ConfigException(message, ce);
}
catch (Exception e)
{
Message message = ERR_CANNOT_DETERMINE_BACKEND_ID.get(
String.valueOf(configEntry.getDN()), getExceptionMessage(e));
throw new ConfigException(message, e);
}
// Get the base DN attribute from the entry. If there isn't one, then
// just skip this entry.
TreeSet<DN> baseDNs = new TreeSet<DN>();
try
{
Message msg = INFO_CONFIG_BACKEND_ATTR_DESCRIPTION_BASE_DNS.get();
DNConfigAttribute baseDNStub =
new DNConfigAttribute(ATTR_BACKEND_BASE_DN, msg,
true, true, true);
DNConfigAttribute baseDNAttr =
(DNConfigAttribute) configEntry.getConfigAttribute(baseDNStub);
if (baseDNAttr != null)
{
baseDNs.addAll(baseDNAttr.activeValues());
}
}
catch (Exception e)
{
Message message = ERR_CANNOT_DETERMINE_BASES_FOR_BACKEND.get(
String.valueOf(configEntry.getDN()), getExceptionMessage(e));
throw new ConfigException(message, e);
}
backendMap.put(backendID, baseDNs);
}