class DistributedSecurityAnalysis extends ExternalSecurityAnalysis {

    @Override
    public CompletableFuture<SecurityAnalysisResultWithLog> runWithLog(String workingVariantId, SecurityAnalysisParameters parameters, ContingenciesProvider contingenciesProvider) {
        LOGGER.debug("Starting distributed security analysis(with log).");

        ExecutionEnvironment itoolsEnv = new ExecutionEnvironment(Collections.emptyMap(), "security_analysis_task_", config.isDebug());

        SecurityAnalysisExecutionInput input = buildInput(workingVariantId, parameters, contingenciesProvider);

        List<Contingency> contingencies = contingenciesProvider.getContingencies(network);
        int actualTaskCount = Math.min(taskCount, Math.max(1, contingencies.size()));
        return computationManager.execute(itoolsEnv,
                SecurityAnalysisExecutionHandlers.distributedWithLog(input, actualTaskCount));
    }

    public  DistributedSecurityAnalysis(ExternalSecurityAnalysisConfig config, Network network,
                                       ComputationManager computationManager, List<String> extensions, int taskCount);

}