Search in sources :

Example 1 with ObjectDeltaWavesType

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

the class ObjectDeltaWaves method toObjectDeltaWavesType.

public ObjectDeltaWavesType toObjectDeltaWavesType() throws SchemaException {
    ObjectDeltaWavesType objectDeltaWavesType = new ObjectDeltaWavesType();
    for (int i = 0; i < waves.size(); i++) {
        ObjectDelta wave = waves.get(i);
        if (wave != null) {
            ObjectDeltaWaveType objectDeltaWaveType = new ObjectDeltaWaveType();
            objectDeltaWaveType.setNumber(i);
            objectDeltaWaveType.setDelta(DeltaConvertor.toObjectDeltaType(wave));
            objectDeltaWavesType.getWave().add(objectDeltaWaveType);
        }
    }
    return objectDeltaWavesType;
}
Also used : ObjectDelta(com.evolveum.midpoint.prism.delta.ObjectDelta) ObjectDeltaWavesType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectDeltaWavesType) ObjectDeltaWaveType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectDeltaWaveType)

Example 2 with ObjectDeltaWavesType

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

the class ObjectDeltaWaves method fromObjectDeltaWavesType.

// don't forget to apply provisioning definitions to resulting deltas (it's the client responsibility)
public static <O extends ObjectType> ObjectDeltaWaves<O> fromObjectDeltaWavesType(ObjectDeltaWavesType secondaryDeltas, PrismContext prismContext) throws SchemaException {
    if (secondaryDeltas == null) {
        return null;
    }
    ObjectDeltaWaves<O> retval = new ObjectDeltaWaves<>();
    int max = 0;
    for (ObjectDeltaWaveType odwt : secondaryDeltas.getWave()) {
        if (odwt.getNumber() > max) {
            max = odwt.getNumber();
        }
    }
    ObjectDelta<O>[] wavesAsArray = new ObjectDelta[max + 1];
    for (ObjectDeltaWaveType odwt : secondaryDeltas.getWave()) {
        wavesAsArray[odwt.getNumber()] = DeltaConvertor.createObjectDelta(odwt.getDelta(), prismContext);
    }
    for (int i = 0; i <= max; i++) {
        retval.waves.add(wavesAsArray[i]);
    }
    return retval;
}
Also used : ObjectDelta(com.evolveum.midpoint.prism.delta.ObjectDelta) ObjectDeltaWaveType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectDeltaWaveType)

Aggregations

ObjectDelta (com.evolveum.midpoint.prism.delta.ObjectDelta)2 ObjectDeltaWaveType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectDeltaWaveType)2 ObjectDeltaWavesType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectDeltaWavesType)1