Package com.evolveum.midpoint.schema
Class DeltaConvertor
java.lang.Object
com.evolveum.midpoint.schema.DeltaConvertor
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
-
Method Summary
Modifier and TypeMethodDescriptionstatic <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
(@NotNull ItemDeltaType propMod, @NotNull PrismContainerDefinition<?> rootPcd, boolean convertUnknownTypes) Item delta: ItemDeltaType -> 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 objectDeltaBean) Object delta: XML -> nativestatic <T extends Objectable>
ObjectDelta<T>createObjectDelta
(@NotNull ObjectDeltaType objectDeltaBean, boolean convertUnknownTypes) static <T extends Objectable>
@NotNull ObjectDelta<T>createObjectDelta
(@NotNull ObjectDeltaType deltaBean, PrismContext ignored) 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 <T extends Objectable>
ObjectDelta<T>createObjectDeltaNullable
(@Nullable ObjectDeltaType objectDeltaBean) static ObjectDeltaOperation<?>
createObjectDeltaOperation
(ObjectDeltaOperationType odoBean, boolean convertUnknownTypes) static 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 boolean
isLegacyDelta
(ItemDelta itemDelta) 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).
-
Constructor Details
-
DeltaConvertor
public DeltaConvertor()
-
-
Method Details
-
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, PrismContext ignored) throws SchemaException Object delta: XML -> native- Throws:
SchemaException
-
createObjectDeltaNullable
@Contract("null -> null; !null -> !null") public static <T extends Objectable> ObjectDelta<T> createObjectDeltaNullable(@Nullable @Nullable ObjectDeltaType objectDeltaBean) throws SchemaException - Throws:
SchemaException
-
createObjectDelta
@NotNull public static <T extends Objectable> @NotNull ObjectDelta<T> createObjectDelta(@NotNull @NotNull ObjectDeltaType objectDeltaBean) throws SchemaException Object delta: XML -> native- Throws:
SchemaException
-
createObjectDelta
public static <T extends Objectable> ObjectDelta<T> createObjectDelta(@NotNull @NotNull ObjectDeltaType objectDeltaBean, boolean convertUnknownTypes) throws SchemaException - Throws:
SchemaException
-
createObjectDeltaOperation
public static ObjectDeltaOperation<?> createObjectDeltaOperation(ObjectDeltaOperationType odoBean, PrismContext prismContext) throws SchemaException Object delta operation: XML -> native.- Throws:
SchemaException
-
createObjectDeltaOperation
public static ObjectDeltaOperation<?> createObjectDeltaOperation(ObjectDeltaOperationType odoBean, boolean convertUnknownTypes) throws SchemaException - 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
-
createItemDelta
public static <IV extends PrismValue,ID extends ItemDefinition<?>> ItemDelta<IV,ID> createItemDelta(@NotNull @NotNull ItemDeltaType propMod, @NotNull @NotNull PrismContainerDefinition<?> rootPcd, boolean convertUnknownTypes) throws SchemaException Item delta: ItemDeltaType -> native.- Parameters:
propMod
- The "XML" form.rootPcd
- Root prism container definition. The root is where the delta path starts.convertUnknownTypes
- If enabled and unknown type is detected (does not have definition in schema registry) returns delta as PPV with RawType- Throws:
SchemaException
-
toItemDeltaTypes
public static Collection<ItemDeltaType> toItemDeltaTypes(ItemDelta<?, ?> delta) throws SchemaExceptionItem delta: native -> XML.- Throws:
SchemaException
-
toItemDeltaTypes
public static Collection<ItemDeltaType> toItemDeltaTypes(ItemDelta<?, ?> delta, DeltaConversionOptions options) throws SchemaExceptionItem 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
-
isLegacyDelta
-