Copilot commented on code in PR #11325:
URL: https://github.com/apache/cloudstack/pull/11325#discussion_r2239394768


##########
server/src/main/java/com/cloud/alert/AlertManagerImpl.java:
##########
@@ -234,12 +225,31 @@ public boolean configure(String name, Map<String, Object> 
params) throws Configu
                 _capacityCheckPeriod = 
Long.parseLong(Config.CapacityCheckPeriod.getDefaultValue());
             }
         }
+        initMessageBusListener();
+        setupRepetitiveAlertTypes();
 
         _timer = new Timer("CapacityChecker");
 
         return true;
     }
 
+    private void setupRepetitiveAlertTypes() {
+        allowedRepetitiveAlertTypes.clear();
+        String allowedRepetitiveAlertsStr = 
AllowedRepetitiveAlertTypes.value();
+        logger.trace("Allowed repetitive alert types specified by {}: {} ", 
AllowedRepetitiveAlertTypes.key(),
+                allowedRepetitiveAlertsStr);
+        String[] allowedRepetitiveAlertTypesArray = 
allowedRepetitiveAlertsStr.split(",");
+        for (String alertTypeName : allowedRepetitiveAlertTypesArray) {

Review Comment:
   Alert type names should be trimmed to handle whitespace around comma 
separators. Without trimming, " ALERT.TYPE.NAME" would not match 
"ALERT.TYPE.NAME".



##########
server/src/main/java/com/cloud/alert/AlertManagerImpl.java:
##########
@@ -234,12 +225,31 @@ public boolean configure(String name, Map<String, Object> 
params) throws Configu
                 _capacityCheckPeriod = 
Long.parseLong(Config.CapacityCheckPeriod.getDefaultValue());
             }
         }
+        initMessageBusListener();
+        setupRepetitiveAlertTypes();
 
         _timer = new Timer("CapacityChecker");
 
         return true;
     }
 
