This set of changes is aiming at having a more consistent
and clean code when an operation is canceled.
With the refactoring, the processing of an operation is split
into a global processing (in XxxOperationBasis) and a local
processing (in LocalBackendWorkflowElement). Because of
that split, we have some piece of code that are duplicated
at the global level and at the local level. For example, whenever
an operation is canceled we have to call indicateCancelled()
then stop the processing time, then log the response and
then invoke the post response plugins. Moreover, the call
to startProcessingTime is done at the global level while the
stopProcessingTime may be called at the local level, which
is not a good thing.
With the new code:
- do not process canceled operation in local processing
- try to not duplicated the code when an operation is canceled
- try to not duplicated the code when a connection is terminated
- When a terminated connection or a canceled operation is
detected in the local processing we just return to the global
processing and let the global processing handle the case
Now, right after the processing bloc at the global level:
- if a connection is terminated
-- call stopProcessingTime
-- log the response
- elsif the operation has been canceled
-- call indicateCancelled
-- call stopProcessingTime
-- log the response
-- invoke the post response plugins
- else (normal case)
-- call stopProcessingTime
-- send the response
-- log the response
-- notify the persistent searches (for Add, Delete, Modify, ModifyDN)
-- invoke the post response plugins