OPENDJ-1116 Introduce abstraction for the changelog DB
Added CNIndexData class to replace the conjunct use of the (CSN, baseDN, previousCookie) tuple along with the changeNumber.
It allowed to replace:
- several parameters list with all theses types
- several groups of methods returning instances of these types with duplicate code in the implementation.
Remainder of r9504: changed changeNumber from int to long.
CNIndexData.java: ADDED
*.java:
Consequence of introducing CNIndexData class.
ECLServerHandler.java:
Renamed releaseIterator() into releaseCursor().
In getNextECLUpdate(), aggregated consecutive if statements + added a debugInfo().
Renamed assignNewDraftCNAndStore() to assignNewChangeNumberAndStore().
Changed changeNumber from int to long.
ChangeNumberIndexDB.java:
Replaced getCSN(), getBaseDN() and getPreviousCookie() by getCNIndexData().
Renamed getFirstChangeNumber() to getFirstCNIndexData().
Added getLastCNIndexData().
Changed add() signature.
DraftCNDbHandler.java
Consequence of the change to implemented interface ChangeNumberIndexDB.
Changed changeNumber from int to long.
Added getChangeNumber().
ChangeNumberIndexDBCursor.java:
Replaced getCSN(), getBaseDN() and getPreviousCookie() by getCNIndexData().
DraftCNDbIterator.java
Consequence of the change to implemented interface ChangeNumberIndexDBCursor.
DraftCNData.java:
Added changeNumber field + getter.
Replaced fields value, baseDN and csn by cnIndexData + getters.
Renamed readFirstChangeNumber() and readLastChangeNumber() to readFirstCNIndexData() and readLastCNIndexData().
Added newCNIndexData().
In inner class DraftCNDBCursor, Field key is now a ReplicationDraftCNKey (was DatabaseEntry) + DraftCNData field has been replaced with CNIndexData + entry is initialized on construction.
Replaced currentValue(), currentBaseDN(), currentCSN() and currentKey() by currentData().
Removed getKey().
ReplicationDraftCNKey.java:
Added a default ctor.
In getChangeNumber(), matched the code in DraftCNDB.
DraftCNDbHandlerTest.java:
Added assertEqualTo(), getFirstChangeNumber(), getLastChangeNumber(), getPreviousCookie().