Upgrade to 4.0 - Prism API migration notes
MidPoint 4.0 and later
MidPoint 4.0 brings the re-engineered Prism API. This document tries to help you with the migration of the original (1.x, 2.x, 3.x) Prism API to the new one. |
Overview
Overview of the new API is provided in Updated Prism API Overview.
In this document we concentrate solely on the migration issues from older versions to version 4.0.
Summary
Old | New | Note |
---|---|---|
Item paths |
||
|
|
+ |
|
|
see |
|
|
|
Query and delta builders |
||
|
|
+ |
|
|
+ |
Item and item values creation |
||
|
`prismContext.itemFactory().createPropertyValue(…) ` |
+ |
|
`prismContext.itemFactory().createReferenceValue(…) ` |
+ |
|
`prismContext.itemFactory().createContainerValue(…) ` |
+ |
`new PrismObjectValue<>(…) ` |
`prismContext.itemFactory().createObjectValue(…) ` |
+ |
|
`prismContext.itemFactory().createProperty(…) ` |
+ |
|
|
+ |
|
|
+ |
`new PrismObject<>(…) ` |
|
+ |
|
|
+ |
|
|
+ |
|
|
also for replace and delete |
Definition creation (use only if really needed) |
||
|
|
+ |
|
|
+ |
|
|
+ |
|
|
+ |
*Definition modification *(avoid if possible) |
||
|
|
+ |
Delta creation (use delta builder if possible) |
||
|
|
+ |
|
|
+ |
|
|
+ |
|
|
+ |
|
|
+ |
|
|
+ |
|
|
+ |
|
|
+ |
|
|
+ |
|
|
+ |
|
|
+ |
Query and filter creation (use query builder if possible) |
||
|
|
+ |
|
|
+ |
|
|
+ |
XNode creation (really avoid if possible) and modification (do not even think about this!) |
||
|
|
+ |
|
|
+ |
|
|
+ |
|
|
+ |
|
|
+ |
|
|
+ |
Schema creation |
||
|
|
+ |
Query conversion |
||
|
|
TODO: |
*Various changes in ItemPath
*
Old | New | Note |
---|---|---|
|
|
segments are now plain Java objects (not always wrapped into |
|
|
also |
|
|
also |
|
ItemPath.toName(path.first()) or even path.firstToName() |
+ |
|
ItemPath.toId(path.first()) or even path.firstToId() |
also |
|
|
note the difference between |
|
|
+ |
|
|
to avoid confusion with a.isSubPath(b) |
|
|
+ |
|
|
+ |
|
|
uses equals, not QNameUtil.match |
|
distributed to |
not quite finished yet |
|
|
+ |
|
|
+ |
|
|
+ |
|
path.asSingleNameOrFail() |
+ |
ItemPathUtil.getOnlySegmentQName(itemPathType) |
ItemPathTypeUtil.asSingleNameOrFail(itemPathType) or ItemPathTypeUtil.asSingleNameOrFailNullSafe(itemPathType) |
+ |
|
|
+ |
|
` prismContext.createCanonicalItemPath(…)` |
+ |
wildcard item path segments |
(removed) |
+ |
|
|
+ |
|
no more in the API |
+ |
|
no longer exists |
+ |
Other changes in prism
module (some of)
Old | New | Note |
---|---|---|
|
|
+ |
|
|
+ |
|
|
+ |
|
|
+ |
|
|
"real value" usually means something different |
|
|
+ |
|
|
+ |
|
|
the same for other matching rule names |
|
|
the same for other normalizers |
|
|
+ |
|
(removed) |
+ |
Related changes in schema
and common
modules
Note: ObjectFactory
is in com.evolveum.midpoint.schema.processor
. Its name, placement and methods will probably change soon.
Old | New |
---|---|
Derived objects creation |
|
|
|
|
|
|
|
|
|
|
|
|
|
GetOperationOptions |
|
|
|
|
|
Related changes in admin-gui
Old | New | Note |
---|---|---|
` findPropertyWrapper(QName n)` |
` findPropertyWrapperByName(QName n)` |
to differentiate between single-name paths and names (this is a hack; it should be implemented more nicely) |
More detailed change description follows.
ItemPath changes
Construction
…
use UniformItemPath
(~ "old" ItemPath
) that supports equals
and hashCode
TODO