| | |
| | | if ((!deleteOperation.isSynchronizationOperation()) |
| | | && (!brokerIsConnected(deleteOperation))) |
| | | { |
| | | return new SynchronizationProviderResult(false); |
| | | Message msg = ERR_REPLICATION_COULD_NOT_CONNECT.get(baseDN.toString()); |
| | | return new SynchronizationProviderResult.StopProcessing( |
| | | ResultCode.UNWILLING_TO_PERFORM, msg); |
| | | } |
| | | |
| | | DeleteContext ctx = |
| | |
| | | * operation will try to find the correct entry and restart a new |
| | | * operation. |
| | | */ |
| | | deleteOperation.setResultCode(ResultCode.NO_SUCH_OBJECT); |
| | | return new SynchronizationProviderResult(false); |
| | | return new SynchronizationProviderResult.StopProcessing( |
| | | ResultCode.NO_SUCH_OBJECT, null); |
| | | } |
| | | } |
| | | else |
| | |
| | | ctx = new DeleteContext(changeNumber, modifiedEntryUUID); |
| | | deleteOperation.setAttachment(SYNCHROCONTEXT, ctx); |
| | | } |
| | | return new SynchronizationProviderResult(true); |
| | | return new SynchronizationProviderResult.ContinueProcessing(); |
| | | } |
| | | |
| | | /** |
| | |
| | | if ((!addOperation.isSynchronizationOperation()) |
| | | && (!brokerIsConnected(addOperation))) |
| | | { |
| | | return new SynchronizationProviderResult(false); |
| | | Message msg = ERR_REPLICATION_COULD_NOT_CONNECT.get(baseDN.toString()); |
| | | return new SynchronizationProviderResult.StopProcessing( |
| | | ResultCode.UNWILLING_TO_PERFORM, msg); |
| | | } |
| | | |
| | | if (addOperation.isSynchronizationOperation()) |
| | |
| | | String uuid = ctx.getEntryUid(); |
| | | if (findEntryDN(uuid) != null) |
| | | { |
| | | addOperation.setResultCode(ResultCode.CANCELED); |
| | | return new SynchronizationProviderResult(false); |
| | | return new SynchronizationProviderResult.StopProcessing( |
| | | ResultCode.CANCELED, null); |
| | | } |
| | | |
| | | /* The parent entry may have been renamed here since the change was done |
| | |
| | | // The parent does not exist with the specified unique id |
| | | // stop the operation with NO_SUCH_OBJECT and let the |
| | | // conflict resolution or the dependency resolution solve this. |
| | | addOperation.setResultCode(ResultCode.NO_SUCH_OBJECT); |
| | | return new SynchronizationProviderResult(false); |
| | | return new SynchronizationProviderResult.StopProcessing( |
| | | ResultCode.NO_SUCH_OBJECT, null); |
| | | } |
| | | else |
| | | { |
| | |
| | | // parentEntry has been renamed |
| | | // replication name conflict resolution is expected to fix that |
| | | // later in the flow |
| | | addOperation.setResultCode(ResultCode.NO_SUCH_OBJECT); |
| | | return new SynchronizationProviderResult(false); |
| | | return new SynchronizationProviderResult.StopProcessing( |
| | | ResultCode.NO_SUCH_OBJECT, null); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return new SynchronizationProviderResult(true); |
| | | return new SynchronizationProviderResult.ContinueProcessing(); |
| | | } |
| | | |
| | | /** |
| | |
| | | * If not set the ResultCode and the response message, |
| | | * interrupt the operation, and return false |
| | | * |
| | | * @param Operation The Operation that needs to be checked. |
| | | * @param op The Operation that needs to be checked. |
| | | * |
| | | * @return true when it OK to process the Operation, false otherwise. |
| | | * When false is returned the resultCode and the reponse message |
| | |
| | | { |
| | | // this isolation policy specifies that the updates are denied |
| | | // when the broker is not connected. |
| | | if (broker.isConnected()) |
| | | { |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | Message msg = ERR_REPLICATION_COULD_NOT_CONNECT.get(baseDN.toString()); |
| | | DirectoryException result = |
| | | new DirectoryException( |
| | | ResultCode.UNWILLING_TO_PERFORM, msg); |
| | | |
| | | op.setResponseData(result); |
| | | |
| | | return false; |
| | | } |
| | | return broker.isConnected(); |
| | | } |
| | | // we should never get there as the only possible policies are |
| | | // ACCEPT_ALL_UPDATES and REJECT_ALL_UPDATES |
| | |
| | | if ((!modifyDNOperation.isSynchronizationOperation()) |
| | | && (!brokerIsConnected(modifyDNOperation))) |
| | | { |
| | | return new SynchronizationProviderResult(false); |
| | | Message msg = ERR_REPLICATION_COULD_NOT_CONNECT.get(baseDN.toString()); |
| | | return new SynchronizationProviderResult.StopProcessing( |
| | | ResultCode.UNWILLING_TO_PERFORM, msg); |
| | | } |
| | | |
| | | ModifyDnContext ctx = |
| | |
| | | * operation will try to find the correct entry and restart a new |
| | | * operation. |
| | | */ |
| | | modifyDNOperation.setResultCode(ResultCode.NO_SUCH_OBJECT); |
| | | return new SynchronizationProviderResult(false); |
| | | return new SynchronizationProviderResult.StopProcessing( |
| | | ResultCode.NO_SUCH_OBJECT, null); |
| | | } |
| | | if (modifyDNOperation.getNewSuperior() != null) |
| | | { |
| | |
| | | if ((newParentId != null) && |
| | | (!newParentId.equals(ctx.getNewParentId()))) |
| | | { |
| | | modifyDNOperation.setResultCode(ResultCode.NO_SUCH_OBJECT); |
| | | return new SynchronizationProviderResult(false); |
| | | return new SynchronizationProviderResult.StopProcessing( |
| | | ResultCode.NO_SUCH_OBJECT, null); |
| | | } |
| | | } |
| | | } |
| | |
| | | ctx = new ModifyDnContext(changeNumber, modifiedEntryUUID, newParentId); |
| | | modifyDNOperation.setAttachment(SYNCHROCONTEXT, ctx); |
| | | } |
| | | return new SynchronizationProviderResult(true); |
| | | return new SynchronizationProviderResult.ContinueProcessing(); |
| | | } |
| | | |
| | | /** |
| | |
| | | if ((!modifyOperation.isSynchronizationOperation()) |
| | | && (!brokerIsConnected(modifyOperation))) |
| | | { |
| | | return new SynchronizationProviderResult(false); |
| | | Message msg = ERR_REPLICATION_COULD_NOT_CONNECT.get(baseDN.toString()); |
| | | return new SynchronizationProviderResult.StopProcessing( |
| | | ResultCode.UNWILLING_TO_PERFORM, msg); |
| | | } |
| | | |
| | | ModifyContext ctx = |
| | |
| | | * operation will try to find the correct entry and restart a new |
| | | * operation. |
| | | */ |
| | | modifyOperation.setResultCode(ResultCode.NO_SUCH_OBJECT); |
| | | return new SynchronizationProviderResult(false); |
| | | return new SynchronizationProviderResult.StopProcessing( |
| | | ResultCode.NO_SUCH_OBJECT, null); |
| | | } |
| | | |
| | | /* |
| | |
| | | * This operation becomes a no-op due to conflict resolution |
| | | * stop the processing and send an OK result |
| | | */ |
| | | modifyOperation.setResultCode(ResultCode.SUCCESS); |
| | | return new SynchronizationProviderResult(false); |
| | | return new SynchronizationProviderResult.StopProcessing( |
| | | ResultCode.SUCCESS, null); |
| | | } |
| | | } |
| | | return new SynchronizationProviderResult(true); |
| | | return new SynchronizationProviderResult.ContinueProcessing(); |
| | | } |
| | | |
| | | /** |