diff options
Diffstat (limited to 'adapters/mso-openstack-adapters/src/main')
6 files changed, 47 insertions, 76 deletions
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java index 6578912b9a..608f39adb4 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java @@ -48,7 +48,7 @@ import org.onap.so.adapters.network.async.client.UpdateNetworkNotification; import org.onap.so.adapters.network.exceptions.NetworkException; import org.onap.so.entity.MsoRequest; import org.onap.so.logger.MessageEnum; -import org.onap.so.logger.MsoAlarmLogger; + import org.onap.so.logger.MsoLogger; import org.onap.so.openstack.beans.NetworkRollback; import org.onap.so.openstack.beans.NetworkStatus; @@ -63,7 +63,7 @@ import org.springframework.stereotype.Component; public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync { private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA,MsoNetworkAdapterAsyncImpl.class); - private static final MsoAlarmLogger alarmLogger = new MsoAlarmLogger (); + private static final String BPEL_AUTH_PROP = "org.onap.so.adapters.network.bpelauth"; private static final String ENCRYPTION_KEY_PROP = "org.onap.so.adapters.network.encryptionKey"; private static final String NETWORK_EXCEPTION_MSG="Got a NetworkException on createNetwork: "; @@ -179,7 +179,7 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync { } catch (Exception e1) { error = CREATE_NETWORK_ERROR_MSG + e1.getMessage (); LOGGER.error (MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, "", "", MsoLogger.ErrorCode.DataError,CREATE_NETWORK_EXCEPTON_MSG, e1); - alarmLogger.sendAlarm (MSO_INTERNAL_ERROR_MSG, MsoAlarmLogger.CRITICAL, error); + } return; } @@ -198,7 +198,7 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync { } catch (Exception e) { error = CREATE_NETWORK_ERROR_MSG + e.getMessage (); LOGGER.error (MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, "", "", MsoLogger.ErrorCode.DataError, CREATE_NETWORK_EXCEPTON_MSG, e); - alarmLogger.sendAlarm (MSO_INTERNAL_ERROR_MSG, MsoAlarmLogger.CRITICAL, error); + } return; } @@ -294,7 +294,7 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync { } catch (Exception e1) { error = "Error sending updateNetwork notification " + e1.getMessage (); LOGGER.error (MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, "", "", MsoLogger.ErrorCode.DataError, "Exception sending updateNetwork notification", e1); - alarmLogger.sendAlarm (MSO_INTERNAL_ERROR_MSG, MsoAlarmLogger.CRITICAL, error); + } return; } @@ -311,7 +311,7 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync { } catch (Exception e) { error = "Error sending updateNotification request" + e.getMessage (); LOGGER.error (MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, "", "", MsoLogger.ErrorCode.DataError, "Exception sending updateNotification request", e); - alarmLogger.sendAlarm (MSO_INTERNAL_ERROR_MSG, MsoAlarmLogger.CRITICAL, error); + } return; } @@ -376,9 +376,9 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync { NetworkAdapterNotify notifyPort = getNotifyEP (notificationUrl); notifyPort.queryNetworkNotification (messageId, false, exCat, eMsg, null, null, null, null, null, null); } catch (Exception e1) { - error = CREATE_NETWORK_ERROR_MSG + e1.getMessage (); - LOGGER.error (MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, "", "", MsoLogger.ErrorCode.DataError, CREATE_NETWORK_EXCEPTON_MSG, e1); - alarmLogger.sendAlarm (MSO_INTERNAL_ERROR_MSG, MsoAlarmLogger.CRITICAL, error); + error = "Error sending createNetwork notification " + e1.getMessage (); + LOGGER.error (MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, "", "", MsoLogger.ErrorCode.DataError, "Exception sending createNetwork notification", e1); + } return; } @@ -398,9 +398,9 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync { vlans.value, copyQuerySubnetIdMap (subnetIdMap)); } catch (Exception e) { - error = CREATE_NETWORK_ERROR_MSG + e.getMessage (); - LOGGER.error (MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, "", "", MsoLogger.ErrorCode.DataError, CREATE_NETWORK_EXCEPTON_MSG, e); - alarmLogger.sendAlarm (MSO_INTERNAL_ERROR_MSG, MsoAlarmLogger.CRITICAL, error); + error = "Error sending createNetwork notification " + e.getMessage (); + LOGGER.error (MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, "", "", MsoLogger.ErrorCode.DataError, "Exception sending createNetwork notification", e); + } return; } @@ -463,9 +463,9 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync { NetworkAdapterNotify notifyPort = getNotifyEP (notificationUrl); notifyPort.deleteNetworkNotification (messageId, false, exCat, eMsg, null); } catch (Exception e1) { - error = CREATE_NETWORK_ERROR_MSG + e1.getMessage (); - LOGGER.error (MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, "", "", MsoLogger.ErrorCode.DataError, CREATE_NETWORK_EXCEPTON_MSG, e1); - alarmLogger.sendAlarm (MSO_INTERNAL_ERROR_MSG, MsoAlarmLogger.CRITICAL, error); + error = "Error sending createNetwork notification " + e1.getMessage (); + LOGGER.error (MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, "", "", MsoLogger.ErrorCode.DataError, "Exception sending createNetwork notification", e1); + } return; } @@ -477,7 +477,7 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync { } catch (Exception e) { error = "Error sending deleteNetwork notification " + e.getMessage (); LOGGER.error (MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, "", "", MsoLogger.ErrorCode.DataError, "Exception sending deleteNetwork notification", e); - alarmLogger.sendAlarm (MSO_INTERNAL_ERROR_MSG, MsoAlarmLogger.CRITICAL, error); + } return; } @@ -529,7 +529,7 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync { } catch (Exception e1) { error = CREATE_NETWORK_ERROR_MSG + e1.getMessage (); LOGGER.error (MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, "", "", MsoLogger.ErrorCode.DataError, "Exception in sending createNetwork notification ", e1); - alarmLogger.sendAlarm (MSO_INTERNAL_ERROR_MSG, MsoAlarmLogger.CRITICAL, error); + } return; } @@ -541,7 +541,7 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync { } catch (Exception e) { error = "Error sending rollbackNetwork notification " + e.getMessage (); LOGGER.error (MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, "", "", MsoLogger.ErrorCode.DataError, "Exception in sending rollbackNetwork notification", e); - alarmLogger.sendAlarm (MSO_INTERNAL_ERROR_MSG, MsoAlarmLogger.CRITICAL, error); + } return; } @@ -627,7 +627,7 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync { } catch (Exception e) { String error1 = "Unable to set authorization in callback request" + e.getMessage (); LOGGER.error (MessageEnum.RA_SET_CALLBACK_AUTH_EXC, "", "", MsoLogger.ErrorCode.DataError, "Exception - Unable to set authorization in callback request", e); - alarmLogger.sendAlarm (MSO_INTERNAL_ERROR_MSG, MsoAlarmLogger.CRITICAL, error1); + } return notifyPort; diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java index 4b6bd09144..45285d0e51 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java @@ -49,7 +49,7 @@ import org.onap.so.db.catalog.data.repository.NetworkResourceRepository; import org.onap.so.db.catalog.utils.MavenLikeVersioning; import org.onap.so.entity.MsoRequest; import org.onap.so.logger.MessageEnum; -import org.onap.so.logger.MsoAlarmLogger; + import org.onap.so.logger.MsoLogger; import org.onap.so.openstack.beans.HeatStatus; import org.onap.so.openstack.beans.NetworkInfo; @@ -92,7 +92,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { private static final String NEUTRON_MODE = "NEUTRON"; private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA,MsoNetworkAdapterImpl.class); - private static final MsoAlarmLogger alarmLogger = new MsoAlarmLogger (); + @Autowired private CloudConfig cloudConfig; @Autowired @@ -404,10 +404,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { if (heatTemplate == null) { String error = "Network error - undefined Heat Template. Network Type = " + networkType; LOGGER.error (MessageEnum.RA_PARAM_NOT_FOUND, "Heat Template", "Network Type", networkType, "Openstack", "", MsoLogger.ErrorCode.DataError, "Network error - undefined Heat Template. Network Type = " + networkType); - alarmLogger.sendAlarm (MSO_CONFIGURATION_ERROR, MsoAlarmLogger.CRITICAL, error); // Alarm on this - // error, - // configuration - // must be fixed LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error); throw new NetworkException (error, MsoExceptionCategory.INTERNAL); } @@ -514,10 +510,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { } catch (IllegalArgumentException e) { String error = "Create Network: Configuration Error: " + e.getMessage (); LOGGER.error (MessageEnum.RA_CONFIG_EXC, e.getMessage(), "Openstack", "", MsoLogger.ErrorCode.DataError, "Exception - Create Network, Configuration Error", e); - alarmLogger.sendAlarm (MSO_CONFIGURATION_ERROR, MsoAlarmLogger.CRITICAL, error); // Alarm on this - // error, - // configuration - // must be fixed LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataError, error); // Input parameters were not valid throw new NetworkException (error, MsoExceptionCategory.INTERNAL); @@ -953,7 +945,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { if (heatTemplate == null) { String error = "Network error - undefined Heat Template. Network Type=" + networkType; LOGGER.error(MessageEnum.RA_PARAM_NOT_FOUND, "Heat Template", "Network Type", networkType, "OpenStack", "getHeatTemplate", MsoLogger.ErrorCode.DataError, "Network error - undefined Heat Template. Network Type=" + networkType); - alarmLogger.sendAlarm(MSO_CONFIGURATION_ERROR, MsoAlarmLogger.CRITICAL, error); + LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest, error); throw new NetworkException(error, MsoExceptionCategory.INTERNAL); } @@ -989,7 +981,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { } catch (IllegalArgumentException e) { String error = "UpdateNetwork: Configuration Error: Network Type=" + networkType; LOGGER.error(MessageEnum.RA_CONFIG_EXC, "Network Type=" + networkType, "OpenStack", "", MsoLogger.ErrorCode.DataError, "Exception - UpdateNetwork: Configuration Error"); - alarmLogger.sendAlarm(MSO_CONFIGURATION_ERROR, MsoAlarmLogger.CRITICAL, error); + LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.SchemaError, error); throw new NetworkException(error, MsoExceptionCategory.INTERNAL, e); } @@ -1177,10 +1169,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { LOGGER.error(MessageEnum.RA_NETWORK_ORCHE_MODE_NOT_SUPPORT, mode, "OpenStack", "", MsoLogger.ErrorCode.DataError, "CreateNetwork: Configuration Error"); - // Alarm on this error, configuration must be fixed - alarmLogger.sendAlarm(MSO_CONFIGURATION_ERROR, - MsoAlarmLogger.CRITICAL, error); - throw new NetworkException(error, MsoExceptionCategory.INTERNAL); } diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImpl.java index bd0dc378d2..21b7ea4142 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImpl.java @@ -45,7 +45,7 @@ import org.onap.so.adapters.vnf.async.client.VnfAdapterNotify_Service; import org.onap.so.adapters.vnf.exceptions.VnfException; import org.onap.so.entity.MsoRequest; import org.onap.so.logger.MessageEnum; -import org.onap.so.logger.MsoAlarmLogger; + import org.onap.so.logger.MsoLogger; import org.onap.so.openstack.beans.VnfRollback; import org.onap.so.openstack.beans.VnfStatus; @@ -60,7 +60,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync { public static final String MSO_PROP_VNF_ADAPTER="MSO_PROP_VNF_ADAPTER"; private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, MsoVnfAdapterAsyncImpl.class); - private static MsoAlarmLogger alarmLogger = new MsoAlarmLogger (); + private static final String BPEL_AUTH_PROP = "org.onap.so.adapters.vnf.bpelauth"; private static final String ENCRYPTION_KEY_PROP = "org.onap.so.adapters.network.encryptionKey"; @@ -181,7 +181,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync { } catch (Exception e1) { error = "Error sending createVnf notification " + e1.getMessage (); LOGGER.error (MessageEnum.RA_SEND_VNF_NOTIF_ERR, "", "createVnfA", MsoLogger.ErrorCode.BusinessProcesssError, "Exception sending createVnf notification", e1); - alarmLogger.sendAlarm ("MsoInternalError", MsoAlarmLogger.CRITICAL, error); + } LOGGER.info (MessageEnum.RA_ASYNC_CREATE_VNF_COMPLETE, "", "createVnfA", ""); return; @@ -200,7 +200,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync { } catch (Exception e) { error = "Error sending createVnf notification " + e.getMessage (); LOGGER.error (MessageEnum.RA_SEND_VNF_NOTIF_ERR, "", "createVnfA", MsoLogger.ErrorCode.BusinessProcesssError, "Exception sending createVnf notification", e); - alarmLogger.sendAlarm ("MsoInternalError", MsoAlarmLogger.CRITICAL, error); + } LOGGER.info (MessageEnum.RA_ASYNC_CREATE_VNF_COMPLETE, "", "","createVnfA"); return; @@ -255,7 +255,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync { } catch (Exception e1) { error = "Error sending updateVnf notification " + e1.getMessage (); LOGGER.error (MessageEnum.RA_SEND_VNF_NOTIF_ERR, "", "UpdateVnfA", MsoLogger.ErrorCode.BusinessProcesssError, "Exception sending updateVnf notification", e1); - alarmLogger.sendAlarm ("MsoInternalError", MsoAlarmLogger.CRITICAL, error); + } LOGGER.info (MessageEnum.RA_ASYNC_UPDATE_VNF_COMPLETE,"","","UpdateVnfA"); return; @@ -273,7 +273,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync { } catch (Exception e) { error = "Error sending updateVnf notification " + e.getMessage (); LOGGER.error (MessageEnum.RA_SEND_VNF_NOTIF_ERR, "", "UpdateVnfA", MsoLogger.ErrorCode.BusinessProcesssError, "Exception sending updateVnf notification", e); - alarmLogger.sendAlarm ("MsoInternalError", MsoAlarmLogger.CRITICAL, error); + } LOGGER.info (MessageEnum.RA_ASYNC_UPDATE_VNF_COMPLETE, "", "","UpdateVnfA"); return; @@ -337,7 +337,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync { } catch (Exception e1) { error = "Error sending queryVnf notification " + e1.getMessage (); LOGGER.error (MessageEnum.RA_SEND_VNF_NOTIF_ERR, "", "queryVnfA", MsoLogger.ErrorCode.BusinessProcesssError, "Exception sending queryVnf notification", e1); - alarmLogger.sendAlarm ("MsoInternalError", MsoAlarmLogger.CRITICAL, error); + } LOGGER.info (MessageEnum.RA_ASYNC_QUERY_VNF_COMPLETE, "","", "queryVnfA"); return; @@ -363,7 +363,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync { } catch (Exception e) { error = "Error sending queryVnf notification " + e.getMessage (); LOGGER.error (MessageEnum.RA_SEND_VNF_NOTIF_ERR, "", "queryVnfA", MsoLogger.ErrorCode.BusinessProcesssError, "Exception sending queryVnf notification", e); - alarmLogger.sendAlarm ("MsoInternalError", MsoAlarmLogger.CRITICAL, error); + } LOGGER.info (MessageEnum.RA_ASYNC_QUERY_VNF_COMPLETE, "","", "queryVnfA"); @@ -421,7 +421,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync { } catch (Exception e1) { error = "Error sending deleteVnf notification " + e1.getMessage (); LOGGER.error (MessageEnum.RA_SEND_VNF_NOTIF_ERR, "", "deleteVnfA", MsoLogger.ErrorCode.BusinessProcesssError, "Exception sending deleteVnfA notification", e1); - alarmLogger.sendAlarm ("MsoInternalError", MsoAlarmLogger.CRITICAL, error); + } LOGGER.info (MessageEnum.RA_ASYNC_DELETE_VNF_COMPLETE, "","", "deleteVnfA"); return; @@ -436,7 +436,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync { } catch (Exception e) { error = "Error sending deleteVnf notification " + e.getMessage (); LOGGER.error (MessageEnum.RA_SEND_VNF_NOTIF_ERR, "", "deleteVnfA", MsoLogger.ErrorCode.BusinessProcesssError, "Exception sending deleteVnfA notification", e); - alarmLogger.sendAlarm ("MsoInternalError", MsoAlarmLogger.CRITICAL, error); + } LOGGER.info (MessageEnum.RA_ASYNC_DELETE_VNF_COMPLETE, "", "","deleteVnfA"); @@ -458,7 +458,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync { if (rollback == null) { error = "Empty Rollback: No action to perform"; LOGGER.info (MessageEnum.RA_ROLLBACK_NULL, "","", "rollbackVnfA"); - alarmLogger.sendAlarm ("MsoInternalError", MsoAlarmLogger.CRITICAL, error); + return; } @@ -491,7 +491,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync { } catch (Exception e1) { error = "Error sending rollbackVnf notification " + e1.getMessage (); LOGGER.error (MessageEnum.RA_SEND_VNF_NOTIF_ERR, "", "rollbackVnfA", MsoLogger.ErrorCode.BusinessProcesssError, "Exception sending rollbackVnfA notification", e1); - alarmLogger.sendAlarm ("MsoInternalError", MsoAlarmLogger.CRITICAL, error); + } LOGGER.info (MessageEnum.RA_ASYNC_ROLLBACK_VNF_COMPLETE, "","", "rollbackVnfA"); return; @@ -505,7 +505,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync { } catch (Exception e) { error = "Error sending rollbackVnf notification " + e.getMessage (); LOGGER.error (MessageEnum.RA_SEND_VNF_NOTIF_ERR, "", "rollbackVnfA", MsoLogger.ErrorCode.BusinessProcesssError, "Exception sending rollbackVnfA notification", e); - alarmLogger.sendAlarm ("MsoInternalError", MsoAlarmLogger.CRITICAL, error); + } LOGGER.info (MessageEnum.RA_ASYNC_ROLLBACK_VNF_COMPLETE, "", "","rollbackVnfA"); @@ -647,7 +647,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync { headers.put ("Authorization", Collections.singletonList (basicAuth)); } catch (Exception e) { LOGGER.error (MessageEnum.RA_SET_CALLBACK_AUTH_EXC, "", "getNotifyEP", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - Unable to set authorization in callback request", e); - alarmLogger.sendAlarm ("MsoInternalError", MsoAlarmLogger.CRITICAL, "Unable to set authorization in callback request"); + } return notifyPort; diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java index 19a41ad7a8..092cefe5f5 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java @@ -52,7 +52,7 @@ import org.onap.so.db.catalog.data.repository.VnfResourceRepository; import org.onap.so.db.catalog.utils.MavenLikeVersioning; import org.onap.so.entity.MsoRequest; import org.onap.so.logger.MessageEnum; -import org.onap.so.logger.MsoAlarmLogger; + import org.onap.so.logger.MsoLogger; import org.onap.so.openstack.beans.HeatStatus; import org.onap.so.openstack.beans.StackInfo; @@ -96,7 +96,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { private static final String MSO_CONFIGURATION_ERROR = "MsoConfigurationError"; private static final String VNF_ADAPTER_SERVICE_NAME = "MSO-BPMN:MSO-VnfAdapter."; private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA,MsoVnfAdapterImpl.class); - private static final MsoAlarmLogger alarmLogger = new MsoAlarmLogger (); + private static final String CHECK_REQD_PARAMS = "org.onap.so.adapters.vnf.checkRequiredParameters"; private static final String ADD_GET_FILES_ON_VOLUME_REQ = "org.onap.so.adapters.vnf.addGetFilesOnVolumeReq"; private static final ObjectMapper JSON_MAPPER = new ObjectMapper(); @@ -932,9 +932,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { if (heatTemplate == null) { String error = "UpdateVF: No Heat Template ID defined in catalog database for " + vfModuleType + ", reqType=" + requestTypeString; LOGGER.error(MessageEnum.RA_VNF_UNKNOWN_PARAM, "Heat Template ID", vfModuleType, "OpenStack", "", MsoLogger.ErrorCode.DataError, error); - LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error); - alarmLogger.sendAlarm(MSO_CONFIGURATION_ERROR, - MsoAlarmLogger.CRITICAL, error); + LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error); throw new VnfException(error, MsoExceptionCategory.INTERNAL); } else { LOGGER.debug ("Got HEAT Template from DB: " + heatTemplate.getHeatTemplate()); @@ -948,9 +946,6 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { String error = "Update VNF: undefined Heat Environment. VF=" + vfModuleType; LOGGER.error (MessageEnum.RA_VNF_UNKNOWN_PARAM, "Heat Environment ID", "OpenStack", "", MsoLogger.ErrorCode.DataError, error); LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error); - // Alarm on this error, configuration must be fixed - alarmLogger.sendAlarm (MSO_CONFIGURATION_ERROR, MsoAlarmLogger.CRITICAL, error); - throw new VnfException (error, MsoExceptionCategory.INTERNAL); } else { LOGGER.debug ("Got Heat Environment from DB: " + heatEnvironment.getEnvironment()); @@ -1661,8 +1656,6 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { String error = "UpdateVF: No Heat Template ID defined in catalog database for " + vfModuleType + ", reqType=" + requestTypeString; LOGGER.error(MessageEnum.RA_VNF_UNKNOWN_PARAM, "Heat Template ID", vfModuleType, "OpenStack", "", MsoLogger.ErrorCode.DataError, error); LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error); - alarmLogger.sendAlarm(MSO_CONFIGURATION_ERROR, - MsoAlarmLogger.CRITICAL, error); throw new VnfException(error, MsoExceptionCategory.INTERNAL); } else { LOGGER.debug ("Got HEAT Template from DB: " + heatTemplate.getHeatTemplate()); @@ -1672,9 +1665,6 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { String error = "Update VNF: undefined Heat Environment. VF=" + vfModuleType; LOGGER.error (MessageEnum.RA_VNF_UNKNOWN_PARAM, "Heat Environment ID", "OpenStack", "", MsoLogger.ErrorCode.DataError, error); LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error); - // Alarm on this error, configuration must be fixed - alarmLogger.sendAlarm (MSO_CONFIGURATION_ERROR, MsoAlarmLogger.CRITICAL, error); - throw new VnfException (error, MsoExceptionCategory.INTERNAL); } else { LOGGER.debug ("Got Heat Environment from DB: " + heatEnvironment.getEnvironment()); diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImpl.java index 41da3c2988..00e72373dd 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImpl.java @@ -52,7 +52,7 @@ import org.onap.so.db.catalog.data.repository.VFModuleCustomizationRepository; import org.onap.so.db.catalog.utils.MavenLikeVersioning; import org.onap.so.entity.MsoRequest; import org.onap.so.logger.MessageEnum; -import org.onap.so.logger.MsoAlarmLogger; + import org.onap.so.logger.MsoLogger; import org.onap.so.openstack.beans.MsoTenant; import org.onap.so.openstack.beans.VnfRollback; @@ -81,7 +81,7 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter { private static final String VNF_ADAPTER_SERVICE_NAME = "MSO-BPMN:MSO-VnfAdapter."; private static final String LOG_REPLY_NAME = "MSO-VnfAdapter:MSO-BPMN."; private static MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, MsoVnfCloudifyAdapterImpl.class); - private static MsoAlarmLogger alarmLogger = new MsoAlarmLogger (); + private static final String CHECK_REQD_PARAMS = "org.onap.so.adapters.vnf.checkRequiredParameters"; private static final String ADD_GET_FILES_ON_VOLUME_REQ = "org.onap.so.adapters.vnf.addGetFilesOnVolumeReq"; private static final String CLOUDIFY_RESPONSE_SUCCESS="Successfully received response from Cloudify"; @@ -873,9 +873,7 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter { if (heatTemplate == null) { String error = "UpdateVF: No Heat Template ID defined in catalog database for " + vfModuleType + ", reqType=" + requestType; LOGGER.error(MessageEnum.RA_VNF_UNKNOWN_PARAM, "Heat Template ID", vfModuleType, "OpenStack", "", MsoLogger.ErrorCode.DataError, error); - LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error); - alarmLogger.sendAlarm(MSO_CONFIGURATION_ERROR, - MsoAlarmLogger.CRITICAL, error); + LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error); throw new VnfException(error, MsoExceptionCategory.INTERNAL); } else { LOGGER.debug ("Got HEAT Template from DB: " + heatTemplate.getHeatTemplate()); @@ -886,7 +884,7 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter { LOGGER.error (MessageEnum.RA_VNF_UNKNOWN_PARAM, "Heat Environment ID", "OpenStack", "", MsoLogger.ErrorCode.DataError, error); LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error); // Alarm on this error, configuration must be fixed - alarmLogger.sendAlarm (MSO_CONFIGURATION_ERROR, MsoAlarmLogger.CRITICAL, error); + throw new VnfException (error, MsoExceptionCategory.INTERNAL); } else { diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java index 269acb9d6f..e0d7581dcf 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java @@ -71,7 +71,7 @@ import org.onap.so.db.catalog.data.repository.VFModuleCustomizationRepository; import org.onap.so.db.catalog.utils.MavenLikeVersioning; import org.onap.so.entity.MsoRequest; import org.onap.so.logger.MessageEnum; -import org.onap.so.logger.MsoAlarmLogger; + import org.onap.so.logger.MsoLogger; import org.onap.so.openstack.beans.VnfRollback; import org.onap.so.openstack.beans.VnfStatus; @@ -98,7 +98,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter { private static final String MSO_CONFIGURATION_ERROR = "MsoConfigurationError"; private static MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, MsoVnfPluginAdapterImpl.class); - private static MsoAlarmLogger alarmLogger = new MsoAlarmLogger (); + private static final String CHECK_REQD_PARAMS = "org.onap.so.adapters.vnf.checkRequiredParameters"; private static final ObjectMapper JSON_MAPPER = new ObjectMapper(); @@ -919,9 +919,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter { if (heatTemplate == null) { String error = "UpdateVF: No Heat Template ID defined in catalog database for " + vfModuleType + ", reqType=" + requestType; LOGGER.error(MessageEnum.RA_VNF_UNKNOWN_PARAM, "Heat Template ID", vfModuleType, "VNF", "", MsoLogger.ErrorCode.DataError, error); - LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error); - alarmLogger.sendAlarm(MSO_CONFIGURATION_ERROR, - MsoAlarmLogger.CRITICAL, error); + LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error); throw new VnfException(error, MsoExceptionCategory.INTERNAL); } else { LOGGER.debug ("Got HEAT Template from DB: " + heatTemplate.getHeatTemplate()); @@ -931,9 +929,6 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter { String error = "Update VNF: undefined Heat Environment. VF=" + vfModuleType; LOGGER.error (MessageEnum.RA_VNF_UNKNOWN_PARAM, "Heat Environment ID", "OpenStack", "", MsoLogger.ErrorCode.DataError, error); LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error); - // Alarm on this error, configuration must be fixed - alarmLogger.sendAlarm (MSO_CONFIGURATION_ERROR, MsoAlarmLogger.CRITICAL, error); - throw new VnfException (error, MsoExceptionCategory.INTERNAL); } else { LOGGER.debug ("Got Heat Environment from DB: " + heatEnvironment.getEnvironment()); |