Class SyncTaskHelper
- java.lang.Object
-
- com.evolveum.midpoint.model.impl.sync.tasks.SyncTaskHelper
-
@Component public class SyncTaskHelper extends Object
Auxiliary methods for synchronization tasks: Live Sync, Async Update, Import, Reconciliation, and - strange but true - Shadow Cleanup). Deals mainly with processing resource, objectclass, kind, intent tuple, i.e. specifying resource object class to be processed. The resource object class determination has the following flow in synchronization tasks: 1. User specifies `ResourceObjectSetType` bean with `resourceRef`, OC name, kind, intent, query (many of them optional). 2. It is then converted to three objects: -ResourceObjectClass
that holds resolved resource, object class definition, kind, and intent, seegetResourceObjectClassCheckingMaintenance(ResourceObjectSetType, Task, OperationResult)
. It does _not_ contain user-specified query. -ResourceSearchSpecification
that contains precise query intended to obtain resource objects (plus search options). This spec is later fine-tuned by activity run to cover its specific needs (like selecting only shadows that were not updated for given time - seeSearchBasedActivityRunSpecifics.customizeQuery(ObjectQuery, OperationResult)
), to cater for bucketing, handling errored objects, and so on. This search specification is used only for search-based activities, e.g. not for live sync or async update. -SynchronizationObjectsFilter
that filters any object returned by the item source (e.g. search operation in search-based activities). Notes: *SynchronizationObjectsFilter
is currently used only for import and reconciliation. In theory, it might be used also for live sync or async update. However, it is a bit questionable, because it would mean that non-compliant changes would be skipped, i.e. in fact thrown away. * The overall handling of object class / kind / intent triple in synchronization tasks (mainly import and reconciliation) is quite counter-intuitive: It works well if kind + intent combo is used. However, when object class is used, the provisioning module gets correct "objectclass = XYZ" style query, but it then looks up first matching refined object definition, and uses it. SeeProvisioningService.searchObjects(Class, ObjectQuery, Collection, Task, OperationResult)
and MID-7470 for more information.
-
-
Constructor Summary
Constructors Constructor Description SyncTaskHelper()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull ResourceObjectClass
createObjectClassForShadow(ShadowType shadow, Task task, OperationResult opResult)
CreatesResourceObjectClass
for a single shadow.ResourceSearchSpecification
createSearchSpecification(@NotNull ResourceObjectSetType set, Task task, OperationResult opResult)
Creates "complete" search specification from given configuration.@NotNull ResourceObjectClass
getResourceObjectClassCheckingMaintenance(@NotNull ResourceObjectSetType resourceObjectSet, Task task, OperationResult opResult)
Returns specification of the object class against which the synchronization will be done (ResourceObjectClass
).@NotNull String
getResourceOid(ResourceObjectSetType set)
static void
setSkipMaintenanceCheck(boolean skipMaintenanceCheck)
-
-
-
Method Detail
-
getResourceObjectClassCheckingMaintenance
@NotNull public @NotNull ResourceObjectClass getResourceObjectClassCheckingMaintenance(@NotNull @NotNull ResourceObjectSetType resourceObjectSet, Task task, OperationResult opResult) throws ActivityRunException
Returns specification of the object class against which the synchronization will be done (ResourceObjectClass
). Checks for the maintenance mode.- Throws:
ActivityRunException
-
createSearchSpecification
public ResourceSearchSpecification createSearchSpecification(@NotNull @NotNull ResourceObjectSetType set, Task task, OperationResult opResult) throws ActivityRunException, SchemaException
Creates "complete" search specification from given configuration. Contains object class + user-specified query. Does _not_ contain tweaking (customizations) by activity run. These are applied later.- Throws:
ActivityRunException
SchemaException
-
createObjectClassForShadow
@NotNull public @NotNull ResourceObjectClass createObjectClassForShadow(ShadowType shadow, Task task, OperationResult opResult) throws ActivityRunException, SchemaException
CreatesResourceObjectClass
for a single shadow.- Throws:
ActivityRunException
SchemaException
-
getResourceOid
@NotNull public @NotNull String getResourceOid(ResourceObjectSetType set) throws ActivityRunException
- Throws:
ActivityRunException
-
setSkipMaintenanceCheck
public static void setSkipMaintenanceCheck(boolean skipMaintenanceCheck)
-
-