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 SimulationResultImpl
createSimulationResult(@Nullable SimulationDefinitionType definition, @Nullable Task rootTask, @Nullable ConfigurationSpecificationType configurationSpecification, @NotNull OperationResult result)
Creates a new simulation result in repository.@NotNull SimulationDefinitionType
defaultDefinition()
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 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.SimulationResult
getSimulationResult(@NotNull String resultOid, @NotNull OperationResult result)
Provides aSimulationResult
for given simulation result OID.@NotNull List<ProcessedObjectImpl<?>>
getStoredProcessedObjects(@NotNull String oid, OperationResult result)
TEMPORARY.void
init()
void
shutdown()
void
update(@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:SimulationResultManager
Returns 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:
defaultDefinition
in 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:SimulationResultManager
Creates a new simulation result in repository.- Specified by:
createSimulationResult
in 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:SystemConfigurationChangeListener
Updates the listener's internal state with the configuration provided.- Specified by:
update
in 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:
getStoredProcessedObjects
in interfaceSimulationResultManager
- Throws:
SchemaException
-
getSimulationResult
public SimulationResult getSimulationResult(@NotNull @NotNull String resultOid, @NotNull @NotNull OperationResult result) throws SchemaException, ObjectNotFoundException
Description copied from interface:SimulationResultManager
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.- Specified by:
getSimulationResult
in interfaceSimulationResultManager
- Throws:
SchemaException
ObjectNotFoundException
-
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 CommonException
Description copied from interface:SimulationResultManager
SeeModelInteractionService.executeWithSimulationResult(TaskExecutionMode, SimulationDefinitionType, Task, OperationResult, SimulatedFunctionCall)
. When in `functionCall`, theTask.getSimulationTransaction()
returns non-null value for the task.- Specified by:
executeWithSimulationResult
in interfaceSimulationResultManager
- Throws:
CommonException
-
getMetricDefinition
@Nullable public @Nullable SimulationMetricDefinitionType getMetricDefinition(@NotNull @NotNull String identifier)
Description copied from interface:SimulationResultManager
Returns the definition of a metric or `null` if there's none.- Specified by:
getMetricDefinition
in interfaceSimulationResultManager
-
-