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

boli
24.50.2006 bf7b61bf7e22fc0c1c0bf69255f44d0139c86937
opends/src/server/org/opends/server/core/CoreConfigManager.java
@@ -532,8 +532,8 @@
    // Determine the default server size limit.
    msgID = MSGID_CONFIG_CORE_DESCRIPTION_SIZE_LIMIT;
    IntegerConfigAttribute sizeLimitStub =
         new IntegerConfigAttribute(ATTR_SIZE_LIMIT, getMessage(msgID), true,
                                    false, false, true, 0, true,
         new IntegerConfigAttribute(ATTR_SIZE_LIMIT, getMessage(msgID), false,
                                    false, false, true, -1, true,
                                    Integer.MAX_VALUE);
    try
    {
@@ -567,7 +567,7 @@
    msgID = MSGID_CONFIG_CORE_DESCRIPTION_TIME_LIMIT;
    IntegerWithUnitConfigAttribute timeLimitStub =
         new IntegerWithUnitConfigAttribute(ATTR_TIME_LIMIT, getMessage(msgID),
                                            false, timeUnits, true, 0, true,
                                            false, timeUnits, true, -1, true,
                                            Integer.MAX_VALUE);
    try
    {
@@ -598,6 +598,41 @@
    }
    // Determine the default server lookthrough limit.
    msgID = MSGID_CONFIG_CORE_DESCRIPTION_LOOKTHROUGH_LIMIT;
    IntegerConfigAttribute lookthroughLimitStub =
         new IntegerConfigAttribute(ATTR_LOOKTHROUGH_LIMIT, getMessage(msgID),
                                    false, false, false, true, -1, true,
                                    Integer.MAX_VALUE);
    try
    {
      IntegerConfigAttribute lookthroughLimitAttr =
           (IntegerConfigAttribute)
           configRoot.getConfigAttribute(lookthroughLimitStub);
      if (lookthroughLimitAttr == null)
      {
        DirectoryServer.setLookthroughLimit(DEFAULT_LOOKTHROUGH_LIMIT);
      }
      else
      {
        DirectoryServer.setLookthroughLimit(
            lookthroughLimitAttr.activeIntValue());
      }
    }
    catch (Exception e)
    {
      // An error occurred, but this should not be considered fatal.  Log an
      // error message and use the default.
      assert debugException(CLASS_NAME, "initializeCoreConfig", e);
      logError(ErrorLogCategory.CONFIGURATION, ErrorLogSeverity.SEVERE_ERROR,
               MSGID_CONFIG_CORE_INVALID_LOOKTHROUGH_LIMIT, configRoot.getDN(),
               String.valueOf(e));
      DirectoryServer.setLookthroughLimit(DEFAULT_LOOKTHROUGH_LIMIT);
    }
    // Determine the writability mode for the Directory Server.  By default, it
    // will be writable.
    WritabilityMode writabilityMode = WritabilityMode.ENABLED;
@@ -2135,6 +2170,40 @@
    }
    // Get the server lookthrough limit.
    int lookthroughLimit = DEFAULT_LOOKTHROUGH_LIMIT;
    msgID = MSGID_CONFIG_CORE_DESCRIPTION_LOOKTHROUGH_LIMIT;
    IntegerConfigAttribute lookthroughLimitStub =
         new IntegerConfigAttribute(ATTR_LOOKTHROUGH_LIMIT,
             getMessage(msgID), false, false, false, true, -1, true,
             Integer.MAX_VALUE);
    try
    {
      IntegerConfigAttribute lookthroughLimitAttr =
           (IntegerConfigAttribute)
           configEntry.getConfigAttribute(lookthroughLimitStub);
      if (lookthroughLimitAttr != null)
      {
        lookthroughLimit = lookthroughLimitAttr.pendingIntValue();
      }
    }
    catch (Exception e)
    {
      assert debugException(CLASS_NAME, "applyNewConfiguration", e);
      // An error occurred, so we will not allow this configuration change to
      // take place.
      if (resultCode == ResultCode.SUCCESS)
      {
        resultCode = ResultCode.INVALID_ATTRIBUTE_SYNTAX;
      }
      msgID = MSGID_CONFIG_CORE_INVALID_LOOKTHROUGH_LIMIT;
      resultMessages.add(getMessage(msgID, configEntry.getDN().toString(),
                                    String.valueOf(e)));
    }
    // Get the server writability mode.
    HashSet<String> writabilityModes = new HashSet<String>(3);
    writabilityModes.add(WritabilityMode.ENABLED.toString());
@@ -2377,6 +2446,16 @@
      }
      DirectoryServer.setLookthroughLimit(lookthroughLimit);
      if (detailedResults)
      {
        resultMessages.add(getMessage(MSGID_CONFIG_SET_ATTRIBUTE,
                                      ATTR_LOOKTHROUGH_LIMIT,
                                      String.valueOf(lookthroughLimit),
                                      configEntryDN.toString()));
      }
      DirectoryServer.setWritabilityMode(writabilityMode);
      if (detailedResults)
      {