Skip to content

Commit

Permalink
extract ComputationsNotificationTypes
Browse files Browse the repository at this point in the history
Signed-off-by: Mathieu DEHARBE <[email protected]>
  • Loading branch information
Mathieu-Deharbe committed Oct 8, 2024
1 parent 400ef5a commit 6fddccb
Show file tree
Hide file tree
Showing 16 changed files with 278 additions and 241 deletions.
38 changes: 19 additions & 19 deletions src/main/java/org/gridsuite/study/server/dto/ComputationType.java
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
package org.gridsuite.study.server.dto;

import lombok.Getter;
import org.gridsuite.study.server.notification.NotificationService;
import static org.gridsuite.study.server.notification.ComputationsNotificationTypes.*;

@Getter
public enum ComputationType {
LOAD_FLOW("Load flow", "loadFlowResultUuid",
NotificationService.UPDATE_TYPE_LOADFLOW_STATUS, NotificationService.UPDATE_TYPE_LOADFLOW_RESULT,
NotificationService.UPDATE_TYPE_LOADFLOW_FAILED),
UPDATE_TYPE_LOADFLOW_STATUS, UPDATE_TYPE_LOADFLOW_RESULT,
UPDATE_TYPE_LOADFLOW_FAILED),
SECURITY_ANALYSIS("Security analysis", "securityAnalysisResultUuid",
NotificationService.UPDATE_TYPE_SECURITY_ANALYSIS_STATUS, NotificationService.UPDATE_TYPE_SECURITY_ANALYSIS_RESULT,
NotificationService.UPDATE_TYPE_SECURITY_ANALYSIS_FAILED),
UPDATE_TYPE_SECURITY_ANALYSIS_STATUS, UPDATE_TYPE_SECURITY_ANALYSIS_RESULT,
UPDATE_TYPE_SECURITY_ANALYSIS_FAILED),
SENSITIVITY_ANALYSIS("Sensitivity analysis", "sensitivityAnalysisResultUuid",
NotificationService.UPDATE_TYPE_SENSITIVITY_ANALYSIS_STATUS, NotificationService.UPDATE_TYPE_SENSITIVITY_ANALYSIS_RESULT,
NotificationService.UPDATE_TYPE_SENSITIVITY_ANALYSIS_FAILED),
UPDATE_TYPE_SENSITIVITY_ANALYSIS_STATUS, UPDATE_TYPE_SENSITIVITY_ANALYSIS_RESULT,
UPDATE_TYPE_SENSITIVITY_ANALYSIS_FAILED),
NON_EVACUATED_ENERGY_ANALYSIS("Non evacuated energy analysis", "nonEvacuatedEnergyResultUuid",
NotificationService.UPDATE_TYPE_NON_EVACUATED_ENERGY_STATUS, NotificationService.UPDATE_TYPE_NON_EVACUATED_ENERGY_RESULT,
NotificationService.UPDATE_TYPE_NON_EVACUATED_ENERGY_FAILED),
UPDATE_TYPE_NON_EVACUATED_ENERGY_STATUS, UPDATE_TYPE_NON_EVACUATED_ENERGY_RESULT,
UPDATE_TYPE_NON_EVACUATED_ENERGY_FAILED),
SHORT_CIRCUIT("Short circuit analysis", "shortCircuitAnalysisResultUuid",
NotificationService.UPDATE_TYPE_SHORT_CIRCUIT_STATUS, NotificationService.UPDATE_TYPE_SHORT_CIRCUIT_RESULT,
NotificationService.UPDATE_TYPE_SHORT_CIRCUIT_FAILED),
UPDATE_TYPE_SHORT_CIRCUIT_STATUS, UPDATE_TYPE_SHORT_CIRCUIT_RESULT,
UPDATE_TYPE_SHORT_CIRCUIT_FAILED),
VOLTAGE_INITIALIZATION("Voltage init", "voltageInitResultUuid",
NotificationService.UPDATE_TYPE_VOLTAGE_INIT_STATUS, NotificationService.UPDATE_TYPE_VOLTAGE_INIT_RESULT,
NotificationService.UPDATE_TYPE_VOLTAGE_INIT_FAILED),
UPDATE_TYPE_VOLTAGE_INIT_STATUS, UPDATE_TYPE_VOLTAGE_INIT_RESULT,
UPDATE_TYPE_VOLTAGE_INIT_FAILED),
DYNAMIC_SIMULATION("Dynamic simulation", "dynamicSimulationResultUuid",
NotificationService.UPDATE_TYPE_DYNAMIC_SIMULATION_STATUS, NotificationService.UPDATE_TYPE_DYNAMIC_SIMULATION_RESULT,
NotificationService.UPDATE_TYPE_DYNAMIC_SIMULATION_FAILED),
UPDATE_TYPE_DYNAMIC_SIMULATION_STATUS, UPDATE_TYPE_DYNAMIC_SIMULATION_RESULT,
UPDATE_TYPE_DYNAMIC_SIMULATION_FAILED),
SHORT_CIRCUIT_ONE_BUS("One bus Short circuit analysis", "oneBusShortCircuitAnalysisResultUuid",
NotificationService.UPDATE_TYPE_ONE_BUS_SHORT_CIRCUIT_STATUS, NotificationService.UPDATE_TYPE_ONE_BUS_SHORT_CIRCUIT_RESULT,
NotificationService.UPDATE_TYPE_ONE_BUS_SHORT_CIRCUIT_FAILED),
UPDATE_TYPE_ONE_BUS_SHORT_CIRCUIT_STATUS, UPDATE_TYPE_ONE_BUS_SHORT_CIRCUIT_RESULT,
UPDATE_TYPE_ONE_BUS_SHORT_CIRCUIT_FAILED),
STATE_ESTIMATION("State estimation", "stateEstimationResultUuid",
NotificationService.UPDATE_TYPE_STATE_ESTIMATION_STATUS, NotificationService.UPDATE_TYPE_STATE_ESTIMATION_RESULT,
NotificationService.UPDATE_TYPE_STATE_ESTIMATION_FAILED);
UPDATE_TYPE_STATE_ESTIMATION_STATUS, UPDATE_TYPE_STATE_ESTIMATION_RESULT,
UPDATE_TYPE_STATE_ESTIMATION_FAILED);

