Search in sources :

Example 1 with ProjectionObjectDeltaType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.ProjectionObjectDeltaType in project midpoint by Evolveum.

the class ObjectTreeDeltas method fromObjectTreeDeltasType.

public static ObjectTreeDeltas fromObjectTreeDeltasType(ObjectTreeDeltasType deltasType, PrismContext prismContext) throws SchemaException {
    Validate.notNull(prismContext, "prismContext");
    if (deltasType == null) {
        return null;
    }
    ObjectTreeDeltas deltas = new ObjectTreeDeltas(prismContext);
    if (deltasType.getFocusPrimaryDelta() != null) {
        deltas.setFocusChange(DeltaConvertor.createObjectDelta(deltasType.getFocusPrimaryDelta(), prismContext));
    }
    for (ProjectionObjectDeltaType projectionObjectDeltaType : deltasType.getProjectionPrimaryDelta()) {
        ResourceShadowDiscriminator rsd = ResourceShadowDiscriminator.fromResourceShadowDiscriminatorType(projectionObjectDeltaType.getResourceShadowDiscriminator());
        ObjectDelta objectDelta = DeltaConvertor.createObjectDelta(projectionObjectDeltaType.getPrimaryDelta(), prismContext);
        deltas.addProjectionChange(rsd, objectDelta);
    }
    return deltas;
}
Also used : ObjectDelta(com.evolveum.midpoint.prism.delta.ObjectDelta) ProjectionObjectDeltaType(com.evolveum.midpoint.xml.ns._public.common.common_3.ProjectionObjectDeltaType)

Example 2 with ProjectionObjectDeltaType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.ProjectionObjectDeltaType in project midpoint by Evolveum.

the class SceneUtil method visualizeObjectTreeDeltas.

public static Scene visualizeObjectTreeDeltas(ObjectTreeDeltasType deltas, String displayNameKey, PrismContext prismContext, ModelInteractionService modelInteractionService, Task task, OperationResult result) throws SchemaException, ExpressionEvaluationException {
    List<Scene> scenes = new ArrayList<>();
    if (deltas != null) {
        if (deltas.getFocusPrimaryDelta() != null) {
            ObjectDelta<? extends ObjectType> delta = DeltaConvertor.createObjectDelta(deltas.getFocusPrimaryDelta(), prismContext);
            scenes.add(modelInteractionService.visualizeDelta(delta, task, result));
        }
        for (ProjectionObjectDeltaType projectionObjectDelta : deltas.getProjectionPrimaryDelta()) {
            ObjectDelta<? extends ObjectType> delta = DeltaConvertor.createObjectDelta(projectionObjectDelta.getPrimaryDelta(), prismContext);
            scenes.add(modelInteractionService.visualizeDelta(delta, task, result));
        }
    }
    return new WrapperScene(scenes, displayNameKey);
}
Also used : ArrayList(java.util.ArrayList) Scene(com.evolveum.midpoint.model.api.visualizer.Scene) ProjectionObjectDeltaType(com.evolveum.midpoint.xml.ns._public.common.common_3.ProjectionObjectDeltaType)

Example 3 with ProjectionObjectDeltaType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.ProjectionObjectDeltaType in project midpoint by Evolveum.

the class ObjectTreeDeltas method toObjectTreeDeltasType.

public ObjectTreeDeltasType toObjectTreeDeltasType() throws SchemaException {
    ObjectTreeDeltasType jaxb = new ObjectTreeDeltasType();
    if (getFocusChange() != null) {
        jaxb.setFocusPrimaryDelta(DeltaConvertor.toObjectDeltaType(getFocusChange()));
    }
    Set<Map.Entry<ResourceShadowDiscriminator, ObjectDelta<ShadowType>>> entries = (Set<Map.Entry<ResourceShadowDiscriminator, ObjectDelta<ShadowType>>>) getProjectionChangeMapEntries();
    for (Map.Entry<ResourceShadowDiscriminator, ObjectDelta<ShadowType>> entry : entries) {
        ProjectionObjectDeltaType projChange = new ProjectionObjectDeltaType();
        projChange.setResourceShadowDiscriminator(entry.getKey().toResourceShadowDiscriminatorType());
        projChange.setPrimaryDelta(DeltaConvertor.toObjectDeltaType(entry.getValue()));
        jaxb.getProjectionPrimaryDelta().add(projChange);
    }
    return jaxb;
}
Also used : ObjectTreeDeltasType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectTreeDeltasType) ShadowType(com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType) ObjectDelta(com.evolveum.midpoint.prism.delta.ObjectDelta) ProjectionObjectDeltaType(com.evolveum.midpoint.xml.ns._public.common.common_3.ProjectionObjectDeltaType)

Aggregations

ProjectionObjectDeltaType (com.evolveum.midpoint.xml.ns._public.common.common_3.ProjectionObjectDeltaType)3 ObjectDelta (com.evolveum.midpoint.prism.delta.ObjectDelta)2 Scene (com.evolveum.midpoint.model.api.visualizer.Scene)1 ObjectTreeDeltasType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectTreeDeltasType)1 ShadowType (com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType)1 ArrayList (java.util.ArrayList)1