powsybl-core
powsybl-core copied to clipboard
Remove violation detector from SecurityAnalysis API
Please check if the PR fulfills these requirements
- [x] The commit message follows our guidelines
Does this PR already have an issue describing the problem? No
What kind of change does this PR introduce? Refactor
What is the current behavior? LimitViolationDetector in SecurityAnalysis API, not in line wit
What is the new behavior (if this is a feature change)?
-
LimitViolationDetector
removed fromSecurityAnalysis
,SecurityAnalysisProvider
andSecurityAnalysisInput
- interface
LimitViolationDetector
moved to dedicated packagecom.powsybl.security.detectors
-
LimitViolationDetector
parameter inDefaultSecurityAnalysis
now optional (nullable)
Does this PR introduce a breaking change or deprecate an API?
- [x] Yes
- [ ] No
If yes, please check if the following requirements are fulfilled
- [x] The Breaking Change or Deprecated label has been added
- [x] The migration steps are described in the following section
What changes might users need to make in their application due to this PR? (migration steps)
Starting from this release the LimitViolationDetector
is removed from security analysis API. The default implementations remains available, and the DefaultSecurityAnalysis
default implementation still handles a LimitViolationDetector
parameter through its constructor, although it is now becoming nullable. The DefaultSecurityAnalysisProvider
now builds a DefaultSecurityAnalysis
with a null LimitViolationDetector
.
If you want to still use the LimitViolationDetector
you need to pass one to your security analysis (or to the DefaultSecurityAnalysis
). Hence, you cannot use directly the DefaultSecurityAnalysisProvider
anymore. It is thus not possible to call SecurityAnalysis.find()
to create the SecurityAnalysis.Runner
anymore. Instead, you should declare your own SecurityAnalysisProvider
(which may or not extends DefaultSecurityAnalysisProvider
) which will create a DefaultSecurityAnalysis
using the constructor taking a LimitViolationDetector
. The downfall is that the provider won't be retrieved dynamically from the default-impl-name
property of the configuration file.
Quality Gate passed
Issues
11 New issues
0 Accepted issues
Measures
0 Security Hotspots
90.2% Coverage on New Code
0.0% Duplication on New Code