Package com.evolveum.midpoint.gui.impl.page.admin.resource.component.wizard.schemaHandling.objectType.smart
Class SmartIntegrationUtils
java.lang.Object
com.evolveum.midpoint.gui.impl.page.admin.resource.component.wizard.schemaHandling.objectType.smart.SmartIntegrationUtils
Utility methods for smart integration features in resource object type handling.
Provides helper functions for:
- Estimating object class sizes
- Loading resource statuses and object type suggestions
- Extracting data from suggestions
- Formatting elapsed execution time
- Triggering suggestion-related background actions
- Resolving complex type definition models
- Providing view toggle state models for tile/table panels
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull StringcomputeCorrelationStrategyMethod(@NotNull CorrelationItemType correlationItemType) Compute the correlation strategy method based on the CorrelationItemType configuration.static @Nullable ObjectClassSizeEstimationTypecomputeObjectClassSizeEstimationType(@NotNull PageBase pageBase, @NotNull String resourceOid, @NotNull QName objectClassName, @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull OperationResult result) Estimates the size of a given object class on the resource using smart integration services.static @NotNull CompareObjectDto<ResourceObjectTypeDefinitionType>createCompareObjectDto(@NotNull PrismContainerValueWrapper<ResourceObjectTypeDefinitionType> selectedDefinition, @NotNull List<PrismContainerValueWrapper<ResourceObjectTypeDefinitionType>> existingDefinitions, @NotNull List<ItemPath> paths) Creates a CompareObjectDto with the standard configuration.static @NotNull org.apache.wicket.model.IModel<Boolean>createSuggestionSwitchModel(@NotNull PageBase pageBase, SuggestionsStorage.SuggestionType type) Creates a model representing the enabled/disabled state of suggestions of the given type.static @NotNull org.apache.wicket.model.IModel<Badge>static @NotNull org.apache.wicket.model.IModel<Badge>static @NotNull org.apache.wicket.model.IModel<Badge>Returns the default set of item paths used for comparison and visibility.getStandaloneStructuralObjectClassesNames(@NotNull String resourceOid, @NotNull PageBase pageBase, com.evolveum.midpoint.task.api.Task task, OperationResult result) Returns names of standalone (i.e. not embedded) + structural (i.e. not auxiliary) object classes.static @Nullable TaskTypestatic voidremoveAssociationTypeSuggestionNew(@NotNull PageBase pageBase, @NotNull com.evolveum.midpoint.smart.api.info.StatusInfo<?> statusInfo, @NotNull AssociationSuggestionType suggestionToRemove, @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull OperationResult result) Removes an association suggestion from the task identified by the status token.static voidremoveCorrelationTypeSuggestionNew(@NotNull PageBase pageBase, @NotNull com.evolveum.midpoint.smart.api.info.StatusInfo<?> statusInfo, @NotNull CorrelationSuggestionType suggestionToRemove, @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull OperationResult result) Removes a correlation suggestion from the task identified by the status token.static voidremoveMappingTypeSuggestionNew(@NotNull PageBase pageBase, @NotNull com.evolveum.midpoint.smart.api.info.StatusInfo<?> statusInfo, AttributeMappingsSuggestionType definitionToRemove, @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull OperationResult result) static voidremoveObjectTypeSuggestionNew(@NotNull PageBase pageBase, @NotNull com.evolveum.midpoint.smart.api.info.StatusInfo<?> statusInfo, @NotNull ResourceObjectTypeDefinitionType suggestionToRemove, @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull OperationResult result) Removes an object-type suggestion from the task identified by the status token.static <C extends Containerable>
booleanremoveSuggestionValue(@NotNull PageBase pageBase, @NotNull org.apache.wicket.ajax.AjaxRequestTarget target, @NotNull PrismContainerValueWrapper<C> valueWrapper, @NotNull com.evolveum.midpoint.smart.api.info.StatusInfo<?> statusInfo, @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull OperationResult result) static voidremoveWholeTaskObject(@NotNull PageBase pageBase, @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull OperationResult result, @NotNull String token) static voidresumeSuggestionTask(@NotNull PageBase pageBase, @NotNull com.evolveum.midpoint.smart.api.info.StatusInfo<?> statusInfo, @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull OperationResult result) static voidrunAssociationSuggestionAction(@NotNull PageBase pageBase, @NotNull String resourceOid, @NotNull org.apache.wicket.ajax.AjaxRequestTarget target, @NotNull String operationName, @NotNull com.evolveum.midpoint.task.api.Task task) Executes an association suggestion operation if no suggestion is currently available.static booleanrunSuggestionAction(@NotNull PageBase pageBase, @NotNull String resourceOid, @NotNull QName objectClassName, @NotNull org.apache.wicket.ajax.AjaxRequestTarget target, @NotNull String operationName, @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull List<DataAccessPermissionType> permissions) Executes an object type suggestion operation if no suggestion is currently available.static booleanrunSuggestionAction(@NotNull PageBase pageBase, @NotNull String resourceOid, @NotNull QName objectClassName, @NotNull org.apache.wicket.ajax.AjaxRequestTarget target, @NotNull String operationName, @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull List<DataAccessPermissionType> permissions, @Nullable com.evolveum.midpoint.smart.api.RegenerateMode regenerateMode, @Nullable List<ResourceObjectTypeDefinitionType> previousObjectTypes) Executes an object type suggestion operation if no suggestion is currently available.static voidshowStatisticsPanel(@NotNull org.apache.wicket.ajax.AjaxRequestTarget target, @NotNull ResourceObjectTypeDefinitionType objectTypeDefinition, @NotNull PageBase pageBase, @NotNull String resourceOid) static voidsuspendSuggestionTask(@NotNull PageBase pageBase, @NotNull com.evolveum.midpoint.smart.api.info.StatusInfo<?> statusInfo, @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull OperationResult result)
-
Constructor Details
-
SmartIntegrationUtils
public SmartIntegrationUtils()
-
-
Method Details
-
computeObjectClassSizeEstimationType
@Nullable public static @Nullable ObjectClassSizeEstimationType computeObjectClassSizeEstimationType(@NotNull @NotNull PageBase pageBase, @NotNull @NotNull String resourceOid, @NotNull @NotNull QName objectClassName, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult result) Estimates the size of a given object class on the resource using smart integration services. Returnsnullif estimation fails. -
getStandaloneStructuralObjectClassesNames
@NotNull public static @NotNull Set<QName> getStandaloneStructuralObjectClassesNames(@NotNull @NotNull String resourceOid, @NotNull @NotNull PageBase pageBase, com.evolveum.midpoint.task.api.Task task, OperationResult result) Returns names of standalone (i.e. not embedded) + structural (i.e. not auxiliary) object classes.Those are the only object classes that can be directly mapped to object types. Also, we can reasonably assume that we can count objects for these classes.
NOTE: This method requires that the schema does exist for the resource and that the resource can be fetched via model API (which should be fine even for slightly malformed resources). Otherwise, it will return an empty set. Anyway, if we want to e.g. count objects on this resource, it must be at least minimally functional.
-
runSuggestionAction
public static boolean runSuggestionAction(@NotNull @NotNull PageBase pageBase, @NotNull @NotNull String resourceOid, @NotNull @NotNull QName objectClassName, @NotNull @NotNull org.apache.wicket.ajax.AjaxRequestTarget target, @NotNull @NotNull String operationName, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull List<DataAccessPermissionType> permissions) Executes an object type suggestion operation if no suggestion is currently available. If suggestions exist, no background task is started. Returnstrueif the task was executed,falseotherwise. -
runSuggestionAction
public static boolean runSuggestionAction(@NotNull @NotNull PageBase pageBase, @NotNull @NotNull String resourceOid, @NotNull @NotNull QName objectClassName, @NotNull @NotNull org.apache.wicket.ajax.AjaxRequestTarget target, @NotNull @NotNull String operationName, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull List<DataAccessPermissionType> permissions, @Nullable @Nullable com.evolveum.midpoint.smart.api.RegenerateMode regenerateMode, @Nullable @Nullable List<ResourceObjectTypeDefinitionType> previousObjectTypes) Executes an object type suggestion operation if no suggestion is currently available. If suggestions exist, no background task is started. -
runAssociationSuggestionAction
public static void runAssociationSuggestionAction(@NotNull @NotNull PageBase pageBase, @NotNull @NotNull String resourceOid, @NotNull @NotNull org.apache.wicket.ajax.AjaxRequestTarget target, @NotNull @NotNull String operationName, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task) Executes an association suggestion operation if no suggestion is currently available. If suggestions exist, no background task is started. Returnstrueif the task was executed,falseotherwise. -
getAiBadgeModel
-
getAiCustomTextBadgeModel
-
getAiEfficiencyBadgeModel
-
suspendSuggestionTask
public static void suspendSuggestionTask(@NotNull @NotNull PageBase pageBase, @NotNull @NotNull com.evolveum.midpoint.smart.api.info.StatusInfo<?> statusInfo, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult result) -
resumeSuggestionTask
public static void resumeSuggestionTask(@NotNull @NotNull PageBase pageBase, @NotNull @NotNull com.evolveum.midpoint.smart.api.info.StatusInfo<?> statusInfo, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult result) -
removeCorrelationTypeSuggestionNew
public static void removeCorrelationTypeSuggestionNew(@NotNull @NotNull PageBase pageBase, @NotNull @NotNull com.evolveum.midpoint.smart.api.info.StatusInfo<?> statusInfo, @NotNull @NotNull CorrelationSuggestionType suggestionToRemove, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult result) Removes a correlation suggestion from the task identified by the status token. Deletes the task if it becomes empty. -
removeObjectTypeSuggestionNew
public static void removeObjectTypeSuggestionNew(@NotNull @NotNull PageBase pageBase, @NotNull @NotNull com.evolveum.midpoint.smart.api.info.StatusInfo<?> statusInfo, @NotNull @NotNull ResourceObjectTypeDefinitionType suggestionToRemove, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult result) Removes an object-type suggestion from the task identified by the status token. Deletes the task if it becomes empty. -
removeMappingTypeSuggestionNew
public static void removeMappingTypeSuggestionNew(@NotNull @NotNull PageBase pageBase, @NotNull @NotNull com.evolveum.midpoint.smart.api.info.StatusInfo<?> statusInfo, AttributeMappingsSuggestionType definitionToRemove, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult result) -
removeAssociationTypeSuggestionNew
public static void removeAssociationTypeSuggestionNew(@NotNull @NotNull PageBase pageBase, @NotNull @NotNull com.evolveum.midpoint.smart.api.info.StatusInfo<?> statusInfo, @NotNull @NotNull AssociationSuggestionType suggestionToRemove, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult result) Removes an association suggestion from the task identified by the status token. Deletes the task if it becomes empty. -
removeWholeTaskObject
public static void removeWholeTaskObject(@NotNull @NotNull PageBase pageBase, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult result, @NotNull @NotNull String token) -
removeSuggestionValue
public static <C extends Containerable> boolean removeSuggestionValue(@NotNull @NotNull PageBase pageBase, @NotNull @NotNull org.apache.wicket.ajax.AjaxRequestTarget target, @NotNull @NotNull PrismContainerValueWrapper<C> valueWrapper, @NotNull @NotNull com.evolveum.midpoint.smart.api.info.StatusInfo<?> statusInfo, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult result) -
computeCorrelationStrategyMethod
@NotNull public static @NotNull String computeCorrelationStrategyMethod(@NotNull @NotNull CorrelationItemType correlationItemType) Compute the correlation strategy method based on the CorrelationItemType configuration. If no fuzzy search is defined, it defaults to "Exact".- Parameters:
correlationItemType- The CorrelationItemType to analyze.- Returns:
- A string representing the correlation strategy method.
-
showStatisticsPanel
public static void showStatisticsPanel(@NotNull @NotNull org.apache.wicket.ajax.AjaxRequestTarget target, @NotNull @NotNull ResourceObjectTypeDefinitionType objectTypeDefinition, @NotNull @NotNull PageBase pageBase, @NotNull @NotNull String resourceOid) -
getDefaultObjectTypeComparePaths
Returns the default set of item paths used for comparison and visibility. -
createCompareObjectDto
@NotNull public static @NotNull CompareObjectDto<ResourceObjectTypeDefinitionType> createCompareObjectDto(@NotNull @NotNull PrismContainerValueWrapper<ResourceObjectTypeDefinitionType> selectedDefinition, @NotNull @NotNull List<PrismContainerValueWrapper<ResourceObjectTypeDefinitionType>> existingDefinitions, @NotNull @NotNull List<ItemPath> paths) Creates a CompareObjectDto with the standard configuration. -
createSuggestionSwitchModel
@NotNull public static @NotNull org.apache.wicket.model.IModel<Boolean> createSuggestionSwitchModel(@NotNull @NotNull PageBase pageBase, @NotNull SuggestionsStorage.SuggestionType type) Creates a model representing the enabled/disabled state of suggestions of the given type. It is backed by the session storage. -
loadTask
-