com.evolveum.midpoint.model.api.hooks
Interface ChangeHook


public interface ChangeHook

TODO This applies to all changes, therefore it will "hook" into addObject, modifyObject and also deleteObject.

Author:
semancik

Method Summary
 HookOperationMode postChange(java.util.Collection<ObjectDelta<?>> changes, Task task, OperationResult result)
          Callback after the change is executed by the model.
 HookOperationMode preChangePrimary(java.util.Collection<ObjectDelta<?>> changes, Task task, OperationResult result)
          Callback before the change is processed by the model.
 HookOperationMode preChangeSecondary(java.util.Collection<ObjectDelta<?>> changes, Task task, OperationResult result)
          Callback before the change is processed by the model.
 

Method Detail

preChangePrimary

HookOperationMode preChangePrimary(java.util.Collection<ObjectDelta<?>> changes,
                                   Task task,
                                   OperationResult result)
Callback before the change is processed by the model. The callback is in the "primary" change phase. It is called before the policies and expressions are being executed. The callback may validate or even manipulate the changes before they are processed e.g. by approval process. The (manipulated) changes will be recomputed to secondary changes after this step. If the method returns FOREGROUND then the value of "changes" parameter will be used directly. Otherwise the return value from the task will be used.

Parameters:
changes - primary changes
task - task in which context we execute
result - ????
Returns:
indication of hook operation mode (foreground or background)
See Also:
HookOperationMode

preChangeSecondary

HookOperationMode preChangeSecondary(java.util.Collection<ObjectDelta<?>> changes,
                                     Task task,
                                     OperationResult result)
Callback before the change is processed by the model. The callback is in the "secondary" change phase. It is called after the policies and expressions are being executed but before the change is applied to repository and resources. The callback may validate or even manipulate the changes before they are executed. The (manipulated) changes will NOT be recomputed again and will be directly applied. If the method returns FOREGROUND then the value of "changes" parameter will be used directly. Otherwise the return value from the task will be used.

Parameters:
changes - secondary changes
task - task in which context we execute
result - ????
Returns:
indication of hook operation mode (foreground or background)
See Also:
HookOperationMode

postChange

HookOperationMode postChange(java.util.Collection<ObjectDelta<?>> changes,
                             Task task,
                             OperationResult result)
Callback after the change is executed by the model. The callback gets a view of the changes after they were executed - with filled-in OIDs, generated values, etc. The callback may be used to post-process the changes, e.g. to notify users about their new accounts. If the method returns FOREGROUND then the value of "changes" parameter will be used directly (if needed). Otherwise the return value from the task will be used.

Parameters:
changes - changes after the execution
task - task in which context we execute
result - ????
Returns:
indication of hook operation mode (foreground or background)
See Also:
HookOperationMode


Copyright © 2012 evolveum. All Rights Reserved.