Class SimulationResultManagerImpl
- java.lang.Object
-
- com.evolveum.midpoint.model.impl.simulation.SimulationResultManagerImpl
-
- All Implemented Interfaces:
SimulationResultManager,SystemConfigurationChangeListener
@Component public class SimulationResultManagerImpl extends Object implements SimulationResultManager, SystemConfigurationChangeListener
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.evolveum.midpoint.model.api.simulation.SimulationResultManager
SimulationResultManager.SimulatedFunctionCall<X>
-
-
Constructor Summary
Constructors Constructor Description SimulationResultManagerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull SimulationResultImplcreateSimulationResult(@Nullable SimulationDefinitionType definition, @Nullable 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 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.SimulationResultgetSimulationResult(@NotNull String resultOid, @NotNull OperationResult result)Provides aSimulationResultfor given simulation result OID.@NotNull List<ProcessedObjectImpl<?>>getStoredProcessedObjects(@NotNull String oid, OperationResult result)TEMPORARY.voidinit()voidshutdown()voidupdate(@Nullable SystemConfigurationType value)Updates the listener's internal state with the configuration provided.
-
-
-
Method Detail
-
defaultDefinition
@NotNull public @NotNull SimulationDefinitionType defaultDefinition() throws ConfigurationException
Description copied from interface:SimulationResultManagerReturns the default simulation definition: either from the system configuration (if present there), or a new one. Returned value is freely modifiable by client.- Specified by:
defaultDefinitionin interfaceSimulationResultManager- Throws:
ConfigurationException
-
createSimulationResult
@NotNull public @NotNull SimulationResultImpl createSimulationResult(@Nullable @Nullable SimulationDefinitionType definition, @Nullable @Nullable Task rootTask, @Nullable @Nullable ConfigurationSpecificationType configurationSpecification, @NotNull @NotNull OperationResult result) throws ConfigurationException
Description copied from interface:SimulationResultManagerCreates a new simulation result in repository.- Specified by:
createSimulationResultin interfaceSimulationResultManager- Parameters:
definition- Definition to use. If null, the default one is used.- Throws:
ConfigurationException- See Also:
SimulationResultManager.defaultDefinition()
-
update
public void update(@Nullable @Nullable SystemConfigurationType value)Description copied from interface:SystemConfigurationChangeListenerUpdates the listener's internal state with the configuration provided.- Specified by:
updatein interfaceSystemConfigurationChangeListener- Parameters:
value- Current value of the system configuration object. It is 'null' if the object does not exist. Usually listeners keep their current state in such cases, but if needed, it will have the information about missing sysconfig object, so it could act accordingly.
-
init
@PostConstruct public void init()
-
shutdown
@PreDestroy public void shutdown()
-
getStoredProcessedObjects
@VisibleForTesting @NotNull public @NotNull List<ProcessedObjectImpl<?>> getStoredProcessedObjects(@NotNull @NotNull String oid, OperationResult result) throws SchemaException
TEMPORARY. Retrieves stored deltas. May be replaced by something more general in the future.- Specified by:
getStoredProcessedObjectsin interfaceSimulationResultManager- Throws:
SchemaException
-
getSimulationResult
public SimulationResult getSimulationResult(@NotNull @NotNull String resultOid, @NotNull @NotNull OperationResult result) throws SchemaException, ObjectNotFoundException
Description copied from interface:SimulationResultManagerProvides 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.- Specified by:
getSimulationResultin interfaceSimulationResultManager- Throws:
SchemaExceptionObjectNotFoundException
-
executeWithSimulationResult
public <X> X executeWithSimulationResult(@NotNull @NotNull TaskExecutionMode mode, @Nullable @Nullable SimulationDefinitionType simulationDefinition, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result, @NotNull @NotNull SimulationResultManager.SimulatedFunctionCall<X> functionCall) throws CommonExceptionDescription copied from interface:SimulationResultManagerSeeModelInteractionService.executeWithSimulationResult(TaskExecutionMode, SimulationDefinitionType, Task, OperationResult, SimulatedFunctionCall). When in `functionCall`, theTask.getSimulationTransaction()returns non-null value for the task.- Specified by:
executeWithSimulationResultin interfaceSimulationResultManager- Throws:
CommonException
-
getMetricDefinition
@Nullable public @Nullable SimulationMetricDefinitionType getMetricDefinition(@NotNull @NotNull String identifier)
Description copied from interface:SimulationResultManagerReturns the definition of a metric or `null` if there's none.- Specified by:
getMetricDefinitionin interfaceSimulationResultManager
-
-