private final String label; // used for logs
private final String resultUuidLabel;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/**
* Copyright (c) 2024, RTE (http://www.rte-france.com)
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
package org.gridsuite.study.server.notification;

/**
* @author Mathieu Deharbe <mathieu.deharbe_externe at rte-france.com
*/
public final class ComputationsNotificationTypes {
private ComputationsNotificationTypes() {
// this class should never be constructed
}

public static final String UPDATE_TYPE_LOADFLOW_STATUS = "loadflow_status";
public static final String UPDATE_TYPE_LOADFLOW_RESULT = "loadflowResult";
public static final String UPDATE_TYPE_LOADFLOW_FAILED = "loadflow_failed";

public static final String UPDATE_TYPE_SECURITY_ANALYSIS_STATUS = "securityAnalysis_status";
public static final String UPDATE_TYPE_SECURITY_ANALYSIS_RESULT = "securityAnalysisResult";
public static final String UPDATE_TYPE_SECURITY_ANALYSIS_FAILED = "securityAnalysis_failed";

public static final String UPDATE_TYPE_SENSITIVITY_ANALYSIS_STATUS = "sensitivityAnalysis_status";
public static final String UPDATE_TYPE_SENSITIVITY_ANALYSIS_RESULT = "sensitivityAnalysisResult";
public static final String UPDATE_TYPE_SENSITIVITY_ANALYSIS_FAILED = "sensitivityAnalysis_failed";

public static final String UPDATE_TYPE_NON_EVACUATED_ENERGY_STATUS = "nonEvacuatedEnergy_status";
public static final String UPDATE_TYPE_NON_EVACUATED_ENERGY_RESULT = "nonEvacuatedEnergyResult";
public static final String UPDATE_TYPE_NON_EVACUATED_ENERGY_FAILED = "nonEvacuatedEnergy_failed";

public static final String UPDATE_TYPE_SHORT_CIRCUIT_STATUS = "shortCircuitAnalysis_status";
public static final String UPDATE_TYPE_SHORT_CIRCUIT_RESULT = "shortCircuitAnalysisResult";
public static final String UPDATE_TYPE_SHORT_CIRCUIT_FAILED = "shortCircuitAnalysis_failed";

public static final String UPDATE_TYPE_VOLTAGE_INIT_STATUS = "voltageInit_status";
public static final String UPDATE_TYPE_VOLTAGE_INIT_RESULT = "voltageInitResult";
public static final String UPDATE_TYPE_VOLTAGE_INIT_FAILED = "voltageInit_failed";

public static final String UPDATE_TYPE_DYNAMIC_SIMULATION_STATUS = "dynamicSimulation_status";
public static final String UPDATE_TYPE_DYNAMIC_SIMULATION_RESULT = "dynamicSimulationResult";
public static final String UPDATE_TYPE_DYNAMIC_SIMULATION_FAILED = "dynamicSimulation_failed";

public static final String UPDATE_TYPE_ONE_BUS_SHORT_CIRCUIT_STATUS = "oneBusShortCircuitAnalysis_status";
public static final String UPDATE_TYPE_ONE_BUS_SHORT_CIRCUIT_RESULT = "oneBusShortCircuitAnalysisResult";
public static final String UPDATE_TYPE_ONE_BUS_SHORT_CIRCUIT_FAILED = "oneBusShortCircuitAnalysis_failed";

public static final String UPDATE_TYPE_STATE_ESTIMATION_STATUS = "stateEstimation_status";
public static final String UPDATE_TYPE_STATE_ESTIMATION_RESULT = "stateEstimationResult";
public static final String UPDATE_TYPE_STATE_ESTIMATION_FAILED = "stateEstimation_failed";
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,39 +49,12 @@ public class NotificationService {
public static final String UPDATE_TYPE_BUILD_CANCELLED = "buildCancelled";
public static final String UPDATE_TYPE_BUILD_COMPLETED = "buildCompleted";
public static final String UPDATE_TYPE_BUILD_FAILED = "buildFailed";
public static final String UPDATE_TYPE_LOADFLOW_RESULT = "loadflowResult";
public static final String UPDATE_TYPE_LOADFLOW_STATUS = "loadflow_status";
public static final String UPDATE_TYPE_LOADFLOW_FAILED = "loadflow_failed";
public static final String UPDATE_TYPE_SECURITY_ANALYSIS_FAILED = "securityAnalysis_failed";
public static final String UPDATE_TYPE_SECURITY_ANALYSIS_RESULT = "securityAnalysisResult";
public static final String UPDATE_TYPE_SECURITY_ANALYSIS_STATUS = "securityAnalysis_status";
public static final String UPDATE_TYPE_SENSITIVITY_ANALYSIS_RESULT = "sensitivityAnalysisResult";
public static final String UPDATE_TYPE_SENSITIVITY_ANALYSIS_STATUS = "sensitivityAnalysis_status";
public static final String UPDATE_TYPE_SENSITIVITY_ANALYSIS_FAILED = "sensitivityAnalysis_failed";
public static final String UPDATE_TYPE_NON_EVACUATED_ENERGY_RESULT = "nonEvacuatedEnergyResult";
public static final String UPDATE_TYPE_NON_EVACUATED_ENERGY_STATUS = "nonEvacuatedEnergy_status";
public static final String UPDATE_TYPE_NON_EVACUATED_ENERGY_FAILED = "nonEvacuatedEnergy_failed";
public static final String UPDATE_TYPE_SHORT_CIRCUIT_RESULT = "shortCircuitAnalysisResult";
public static final String UPDATE_TYPE_SHORT_CIRCUIT_STATUS = "shortCircuitAnalysis_status";
public static final String UPDATE_TYPE_SHORT_CIRCUIT_FAILED = "shortCircuitAnalysis_failed";
public static final String UPDATE_TYPE_ONE_BUS_SHORT_CIRCUIT_RESULT = "oneBusShortCircuitAnalysisResult";
public static final String UPDATE_TYPE_ONE_BUS_SHORT_CIRCUIT_STATUS = "oneBusShortCircuitAnalysis_status";
public static final String UPDATE_TYPE_ONE_BUS_SHORT_CIRCUIT_FAILED = "oneBusShortCircuitAnalysis_failed";
public static final String UPDATE_TYPE_DYNAMIC_SIMULATION_FAILED = "dynamicSimulation_failed";
public static final String UPDATE_TYPE_DYNAMIC_SIMULATION_RESULT = "dynamicSimulationResult";
public static final String UPDATE_TYPE_DYNAMIC_SIMULATION_STATUS = "dynamicSimulation_status";
public static final String UPDATE_TYPE_VOLTAGE_INIT_RESULT = "voltageInitResult";
public static final String UPDATE_TYPE_VOLTAGE_INIT_STATUS = "voltageInit_status";
public static final String UPDATE_TYPE_VOLTAGE_INIT_FAILED = "voltageInit_failed";
public static final String UPDATE_TYPE_VOLTAGE_INIT_CANCEL_FAILED = "voltageInit_cancel_failed";
public static final String UPDATE_TYPE_STUDIES = "studies";
public static final String UPDATE_TYPE_STUDY_NETWORK_RECREATION_DONE = "study_network_recreation_done";
public static final String UPDATE_TYPE_STUDY = "study";
public static final String UPDATE_TYPE_STUDY_METADATA_UPDATED = "metadata_updated";
public static final String UPDATE_TYPE_INDEXATION_STATUS = "indexation_status_updated";
public static final String UPDATE_TYPE_STATE_ESTIMATION_FAILED = "stateEstimation_failed";
public static final String UPDATE_TYPE_STATE_ESTIMATION_RESULT = "stateEstimationResult";
public static final String UPDATE_TYPE_STATE_ESTIMATION_STATUS = "stateEstimation_status";
public static final String UPDATE_TYPE_COMPUTATION_PARAMETERS = "computationParametersUpdated";

public static final String MODIFICATIONS_CREATING_IN_PROGRESS = "creatingInProgress";
Expand Down
Loading

0 comments on commit 6fddccb

Please sign in to comment.