2323import com .cloud .exception .InvalidParameterValueException ;
2424
2525public interface AlertService {
26- public static class AlertType {
27- private static Set <AlertType > defaultAlertTypes = new HashSet <AlertType >();
26+ class AlertType {
27+ private static Set <AlertType > defaultAlertTypes = new HashSet <>();
2828 private final String name ;
2929 private final short type ;
3030
@@ -36,15 +36,13 @@ private AlertType(short type, String name, boolean isDefault) {
3636 }
3737 }
3838
39- public static final AlertType ALERT_TYPE_MEMORY = new AlertType (Capacity .CAPACITY_TYPE_MEMORY , "ALERT.MEMORY" , true );
40- public static final AlertType ALERT_TYPE_CPU = new AlertType (Capacity .CAPACITY_TYPE_CPU , "ALERT.CPU" , true );
41- public static final AlertType ALERT_TYPE_STORAGE = new AlertType (Capacity .CAPACITY_TYPE_STORAGE , "ALERT.STORAGE" , true );
42- public static final AlertType ALERT_TYPE_STORAGE_ALLOCATED = new AlertType (Capacity .CAPACITY_TYPE_STORAGE_ALLOCATED , "ALERT.STORAGE.ALLOCATED" , true );
43- public static final AlertType ALERT_TYPE_VIRTUAL_NETWORK_PUBLIC_IP = new AlertType (Capacity .CAPACITY_TYPE_VIRTUAL_NETWORK_PUBLIC_IP , "ALERT.NETWORK.PUBLICIP" ,
44- true );
45- public static final AlertType ALERT_TYPE_VIRTUAL_NETWORK_IPV6_SUBNET = new AlertType (Capacity .CAPACITY_TYPE_VIRTUAL_NETWORK_IPV6_SUBNET , "ALERT.NETWORK.IPV6SUBNET" , true );
46- public static final AlertType ALERT_TYPE_PRIVATE_IP = new AlertType (Capacity .CAPACITY_TYPE_PRIVATE_IP , "ALERT.NETWORK.PRIVATEIP" , true );
47- public static final AlertType ALERT_TYPE_SECONDARY_STORAGE = new AlertType (Capacity .CAPACITY_TYPE_SECONDARY_STORAGE , "ALERT.STORAGE.SECONDARY" , true );
39+ public static final AlertType ALERT_TYPE_MEMORY = new AlertType ((short )0 , "ALERT.MEMORY" , true );
40+ public static final AlertType ALERT_TYPE_CPU = new AlertType ((short )1 , "ALERT.CPU" , true );
41+ public static final AlertType ALERT_TYPE_STORAGE = new AlertType ((short )2 , "ALERT.STORAGE" , true );
42+ public static final AlertType ALERT_TYPE_STORAGE_ALLOCATED = new AlertType ((short )3 , "ALERT.STORAGE.ALLOCATED" , true );
43+ public static final AlertType ALERT_TYPE_VIRTUAL_NETWORK_PUBLIC_IP = new AlertType ((short )4 , "ALERT.NETWORK.PUBLICIP" , true );
44+ public static final AlertType ALERT_TYPE_PRIVATE_IP = new AlertType ((short )5 , "ALERT.NETWORK.PRIVATEIP" , true );
45+ public static final AlertType ALERT_TYPE_SECONDARY_STORAGE = new AlertType ((short )6 , "ALERT.STORAGE.SECONDARY" , true );
4846 public static final AlertType ALERT_TYPE_HOST = new AlertType ((short )7 , "ALERT.COMPUTE.HOST" , true );
4947 public static final AlertType ALERT_TYPE_USERVM = new AlertType ((short )8 , "ALERT.USERVM" , true );
5048 public static final AlertType ALERT_TYPE_DOMAIN_ROUTER = new AlertType ((short )9 , "ALERT.SERVICE.DOMAINROUTER" , true );
@@ -73,9 +71,12 @@ private AlertType(short type, String name, boolean isDefault) {
7371 public static final AlertType ALERT_TYPE_VM_SNAPSHOT = new AlertType ((short )32 , "ALERT.VM.SNAPSHOT" , true );
7472 public static final AlertType ALERT_TYPE_VR_PUBLIC_IFACE_MTU = new AlertType ((short )33 , "ALERT.VR.PUBLIC.IFACE.MTU" , true );
7573 public static final AlertType ALERT_TYPE_VR_PRIVATE_IFACE_MTU = new AlertType ((short )34 , "ALERT.VR.PRIVATE.IFACE.MTU" , true );
76- public static final AlertType ALERT_TYPE_EXTENSION_PATH_NOT_READY = new AlertType ((short )33 , "ALERT.TYPE.EXTENSION.PATH.NOT.READY" , true );
77- public static final AlertType ALERT_TYPE_BACKUP_STORAGE = new AlertType (Capacity .CAPACITY_TYPE_BACKUP_STORAGE , "ALERT.STORAGE.BACKUP" , true );
78- public static final AlertType ALERT_TYPE_OBJECT_STORAGE = new AlertType (Capacity .CAPACITY_TYPE_OBJECT_STORAGE , "ALERT.STORAGE.OBJECT" , true );
74+ public static final AlertType ALERT_TYPE_VIRTUAL_NETWORK_IPV6_SUBNET = new AlertType ((short )35 , "ALERT.NETWORK.IPV6SUBNET" , true );
75+ public static final AlertType ALERT_TYPE_EXTENSION_PATH_NOT_READY = new AlertType ((short )36 , "ALERT.TYPE.EXTENSION.PATH.NOT.READY" , true );
76+ public static final AlertType ALERT_TYPE_BACKUP_STORAGE = new AlertType ((short )37 , "ALERT.STORAGE.BACKUP" , true );
77+ public static final AlertType ALERT_TYPE_OBJECT_STORAGE = new AlertType ((short )38 , "ALERT.STORAGE.OBJECT" , true );
78+ // Note: Add next Alert Type before this. Always check the 'main' branch and keep the next number for the Alert Type to avoid conflicts.
79+ // Do not use Capacity Type to define the Alert Type.
7980
8081 public short getType () {
8182 return type ;
0 commit comments