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

Jean-Noel Rouvignac
04.34.2013 ff3d7d233cd306e4fe50e2219fcdfc7f4ec7c920
opends/src/server/org/opends/server/replication/server/changelog/je/DraftCNDbHandler.java
@@ -516,7 +516,7 @@
  /** {@inheritDoc} */
  @Override
  public String getPreviousCookie(long changeNumber)
  public String getPreviousCookie(long changeNumber) throws ChangelogException
  {
    DraftCNDBCursor cursor = null;
    try
@@ -524,11 +524,6 @@
      cursor = db.openReadCursor(changeNumber);
      return cursor.currentValue();
    }
    catch(Exception e)
    {
      debugException("getValue", changeNumber, e);
      return null;
    }
    finally
    {
      close(cursor);
@@ -537,7 +532,7 @@
  /** {@inheritDoc} */
  @Override
  public CSN getCSN(long changeNumber)
  public CSN getCSN(long changeNumber) throws ChangelogException
  {
    DraftCNDBCursor cursor = null;
    try
@@ -545,20 +540,15 @@
      cursor = db.openReadCursor(changeNumber);
      return cursor.currentCSN();
    }
    catch(Exception e)
    {
      debugException("getCSN", changeNumber, e);
      return null;
    }
    finally
    {
      close(cursor);
    }
  }
  /**{@inheritDoc}*/
  /** {@inheritDoc} */
  @Override
  public String getBaseDN(long changeNumber)
  public String getBaseDN(long changeNumber) throws ChangelogException
  {
    DraftCNDBCursor cursor = null;
    try
@@ -566,25 +556,9 @@
      cursor = db.openReadCursor(changeNumber);
      return cursor.currentBaseDN();
    }
    catch(Exception e)
    {
      debugException("getBaseDN", changeNumber, e);
      return null;
    }
    finally
    {
      close(cursor);
    }
  }
  private void debugException(String methodName, long changeNumber, Exception e)
  {
    if (debugEnabled())
      TRACER.debugInfo("In DraftCNDbHandler." + methodName + "(), read: "
          + " key=" + changeNumber + " value returned is null"
          + " first="+ db.readFirstChangeNumber()
          + " last=" + db.readLastChangeNumber()
          + " count=" + db.count()
          + " exception " + e + " " + e.getMessage());
  }
}