java.lang.Object
com.evolveum.midpoint.gui.impl.page.admin.resource.component.wizard.schemaHandling.objectType.smart.SmartIntegrationUtils

public class SmartIntegrationUtils extends Object
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
  • 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 Task task, @NotNull @NotNull OperationResult result)
      Estimates the size of a given object class on the resource using smart integration services. Returns null if estimation fails.
    • getStandaloneStructuralObjectClassesNames

      @NotNull public static @NotNull Set<QName> getStandaloneStructuralObjectClassesNames(@NotNull @NotNull String resourceOid, @NotNull @NotNull PageBase pageBase, 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 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. Returns true if the task was executed, false otherwise.
    • 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 Task task, @NotNull @NotNull List<DataAccessPermissionType> permissions, @Nullable @Nullable 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 Task task)
      Executes an association suggestion operation if no suggestion is currently available. If suggestions exist, no background task is started. Returns true if the task was executed, false otherwise.
    • getAiCustomTextBadgeModel

      @NotNull public static @NotNull org.apache.wicket.model.IModel<Badge> getAiCustomTextBadgeModel(String text)
    • getAiEfficiencyBadgeModel

      @NotNull public static @NotNull org.apache.wicket.model.IModel<Badge> getAiEfficiencyBadgeModel(String text)
    • suspendSuggestionTask

      public static void suspendSuggestionTask(@NotNull @NotNull PageBase pageBase, @NotNull @NotNull StatusInfo<?> statusInfo, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result)
    • resumeSuggestionTask

      public static void resumeSuggestionTask(@NotNull @NotNull PageBase pageBase, @NotNull @NotNull StatusInfo<?> statusInfo, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result)
    • removeCorrelationTypeSuggestionNew

      public static void removeCorrelationTypeSuggestionNew(@NotNull @NotNull PageBase pageBase, @NotNull @NotNull StatusInfo<?> statusInfo, @NotNull @NotNull CorrelationSuggestionType suggestionToRemove, @NotNull @NotNull 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 StatusInfo<?> statusInfo, @NotNull @NotNull ResourceObjectTypeDefinitionType suggestionToRemove, @NotNull @NotNull 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 StatusInfo<?> statusInfo, AttributeMappingsSuggestionType definitionToRemove, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result)
    • removeAssociationTypeSuggestionNew

      public static void removeAssociationTypeSuggestionNew(@NotNull @NotNull PageBase pageBase, @NotNull @NotNull StatusInfo<?> statusInfo, @NotNull @NotNull AssociationSuggestionType suggestionToRemove, @NotNull @NotNull 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 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 StatusInfo<?> statusInfo, @NotNull @NotNull 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

      @NotNull public static @NotNull @Unmodifiable List<ItemPath> 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

      @Nullable public static @Nullable TaskType loadTask(@NotNull @NotNull PageBase pageBase, @NotNull @NotNull String taskOid)