Interface SimulationResultManager
public interface SimulationResultManager
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
-
Method Summary
Modifier and TypeMethodDescription@NotNull com.evolveum.midpoint.task.api.SimulationResult
createSimulationResult
(@Nullable SimulationDefinitionType definition, @Nullable com.evolveum.midpoint.task.api.Task rootTask, @Nullable ConfigurationSpecificationType configurationSpecification, @NotNull OperationResult result) Creates a new simulation result in repository.@NotNull SimulationDefinitionType
Returns the default simulation definition: either from the system configuration (if present there), or a new one.<X> X
executeWithSimulationResult
(@NotNull TaskExecutionMode mode, @Nullable SimulationDefinitionType simulationDefinition, @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull OperationResult result, @NotNull SimulationResultManager.SimulatedFunctionCall<X> functionCall) @Nullable SimulationMetricDefinitionType
getMetricDefinition
(@NotNull String identifier) Returns the definition of a metric or `null` if there's none.com.evolveum.midpoint.task.api.SimulationResult
getSimulationResult
(@NotNull String resultOid, @NotNull OperationResult result) Provides aSimulationResult
for given simulation result OID.@NotNull List<? extends ProcessedObject<?>>
getStoredProcessedObjects
(@NotNull String oid, OperationResult result) Fetches and parses all stored processed objects from givenSimulationResultType
.
-
Method Details
-
createSimulationResult
@NotNull @NotNull com.evolveum.midpoint.task.api.SimulationResult createSimulationResult(@Nullable @Nullable SimulationDefinitionType definition, @Nullable @Nullable com.evolveum.midpoint.task.api.Task rootTask, @Nullable @Nullable ConfigurationSpecificationType configurationSpecification, @NotNull @NotNull OperationResult result) throws ConfigurationException Creates a new simulation result in repository.- Parameters:
definition
- Definition to use. If null, the default one is used.- Throws:
ConfigurationException
- See Also:
-
getSimulationResult
com.evolveum.midpoint.task.api.SimulationResult getSimulationResult(@NotNull @NotNull String resultOid, @NotNull @NotNull OperationResult result) throws SchemaException, ObjectNotFoundException Provides aSimulationResult
for given simulation result OID. May involve repository get operation. Makes sure that the simulation result is open. Although this does not prevent writing to closed results (as the result may be closed after obtaining the context), it should be good enough to cover e.g. cases when we re-use existing result by mistake. -
defaultDefinition
Returns the default simulation definition: either from the system configuration (if present there), or a new one. Returned value is freely modifiable by client.- Throws:
ConfigurationException
-
getStoredProcessedObjects
@VisibleForTesting @NotNull @NotNull List<? extends ProcessedObject<?>> getStoredProcessedObjects(@NotNull @NotNull String oid, OperationResult result) throws SchemaException Fetches and parses all stored processed objects from givenSimulationResultType
.- Throws:
SchemaException
-
executeWithSimulationResult
<X> X executeWithSimulationResult(@NotNull @NotNull TaskExecutionMode mode, @Nullable @Nullable SimulationDefinitionType simulationDefinition, @NotNull @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull @NotNull OperationResult result, @NotNull @NotNull SimulationResultManager.SimulatedFunctionCall<X> functionCall) throws CommonException SeeModelInteractionService.executeWithSimulationResult(TaskExecutionMode, SimulationDefinitionType, Task, OperationResult, SimulatedFunctionCall)
. When in `functionCall`, theTask.getSimulationTransaction()
returns non-null value for the task.- Throws:
CommonException
-
getMetricDefinition
@Nullable @Nullable SimulationMetricDefinitionType getMetricDefinition(@NotNull @NotNull String identifier) Returns the definition of a metric or `null` if there's none.
-