+    private void setupRepetitiveAlertTypes() {
+        allowedRepetitiveAlertTypes.clear();
+        String allowedRepetitiveAlertsStr = 
AllowedRepetitiveAlertTypes.value();
+        logger.trace("Allowed repetitive alert types specified by {}: {} ", 
AllowedRepetitiveAlertTypes.key(),
+                allowedRepetitiveAlertsStr);
+        String[] allowedRepetitiveAlertTypesArray = 
allowedRepetitiveAlertsStr.split(",");
+        for (String alertTypeName : allowedRepetitiveAlertTypesArray) {
+            AlertType type = AlertType.getAlertTypeByName(alertTypeName);

Review Comment:
   The split operation will create an array with an empty string element when 
the configuration value is empty, causing unnecessary processing. Consider 
checking if the string is empty before splitting or trimming each element.
   ```suggestion
           if (allowedRepetitiveAlertsStr == null || 
allowedRepetitiveAlertsStr.trim().isEmpty()) {
               logger.warn("No allowed repetitive alert types specified. 
Skipping setup.");
               return;
           }
           String[] allowedRepetitiveAlertTypesArray = 
allowedRepetitiveAlertsStr.split(",");
           for (String alertTypeName : allowedRepetitiveAlertTypesArray) {
               AlertType type = 
AlertType.getAlertTypeByName(alertTypeName.trim());
   ```



##########
server/src/main/java/com/cloud/alert/AlertManagerImpl.java:
##########
@@ -864,4 +873,17 @@ public boolean generateAlert(AlertType alertType, long 
dataCenterId, Long podId,
             return false;
         }
     }
+
+    @SuppressWarnings("unchecked")
+    private void initMessageBusListener() {
+        messageBus.subscribe(EventTypes.EVENT_CONFIGURATION_VALUE_EDIT, 
(senderAddress, subject, args) -> {
+            Ternary<String, ConfigKey.Scope, Long> updatedSetting = 
(Ternary<String, ConfigKey.Scope, Long>) args;
+            String updatedSettingName = updatedSetting.first();
+            if (!AllowedRepetitiveAlertTypes.key().equals(updatedSettingName)) 
{
+                return;
+

Review Comment:
   [nitpick] Empty line after return statement is unnecessary and reduces code 
readability. The return statement should be followed directly by the closing 
brace.
   ```suggestion
   
   ```



##########
api/src/main/java/org/apache/cloudstack/alert/AlertService.java:
##########
@@ -25,55 +27,59 @@
 public interface AlertService {
     public static class AlertType {
         private static Set<AlertType> defaultAlertTypes = new 
HashSet<AlertType>();
+        private static Map<String, AlertType> allAlertTypesMap = new 
HashMap<>();
         private final String name;
         private final short type;
+        private final boolean repetitionAllowed;
 
-        private AlertType(short type, String name, boolean isDefault) {
+        private AlertType(short type, String name, boolean isDefault, boolean 
repetitionAllowed) {
             this.name = name;
             this.type = type;
+            this.repetitionAllowed = repetitionAllowed;
             if (isDefault) {
                 defaultAlertTypes.add(this);
             }
+            allAlertTypesMap.put(name, this);
         }
 
-        public static final AlertType ALERT_TYPE_MEMORY = new 
AlertType(Capacity.CAPACITY_TYPE_MEMORY, "ALERT.MEMORY", true);
-        public static final AlertType ALERT_TYPE_CPU = new 
AlertType(Capacity.CAPACITY_TYPE_CPU, "ALERT.CPU", true);
-        public static final AlertType ALERT_TYPE_STORAGE = new 
AlertType(Capacity.CAPACITY_TYPE_STORAGE, "ALERT.STORAGE", true);
-        public static final AlertType ALERT_TYPE_STORAGE_ALLOCATED = new 
AlertType(Capacity.CAPACITY_TYPE_STORAGE_ALLOCATED, "ALERT.STORAGE.ALLOCATED", 
true);
+        public static final AlertType ALERT_TYPE_MEMORY = new 
AlertType(Capacity.CAPACITY_TYPE_MEMORY, "ALERT.MEMORY", true, false);
+        public static final AlertType ALERT_TYPE_CPU = new 
AlertType(Capacity.CAPACITY_TYPE_CPU, "ALERT.CPU", true, false);
+        public static final AlertType ALERT_TYPE_STORAGE = new 
AlertType(Capacity.CAPACITY_TYPE_STORAGE, "ALERT.STORAGE", true, false);
+        public static final AlertType ALERT_TYPE_STORAGE_ALLOCATED = new 
AlertType(Capacity.CAPACITY_TYPE_STORAGE_ALLOCATED, "ALERT.STORAGE.ALLOCATED", 
true, false);
         public static final AlertType ALERT_TYPE_VIRTUAL_NETWORK_PUBLIC_IP = 
new AlertType(Capacity.CAPACITY_TYPE_VIRTUAL_NETWORK_PUBLIC_IP, 
"ALERT.NETWORK.PUBLICIP",
-            true);
-        public static final AlertType ALERT_TYPE_VIRTUAL_NETWORK_IPV6_SUBNET = 
new AlertType(Capacity.CAPACITY_TYPE_VIRTUAL_NETWORK_IPV6_SUBNET, 
"ALERT.NETWORK.IPV6SUBNET", true);
-        public static final AlertType ALERT_TYPE_PRIVATE_IP = new 
AlertType(Capacity.CAPACITY_TYPE_PRIVATE_IP, "ALERT.NETWORK.PRIVATEIP", true);
-        public static final AlertType ALERT_TYPE_SECONDARY_STORAGE = new 
AlertType(Capacity.CAPACITY_TYPE_SECONDARY_STORAGE, "ALERT.STORAGE.SECONDARY", 
true);
-        public static final AlertType ALERT_TYPE_HOST = new 
AlertType((short)7, "ALERT.COMPUTE.HOST", true);
-        public static final AlertType ALERT_TYPE_USERVM = new 
AlertType((short)8, "ALERT.USERVM", true);
-        public static final AlertType ALERT_TYPE_DOMAIN_ROUTER = new 
AlertType((short)9, "ALERT.SERVICE.DOMAINROUTER", true);
-        public static final AlertType ALERT_TYPE_CONSOLE_PROXY = new 
AlertType((short)10, "ALERT.SERVICE.CONSOLEPROXY", true);
-        public static final AlertType ALERT_TYPE_ROUTING = new 
AlertType((short)11, "ALERT.NETWORK.ROUTING", true);
-        public static final AlertType ALERT_TYPE_STORAGE_MISC = new 
AlertType((short)12, "ALERT.STORAGE.MISC", true);
-        public static final AlertType ALERT_TYPE_USAGE_SERVER = new 
AlertType((short)13, "ALERT.USAGE", true);
-        public static final AlertType ALERT_TYPE_MANAGEMENT_NODE = new 
AlertType((short)14, "ALERT.MANAGEMENT", true);
-        public static final AlertType ALERT_TYPE_DOMAIN_ROUTER_MIGRATE = new 
AlertType((short)15, "ALERT.NETWORK.DOMAINROUTERMIGRATE", true);
-        public static final AlertType ALERT_TYPE_CONSOLE_PROXY_MIGRATE = new 
AlertType((short)16, "ALERT.SERVICE.CONSOLEPROXYMIGRATE", true);
-        public static final AlertType ALERT_TYPE_USERVM_MIGRATE = new 
AlertType((short)17, "ALERT.USERVM.MIGRATE", true);
-        public static final AlertType ALERT_TYPE_VLAN = new 
AlertType((short)18, "ALERT.NETWORK.VLAN", true);
-        public static final AlertType ALERT_TYPE_SSVM = new 
AlertType((short)19, "ALERT.SERVICE.SSVM", true);
-        public static final AlertType ALERT_TYPE_USAGE_SERVER_RESULT = new 
AlertType((short)20, "ALERT.USAGE.RESULT", true);
-        public static final AlertType ALERT_TYPE_STORAGE_DELETE = new 
AlertType((short)21, "ALERT.STORAGE.DELETE", true);
-        public static final AlertType ALERT_TYPE_UPDATE_RESOURCE_COUNT = new 
AlertType((short)22, "ALERT.RESOURCE.COUNT", true);
-        public static final AlertType ALERT_TYPE_USAGE_SANITY_RESULT = new 
AlertType((short)23, "ALERT.USAGE.SANITY", true);
-        public static final AlertType ALERT_TYPE_DIRECT_ATTACHED_PUBLIC_IP = 
new AlertType((short)24, "ALERT.NETWORK.DIRECTPUBLICIP", true);
-        public static final AlertType ALERT_TYPE_LOCAL_STORAGE = new 
AlertType((short)25, "ALERT.STORAGE.LOCAL", true);
-        public static final AlertType ALERT_TYPE_RESOURCE_LIMIT_EXCEEDED = new 
AlertType((short)26, "ALERT.RESOURCE.EXCEED", true);
-        public static final AlertType ALERT_TYPE_SYNC = new 
AlertType((short)27, "ALERT.TYPE.SYNC", true);
-        public static final AlertType ALERT_TYPE_UPLOAD_FAILED = new 
AlertType((short)28, "ALERT.UPLOAD.FAILED", true);
-        public static final AlertType ALERT_TYPE_OOBM_AUTH_ERROR = new 
AlertType((short)29, "ALERT.OOBM.AUTHERROR", true);
-        public static final AlertType ALERT_TYPE_HA_ACTION = new 
AlertType((short)30, "ALERT.HA.ACTION", true);
-        public static final AlertType ALERT_TYPE_CA_CERT = new 
AlertType((short)31, "ALERT.CA.CERT", true);
-        public static final AlertType ALERT_TYPE_VM_SNAPSHOT = new 
AlertType((short)32, "ALERT.VM.SNAPSHOT", true);
-        public static final AlertType ALERT_TYPE_VR_PUBLIC_IFACE_MTU = new 
AlertType((short)32, "ALERT.VR.PUBLIC.IFACE.MTU", true);
-        public static final AlertType ALERT_TYPE_VR_PRIVATE_IFACE_MTU = new 
AlertType((short)32, "ALERT.VR.PRIVATE.IFACE.MTU", true);
-        public static final AlertType ALERT_TYPE_EXTENSION_PATH_NOT_READY = 
new AlertType((short)33, "ALERT.TYPE.EXTENSION.PATH.NOT.READY", true);
+            true, false);
+        public static final AlertType ALERT_TYPE_VIRTUAL_NETWORK_IPV6_SUBNET = 
new AlertType(Capacity.CAPACITY_TYPE_VIRTUAL_NETWORK_IPV6_SUBNET, 
"ALERT.NETWORK.IPV6SUBNET", true, false);
+        public static final AlertType ALERT_TYPE_PRIVATE_IP = new 
AlertType(Capacity.CAPACITY_TYPE_PRIVATE_IP, "ALERT.NETWORK.PRIVATEIP", true, 
false);
+        public static final AlertType ALERT_TYPE_SECONDARY_STORAGE = new 
AlertType(Capacity.CAPACITY_TYPE_SECONDARY_STORAGE, "ALERT.STORAGE.SECONDARY", 
true, false);
+        public static final AlertType ALERT_TYPE_HOST = new 
AlertType((short)7, "ALERT.COMPUTE.HOST", true, true);
+        public static final AlertType ALERT_TYPE_USERVM = new 
AlertType((short)8, "ALERT.USERVM", true, true);
+        public static final AlertType ALERT_TYPE_DOMAIN_ROUTER = new 
AlertType((short)9, "ALERT.SERVICE.DOMAINROUTER", true, true);
+        public static final AlertType ALERT_TYPE_CONSOLE_PROXY = new 
AlertType((short)10, "ALERT.SERVICE.CONSOLEPROXY", true, true);
+        public static final AlertType ALERT_TYPE_ROUTING = new 
AlertType((short)11, "ALERT.NETWORK.ROUTING", true, false);
+        public static final AlertType ALERT_TYPE_STORAGE_MISC = new 
AlertType((short)12, "ALERT.STORAGE.MISC", true, true);
+        public static final AlertType ALERT_TYPE_USAGE_SERVER = new 
AlertType((short)13, "ALERT.USAGE", true, false);
+        public static final AlertType ALERT_TYPE_MANAGEMENT_NODE = new 
AlertType((short)14, "ALERT.MANAGEMENT", true, true);
+        public static final AlertType ALERT_TYPE_DOMAIN_ROUTER_MIGRATE = new 
AlertType((short)15, "ALERT.NETWORK.DOMAINROUTERMIGRATE", true, false);
+        public static final AlertType ALERT_TYPE_CONSOLE_PROXY_MIGRATE = new 
AlertType((short)16, "ALERT.SERVICE.CONSOLEPROXYMIGRATE", true, false);
+        public static final AlertType ALERT_TYPE_USERVM_MIGRATE = new 
AlertType((short)17, "ALERT.USERVM.MIGRATE", true, false);
+        public static final AlertType ALERT_TYPE_VLAN = new 
AlertType((short)18, "ALERT.NETWORK.VLAN", true, false);
+        public static final AlertType ALERT_TYPE_SSVM = new 
AlertType((short)19, "ALERT.SERVICE.SSVM", true, true);
+        public static final AlertType ALERT_TYPE_USAGE_SERVER_RESULT = new 
AlertType((short)20, "ALERT.USAGE.RESULT", true, false);
+        public static final AlertType ALERT_TYPE_STORAGE_DELETE = new 
AlertType((short)21, "ALERT.STORAGE.DELETE", true, false);
+        public static final AlertType ALERT_TYPE_UPDATE_RESOURCE_COUNT = new 
AlertType((short)22, "ALERT.RESOURCE.COUNT", true, false);
+        public static final AlertType ALERT_TYPE_USAGE_SANITY_RESULT = new 
AlertType((short)23, "ALERT.USAGE.SANITY", true, false);
+        public static final AlertType ALERT_TYPE_DIRECT_ATTACHED_PUBLIC_IP = 
new AlertType((short)24, "ALERT.NETWORK.DIRECTPUBLICIP", true, false);
+        public static final AlertType ALERT_TYPE_LOCAL_STORAGE = new 
AlertType((short)25, "ALERT.STORAGE.LOCAL", true, false);
+        public static final AlertType ALERT_TYPE_RESOURCE_LIMIT_EXCEEDED = new 
AlertType((short)26, "ALERT.RESOURCE.EXCEED", true, true);
+        public static final AlertType ALERT_TYPE_SYNC = new 
AlertType((short)27, "ALERT.TYPE.SYNC", true, false);
+        public static final AlertType ALERT_TYPE_UPLOAD_FAILED = new 
AlertType((short)28, "ALERT.UPLOAD.FAILED", true, true);
+        public static final AlertType ALERT_TYPE_OOBM_AUTH_ERROR = new 
AlertType((short)29, "ALERT.OOBM.AUTHERROR", true, true);
+        public static final AlertType ALERT_TYPE_HA_ACTION = new 
AlertType((short)30, "ALERT.HA.ACTION", true, true);
+        public static final AlertType ALERT_TYPE_CA_CERT = new 
AlertType((short)31, "ALERT.CA.CERT", true, true);
+        public static final AlertType ALERT_TYPE_VM_SNAPSHOT = new 
AlertType((short)32, "ALERT.VM.SNAPSHOT", true, false);
+        public static final AlertType ALERT_TYPE_VR_PUBLIC_IFACE_MTU = new 
AlertType((short)32, "ALERT.VR.PUBLIC.IFACE.MTU", true, false);
+        public static final AlertType ALERT_TYPE_VR_PRIVATE_IFACE_MTU = new 
AlertType((short)32, "ALERT.VR.PRIVATE.IFACE.MTU", true, false);

Review Comment:
   This AlertType uses the same type value (32) as ALERT_TYPE_VM_SNAPSHOT and 
ALERT_TYPE_VR_PUBLIC_IFACE_MTU. Each AlertType should have a unique type 
identifier.
   ```suggestion
           public static final AlertType ALERT_TYPE_VR_PUBLIC_IFACE_MTU = new 
AlertType((short)34, "ALERT.VR.PUBLIC.IFACE.MTU", true, false);
           public static final AlertType ALERT_TYPE_VR_PRIVATE_IFACE_MTU = new 
AlertType((short)35, "ALERT.VR.PRIVATE.IFACE.MTU", true, false);
   ```



##########
api/src/main/java/org/apache/cloudstack/alert/AlertService.java:
##########
@@ -25,55 +27,59 @@
 public interface AlertService {
     public static class AlertType {
         private static Set<AlertType> defaultAlertTypes = new 
HashSet<AlertType>();
+        private static Map<String, AlertType> allAlertTypesMap = new 
HashMap<>();
         private final String name;
         private final short type;
+        private final boolean repetitionAllowed;
 
-        private AlertType(short type, String name, boolean isDefault) {
+        private AlertType(short type, String name, boolean isDefault, boolean 
repetitionAllowed) {
             this.name = name;
             this.type = type;
+            this.repetitionAllowed = repetitionAllowed;
             if (isDefault) {
                 defaultAlertTypes.add(this);
             }
+            allAlertTypesMap.put(name, this);
         }
 
-        public static final AlertType ALERT_TYPE_MEMORY = new 
AlertType(Capacity.CAPACITY_TYPE_MEMORY, "ALERT.MEMORY", true);
-        public static final AlertType ALERT_TYPE_CPU = new 
AlertType(Capacity.CAPACITY_TYPE_CPU, "ALERT.CPU", true);
-        public static final AlertType ALERT_TYPE_STORAGE = new 
AlertType(Capacity.CAPACITY_TYPE_STORAGE, "ALERT.STORAGE", true);
-        public static final AlertType ALERT_TYPE_STORAGE_ALLOCATED = new 
AlertType(Capacity.CAPACITY_TYPE_STORAGE_ALLOCATED, "ALERT.STORAGE.ALLOCATED", 
true);
+        public static final AlertType ALERT_TYPE_MEMORY = new 
AlertType(Capacity.CAPACITY_TYPE_MEMORY, "ALERT.MEMORY", true, false);
+        public static final AlertType ALERT_TYPE_CPU = new 
AlertType(Capacity.CAPACITY_TYPE_CPU, "ALERT.CPU", true, false);
+        public static final AlertType ALERT_TYPE_STORAGE = new 
AlertType(Capacity.CAPACITY_TYPE_STORAGE, "ALERT.STORAGE", true, false);
+        public static final AlertType ALERT_TYPE_STORAGE_ALLOCATED = new 
AlertType(Capacity.CAPACITY_TYPE_STORAGE_ALLOCATED, "ALERT.STORAGE.ALLOCATED", 
true, false);
         public static final AlertType ALERT_TYPE_VIRTUAL_NETWORK_PUBLIC_IP = 
new AlertType(Capacity.CAPACITY_TYPE_VIRTUAL_NETWORK_PUBLIC_IP, 
"ALERT.NETWORK.PUBLICIP",
-            true);
-        public static final AlertType ALERT_TYPE_VIRTUAL_NETWORK_IPV6_SUBNET = 
new AlertType(Capacity.CAPACITY_TYPE_VIRTUAL_NETWORK_IPV6_SUBNET, 
"ALERT.NETWORK.IPV6SUBNET", true);
-        public static final AlertType ALERT_TYPE_PRIVATE_IP = new 
AlertType(Capacity.CAPACITY_TYPE_PRIVATE_IP, "ALERT.NETWORK.PRIVATEIP", true);
-        public static final AlertType ALERT_TYPE_SECONDARY_STORAGE = new 
AlertType(Capacity.CAPACITY_TYPE_SECONDARY_STORAGE, "ALERT.STORAGE.SECONDARY", 
true);
-        public static final AlertType ALERT_TYPE_HOST = new 
AlertType((short)7, "ALERT.COMPUTE.HOST", true);
-        public static final AlertType ALERT_TYPE_USERVM = new 
AlertType((short)8, "ALERT.USERVM", true);
-        public static final AlertType ALERT_TYPE_DOMAIN_ROUTER = new 
AlertType((short)9, "ALERT.SERVICE.DOMAINROUTER", true);
-        public static final AlertType ALERT_TYPE_CONSOLE_PROXY = new 
AlertType((short)10, "ALERT.SERVICE.CONSOLEPROXY", true);
-        public static final AlertType ALERT_TYPE_ROUTING = new 
AlertType((short)11, "ALERT.NETWORK.ROUTING", true);
-        public static final AlertType ALERT_TYPE_STORAGE_MISC = new 
AlertType((short)12, "ALERT.STORAGE.MISC", true);
-        public static final AlertType ALERT_TYPE_USAGE_SERVER = new 
AlertType((short)13, "ALERT.USAGE", true);
-        public static final AlertType ALERT_TYPE_MANAGEMENT_NODE = new 
AlertType((short)14, "ALERT.MANAGEMENT", true);
-        public static final AlertType ALERT_TYPE_DOMAIN_ROUTER_MIGRATE = new 
AlertType((short)15, "ALERT.NETWORK.DOMAINROUTERMIGRATE", true);
-        public static final AlertType ALERT_TYPE_CONSOLE_PROXY_MIGRATE = new 
AlertType((short)16, "ALERT.SERVICE.CONSOLEPROXYMIGRATE", true);
-        public static final AlertType ALERT_TYPE_USERVM_MIGRATE = new 
AlertType((short)17, "ALERT.USERVM.MIGRATE", true);
-        public static final AlertType ALERT_TYPE_VLAN = new 
AlertType((short)18, "ALERT.NETWORK.VLAN", true);
-        public static final AlertType ALERT_TYPE_SSVM = new 
AlertType((short)19, "ALERT.SERVICE.SSVM", true);
-        public static final AlertType ALERT_TYPE_USAGE_SERVER_RESULT = new 
AlertType((short)20, "ALERT.USAGE.RESULT", true);
-        public static final AlertType ALERT_TYPE_STORAGE_DELETE = new 
AlertType((short)21, "ALERT.STORAGE.DELETE", true);
-        public static final AlertType ALERT_TYPE_UPDATE_RESOURCE_COUNT = new 
AlertType((short)22, "ALERT.RESOURCE.COUNT", true);
-        public static final AlertType ALERT_TYPE_USAGE_SANITY_RESULT = new 
AlertType((short)23, "ALERT.USAGE.SANITY", true);
-        public static final AlertType ALERT_TYPE_DIRECT_ATTACHED_PUBLIC_IP = 
new AlertType((short)24, "ALERT.NETWORK.DIRECTPUBLICIP", true);
-        public static final AlertType ALERT_TYPE_LOCAL_STORAGE = new 
AlertType((short)25, "ALERT.STORAGE.LOCAL", true);
-        public static final AlertType ALERT_TYPE_RESOURCE_LIMIT_EXCEEDED = new 
AlertType((short)26, "ALERT.RESOURCE.EXCEED", true);
-        public static final AlertType ALERT_TYPE_SYNC = new 
AlertType((short)27, "ALERT.TYPE.SYNC", true);
-        public static final AlertType ALERT_TYPE_UPLOAD_FAILED = new 
AlertType((short)28, "ALERT.UPLOAD.FAILED", true);
-        public static final AlertType ALERT_TYPE_OOBM_AUTH_ERROR = new 
AlertType((short)29, "ALERT.OOBM.AUTHERROR", true);
-        public static final AlertType ALERT_TYPE_HA_ACTION = new 
AlertType((short)30, "ALERT.HA.ACTION", true);
-        public static final AlertType ALERT_TYPE_CA_CERT = new 
AlertType((short)31, "ALERT.CA.CERT", true);
-        public static final AlertType ALERT_TYPE_VM_SNAPSHOT = new 
AlertType((short)32, "ALERT.VM.SNAPSHOT", true);
-        public static final AlertType ALERT_TYPE_VR_PUBLIC_IFACE_MTU = new 
AlertType((short)32, "ALERT.VR.PUBLIC.IFACE.MTU", true);
-        public static final AlertType ALERT_TYPE_VR_PRIVATE_IFACE_MTU = new 
AlertType((short)32, "ALERT.VR.PRIVATE.IFACE.MTU", true);
-        public static final AlertType ALERT_TYPE_EXTENSION_PATH_NOT_READY = 
new AlertType((short)33, "ALERT.TYPE.EXTENSION.PATH.NOT.READY", true);
+            true, false);
+        public static final AlertType ALERT_TYPE_VIRTUAL_NETWORK_IPV6_SUBNET = 
new AlertType(Capacity.CAPACITY_TYPE_VIRTUAL_NETWORK_IPV6_SUBNET, 
"ALERT.NETWORK.IPV6SUBNET", true, false);
+        public static final AlertType ALERT_TYPE_PRIVATE_IP = new 
AlertType(Capacity.CAPACITY_TYPE_PRIVATE_IP, "ALERT.NETWORK.PRIVATEIP", true, 
false);
+        public static final AlertType ALERT_TYPE_SECONDARY_STORAGE = new 
AlertType(Capacity.CAPACITY_TYPE_SECONDARY_STORAGE, "ALERT.STORAGE.SECONDARY", 
true, false);
+        public static final AlertType ALERT_TYPE_HOST = new 
AlertType((short)7, "ALERT.COMPUTE.HOST", true, true);
+        public static final AlertType ALERT_TYPE_USERVM = new 
AlertType((short)8, "ALERT.USERVM", true, true);
+        public static final AlertType ALERT_TYPE_DOMAIN_ROUTER = new 
AlertType((short)9, "ALERT.SERVICE.DOMAINROUTER", true, true);
+        public static final AlertType ALERT_TYPE_CONSOLE_PROXY = new 
AlertType((short)10, "ALERT.SERVICE.CONSOLEPROXY", true, true);
+        public static final AlertType ALERT_TYPE_ROUTING = new 
AlertType((short)11, "ALERT.NETWORK.ROUTING", true, false);
+        public static final AlertType ALERT_TYPE_STORAGE_MISC = new 
AlertType((short)12, "ALERT.STORAGE.MISC", true, true);
+        public static final AlertType ALERT_TYPE_USAGE_SERVER = new 
AlertType((short)13, "ALERT.USAGE", true, false);
+        public static final AlertType ALERT_TYPE_MANAGEMENT_NODE = new 
AlertType((short)14, "ALERT.MANAGEMENT", true, true);
+        public static final AlertType ALERT_TYPE_DOMAIN_ROUTER_MIGRATE = new 
AlertType((short)15, "ALERT.NETWORK.DOMAINROUTERMIGRATE", true, false);
+        public static final AlertType ALERT_TYPE_CONSOLE_PROXY_MIGRATE = new 
AlertType((short)16, "ALERT.SERVICE.CONSOLEPROXYMIGRATE", true, false);
+        public static final AlertType ALERT_TYPE_USERVM_MIGRATE = new 
AlertType((short)17, "ALERT.USERVM.MIGRATE", true, false);
+        public static final AlertType ALERT_TYPE_VLAN = new 
AlertType((short)18, "ALERT.NETWORK.VLAN", true, false);
+        public static final AlertType ALERT_TYPE_SSVM = new 
AlertType((short)19, "ALERT.SERVICE.SSVM", true, true);
+        public static final AlertType ALERT_TYPE_USAGE_SERVER_RESULT = new 
AlertType((short)20, "ALERT.USAGE.RESULT", true, false);
+        public static final AlertType ALERT_TYPE_STORAGE_DELETE = new 
AlertType((short)21, "ALERT.STORAGE.DELETE", true, false);
+        public static final AlertType ALERT_TYPE_UPDATE_RESOURCE_COUNT = new 
AlertType((short)22, "ALERT.RESOURCE.COUNT", true, false);
+        public static final AlertType ALERT_TYPE_USAGE_SANITY_RESULT = new 
AlertType((short)23, "ALERT.USAGE.SANITY", true, false);
+        public static final AlertType ALERT_TYPE_DIRECT_ATTACHED_PUBLIC_IP = 
new AlertType((short)24, "ALERT.NETWORK.DIRECTPUBLICIP", true, false);
+        public static final AlertType ALERT_TYPE_LOCAL_STORAGE = new 
AlertType((short)25, "ALERT.STORAGE.LOCAL", true, false);
+        public static final AlertType ALERT_TYPE_RESOURCE_LIMIT_EXCEEDED = new 
AlertType((short)26, "ALERT.RESOURCE.EXCEED", true, true);
+        public static final AlertType ALERT_TYPE_SYNC = new 
AlertType((short)27, "ALERT.TYPE.SYNC", true, false);
+        public static final AlertType ALERT_TYPE_UPLOAD_FAILED = new 
AlertType((short)28, "ALERT.UPLOAD.FAILED", true, true);
+        public static final AlertType ALERT_TYPE_OOBM_AUTH_ERROR = new 
AlertType((short)29, "ALERT.OOBM.AUTHERROR", true, true);
+        public static final AlertType ALERT_TYPE_HA_ACTION = new 
AlertType((short)30, "ALERT.HA.ACTION", true, true);
+        public static final AlertType ALERT_TYPE_CA_CERT = new 
AlertType((short)31, "ALERT.CA.CERT", true, true);
+        public static final AlertType ALERT_TYPE_VM_SNAPSHOT = new 
AlertType((short)32, "ALERT.VM.SNAPSHOT", true, false);
+        public static final AlertType ALERT_TYPE_VR_PUBLIC_IFACE_MTU = new 
AlertType((short)32, "ALERT.VR.PUBLIC.IFACE.MTU", true, false);
+        public static final AlertType ALERT_TYPE_VR_PRIVATE_IFACE_MTU = new 
AlertType((short)32, "ALERT.VR.PRIVATE.IFACE.MTU", true, false);

Review Comment:
   Multiple AlertType constants are using the same type value (32). 
ALERT_TYPE_VM_SNAPSHOT, ALERT_TYPE_VR_PUBLIC_IFACE_MTU, and 
ALERT_TYPE_VR_PRIVATE_IFACE_MTU all use (short)32, which will cause conflicts 
in alert type identification.
   ```suggestion
           public static final AlertType ALERT_TYPE_VR_PUBLIC_IFACE_MTU = new 
AlertType((short)34, "ALERT.VR.PUBLIC.IFACE.MTU", true, false);
           public static final AlertType ALERT_TYPE_VR_PRIVATE_IFACE_MTU = new 
AlertType((short)35, "ALERT.VR.PRIVATE.IFACE.MTU", true, false);
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to