Class CorrelationUtil
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enum -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull DashboardWidgetTypebuildWidget(String label, String help, String iconCss, int value) static @NotNull CorrelationUtil.CandidateDisplayDatacreateCandidateDisplay(@NotNull PageBase pageBase, @NotNull List<ResourceObjectOwnerOptionType> candidates, @Nullable String correlatedOwnersOid) static @NotNull BadgecreateStatusBadge(@NotNull List<ObjectReferenceType> eventMakRefs, @NotNull PageBase pageBase) static @Nullable List<ResourceAttributeDefinitionType>findCandidateMappings(PageBase pageBase, @NotNull SimulationResultType result) Returns candidate attribute mappings for correlation simulation.static @Nullable PrismContainerWrapper<ResourceAttributeDefinitionType>findCandidateMappingsAsWrapper(PageBase page, SimulationResultType simulationResult) Creates a virtual container wrapper for candidate mappings returned byfindCandidateMappings(PageBase, SimulationResultType).static @Nullable ResourceObjectTypeDefinitionTypefindResourceObjectTypeDefinitionType(@NotNull PageBase page, @NotNull SimulationResultType result) Finds the ResourceObjectTypeDefinitionType related to the simulation result.static @Nullable CorrelationDefinitionTypefindUsedCorrelationDefinition(@NotNull PageBase page, @NotNull SimulationResultType result) Builds the correlation definition that was effectively used for the given simulation result.getCorrelatedOwner(ShadowType shadow) static @NotNull org.apache.wicket.model.IModel<List<ResourceObjectOwnerOptionType>>static <O extends Objectable>
@NotNull StringgetItemDisplayName(@Nullable ItemPathType pathType, Class<O> objectClass) Returns the display name of the item specified by the given ItemPathType in the context of the given object class.static ShadowTypegetShadowAfterChanges(ProcessedObject<ShadowType> processedObject) getShadowCorrelationPathMap(@NotNull CorrelationDefinitionType correlationDefinition, List<ResourceAttributeDefinitionType> mappings) Builds a mapping between correlation item paths (as defined in correlationDefinition) and shadow attribute paths (derived from inbound mappings on resource attributes).static @Nullable List<ResourceObjectOwnerOptionType>parseResourceObjectOwnerOptionsFromDelta(@Nullable ObjectDelta<?> delta)
-
Constructor Details
-
CorrelationUtil
public CorrelationUtil()
-
-
Method Details
-
findUsedCorrelationDefinition
@Nullable public static @Nullable CorrelationDefinitionType findUsedCorrelationDefinition(@NotNull @NotNull PageBase page, @NotNull @NotNull SimulationResultType result) Builds the correlation definition that was effectively used for the given simulation result.Correlation simulation can combine correlators from two places:
- the existing correlation definition on the resource object type (optional), and
- inline correlators provided by the simulation task (always applied on top).
We clone/merge definitions to avoid modifying the original resource configuration while showing the "effective" configuration used by the simulation run.
- Returns:
- effective correlation definition (maybe empty), or
nullif the simulation task/work definition is missing
-
findCandidateMappings
@Nullable public static @Nullable List<ResourceAttributeDefinitionType> findCandidateMappings(PageBase pageBase, @NotNull @NotNull SimulationResultType result) Returns candidate attribute mappings for correlation simulation.The simulation task can provide additional (not yet stored in resource object) inbound mappings as suggestions. These mappings may not exist in the resource schema handling configuration, but they should be visible to the UI during simulation (e.g. in correlation candidate tables).
The result is a merged view:
- existing resource attribute definitions (if present), plus
- additional suggested mappings from the simulation task, matched/merged by
ref.
We clone incoming data to keep the returned list isolated from the underlying task/resource objects.
- Returns:
- merged list of attribute definitions (may include suggestions), or
nullif nothing can be resolved
-
findCandidateMappingsAsWrapper
@Nullable public static @Nullable PrismContainerWrapper<ResourceAttributeDefinitionType> findCandidateMappingsAsWrapper(PageBase page, SimulationResultType simulationResult) Creates a virtual container wrapper for candidate mappings returned byfindCandidateMappings(PageBase, SimulationResultType).This is used by UI components that expect
PrismContainerWrapperinstead of plain beans. The wrapper is created as "simulation-only": it represents a preview/merged view (including suggested additional mappings) and is not meant to be persisted. Therefore, it should not produce deltas.- Returns:
- container wrapper for displaying candidate mappings in UI, or
nullif there are no candidates
-
getShadowCorrelationPathMap
@NotNull public static @NotNull Map<ItemPath,ItemPath> getShadowCorrelationPathMap(@NotNull @NotNull CorrelationDefinitionType correlationDefinition, List<ResourceAttributeDefinitionType> mappings) Builds a mapping between correlation item paths (as defined in correlationDefinition) and shadow attribute paths (derived from inbound mappings on resource attributes).The result maps: <correlatedItemPath → shadowAttributePath>
For each correlation item path (from correlators/items), the method searches the resource object type definition for an attribute whose inbound target path matches that correlation path. If found, the mapping is returned.
- Parameters:
correlationDefinition- correlation definition with correlators/items- Returns:
- map of correlated item path → shadow attribute path
-
findResourceObjectTypeDefinitionType
@Nullable public static @Nullable ResourceObjectTypeDefinitionType findResourceObjectTypeDefinitionType(@NotNull @NotNull PageBase page, @NotNull @NotNull SimulationResultType result) Finds the ResourceObjectTypeDefinitionType related to the simulation result. -
getShadowAfterChanges
-
getCorrelationCandidateModel
@NotNull public static @NotNull org.apache.wicket.model.IModel<List<ResourceObjectOwnerOptionType>> getCorrelationCandidateModel(ShadowType shadow) -
parseResourceObjectOwnerOptionsFromDelta
@Nullable public static @Nullable List<ResourceObjectOwnerOptionType> parseResourceObjectOwnerOptionsFromDelta(@Nullable @Nullable ObjectDelta<?> delta) -
createStatusBadge
@NotNull public static @NotNull Badge createStatusBadge(@NotNull @NotNull List<ObjectReferenceType> eventMakRefs, @NotNull @NotNull PageBase pageBase) -
createCandidateDisplay
@NotNull public static @NotNull CorrelationUtil.CandidateDisplayData createCandidateDisplay(@NotNull @NotNull PageBase pageBase, @NotNull @NotNull List<ResourceObjectOwnerOptionType> candidates, @Nullable @Nullable String correlatedOwnersOid) -
getItemDisplayName
@NotNull public static <O extends Objectable> @NotNull String getItemDisplayName(@Nullable @Nullable ItemPathType pathType, Class<O> objectClass) Returns the display name of the item specified by the given ItemPathType in the context of the given object class. -
buildWidget
@NotNull public static @NotNull DashboardWidgetType buildWidget(String label, String help, String iconCss, int value)
-