| | |
| | | { |
| | | String crossDomainStartState; |
| | | |
| | | try |
| | | { |
| | | draftCompat = true; |
| | | |
| | | DraftCNDbHandler draftCNDb = replicationServer.getDraftCNDbHandler(); |
| | | |
| | | // Any (optimizable) condition on draft changenumber in the request filter ? |
| | | // Any (optimizable) condition on draft CN in the request filter ? |
| | | if (startDraftCN <= 1) |
| | | { |
| | | // Request filter DOES NOT contain any firstDraftCN |
| | |
| | | crossDomainStartState = draftCNDb.getValue(draftCNDb.getFirstKey()); |
| | | |
| | | // And get an iterator to traverse the draftCNDb |
| | | try |
| | | { |
| | | draftCNDbIter = |
| | | draftCNDb.generateIterator(draftCNDb.getFirstKey()); |
| | | } |
| | | catch(Exception e) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | |
| | | if (draftCNDbIter != null) |
| | | draftCNDbIter.releaseCursor(); |
| | | |
| | | throw new DirectoryException( |
| | | ResultCode.OPERATIONS_ERROR, |
| | | Message.raw(Category.SYNC, |
| | | Severity.FATAL_ERROR,"Server Error.")); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | { |
| | | // startDraftCN (from the request filter) is present in the draftCnDb |
| | | // Get an iterator to traverse the draftCNDb |
| | | try |
| | | { |
| | | draftCNDbIter = |
| | | draftCNDb.generateIterator(draftCNDb.getFirstKey()); |
| | | } |
| | | catch(Exception e) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | |
| | | if (draftCNDbIter != null) |
| | | draftCNDbIter.releaseCursor(); |
| | | |
| | | throw new DirectoryException( |
| | | ResultCode.OPERATIONS_ERROR, |
| | | Message.raw(Category.SYNC, |
| | | Severity.FATAL_ERROR,"Server Error.")); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | // startDraftCN provided in the request IS NOT in the DraftCNDb |
| | |
| | | else |
| | | { |
| | | crossDomainStartState = draftCNDb.getValue(draftCNDb.getLastKey()); |
| | | try |
| | | { |
| | | draftCNDbIter = |
| | | draftCNDb.generateIterator(draftCNDb.getLastKey()); |
| | | } |
| | | catch(Exception e) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | |
| | | if (draftCNDbIter != null) |
| | | draftCNDbIter.releaseCursor(); |
| | | |
| | | throw new DirectoryException( |
| | | ResultCode.OPERATIONS_ERROR, |
| | | Message.raw(Category.SYNC, |
| | | Severity.FATAL_ERROR,e.getLocalizedMessage())); |
| | | } |
| | | } |
| | | // TODO:ECL ... ok we'll start from the end of the draftCNDb BUT ... |
| | | // this may be very long. Work on perf improvement here. |
| | | } |
| | |
| | | this.draftCompat = true; |
| | | |
| | | initializeCLDomCtxts(crossDomainStartState); |
| | | |
| | | } |
| | | catch(DirectoryException de) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, de); |
| | | if (draftCNDbIter != null) |
| | | draftCNDbIter.releaseCursor(); |
| | | throw(de); |
| | | } |
| | | catch(Exception e) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | if (draftCNDbIter != null) |
| | | draftCNDbIter.releaseCursor(); |
| | | throw new DirectoryException( |
| | | ResultCode.OPERATIONS_ERROR, |
| | | Message.raw(Category.SYNC, |
| | | Severity.FATAL_ERROR,e.getLocalizedMessage())); |
| | | } |
| | | } |
| | | |
| | | /** |