| | |
| | | domain.registerHandler(mh); |
| | | newDomainCtxt.mh = mh; |
| | | |
| | | previousCookie.update(newDomainCtxt.rsDomain.getBaseDN(), |
| | | newDomainCtxt.startState.duplicate()); |
| | | previousCookie.replace(newDomainCtxt.rsDomain.getBaseDN(), |
| | | newDomainCtxt.startState.duplicate()); |
| | | |
| | | results.add(newDomainCtxt); |
| | | } |
| | |
| | | final DomainContext oldestContext = findDomainCtxtWithOldestChange(); |
| | | if (oldestContext != null) |
| | | { |
| | | final ECLUpdateMsg change = newECLUpdateMsg(oldestContext); |
| | | oldestContext.currentState.update(change.getUpdateMsg().getCSN()); |
| | | if (draftCompat) |
| | | { |
| | | assignNewChangeNumberAndStore(change); |
| | | } |
| | | oldestChange = change; |
| | | oldestChange = newECLUpdateMsg(oldestContext); |
| | | oldestContext.currentState.update( |
| | | oldestChange.getUpdateMsg().getCSN()); |
| | | } |
| | | } |
| | | } |
| | |
| | | * if a database problem occurs. |
| | | */ |
| | | private boolean assignChangeNumber(final ECLUpdateMsg replicaDBChange) |
| | | throws ChangelogException |
| | | throws ChangelogException, DirectoryException |
| | | { |
| | | // We also need to check if the CNIndexDB is consistent with the replicaDBs. |
| | | // If not, 2 potential reasons: |
| | |
| | | CSN csnFromReplicaDB = replicaDBChange.getUpdateMsg().getCSN(); |
| | | DN baseDNFromReplicaDB = replicaDBChange.getBaseDN(); |
| | | |
| | | while (true) |
| | | while (!isEndOfCNIndexDBReached) |
| | | { |
| | | if (isEndOfCNIndexDBReached) |
| | | { |
| | | // we are at the end of the CNIndexDB in the append mode |
| | | assignNewChangeNumberAndStore(replicaDBChange); |
| | | return true; |
| | | } |
| | | |
| | | final ChangeNumberIndexRecord currentRecord = cnIndexDBCursor.getRecord(); |
| | | final CSN csnFromCNIndexDB = currentRecord.getCSN(); |
| | | final DN baseDNFromCNIndexDB = currentRecord.getBaseDN(); |
| | |
| | | + currentRecord.getChangeNumber() + " to change=" |
| | | + replicaDBChange); |
| | | |
| | | previousCookie = |
| | | new MultiDomainServerState(currentRecord.getPreviousCookie()); |
| | | replicaDBChange.setCookie(previousCookie); |
| | | replicaDBChange.setChangeNumber(currentRecord.getChangeNumber()); |
| | | return true; |
| | | } |
| | |
| | | // continuously throws ChangelogExceptions |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | private Date asDate(CSN csn) |
| | |
| | | return sameDN && sameCSN; |
| | | } |
| | | |
| | | private void assignNewChangeNumberAndStore(ECLUpdateMsg change) |
| | | throws ChangelogException |
| | | { |
| | | final ChangeNumberIndexRecord record = |
| | | new ChangeNumberIndexRecord(previousCookie.toString(), |
| | | change.getBaseDN(), change.getUpdateMsg().getCSN()); |
| | | // store in CNIndexDB the pair |
| | | // (change number of the current change, state before this change) |
| | | change.setChangeNumber( |
| | | replicationServer.getChangeNumberIndexDB().addRecord(record)); |
| | | } |
| | | |
| | | /** |
| | | * Terminates the first (non persistent) phase of the search on the ECL. |
| | | */ |