Interface SimulationResultManager
-
public interface SimulationResultManager
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceSimulationResultManager.SimulatedFunctionCall<X>
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull com.evolveum.midpoint.task.api.SimulationResultcreateSimulationResult(@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 SimulationDefinitionTypedefaultDefinition()Returns the default simulation definition: either from the system configuration (if present there), or a new one.<X> XexecuteWithSimulationResult(@NotNull TaskExecutionMode mode, @Nullable SimulationDefinitionType simulationDefinition, @NotNull com.evolveum.midpoint.task.api.Task task, @NotNull OperationResult result, @NotNull SimulationResultManager.SimulatedFunctionCall<X> functionCall)@Nullable SimulationMetricDefinitionTypegetMetricDefinition(@NotNull String identifier)Returns the definition of a metric or `null` if there's none.com.evolveum.midpoint.task.api.SimulationResultgetSimulationResult(@NotNull String resultOid, @NotNull OperationResult result)Provides aSimulationResultfor given simulation result OID.@NotNull List<? extends ProcessedObject<?>>getStoredProcessedObjects(@NotNull String oid, OperationResult result)Fetches and parses all stored processed objects from givenSimulationResultType.
-
-
-
Method Detail
-
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 ConfigurationExceptionCreates a new simulation result in repository.- Parameters:
definition- Definition to use. If null, the default one is used.- Throws:
ConfigurationException- See Also:
defaultDefinition()
-
getSimulationResult
com.evolveum.midpoint.task.api.SimulationResult getSimulationResult(@NotNull @NotNull String resultOid, @NotNull @NotNull OperationResult result) throws SchemaException, ObjectNotFoundExceptionProvides aSimulationResultfor 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
@NotNull @NotNull SimulationDefinitionType defaultDefinition() throws ConfigurationException
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 CommonExceptionSeeModelInteractionService.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.
-
-