+func (w *rNibDataService) GetE2TInstance(address string) (*entities.E2TInstance, error) {
+ var e2tInstance *entities.E2TInstance = nil
+
+ err := w.retry("GetE2TInstance", func() (err error) {
+ e2tInstance, err = w.rnibReader.GetE2TInstance(address)
+ return
+ })
+
+ if err == nil {
+ w.logger.Infof("#RnibDataService.GetE2TInstance - E2T instance address: %s, state: %s, associated RANs count: %d, keep Alive ts: %d", e2tInstance.Address, e2tInstance.State, len(e2tInstance.AssociatedRanList), e2tInstance.KeepAliveTimestamp)
+ }
+
+ return e2tInstance, err
+}
+
+func (w *rNibDataService) GetE2TInstanceNoLogs(address string) (*entities.E2TInstance, error) {
+ var e2tInstance *entities.E2TInstance = nil
+
+ err := w.retry("GetE2TInstance", func() (err error) {
+ e2tInstance, err = w.rnibReader.GetE2TInstance(address)
+ return
+ })
+
+ return e2tInstance, err
+}
+
+func (w *rNibDataService) GetE2TInstances(addresses []string) ([]*entities.E2TInstance, error) {
+ w.logger.Infof("#RnibDataService.GetE2TInstances - addresses: %s", addresses)
+ var e2tInstances []*entities.E2TInstance = nil
+
+ err := w.retry("GetE2TInstance", func() (err error) {
+ e2tInstances, err = w.rnibReader.GetE2TInstances(addresses)
+ return
+ })
+
+ return e2tInstances, err
+}
+
+func (w *rNibDataService) GetE2TInstancesNoLogs(addresses []string) ([]*entities.E2TInstance, error) {
+
+ var e2tInstances []*entities.E2TInstance = nil
+
+ err := w.retry("GetE2TInstance", func() (err error) {
+ e2tInstances, err = w.rnibReader.GetE2TInstances(addresses)
+ return
+ })
+
+ return e2tInstances, err
+}
+
+func (w *rNibDataService) GetE2TAddresses() ([]string, error) {
+
+ var e2tAddresses []string = nil
+
+ err := w.retry("GetE2TAddresses", func() (err error) {
+ e2tAddresses, err = w.rnibReader.GetE2TAddresses()
+ return
+ })
+
+ if err == nil {
+ w.logger.Infof("#RnibDataService.GetE2TAddresses - addresses: %s", e2tAddresses)
+ }
+
+ return e2tAddresses, err
+}
+
+func (w *rNibDataService) GetE2TAddressesNoLogs() ([]string, error) {
+
+ var e2tAddresses []string = nil
+
+ err := w.retry("GetE2TAddresses", func() (err error) {
+ e2tAddresses, err = w.rnibReader.GetE2TAddresses()
+ return
+ })
+
+ return e2tAddresses, err
+}
+
+func (w *rNibDataService) SaveE2TInstance(e2tInstance *entities.E2TInstance) error {
+ w.logger.Infof("#RnibDataService.SaveE2TInstance - E2T instance address: %s, podName: %s, state: %s, associated RANs count: %d, keep Alive ts: %d", e2tInstance.Address, e2tInstance.PodName, e2tInstance.State, len(e2tInstance.AssociatedRanList), e2tInstance.KeepAliveTimestamp)
+
+ return w.SaveE2TInstanceNoLogs(e2tInstance)
+}
+
+func (w *rNibDataService) SaveE2TInstanceNoLogs(e2tInstance *entities.E2TInstance) error {
+
+ err := w.retry("SaveE2TInstance", func() (err error) {
+ err = w.rnibWriter.SaveE2TInstance(e2tInstance)
+ return
+ })
+
+ return err
+}
+
+func (w *rNibDataService) SaveE2TAddresses(addresses []string) error {
+ w.logger.Infof("#RnibDataService.SaveE2TAddresses - addresses: %s", addresses)
+
+ err := w.retry("SaveE2TAddresses", func() (err error) {
+ err = w.rnibWriter.SaveE2TAddresses(addresses)
+ return
+ })
+
+ return err
+}
+
+func (w *rNibDataService) RemoveE2TInstance(e2tAddress string) error {
+ w.logger.Infof("#RnibDataService.RemoveE2TInstance - e2tAddress: %s", e2tAddress)
+
+ err := w.retry("RemoveE2TInstance", func() (err error) {
+ err = w.rnibWriter.RemoveE2TInstance(e2tAddress)
+ return
+ })
+
+ return err
+}
+
+func (w *rNibDataService) GetGeneralConfiguration() (*entities.GeneralConfiguration, error) {
+ var generalConfiguration *entities.GeneralConfiguration = nil
+
+ err := w.retry("GetGeneralConfiguration", func() (err error) {
+ generalConfiguration, err = w.rnibReader.GetGeneralConfiguration()
+ return
+ })
+
+ return generalConfiguration, err
+}
+
+func (w *rNibDataService) SaveGeneralConfiguration(config *entities.GeneralConfiguration) error {
+ err := w.retry("SaveGeneralConfiguration", func() (err error) {
+ err = w.rnibWriter.SaveGeneralConfiguration(config)
+ return
+ })
+
+ return err
+}
+
+func (w *rNibDataService) RemoveServedCells(inventoryName string, servedCells []*entities.ServedCellInfo) error {
+ err := w.retry("RemoveServedCells", func() (err error) {
+ err = w.rnibWriter.RemoveServedCells(inventoryName, servedCells)
+ return
+ })
+
+ return err
+}
+
+func (w *rNibDataService) UpdateEnb(nodebInfo *entities.NodebInfo, servedCells []*entities.ServedCellInfo) error {
+ err := w.retry("UpdateEnb", func() (err error) {
+ err = w.rnibWriter.UpdateEnb(nodebInfo, servedCells)
+ return
+ })
+
+ return err
+}
+
+func (w *rNibDataService) PingRnib() bool {
+ err := w.retry("GetListNodebIds", func() (err error) {
+ _, err = w.rnibReader.GetListNodebIds()
+ return
+ })
+
+ return !isRnibConnectionError(err)
+}
+
+func (w *rNibDataService) UpdateNodebInfoOnConnectionStatusInversion(nodebInfo *entities.NodebInfo, event string) error {
+ w.logger.Infof("#RnibDataService.UpdateNodebInfoOnConnectionStatusInversion - event: %s, nodebInfo: %s", event, nodebInfo)
+
+ err := w.retry("UpdateNodebInfoOnConnectionStatusInversion", func() (err error) {
+ err = w.rnibWriter.UpdateNodebInfoOnConnectionStatusInversion(nodebInfo, event)
+ return
+ })
+
+ return err
+}
+
+func (w *rNibDataService) AddEnb(nodebInfo *entities.NodebInfo) error {
+ w.logger.Infof("#RnibDataService.AddEnb - nodebInfo: %s", nodebInfo)
+
+ err := w.retry("AddEnb", func() (err error) {
+ err = w.rnibWriter.AddEnb(nodebInfo)
+ return
+ })
+
+ return err
+}
+