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

dugan
19.17.2006 aa160386929ecf4162592214c75ae577a019be50
opends/src/server/org/opends/server/backends/jeb/VerifyJob.java
@@ -201,10 +201,11 @@
   * Verify the backend.
   *
   * @param rootContainer The root container that holds the entries to verify.
   * @param statEntry Optional statistics entry.
   * @throws DatabaseException If an error occurs in the JE database.
   * @throws JebException If an error occurs in the JE backend.
   */
  public void verifyBackend(RootContainer rootContainer) throws
  public void verifyBackend(RootContainer rootContainer, Entry statEntry) throws
      DatabaseException, JebException
  {
@@ -325,6 +326,10 @@
      rate = 1000f*keyCount / totalTime;
    }
    addStatEntry(statEntry, "verify-error-count",
              String.valueOf(errorCount));
    addStatEntry(statEntry, "verify-key-count",
              String.valueOf(keyCount));
    if (cleanMode)
    {
      int msgID = MSGID_JEB_VERIFY_CLEAN_FINAL_STATUS;
@@ -345,21 +350,29 @@
        message = getMessage(msgID, multiReferenceCount);
        logError(ErrorLogCategory.BACKEND, ErrorLogSeverity.NOTICE,
                 message, msgID);
        addStatEntry(statEntry, "verify-multiple-reference-count",
                String.valueOf(multiReferenceCount));
        msgID = MSGID_JEB_VERIFY_ENTRY_LIMIT_EXCEEDED_COUNT;
        message = getMessage(msgID, entryLimitExceededCount);
        logError(ErrorLogCategory.BACKEND, ErrorLogSeverity.NOTICE,
                 message, msgID);
        addStatEntry(statEntry, "verify-entry-limit-exceeded-count",
                String.valueOf(entryLimitExceededCount));
        msgID = MSGID_JEB_VERIFY_AVERAGE_REFERENCE_COUNT;
        message = getMessage(msgID, averageEntryReferences);
        logError(ErrorLogCategory.BACKEND, ErrorLogSeverity.NOTICE,
                 message, msgID);
        addStatEntry(statEntry, "verify-average-reference-count",
                String.valueOf(averageEntryReferences));
        msgID = MSGID_JEB_VERIFY_MAX_REFERENCE_COUNT;
        message = getMessage(msgID, maxEntryPerValue);
        logError(ErrorLogCategory.BACKEND, ErrorLogSeverity.NOTICE,
                 message, msgID);
        addStatEntry(statEntry, "verify-max-reference-count",
                   String.valueOf(maxEntryPerValue));
      }
    }
    else
@@ -369,7 +382,7 @@
                                  totalTime/1000, rate);
      logError(ErrorLogCategory.BACKEND, ErrorLogSeverity.NOTICE,
               message, msgID);
      //TODO add entry-limit-stats to the statEntry
      if (entryLimitMap.size() > 0)
      {
        msgID = MSGID_JEB_VERIFY_ENTRY_LIMIT_STATS_HEADER;
@@ -1601,4 +1614,20 @@
      previousTime = latestTime;
    }
  }
    /**
     * Adds an attribute of type t and value v to the statEntry, only if the
     * statEntry is not null.
     * @param statEntry passed in from backentryImpl.verifyBackend.
     * @param t String to be used as the attribute type.
     * @param v String to be used as the attribute value.
     */
    private void addStatEntry(Entry statEntry, String t, String v)
    {
        if (statEntry != null)
        {
            Attribute a = new Attribute(t, v);
            statEntry.addAttribute(a, null);
        }
    }
}