mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

boli
01.27.2007 455897cc245b67d929f409a93cfa7106e835cc1f
opends/src/server/org/opends/server/core/RootDNConfigManager.java
@@ -56,7 +56,9 @@
import org.opends.server.types.ResultCode;
import static org.opends.server.config.ConfigConstants.*;
import static org.opends.server.loggers.Debug.*;
import static org.opends.server.loggers.debug.DebugLogger.debugCought;
import static org.opends.server.loggers.debug.DebugLogger.debugEnabled;
import org.opends.server.types.DebugLogLevel;
import static org.opends.server.loggers.Error.*;
import static org.opends.server.messages.ConfigMessages.*;
import static org.opends.server.messages.MessageHandler.*;
@@ -76,11 +78,6 @@
       implements ConfigChangeListener, ConfigAddListener, ConfigDeleteListener,
                  ConfigurableComponent
{
  /**
   * The fully-qualified name of this class for debugging purposes.
   */
  private static final String CLASS_NAME =
       "org.opends.server.core.RootDNConfigManager";
@@ -102,7 +99,6 @@
   */
  public RootDNConfigManager()
  {
    assert debugConstructor(CLASS_NAME);
    bindMappings = new ConcurrentHashMap<DN,List<DN>>();
  }
@@ -123,7 +119,6 @@
  public void initializeRootDNs()
         throws ConfigException, InitializationException
  {
    assert debugEnter(CLASS_NAME, "initializeRootDNs");
    // First, get the base configuration entry for the root DNs.
@@ -136,7 +131,10 @@
    }
    catch (Exception e)
    {
      assert debugException(CLASS_NAME, "initializeRootDNs", e);
      if (debugEnabled())
      {
        debugCought(DebugLogLevel.ERROR, e);
      }
      int    msgID   = MSGID_CONFIG_ROOTDN_CANNOT_GET_BASE;
      String message = getMessage(msgID, String.valueOf(e));
@@ -192,7 +190,10 @@
    }
    catch (Exception e)
    {
      assert debugException(CLASS_NAME, "initializeRootDNs", e);
      if (debugEnabled())
      {
        debugCought(DebugLogLevel.ERROR, e);
      }
      msgID = MSGID_CONFIG_ROOTDN_ERROR_DETERMINING_ROOT_PRIVILEGES;
      String message = getMessage(msgID, stackTraceToSingleLineString(e));
@@ -280,7 +281,6 @@
   */
  public Set<Privilege> getRootPrivileges()
  {
    assert debugEnter(CLASS_NAME, "getRootPrivileges");
    return rootPrivileges;
  }
@@ -303,8 +303,6 @@
  public boolean configChangeIsAcceptable(ConfigEntry configEntry,
                                          StringBuilder unacceptableReason)
  {
    assert debugEnter(CLASS_NAME, "configChangeIsAcceptable",
                      String.valueOf(configEntry), "java.lang.StringBuilder");
    // Make sure that the entry has an appropriate objectclass for a root DN.
@@ -349,7 +347,10 @@
    }
    catch (Exception e)
    {
      assert debugException(CLASS_NAME, "configChangeIsAcceptable", e);
      if (debugEnabled())
      {
        debugCought(DebugLogLevel.ERROR, e);
      }
      msgID = MSGID_CONFIG_ROOTDN_CANNOT_PARSE_ALTERNATE_BIND_DNS;
      String message = getMessage(msgID, String.valueOf(configEntry.getDN()),
@@ -377,8 +378,6 @@
   */
  public ConfigChangeResult applyConfigurationChange(ConfigEntry configEntry)
  {
    assert debugEnter(CLASS_NAME, "applyConfigurationChange",
                      String.valueOf(configEntry));
    DN                configEntryDN       = configEntry.getDN();
@@ -404,7 +403,10 @@
    }
    catch (Exception e)
    {
      assert debugException(CLASS_NAME, "applyConfigurationChange", e);
      if (debugEnabled())
      {
        debugCought(DebugLogLevel.ERROR, e);
      }
      msgID = MSGID_CONFIG_ROOTDN_CANNOT_PARSE_ALTERNATE_BIND_DNS;
      messages.add(getMessage(msgID, stackTraceToSingleLineString(e)));
@@ -443,7 +445,10 @@
          }
          catch (DirectoryException de)
          {
            assert debugException(CLASS_NAME, "applyConfigurationChange", de);
            if (debugEnabled())
            {
              debugCought(DebugLogLevel.ERROR, de);
            }
            msgID = MSGID_CONFIG_ROOTDN_CANNOT_REGISTER_ALTERNATE_BIND_DN;
            messages.add(getMessage(msgID, String.valueOf(alternateBindDN),
@@ -483,8 +488,6 @@
  public boolean configAddIsAcceptable(ConfigEntry configEntry,
                                       StringBuilder unacceptableReason)
  {
    assert debugEnter(CLASS_NAME, "configAddIsAcceptable",
                      String.valueOf(configEntry), "java.lang.StringBuilder");
    // Make sure that no entry already exists with the specified DN, and that
@@ -544,7 +547,10 @@
    }
    catch (Exception e)
    {
      assert debugException(CLASS_NAME, "configAddIsAcceptable", e);
      if (debugEnabled())
      {
        debugCought(DebugLogLevel.ERROR, e);
      }
      msgID = MSGID_CONFIG_ROOTDN_CANNOT_PARSE_ALTERNATE_BIND_DNS;
      String message = getMessage(msgID, stackTraceToSingleLineString(e));
@@ -570,8 +576,6 @@
   */
  public ConfigChangeResult applyConfigurationAdd(ConfigEntry configEntry)
  {
    assert debugEnter(CLASS_NAME, "applyConfigurationAdd",
                      String.valueOf(configEntry));
    DN                configEntryDN       = configEntry.getDN();
@@ -597,7 +601,10 @@
    }
    catch (Exception e)
    {
      assert debugException(CLASS_NAME, "applyConfigurationAdd", e);
      if (debugEnabled())
      {
        debugCought(DebugLogLevel.ERROR, e);
      }
      msgID = MSGID_CONFIG_ROOTDN_CANNOT_PARSE_ALTERNATE_BIND_DNS;
      messages.add(getMessage(msgID, stackTraceToSingleLineString(e)));
@@ -636,7 +643,10 @@
          }
          catch (DirectoryException de)
          {
            assert debugException(CLASS_NAME, "applyConfigurationAdd", de);
            if (debugEnabled())
            {
              debugCought(DebugLogLevel.ERROR, de);
            }
            msgID = MSGID_CONFIG_ROOTDN_CANNOT_REGISTER_ALTERNATE_BIND_DN;
            messages.add(getMessage(msgID, String.valueOf(alternateBindDN),
@@ -677,8 +687,6 @@
  public boolean configDeleteIsAcceptable(ConfigEntry configEntry,
                                          StringBuilder unacceptableReason)
  {
    assert debugEnter(CLASS_NAME, "configDeleteIsAcceptable",
                      String.valueOf(configEntry), "java.lang.StringBuilder");
    // A delete should always be acceptable, so just return true.
@@ -697,8 +705,6 @@
   */
  public ConfigChangeResult applyConfigurationDelete(ConfigEntry configEntry)
  {
    assert debugEnter(CLASS_NAME, "applyConfigurationDelete",
                      String.valueOf(configEntry));
    DN         configEntryDN       = configEntry.getDN();
@@ -732,8 +738,6 @@
   */
  public DN getConfigurableComponentEntryDN()
  {
    assert debugEnter(CLASS_NAME, "getConfigurableComponentEntryDN");
    return rootDNConfigBaseDN;
  }
@@ -748,8 +752,6 @@
   */
  public List<ConfigAttribute> getConfigurationAttributes()
  {
    assert debugEnter(CLASS_NAME, "getConfigurationAttributes");
    LinkedList<ConfigAttribute> attrList = new LinkedList<ConfigAttribute>();
    LinkedList<String> currentValues = new LinkedList<String>();
@@ -789,8 +791,6 @@
  public boolean hasAcceptableConfiguration(ConfigEntry configEntry,
                                            List<String> unacceptableReasons)
  {
    assert debugEnter(CLASS_NAME, "hasAcceptableConfiguration",
                      String.valueOf(configEntry), "List<String>");
    int msgID = MSGID_CONFIG_ROOTDN_DESCRIPTION_ROOT_PRIVILEGE;
@@ -823,7 +823,10 @@
    }
    catch (Exception e)
    {
      assert debugException(CLASS_NAME, "initializeRootDNs", e);
      if (debugEnabled())
      {
        debugCought(DebugLogLevel.ERROR, e);
      }
      msgID = MSGID_CONFIG_ROOTDN_ERROR_DETERMINING_ROOT_PRIVILEGES;
      String message = getMessage(msgID, stackTraceToSingleLineString(e));
@@ -861,9 +864,6 @@
  public ConfigChangeResult applyNewConfiguration(ConfigEntry configEntry,
                                                  boolean detailedResults)
  {
    assert debugEnter(CLASS_NAME, "applyNewConfiguration",
                      String.valueOf(configEntry),
                      String.valueOf(detailedResults));
    ResultCode        resultCode          = ResultCode.SUCCESS;
@@ -914,7 +914,10 @@
    }
    catch (Exception e)
    {
      assert debugException(CLASS_NAME, "initializeRootDNs", e);
      if (debugEnabled())
      {
        debugCought(DebugLogLevel.ERROR, e);
      }
      if (resultCode == ResultCode.SUCCESS)
      {