Send notification for Under reset status
[ric-plt/e2mgr.git] / E2Manager / managers / ran_connect_status_change_manager.go
index 138f089..d3d596b 100644 (file)
@@ -22,6 +22,8 @@ package managers
 import (
        "e2mgr/logger"
        "e2mgr/services"
+       "time"
+
        "gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities"
 )
 
@@ -61,7 +63,9 @@ func (m *RanConnectStatusChangeManager) ChangeStatus(nodebInfo *entities.NodebIn
        isConnectivityEvent := event != NONE_RAW_EVENT
 
        // only after determining event we set next status
-       nodebInfo.ConnectionStatus = nextStatus;
+       nodebInfo.ConnectionStatus = nextStatus
+       // filling the timeStamp for the last Connection Status update
+       nodebInfo.StatusUpdateTimeStamp = uint64(time.Now().UnixNano())
        if !isConnectivityEvent {
                err := m.updateNodebInfo(nodebInfo)
                if err != nil {
@@ -76,8 +80,9 @@ func (m *RanConnectStatusChangeManager) ChangeStatus(nodebInfo *entities.NodebIn
        }
 
        // in any case, update RanListManager
-       m.logger.Infof("#RanConnectStatusChangeManager.ChangeStatus - RAN name: %s, updating RanListManager... status: %s", nodebInfo.RanName, nodebInfo.GetConnectionStatus())
-       err := m.ranListManager.UpdateRanState(nodebInfo)
+       connectionStatus := nodebInfo.GetConnectionStatus()
+       m.logger.Infof("#RanConnectStatusChangeManager.ChangeStatus - RAN name: %s, updating RanListManager... status: %s", nodebInfo.RanName, connectionStatus)
+       err := m.ranListManager.UpdateNbIdentityConnectionStatus(nodebInfo.GetNodeType(), nodebInfo.RanName, connectionStatus)
        if err != nil {
                m.logger.Errorf("#RanConnectStatusChangeManager.ChangeStatus - RAN name: %s - Failed updating RAN's connection status by RanListManager. Error: %v", nodebInfo.RanName, err)
                // log and proceed...