| | |
| | | public boolean replayOperation(Iterator<Modification> modsIterator, CSN csn, |
| | | Entry modifiedEntry, Modification m) |
| | | { |
| | | if (csn.isNewerThanOrEqualTo(getLastUpdateTime()) |
| | | && m.getModificationType() == ModificationType.REPLACE) |
| | | { |
| | | processLocalOrNonConflictModification(csn, m); |
| | | return false;// the attribute was not modified more recently |
| | | } |
| | | // We are replaying an operation that was already done |
| | | // on another master server and this operation has a potential |
| | | // conflict with some more recent operations on this same entry |
| | | // we need to take the more complex path to solve them |
| | | if (CSN.compare(csn, getLastUpdateTime()) < 0 || |
| | | m.getModificationType() != ModificationType.REPLACE) |
| | | return replayPotentialConflictModification(modsIterator, csn, modifiedEntry, m); |
| | | } |
| | | |
| | | private boolean replayPotentialConflictModification(Iterator<Modification> modsIterator, CSN csn, |
| | | Entry modifiedEntry, Modification m) |
| | | { |
| | | // the attribute was modified after this change -> conflict |
| | | |
| | | switch (m.getModificationType().asEnum()) |
| | | { |
| | | case DELETE: |
| | |
| | | return false; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | processLocalOrNonConflictModification(csn, m); |
| | | return false;// the attribute was not modified more recently |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void processLocalOrNonConflictModification(CSN csn, Modification mod) |