Package com.powsybl.security.distributed
Class SecurityAnalysisExecutionHandler<R>
- java.lang.Object
-
- com.powsybl.computation.AbstractExecutionHandler<R>
-
- com.powsybl.security.distributed.SecurityAnalysisExecutionHandler<R>
-
- All Implemented Interfaces:
ExecutionHandler<R>
public class SecurityAnalysisExecutionHandler<R> extends AbstractExecutionHandler<R>
Base implementation forExecutionHandler
s which may execute one or multiple itools security-analysis command(s). The exact behaviour is provided through the constructor argument. Instances are provided by factory methods ofSecurityAnalysisExecutionHandlers
.Specified
Network
variant is serialized as an XIIDM file.- Author:
- Sylvain Leclerc
-
-
Constructor Summary
Constructors Constructor Description SecurityAnalysisExecutionHandler(com.powsybl.security.distributed.SecurityAnalysisExecutionHandler.ResultReader<R> reader, com.powsybl.security.distributed.SecurityAnalysisExecutionHandler.OptionsCustomizer optionsCustomizer, com.powsybl.security.distributed.SecurityAnalysisExecutionHandler.ExceptionHandler exceptionHandler, int executionCount, SecurityAnalysisExecutionInput input)
Creates a new security analysis execution handler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description R
after(Path workingDir, ExecutionReport report)
Reads result from the working directory, as defined by the specified reader.List<CommandExecution>
before(Path workingDir)
Copies case file, contingencies file, and parameters file to working directory, and creates the itools security-analysis command(s) to be executed, based on configuration and the optional options customizer.-
Methods inherited from class com.powsybl.computation.AbstractExecutionHandler
onExecutionCompletion, onExecutionStart
-
-
-
-
Constructor Detail
-
SecurityAnalysisExecutionHandler
public SecurityAnalysisExecutionHandler(com.powsybl.security.distributed.SecurityAnalysisExecutionHandler.ResultReader<R> reader, com.powsybl.security.distributed.SecurityAnalysisExecutionHandler.OptionsCustomizer optionsCustomizer, com.powsybl.security.distributed.SecurityAnalysisExecutionHandler.ExceptionHandler exceptionHandler, int executionCount, SecurityAnalysisExecutionInput input)
Creates a new security analysis execution handler.- Parameters:
reader
- Defines how results should be read from working directory.optionsCustomizer
- If notnull
, defines additional command options.exceptionHandler
- Used to translate exceptions to aComputationException
.executionCount
- The number of executions of the command.input
- The execution input data.
-
-
Method Detail
-
before
public List<CommandExecution> before(Path workingDir) throws IOException
Copies case file, contingencies file, and parameters file to working directory, and creates the itools security-analysis command(s) to be executed, based on configuration and the optional options customizer.- Parameters:
workingDir
- the working directory used for this computation. Input data may be written to it.- Returns:
- the list of
CommandExecution
s to be executed. - Throws:
IOException
- when an error occurs while wirting to working directory.
-
after
public R after(Path workingDir, ExecutionReport report) throws IOException
Reads result from the working directory, as defined by the specified reader.- Specified by:
after
in interfaceExecutionHandler<R>
- Overrides:
after
in classAbstractExecutionHandler<R>
- Parameters:
workingDir
- the working directory used for this computation. Results may be read from it.report
- the execution report, in particular reporting command execution errors.- Returns:
- the actual result of the processing.
- Throws:
IOException
- if and error occurs while reading results from the working directory.
-
-