IAlarmProcessing.java

  1. /*
  2.  * GovWay - A customizable API Gateway
  3.  * https://govway.org
  4.  *
  5.  * Copyright (c) 2005-2025 Link.it srl (https://link.it).
  6.  *
  7.  * This program is free software: you can redistribute it and/or modify
  8.  * it under the terms of the GNU General Public License version 3, as published by
  9.  * the Free Software Foundation.
  10.  *
  11.  * This program is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  18.  *
  19.  */

  20. package org.openspcoop2.monitor.sdk.plugins;

  21. import org.openspcoop2.monitor.sdk.alarm.AlarmStatus;
  22. import org.openspcoop2.monitor.sdk.alarm.IAlarm;
  23. import org.openspcoop2.monitor.sdk.condition.Context;
  24. import org.openspcoop2.monitor.sdk.constants.AlarmType;
  25. import org.openspcoop2.monitor.sdk.exceptions.AlarmException;

  26. /**
  27.  * IAlarmProcessing
  28.  *
  29.  * @author Poli Andrea (apoli@link.it)
  30.  * @author $Author$
  31.  * @version $Rev$, $Date$
  32.  */
  33. public interface IAlarmProcessing extends ISearchArguments {

  34.     public AlarmType getAlarmType();
  35.    
  36.     // Serve per la generazione automatica del nome dell'allarme
  37.     public String getAutomaticPrefixName(Context context);
  38.     public String getAutomaticSuffixName(Context context);
  39.    
  40.     // Per comprendere se l'allarme รจ configurabile con criteri di filtro o raggruppamento
  41.     public default boolean isUsableFilter() {
  42.         return false;
  43.     }
  44.     public default boolean isUsableFilter(Context context) {
  45.         return isUsableFilter();
  46.     }
  47.     public default FiltersConfiguration getFiltersConfiguration(Context context) {
  48.         return null;
  49.     }
  50.     public default boolean isUsableGroupBy() {
  51.         return false;
  52.     }
  53.     public default boolean isUsableGroupBy(Context context) {
  54.         return isUsableGroupBy();
  55.     }
  56.     public default GroupByConfiguration getGroupByConfiguration(Context context) {
  57.         return null;
  58.     }
  59.    
  60.     public boolean isManuallyUpdateState();
  61.     public boolean isManuallyAckCriteria();
  62.     public default String getDefaultManuallyAckCriteria(Context context) {
  63.         return null;
  64.     }
  65.     public default DialogInfo getDialogInfoAckCriteria(Context context) {
  66.         return null;
  67.     }
  68.    
  69.     public default String getParameterSectionTitle() {
  70.         return null;
  71.     }
  72.    
  73.     /* Solo per allarmi di tipo Attivo */
  74.     public void check(IAlarm allarme) throws AlarmException;
  75.    
  76.     /*
  77.      * Vale sia per attivo che per passivo. Viene notificato un cambio di stato in modo da implementare una segnalazione via API
  78.      * Differente da quelle utilizzabili infrastrutturalmente (Mail o Script)
  79.      **/
  80.     public void changeStatusNotify(IAlarm allarme, AlarmStatus vecchioStato, AlarmStatus nuovoStato) throws AlarmException;
  81.    
  82. }