com.evolveum.midpoint.provisioning.impl
Class ChangeNotificationDispatcherImpl

java.lang.Object
  extended by com.evolveum.midpoint.provisioning.impl.ChangeNotificationDispatcherImpl
All Implemented Interfaces:
ChangeNotificationDispatcher, ProvisioningListener, ResourceObjectChangeListener, ResourceOperationListener

@Component
public class ChangeNotificationDispatcherImpl
extends Object
implements ChangeNotificationDispatcher

Author:
Radovan Semancik

Field Summary
 
Fields inherited from interface com.evolveum.midpoint.provisioning.api.ResourceObjectChangeListener
CHECK_SITUATION, CLASS_NAME_WITH_DOT, NOTIFY_CHANGE
 
Constructor Summary
ChangeNotificationDispatcherImpl()
           
 
Method Summary
 String getName()
          Returns a short name of the listener for debugging purposes.
 void notifyChange(ResourceObjectShadowChangeDescription change, Task task, OperationResult parentResult)
          Submits notification about a specific change that happened on the resource.
 void notifyFailure(ResourceOperationDescription failureDescription, Task task, OperationResult parentResult)
          Submits notification about a failure of provisioning operation.
 void notifyInProgress(ResourceOperationDescription failureDescription, Task task, OperationResult parentResult)
          Submits notification about provisioning operation that is in progress.
 void notifySuccess(ResourceOperationDescription failureDescription, Task task, OperationResult parentResult)
          Submits notification about a success of a provisioning operation.
 void registerNotificationListener(ResourceObjectChangeListener listener)
           
 void registerNotificationListener(ResourceOperationListener listener)
           
 void unregisterNotificationListener(ResourceObjectChangeListener listener)
           
 void unregisterNotificationListener(ResourceOperationListener listener)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChangeNotificationDispatcherImpl

public ChangeNotificationDispatcherImpl()
Method Detail

registerNotificationListener

public void registerNotificationListener(ResourceObjectChangeListener listener)
Specified by:
registerNotificationListener in interface ChangeNotificationDispatcher

registerNotificationListener

public void registerNotificationListener(ResourceOperationListener listener)
Specified by:
registerNotificationListener in interface ChangeNotificationDispatcher

unregisterNotificationListener

public void unregisterNotificationListener(ResourceOperationListener listener)
Specified by:
unregisterNotificationListener in interface ChangeNotificationDispatcher

unregisterNotificationListener

public void unregisterNotificationListener(ResourceObjectChangeListener listener)
Specified by:
unregisterNotificationListener in interface ChangeNotificationDispatcher

notifyChange

public void notifyChange(ResourceObjectShadowChangeDescription change,
                         Task task,
                         OperationResult parentResult)
Description copied from interface: ResourceObjectChangeListener
Submits notification about a specific change that happened on the resource. This describes the change that has already happened on the resource. The upper layers are notified to take that change into an account (synchronize it). The call should return without a major delay. It means that the implementation can do calls to repository, but it should not (synchronously) initiate a long-running process or provisioning request. This operation may be called multiple times with the same change, e.g. in case of failures in IDM or on the resource. The implementation must be able to handle such duplicates.

Specified by:
notifyChange in interface ResourceObjectChangeListener
Parameters:
change - change description

notifyFailure

public void notifyFailure(ResourceOperationDescription failureDescription,
                          Task task,
                          OperationResult parentResult)
Description copied from interface: ResourceOperationListener
Submits notification about a failure of provisioning operation. This describes the operation that was executed on the resource and it failed. The upper layers are notified to handle that failure. This should be called for operations that were executed and failed to execute. This should be called only for the FINAL result. E.g. if the system will never again try the operation. If the operation has been just tried and there is an intermediary failure (e.g. a timeout) then this operation should NOT be called. notifyInProgress is used for that purpose. However, this operation should be called even for timeout-like errors if the system stops trying and will no longer attempt to retry the operation (e.g. if the attempt counter hits the maximum attempts limit). It should be called for both synchronous and asynchronous operations. For synchronous operations it should provide the same result as is returned from the operation.

Specified by:
notifyFailure in interface ResourceOperationListener
parentResult - the result that can be used to collect subresults of the listener execution. It is NOT the result of the operation that failed. That result is inside the operationDescription structure.

notifySuccess

public void notifySuccess(ResourceOperationDescription failureDescription,
                          Task task,
                          OperationResult parentResult)
Description copied from interface: ResourceOperationListener
Submits notification about a success of a provisioning operation. This describes the operation that was executed on the resource and it was successful. The upper layers are notified to post-process the result. It should be called for both synchronous and asynchronous operations. For synchronous operations it should provide the same result as is returned from the operation.

Specified by:
notifySuccess in interface ResourceOperationListener
parentResult - the result that can be used to collect subresults of the listener execution. It is NOT the result of the operation that succeeded. That result is inside the operationDescription structure.

notifyInProgress

public void notifyInProgress(ResourceOperationDescription failureDescription,
                             Task task,
                             OperationResult parentResult)
Description copied from interface: ResourceOperationListener
Submits notification about provisioning operation that is in progress. This describes the operation that was tried to be executed on the resource but cannot be executed immediately. This may be caused by the resource being down (communication error), it may be caused by the mode of resource operation (e.g. asynchronous processing) or by any similar cause. This should be called after each attempt that the operation was tried. The number of attempts already tried in indicated inside operationDescription structure. This can be used e.g. to detect a first attempt to send mail to admin only once. This should NOT be called for the final result of the operation. Methods notifySuccess and notifyFailure should be used instead.

Specified by:
notifyInProgress in interface ResourceOperationListener
parentResult - the result that can be used to collect subresults of the listener execution. It is NOT the result of the operation that is in progress. That result is inside the operationDescription structure.

getName

public String getName()
Description copied from interface: ProvisioningListener
Returns a short name of the listener for debugging purposes. E.g. "model synchronization service". This name is used in log and error messages.

Specified by:
getName in interface ProvisioningListener


Copyright © 2013 evolveum. All Rights Reserved.