Class StatusAwareDataProvider<C extends Containerable>

Type Parameters:
C - type of container values this provider supplies
All Implemented Interfaces:
ISelectableDataProvider<PrismContainerValueWrapper<C>>, IterativeExportSupport<PrismContainerValueWrapper<C>>, Serializable, org.apache.wicket.extensions.markup.html.repeater.data.sort.ISortStateLocator<String>, org.apache.wicket.extensions.markup.html.repeater.data.table.ISortableDataProvider<PrismContainerValueWrapper<C>,String>, org.apache.wicket.markup.repeater.data.IDataProvider<PrismContainerValueWrapper<C>>, org.apache.wicket.model.IDetachable, org.apache.wicket.util.io.IClusterable

public class StatusAwareDataProvider<C extends Containerable> extends MultivalueContainerListDataProvider<C>
Data provider that augments MultivalueContainerListDataProvider with awareness of StatusInfo for each wrapped value.

It maintains two caches:

These caches allow efficient lookup of suggestion status for both the current page and all loaded items.
See Also:
  • Field Details

  • Constructor Details

    • StatusAwareDataProvider

      public StatusAwareDataProvider(@NotNull @NotNull org.apache.wicket.Component component, @NotNull @NotNull org.apache.wicket.model.IModel<Search<C>> search, @NotNull StatusAwareDataFactory.SuggestionsModelDto<C> suggestionsModelDto, @NotNull @NotNull Class<?> resultClass, boolean sortable)
  • Method Details

    • postProcessWrapper

      protected void postProcessWrapper(@NotNull @NotNull PrismContainerValueWrapper<C> vw)
      Overrides:
      postProcessWrapper in class MultivalueContainerListDataProvider<C extends Containerable>
    • getSuggestionInfo

      @Nullable public @Nullable StatusInfo<?> getSuggestionInfo(PrismContainerValueWrapper<C> vw)
      Returns the current StatusInfo for the given value wrapper.

      If the wrapper is not yet cached, the suggestionResolver is applied, and the token/status are stored. The status is then refreshed using the SmartIntegrationService, ensuring up-to-date information.

      Parameters:
      vw - wrapper whose suggestion status should be resolved
      Returns:
      the latest StatusInfo, or null if none is available
    • getResourceOid

      protected String getResourceOid()
    • clearCache

      public void clearCache()
      Overrides:
      clearCache in class MultivalueContainerListDataProvider<C extends Containerable>
    • detach

      public void detach()
      Specified by:
      detach in interface org.apache.wicket.markup.repeater.data.IDataProvider<C extends Containerable>
      Specified by:
      detach in interface org.apache.wicket.model.IDetachable
      Overrides:
      detach in class BaseSearchDataProvider<C extends Containerable,PrismContainerValueWrapper<C extends Containerable>>
    • primeSuggestionCacheForAll

      public void primeSuggestionCacheForAll()
      Optionally warm the cache for all rows (not just current page).
    • getAllSelected

      public List<PrismContainerValueWrapper<C>> getAllSelected()
    • applyInitialSorting

      protected void applyInitialSorting()
      Configures the initial sort state for this data provider.

      By default, no explicit sorting is applied (setSort(null)), meaning items are presented in their natural or source-defined order.

      Subclasses may override this method to define a custom default sort, for example to prioritize suggested or existing mappings:

      
       @Override
       protected void applyInitialSorting() {
           // Sort by "name" property in ascending order
           setSort(new SortParam<>("name", true));
       }
       

      In the context of mapping tables, different item types (e.g. suggestions vs. existing mappings) may define distinct default sorting strategies.

    • getPageSuggestionCount

      public int getPageSuggestionCount()