Search in sources :

Example 1 with ExternalResourceEvent

use of com.evolveum.midpoint.provisioning.api.ExternalResourceEvent in project midpoint by Evolveum.

the class ModelController method notifyChange.

// endregion
public void notifyChange(ResourceObjectShadowChangeDescriptionType changeDescription, Task task, OperationResult parentResult) throws CommonException {
    OperationResult result = parentResult.createSubresult(NOTIFY_CHANGE);
    try {
        PrismObject<ShadowType> oldRepoShadow = getOldRepoShadow(changeDescription, task, result);
        PrismObject<ShadowType> resourceObject = getResourceObject(changeDescription);
        ObjectDelta<ShadowType> objectDelta = getObjectDelta(changeDescription, result);
        ExternalResourceEvent event = new ExternalResourceEvent(objectDelta, resourceObject, oldRepoShadow, changeDescription.getChannel());
        LOGGER.trace("Created event description:\n{}", event.debugDumpLazily());
        dispatcher.notifyEvent(event, task, result);
    } catch (TunnelException te) {
        Throwable cause = te.getCause();
        if (cause instanceof CommonException) {
            result.recordFatalError(cause);
            throw (CommonException) cause;
        } else if (cause != null) {
            result.recordFatalError(cause);
            throw new SystemException(cause);
        } else {
            // very strange case
            result.recordFatalError(te);
            throw te;
        }
    } catch (Throwable t) {
        result.recordFatalError(t);
        throw t;
    } finally {
        result.computeStatusIfUnknown();
    }
}
Also used : ExternalResourceEvent(com.evolveum.midpoint.provisioning.api.ExternalResourceEvent) OperationResult(com.evolveum.midpoint.schema.result.OperationResult)

Aggregations

ExternalResourceEvent (com.evolveum.midpoint.provisioning.api.ExternalResourceEvent)1 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)1