Package com.evolveum.midpoint.schema
Class DeltaConvertor
- java.lang.Object
-
- com.evolveum.midpoint.schema.DeltaConvertor
-
public class DeltaConvertor extends Object
Converts between "XML" (i.e. XML/JSON/YAML/bean) and "native" (ObjectDelta and company) form. The "XML" form has two sub-forms: ObjectDeltaType (types-3) and ObjectModificationType (api-types-3).- Author:
- semancik
-
-
Constructor Summary
Constructors Constructor Description DeltaConvertor()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <IV extends PrismValue,ID extends ItemDefinition<?>>
ItemDelta<IV,ID>createItemDelta(@NotNull ItemDeltaType propMod, @NotNull PrismContainerDefinition<?> rootPcd)
Item delta: XML -> native.static <IV extends PrismValue,ID extends ItemDefinition<?>>
ItemDelta<IV,ID>createItemDelta(ItemDeltaType propMod, Class<? extends Containerable> objectType, PrismContext prismContext)
Item delta: XML -> native.static <T extends Objectable>
@NotNull ObjectDelta<T>createObjectDelta(@NotNull ObjectDeltaType deltaBean)
Object delta: XML -> nativestatic <T extends Objectable>
@NotNull ObjectDelta<T>createObjectDelta(@NotNull ObjectDeltaType objectDeltaBean, PrismContext prismContext)
Object delta: XML -> nativestatic <T extends Objectable>
@NotNull ObjectDelta<T>createObjectDelta(ObjectModificationType objectModification, PrismObjectDefinition<T> objDef)
Object delta: XML (api-types-3) -> nativestatic <T extends Objectable>
@NotNull ObjectDelta<T>createObjectDelta(ObjectModificationType objectModification, Class<T> type, PrismContext prismContext)
Object delta: XML (api-types-3) -> nativestatic ObjectDeltaOperation<?>
createObjectDeltaOperation(ObjectDeltaOperationType odoBean, PrismContext prismContext)
Object delta operation: XML -> native.static Collection<ObjectDelta<? extends ObjectType>>
createObjectDeltas(ObjectDeltaListType deltaList, PrismContext prismContext)
Object deltas: XML (api-types-3) -> native Dubious.static String
serializeDelta(ObjectDelta<? extends ObjectType> delta, DeltaConversionOptions options, @NotNull String language)
Object delta: native -> serialized XML.static String
serializeDelta(ObjectDeltaType objectDeltaType, DeltaConversionOptions options, @NotNull String language)
static Collection<ItemDeltaType>
toItemDeltaTypes(ItemDelta<?,?> delta)
Item delta: native -> XML.static Collection<ItemDeltaType>
toItemDeltaTypes(ItemDelta<?,?> delta, DeltaConversionOptions options)
Item delta: native -> XML.static <T extends Objectable>
Collection<? extends ItemDelta<?,?>>toModifications(ObjectModificationType objectModification, PrismObjectDefinition<T> objDef)
Object delta: XML (api-types-3) -> native (ItemDelta collection)static <T extends Objectable>
Collection<? extends ItemDelta<?,?>>toModifications(ObjectModificationType objectModification, Class<T> type, PrismContext prismContext)
Object delta: XML (api-types-3) -> native (ItemDelta collection)static <T extends Objectable>
Collection<? extends ItemDelta<?,?>>toModifications(Collection<ItemDeltaType> itemDeltaBeans, PrismObjectDefinition<T> objDef)
Item deltas: XML -> nativestatic ObjectDeltaOperationType
toObjectDeltaOperationType(ObjectDeltaOperation<?> objectDeltaOperation)
Object delta operation: native -> XML.static ObjectDeltaOperationType
toObjectDeltaOperationType(ObjectDeltaOperation<?> odo, DeltaConversionOptions options)
Object delta operation: native -> XML.static void
toObjectDeltaOperationType(ObjectDeltaOperation<?> odo, ObjectDeltaOperationType odoBean, DeltaConversionOptions options)
Object delta operation: native -> XML (passed as parameter).static ObjectDeltaType
toObjectDeltaType(ObjectDelta<?> objectDelta)
Object delta: native -> XML.static ObjectDeltaType
toObjectDeltaType(ObjectDelta<?> objectDelta, DeltaConversionOptions options)
Object delta: native -> XML.static <T extends Objectable>
ObjectModificationTypetoObjectModificationType(ObjectDelta<T> delta)
Object delta: native -> XML (api-types-3).
-
-
-
Method Detail
-
createObjectDelta
@NotNull public static <T extends Objectable> @NotNull ObjectDelta<T> createObjectDelta(ObjectModificationType objectModification, Class<T> type, PrismContext prismContext) throws SchemaException
Object delta: XML (api-types-3) -> native- Throws:
SchemaException
-
createObjectDelta
@NotNull public static <T extends Objectable> @NotNull ObjectDelta<T> createObjectDelta(ObjectModificationType objectModification, PrismObjectDefinition<T> objDef) throws SchemaException
Object delta: XML (api-types-3) -> native- Throws:
SchemaException
-
createObjectDelta
@NotNull public static <T extends Objectable> @NotNull ObjectDelta<T> createObjectDelta(@NotNull @NotNull ObjectDeltaType deltaBean) throws SchemaException
Object delta: XML -> native- Throws:
SchemaException
-
createObjectDelta
@NotNull public static <T extends Objectable> @NotNull ObjectDelta<T> createObjectDelta(@NotNull @NotNull ObjectDeltaType objectDeltaBean, PrismContext prismContext) throws SchemaException
Object delta: XML -> native- Throws:
SchemaException
-
createObjectDeltaOperation
public static ObjectDeltaOperation<?> createObjectDeltaOperation(ObjectDeltaOperationType odoBean, PrismContext prismContext) throws SchemaException
Object delta operation: XML -> native.- Throws:
SchemaException
-
toModifications
public static <T extends Objectable> Collection<? extends ItemDelta<?,?>> toModifications(ObjectModificationType objectModification, Class<T> type, PrismContext prismContext) throws SchemaException
Object delta: XML (api-types-3) -> native (ItemDelta collection)- Throws:
SchemaException
-
toModifications
public static <T extends Objectable> Collection<? extends ItemDelta<?,?>> toModifications(ObjectModificationType objectModification, PrismObjectDefinition<T> objDef) throws SchemaException
Object delta: XML (api-types-3) -> native (ItemDelta collection)- Throws:
SchemaException
-
toModifications
public static <T extends Objectable> Collection<? extends ItemDelta<?,?>> toModifications(Collection<ItemDeltaType> itemDeltaBeans, PrismObjectDefinition<T> objDef) throws SchemaException
Item deltas: XML -> native- Throws:
SchemaException
-
toObjectModificationType
public static <T extends Objectable> ObjectModificationType toObjectModificationType(ObjectDelta<T> delta) throws SchemaException
Object delta: native -> XML (api-types-3). Only for MODIFY deltas.- Throws:
SchemaException
-
toObjectDeltaType
@Contract("null -> null; !null -> !null") public static ObjectDeltaType toObjectDeltaType(ObjectDelta<?> objectDelta) throws SchemaException
Object delta: native -> XML.- Throws:
SchemaException
-
toObjectDeltaType
@Contract("null, _ -> null; !null, _ -> !null") public static ObjectDeltaType toObjectDeltaType(ObjectDelta<?> objectDelta, DeltaConversionOptions options) throws SchemaException
Object delta: native -> XML.- Throws:
SchemaException
-
serializeDelta
public static String serializeDelta(ObjectDelta<? extends ObjectType> delta, DeltaConversionOptions options, @NotNull @NotNull String language) throws SchemaException
Object delta: native -> serialized XML.- Throws:
SchemaException
-
serializeDelta
public static String serializeDelta(ObjectDeltaType objectDeltaType, DeltaConversionOptions options, @NotNull @NotNull String language) throws SchemaException
- Throws:
SchemaException
-
toObjectDeltaOperationType
public static ObjectDeltaOperationType toObjectDeltaOperationType(ObjectDeltaOperation<?> objectDeltaOperation) throws SchemaException
Object delta operation: native -> XML.- Throws:
SchemaException
-
toObjectDeltaOperationType
public static ObjectDeltaOperationType toObjectDeltaOperationType(ObjectDeltaOperation<?> odo, DeltaConversionOptions options) throws SchemaException
Object delta operation: native -> XML.- Throws:
SchemaException
-
toObjectDeltaOperationType
public static void toObjectDeltaOperationType(ObjectDeltaOperation<?> odo, ObjectDeltaOperationType odoBean, DeltaConversionOptions options) throws SchemaException
Object delta operation: native -> XML (passed as parameter). Quite dubious.- Throws:
SchemaException
-
createItemDelta
public static <IV extends PrismValue,ID extends ItemDefinition<?>> ItemDelta<IV,ID> createItemDelta(ItemDeltaType propMod, Class<? extends Containerable> objectType, PrismContext prismContext) throws SchemaException
Item delta: XML -> native. Creates delta from ItemDeltaType (XML). The values inside the ItemDeltaType are converted to java. That's the reason this method needs schema and objectType (to locate the appropriate definitions).- Throws:
SchemaException
-
createItemDelta
public static <IV extends PrismValue,ID extends ItemDefinition<?>> ItemDelta<IV,ID> createItemDelta(@NotNull @NotNull ItemDeltaType propMod, @NotNull @NotNull PrismContainerDefinition<?> rootPcd) throws SchemaException
Item delta: XML -> native.- Parameters:
propMod
- The "XML" form.rootPcd
- Root prism container definition. The root is where the delta path starts.- Throws:
SchemaException
-
toItemDeltaTypes
public static Collection<ItemDeltaType> toItemDeltaTypes(ItemDelta<?,?> delta) throws SchemaException
Item delta: native -> XML.- Throws:
SchemaException
-
toItemDeltaTypes
public static Collection<ItemDeltaType> toItemDeltaTypes(ItemDelta<?,?> delta, DeltaConversionOptions options) throws SchemaException
Item delta: native -> XML.- Throws:
SchemaException
-
createObjectDeltas
public static Collection<ObjectDelta<? extends ObjectType>> createObjectDeltas(ObjectDeltaListType deltaList, PrismContext prismContext) throws SchemaException
Object deltas: XML (api-types-3) -> native Dubious. Consider removal.- Throws:
SchemaException
-
-