Class SecurityAnalysisPreprocessors
- java.lang.Object
-
- com.powsybl.security.preprocessor.SecurityAnalysisPreprocessors
-
public final class SecurityAnalysisPreprocessors extends Object
Provides instances ofSecurityAnalysisPreprocessor
s or factories.- Author:
- Sylvain Leclerc
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Optional<SecurityAnalysisPreprocessorFactory>
configuredFactory(PlatformConfig platformConfig)
The preprocessor factory based on the specified platformconfig
.static Optional<SecurityAnalysisPreprocessorFactory>
configuredFactory(SecurityAnalysisConfig config)
The default preprocessor factory, based on default platformconfig
.static SecurityAnalysisPreprocessor
contingenciesPreprocessor(ContingenciesProviderFactory factory, com.google.common.io.ByteSource source)
Create a preprocessor which will create and inject aContingenciesProvider
into security analysis inputs, based on the specified factory and the specified source of data (raw bytes to be interpreted by the factory).static Optional<SecurityAnalysisPreprocessorFactory>
defaultConfiguredFactory()
The default preprocessor factory, based on default platformconfig
.static SecurityAnalysisPreprocessorFactory
factoryForName(String name)
Look for a factory with specified name, among the factories loaded as services.static SecurityAnalysisPreprocessorFactory
wrap(ContingenciesProviderFactory factory)
Create a preprocessor which will create and inject aContingenciesProvider
into security analysis inputs, based on the specified factory and the specified source of data (raw bytes to be interpreted by the factory).
-
-
-
Method Detail
-
factoryForName
public static SecurityAnalysisPreprocessorFactory factoryForName(String name)
Look for a factory with specified name, among the factories loaded as services. Throws if no matching factory is found.- Parameters:
name
- the name identifying the requested factory.- Returns:
- the factory corresponding to the specified name.
-
defaultConfiguredFactory
public static Optional<SecurityAnalysisPreprocessorFactory> defaultConfiguredFactory()
The default preprocessor factory, based on default platformconfig
.- Returns:
- The preprocessor factory as defined in default platform config.
-
configuredFactory
public static Optional<SecurityAnalysisPreprocessorFactory> configuredFactory(PlatformConfig platformConfig)
The preprocessor factory based on the specified platformconfig
.- Returns:
- The preprocessor factory as defined in default platform config.
-
configuredFactory
public static Optional<SecurityAnalysisPreprocessorFactory> configuredFactory(SecurityAnalysisConfig config)
The default preprocessor factory, based on default platformconfig
.If a preprocessor is specified in security-analysis config module, returns the corresponding factory, else return the default factory which delegates data interpretation to the configured
ContingenciesProviderFactory
.- Returns:
- The preprocessor factory as defined in default platform config.
-
wrap
public static SecurityAnalysisPreprocessorFactory wrap(ContingenciesProviderFactory factory)
Create a preprocessor which will create and inject aContingenciesProvider
into security analysis inputs, based on the specified factory and the specified source of data (raw bytes to be interpreted by the factory).- Parameters:
factory
- the factory in charge of creating theContingenciesProvider
.- Returns:
- a preprocessor which will create and inject a
ContingenciesProvider
.
-
contingenciesPreprocessor
public static SecurityAnalysisPreprocessor contingenciesPreprocessor(ContingenciesProviderFactory factory, com.google.common.io.ByteSource source)
Create a preprocessor which will create and inject aContingenciesProvider
into security analysis inputs, based on the specified factory and the specified source of data (raw bytes to be interpreted by the factory).- Parameters:
factory
- the factory in charge of creating theContingenciesProvider
.source
- the source of data to be used by the factory.- Returns:
- a preprocessor which will create and inject a
ContingenciesProvider
.
-
-