X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=E2Manager%2Fservices%2Frnib_data_service.go;h=2ab34d2f1b17add8987dff40f1368346825a256a;hb=refs%2Fchanges%2F37%2F4337%2F1;hp=e96ba488315866bbf7a439ca0b3e25777d41d8af;hpb=197657e0e814c871b903ef779ad654b13347e430;p=ric-plt%2Fe2mgr.git diff --git a/E2Manager/services/rnib_data_service.go b/E2Manager/services/rnib_data_service.go index e96ba48..2ab34d2 100644 --- a/E2Manager/services/rnib_data_service.go +++ b/E2Manager/services/rnib_data_service.go @@ -52,25 +52,24 @@ type RNibDataService interface { GetGeneralConfiguration() (*entities.GeneralConfiguration, error) UpdateNodebInfoOnConnectionStatusInversion(nodebInfo *entities.NodebInfo, event string) error SaveGeneralConfiguration(config *entities.GeneralConfiguration) error + RemoveEnb(nodebInfo *entities.NodebInfo) error } type rNibDataService struct { - logger *logger.Logger - rnibReader reader.RNibReader - rnibWriter rNibWriter.RNibWriter - maxAttempts int - retryInterval time.Duration - stateChangeMessageChannel string + logger *logger.Logger + rnibReader reader.RNibReader + rnibWriter rNibWriter.RNibWriter + maxAttempts int + retryInterval time.Duration } func NewRnibDataService(logger *logger.Logger, config *configuration.Configuration, rnibReader reader.RNibReader, rnibWriter rNibWriter.RNibWriter) *rNibDataService { return &rNibDataService{ - logger: logger, - rnibReader: rnibReader, - rnibWriter: rnibWriter, - maxAttempts: config.MaxRnibConnectionAttempts, - retryInterval: time.Duration(config.RnibRetryIntervalMs) * time.Millisecond, - stateChangeMessageChannel: config.StateChangeMessageChannel, + logger: logger, + rnibReader: rnibReader, + rnibWriter: rnibWriter, + maxAttempts: config.MaxRnibConnectionAttempts, + retryInterval: time.Duration(config.RnibRetryIntervalMs) * time.Millisecond, } } @@ -83,6 +82,15 @@ func (w *rNibDataService) RemoveServedNrCells(inventoryName string, servedNrCell return err } +func (w *rNibDataService) RemoveEnb(nodebInfo *entities.NodebInfo) error { + err := w.retry("RemoveEnb", func() (err error) { + err = w.rnibWriter.RemoveEnb(nodebInfo) + return + }) + + return err +} + func (w *rNibDataService) UpdateGnbCells(nodebInfo *entities.NodebInfo, servedNrCells []*entities.ServedNRCell) error { w.logger.Infof("#RnibDataService.UpdateGnbCells - nodebInfo: %s, servedNrCells: %s", nodebInfo, servedNrCells) @@ -304,10 +312,10 @@ func (w *rNibDataService) PingRnib() bool { } func (w *rNibDataService) UpdateNodebInfoOnConnectionStatusInversion(nodebInfo *entities.NodebInfo, event string) error { - w.logger.Infof("#RnibDataService.UpdateNodebInfoOnConnectionStatusInversion - nodebInfo: %s", nodebInfo) + w.logger.Infof("#RnibDataService.UpdateNodebInfoOnConnectionStatusInversion - event: %s, nodebInfo: %s", event, nodebInfo) err := w.retry("UpdateNodebInfoOnConnectionStatusInversion", func() (err error) { - err = w.rnibWriter.UpdateNodebInfoOnConnectionStatusInversion(nodebInfo, w.stateChangeMessageChannel, event) + err = w.rnibWriter.UpdateNodebInfoOnConnectionStatusInversion(nodebInfo, event) return })