X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=E2Manager%2Fhandlers%2Frmrmsghandlers%2Fe2_setup_request_notification_handler.go;h=04b33d7bbdc1d40e436e8a71450e0e91cbd11632;hb=a269db89a144d3f041eb265c9aa2e7633142429f;hp=d229e8c9383322d8f92e4a2e80a8778e04d2573e;hpb=db0380732b248c2343c95cdd56b33a50b3383d66;p=ric-plt%2Fe2mgr.git diff --git a/E2Manager/handlers/rmrmsghandlers/e2_setup_request_notification_handler.go b/E2Manager/handlers/rmrmsghandlers/e2_setup_request_notification_handler.go index d229e8c..04b33d7 100644 --- a/E2Manager/handlers/rmrmsghandlers/e2_setup_request_notification_handler.go +++ b/E2Manager/handlers/rmrmsghandlers/e2_setup_request_notification_handler.go @@ -51,9 +51,10 @@ type E2SetupRequestNotificationHandler struct { rNibDataService services.RNibDataService e2tAssociationManager *managers.E2TAssociationManager ranConnectStatusChangeManager managers.IRanConnectStatusChangeManager + ranListManager managers.RanListManager } -func NewE2SetupRequestNotificationHandler(logger *logger.Logger, config *configuration.Configuration, e2tInstancesManager managers.IE2TInstancesManager, rmrSender *rmrsender.RmrSender, rNibDataService services.RNibDataService, e2tAssociationManager *managers.E2TAssociationManager, ranConnectStatusChangeManager managers.IRanConnectStatusChangeManager) *E2SetupRequestNotificationHandler { +func NewE2SetupRequestNotificationHandler(logger *logger.Logger, config *configuration.Configuration, e2tInstancesManager managers.IE2TInstancesManager, rmrSender *rmrsender.RmrSender, rNibDataService services.RNibDataService, e2tAssociationManager *managers.E2TAssociationManager, ranConnectStatusChangeManager managers.IRanConnectStatusChangeManager, ranListManager managers.RanListManager) *E2SetupRequestNotificationHandler { return &E2SetupRequestNotificationHandler{ logger: logger, config: config, @@ -62,6 +63,7 @@ func NewE2SetupRequestNotificationHandler(logger *logger.Logger, config *configu rNibDataService: rNibDataService, e2tAssociationManager: e2tAssociationManager, ranConnectStatusChangeManager: ranConnectStatusChangeManager, + ranListManager: ranListManager, } } @@ -137,22 +139,17 @@ func (h *E2SetupRequestNotificationHandler) Handle(request *models.NotificationR func (h *E2SetupRequestNotificationHandler) handleNewRan(ranName string, e2tIpAddress string, setupRequest *models.E2SetupRequestMessage) (*entities.NodebInfo, error) { - nodebInfo, err := h.buildNodebInfo(ranName, e2tIpAddress, setupRequest) + nodebInfo := h.buildNodebInfo(ranName, e2tIpAddress, setupRequest) + err := h.rNibDataService.SaveNodeb(nodebInfo) if err != nil { - h.logger.Errorf("#E2SetupRequestNotificationHandler.handleNewRan - RAN name: %s - failed to build nodebInfo entity. Error: %s", ranName, err) + h.logger.Errorf("#E2SetupRequestNotificationHandler.handleNewRan - RAN name: %s - failed saving nodebInfo. Error: %s", ranName, err) return nil, err } nbIdentity := h.buildNbIdentity(ranName, setupRequest) - err = h.rNibDataService.SaveNodeb(nbIdentity, nodebInfo) - if err != nil { - h.logger.Errorf("#E2SetupRequestNotificationHandler.handleNewRan - RAN name: %s - failed to save nodebInfo entity. Error: %s", ranName, err) - return nil, err - } - - err = h.ranConnectStatusChangeManager.ChangeStatus(nodebInfo, entities.ConnectionStatus_CONNECTED) + err = h.ranListManager.AddNbIdentity(entities.Node_GNB, nbIdentity) if err != nil { return nil, err @@ -292,9 +289,7 @@ func normalizeXml(payload []byte) []byte { return []byte(normalized) } -func (h *E2SetupRequestNotificationHandler) buildNodebInfo(ranName string, e2tAddress string, request *models.E2SetupRequestMessage) (*entities.NodebInfo, error) { - - var err error +func (h *E2SetupRequestNotificationHandler) buildNodebInfo(ranName string, e2tAddress string, request *models.E2SetupRequestMessage) *entities.NodebInfo { nodebInfo := &entities.NodebInfo{ AssociatedE2TInstanceAddress: e2tAddress, RanName: ranName, @@ -304,7 +299,7 @@ func (h *E2SetupRequestNotificationHandler) buildNodebInfo(ranName string, e2tAd } h.setGnbFunctions(nodebInfo, request) - return nodebInfo, err + return nodebInfo } func (h *E2SetupRequestNotificationHandler) buildGlobalNbId(setupRequest *models.E2SetupRequestMessage) *entities.GlobalNbId {