return writerMock
}
- rnibErr := &common.RNibError{}
+ rnibErr := &common.ResourceNotFoundError{}
var nbIdentityList []*entities.NbIdentity
readerMock.On("GetListNodebIds").Return(nbIdentityList, rnibErr)
}
config := configuration.ParseConfiguration()
- var rnibError common.IRNibError
+ var rnibError error
nbIdentityList := []*entities.NbIdentity{}
readerMock.On("GetListNodebIds").Return(nbIdentityList, rnibError)
float64(time.Since(startTime))/float64(time.Millisecond))
}
-func rnibErrorToHttpError(rnibError common.IRNibError) (int, int, string) {
- switch rnibError.GetCode() {
- case common.RESOURCE_NOT_FOUND:
+func rnibErrorToHttpError(rnibError error) (int, int, string) {
+ switch rnibError.(type) {
+ case *common.ResourceNotFoundError:
return http.StatusNotFound, notFoundErrorCode, notFoundErrorMessage
- case common.INTERNAL_ERROR:
+ case *common.InternalError:
return http.StatusInternalServerError, internalErrorCode, internalErrorMessage
- case common.VALIDATION_ERROR:
+ case *common.ValidationError:
return http.StatusBadRequest, validationErrorCode, validationFailedMessage
default:
return http.StatusInternalServerError, internalErrorCode, internalErrorMessage
rnibReaderMock := mocks.RnibReaderMock{}
- var rnibError common.IRNibError
+ var rnibError error
rnibReaderMock.On("GetNodeb", "testNode").Return(&entities.NodebInfo{}, rnibError)
rnibReaderProvider := func() reader.RNibReader {
writer := httptest.NewRecorder()
rnibReaderMock := mocks.RnibReaderMock{}
- rnibError := common.NewResourceNotFoundError(errors.Errorf("#reader.GetNodeb - responding node %s not found", "testNode"))
+ rnibError := common.NewResourceNotFoundErrorf("#reader.GetNodeb - responding node %s not found", "testNode")
var nodebInfo *entities.NodebInfo
rnibReaderMock.On("GetNodeb", "testNode").Return(nodebInfo, rnibError)
writer := httptest.NewRecorder()
rnibReaderMock := mocks.RnibReaderMock{}
- var rnibError common.IRNibError
+ var rnibError error
nbList := []*entities.NbIdentity{
{InventoryName:"test1", GlobalNbId: &entities.GlobalNbId{PlmnId:"plmnId1",NbId: "nbId1"}},
rnibReaderMock := mocks.RnibReaderMock{}
- var rnibError common.IRNibError
+ var rnibError error
nbList := []*entities.NbIdentity{}
rnibReaderMock.On("GetListNodebIds").Return(nbList, rnibError)
module e2mgr
require (
- gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.0.19
- gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.19
- gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader v1.0.19
- gerrit.o-ran-sc.org/r/ric-plt/sdlgo v0.2.0
+ gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.0.21
+ gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.21
+ gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader v1.0.21
+ gerrit.o-ran-sc.org/r/ric-plt/sdlgo v0.3.0
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
github.com/go-ozzo/ozzo-validation v3.5.0+incompatible
github.com/golang/protobuf v1.3.1
gopkg.in/yaml.v2 v2.2.2
)
-replace gerrit.o-ran-sc.org/r/ric-plt/sdlgo => gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.2.0
+replace gerrit.o-ran-sc.org/r/ric-plt/sdlgo => gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.3.0
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.0.19 h1:b6ggNQ4PdWxCkQupfus80nsCs0YD84u+cGc+nQ2W560=
gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.0.19/go.mod h1:QJ1uPPZosGbhxUWpUpeM5fLqFHdnWTrVnvW2DgyOCes=
+gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.0.21 h1:eK9nUZOTMJ/EnMpH9bkWtMgOvCn3u4+PNCb9gu10s6w=
+gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.0.21/go.mod h1:QJ1uPPZosGbhxUWpUpeM5fLqFHdnWTrVnvW2DgyOCes=
gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.19 h1:5VGHtsiGnR/VfcsqhbKVScUTLBgoePp1KhSVylwlFKM=
gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.19/go.mod h1:GXiXLz4ORBeIr0FLIbzENRykgh3Po5uPkX2jICxnRF0=
+gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.21 h1:PQ/Mu2ol+8Oh/0BqCWWhPlVVoRCg5dQDEGm4+Opp5w4=
+gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.21/go.mod h1:GXiXLz4ORBeIr0FLIbzENRykgh3Po5uPkX2jICxnRF0=
gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader v1.0.19 h1:WwUWG3mp2uU9ouqAzj4d6dUGZUA+2HmutQBiH4s4UIw=
gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader v1.0.19/go.mod h1:7fQ7/R9hBsCi5g6444ySaavYLB+/aCsCyDEiqWK+L34=
+gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader v1.0.21 h1:N3UbqJ9WqC8JEz/TwHHwZwCFAW6VTlZLpD5lnbdD+Y8=
+gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader v1.0.21/go.mod h1:SQBZLy1HP94i1vQ3y730wGFsrHqZtgPaEkzPgtqBNw0=
gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.2.0 h1:7edCLIQtk9xCwxTtLRUlXr8wQ6nmr/Mo4ZoqjF3m0NE=
gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.2.0/go.mod h1:2Y8gw2jqj9urI8VFqFQn7BX0J3A852+YrXVV9V8gOt4=
+gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.3.0 h1:Gg3PH9XVAuSjyAr8Z8Ebmcmt6PTKeU/+FG6J7qQl+ew=
+gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.3.0/go.mod h1:y2WhrCvdLkAKdH+ySdHSOSehACJkTMyZghCGVcqoZzc=
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/go-ozzo/ozzo-validation v3.5.0+incompatible/go.mod h1:gsEKFIVnabGBt6mXmxK0MoFy+cZoTJY6mu5Ll3LVLBU=
github.com/go-redis/redis v6.15.2+incompatible h1:9SpNVG76gr6InJGxoZ6IuuxaCOQwDAhzyXg+Bs+0Sb4=
github.com/go-redis/redis v6.15.2+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
+github.com/go-redis/redis v6.15.3+incompatible h1:NZ0O90AhLSvSrvLZ/S9h7D4kl1mW2PrKyxL7MyBKO2g=
+github.com/go-redis/redis v6.15.3+incompatible/go.mod h1:W2YCLaZryXHirdd9QqwkiVUxCQsrx8SbLq9Uqk7JS7A=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
handler := NewDeleteAllRequestHandler(getRmrService(rmrMessengerMock, log), config, writerProvider, readerProvider)
- rnibErr := &common.RNibError{}
+ rnibErr := &common.ResourceNotFoundError{}
var nbIdentityList []*entities.NbIdentity
readerMock.On("GetListNodebIds").Return(nbIdentityList, rnibErr)
handler := NewDeleteAllRequestHandler(getRmrService(rmrMessengerMock, log), config, writerProvider, readerProvider)
- rnibErr := &common.RNibError{}
+ rnibErr := &common.ResourceNotFoundError{}
//Before timer: Disconnected->ShutDown, ShuttingDown->Ignore, Connected->ShuttingDown
nbIdentityList := createIdentityList()
nbIdentityList := createIdentityList()
readerMock.On("GetListNodebIds").Return(nbIdentityList, nil)
- errRnib := &common.RNibError{}
+ errRnib := &common.ResourceNotFoundError{}
nb1 := &entities.NodebInfo{RanName: "RanName_1", ConnectionStatus: entities.ConnectionStatus_DISCONNECTED,}
nb2 := &entities.NodebInfo{RanName: "RanName_2", ConnectionStatus:entities.ConnectionStatus_SHUTTING_DOWN,}
nb3 := &entities.NodebInfo{RanName: "RanName_3", ConnectionStatus:entities.ConnectionStatus_CONNECTED,}
readerMock.On("GetNodeb", "RanName_2").Return(nb2, nil)
readerMock.On("GetNodeb", "RanName_3").Return(nb3, nil)
- errRnib := &common.RNibError{}
+ errRnib := &common.ResourceNotFoundError{}
updatedNb1 := &entities.NodebInfo{RanName:"RanName_1", ConnectionStatus:entities.ConnectionStatus_SHUT_DOWN,}
updatedNb3 := &entities.NodebInfo{RanName:"RanName_3", ConnectionStatus:entities.ConnectionStatus_SHUTTING_DOWN,}
writerMock.On("SaveNodeb", mock.Anything, updatedNb1).Return(nil)
handler := NewDeleteAllRequestHandler(getRmrService(rmrMessengerMock, log), config, writerProvider, readerProvider)
- var rnibError common.IRNibError
+ var rnibError error
nbIdentityList := []*entities.NbIdentity{}
readerMock.On("GetListNodebIds").Return(nbIdentityList, rnibError)
if err := handler.ranReconnectionManager.ReconnectRan(nbIdentity.InventoryName); err != nil {
logger.Errorf("#E2TermInitNotificationHandler.Handle - Ran name: %s - connection attempt failure, error: %s", (*nbIdentity).GetInventoryName(), err.Error())
- rNibError, ok := err.(common.IRNibError)
- if !ok || rNibError.GetCode() != common.RESOURCE_NOT_FOUND {
+ _, ok := err.(*common.ResourceNotFoundError)
+ if !ok {
break
}
}
func TestE2TerminInitHandlerSuccessOneRan(t *testing.T) {
log, readerMock, writerMock, rmrMessengerMock, ranReconnectMgr := initRanLostConnectionTest(t)
- var rnibErr common.IRNibError
+ var rnibErr error
readerProvider := func() reader.RNibReader {
return readerMock
func TestE2TerminInitHandlerSuccessTwoRans(t *testing.T) {
log, readerMock, writerMock, rmrMessengerMock, ranReconnectMgr := initRanLostConnectionTest(t)
- var rnibErr common.IRNibError
+ var rnibErr error
readerProvider := func() reader.RNibReader {
return readerMock
func TestE2TerminInitHandlerSuccessThreeRansFirstRmrFailure(t *testing.T) {
log, readerMock, writerMock, rmrMessengerMock, ranReconnectMgr := initRanLostConnectionTest(t)
- var rnibErr common.IRNibError
+ var rnibErr error
readerProvider := func() reader.RNibReader {
return readerMock
func TestE2TerminInitHandlerSuccessThreeRansSecondNotFoundFailure(t *testing.T) {
log, readerMock, writerMock, rmrMessengerMock, ranReconnectMgr := initRanLostConnectionTest(t)
- var rnibErr common.IRNibError
+ var rnibErr error
readerProvider := func() reader.RNibReader {
return readerMock
var initialNodeb1 = &entities.NodebInfo{RanName: ids[1].InventoryName, ConnectionStatus: entities.ConnectionStatus_CONNECTED, E2ApplicationProtocol: entities.E2ApplicationProtocol_X2_SETUP_REQUEST}
var initialNodeb2 = &entities.NodebInfo{RanName: ids[2].InventoryName, ConnectionStatus: entities.ConnectionStatus_CONNECTED, E2ApplicationProtocol: entities.E2ApplicationProtocol_X2_SETUP_REQUEST}
readerMock.On("GetNodeb", ids[0].InventoryName).Return(initialNodeb0, rnibErr)
- readerMock.On("GetNodeb", ids[1].InventoryName).Return(initialNodeb1, common.NewResourceNotFoundError(fmt.Errorf("not found")))
+ readerMock.On("GetNodeb", ids[1].InventoryName).Return(initialNodeb1, common.NewResourceNotFoundError("not found"))
readerMock.On("GetNodeb", ids[2].InventoryName).Return(initialNodeb2, rnibErr)
var argNodeb0 = &entities.NodebInfo{RanName: ids[0].InventoryName,ConnectionStatus: entities.ConnectionStatus_CONNECTING, E2ApplicationProtocol: entities.E2ApplicationProtocol_X2_SETUP_REQUEST, ConnectionAttempts: 1}
func TestE2TerminInitHandlerSuccessThreeRansSecondRnibInternalErrorFailure(t *testing.T) {
log, readerMock, writerMock, rmrMessengerMock, ranReconnectMgr := initRanLostConnectionTest(t)
- var rnibErr common.IRNibError
+ var rnibErr error
readerProvider := func() reader.RNibReader {
return readerMock
func TestE2TerminInitHandlerSuccessZeroRans(t *testing.T) {
log, readerMock, writerMock, rmrMessengerMock, ranReconnectMgr := initRanLostConnectionTest(t)
- var rnibErr common.IRNibError
+ var rnibErr error
readerProvider := func() reader.RNibReader {
return readerMock
// return writerMock
// }
//
-// var rnibErr common.IRNibError
+// var rnibErr error
// writerMock.On("SaveRanLoadInformation",inventoryName, mock.Anything).Return(rnibErr)
//
// loadInformationHandler := NewEnbLoadInformationNotificationHandler(rnibWriterProvider)
// return writerMock
// }
//
-// var rnibErr common.IRNibError
+// var rnibErr error
// writerMock.On("SaveRanLoadInformation",inventoryName, mock.Anything).Return(rnibErr)
//
// loadInformationHandler := NewEnbLoadInformationNotificationHandler(rnibWriterProvider)
nodeb, err := handler.readerProvider().GetNodeb(resetRequest.RanName)
if err != nil {
logger.Errorf("#reset_request_handler.Handle - failed to get status of RAN: %s from RNIB. Error: %s", resetRequest.RanName, err.Error())
- if err.GetCode() == common.RESOURCE_NOT_FOUND {
+ _, ok := err.(*common.ResourceNotFoundError)
+ if ok {
return e2managererrors.NewResourceNotFoundError()
}
return e2managererrors.NewRnibDbError()
rmrService:=getRmrService(rmrMessengerMock, log)
handler := NewX2ResetRequestHandler(rmrService, config, writerProvider, readerProvider)
- readerMock.On("GetNodeb",ranName).Return(&entities.NodebInfo{}, common.NewResourceNotFoundError(fmt.Errorf("nodeb not found")))
+ readerMock.On("GetNodeb",ranName).Return(&entities.NodebInfo{}, common.NewResourceNotFoundError("nodeb not found"))
actual := handler.Handle(log, models.ResetRequest{RanName: ranName })
StartTime: time.Now(), TransactionId: string(xaction)}
nb := &entities.NodebInfo{RanName:mBuf.Meid, ConnectionStatus:entities.ConnectionStatus_CONNECTED,}
- var rnibErr common.IRNibError
+ var rnibErr error
readerMock.On("GetNodeb", mBuf.Meid).Return(nb, rnibErr)
messageChannel := make(chan *models.NotificationResponse)
StartTime: time.Now(), TransactionId: string(xaction)}
nb := &entities.NodebInfo{RanName:mBuf.Meid, ConnectionStatus:entities.ConnectionStatus_SHUTTING_DOWN,}
- var rnibErr common.IRNibError
+ var rnibErr error
readerMock.On("GetNodeb", mBuf.Meid).Return(nb, rnibErr)
StartTime: time.Now(), TransactionId: string(xaction)}
nb := &entities.NodebInfo{RanName:mBuf.Meid, ConnectionStatus:entities.ConnectionStatus_DISCONNECTED,}
- var rnibErr common.IRNibError
+ var rnibErr error
readerMock.On("GetNodeb", mBuf.Meid).Return(nb, rnibErr)
StartTime: time.Now(), TransactionId: string(xaction)}
var nb *entities.NodebInfo
- rnibErr := &common.RNibError{}
+ rnibErr := &common.ResourceNotFoundError{}
readerMock.On("GetNodeb", mBuf.Meid).Return(nb, rnibErr)
h.Handle(log,nil, ¬ificationRequest, nil)
"gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common"
"gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities"
"gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader"
- "github.com/pkg/errors"
"testing"
"time"
)
var messageChannel chan<- *models.NotificationResponse
nb := &entities.NodebInfo{RanName:mBuf.Meid, ConnectionStatus:entities.ConnectionStatus_CONNECTED_SETUP_FAILED,}
- var rnibErr common.IRNibError
+ var rnibErr error
readerMock.On("GetNodeb", mBuf.Meid).Return(nb, rnibErr)
h.Handle(log,e2Sessions, ¬ificationRequest, messageChannel)
var messageChannel chan<- *models.NotificationResponse
var nb *entities.NodebInfo
- rnibErr := common.NewResourceNotFoundError(errors.New("nodeb not found"))
+ rnibErr := common.NewResourceNotFoundError("nodeb not found")
readerMock.On("GetNodeb", mBuf.Meid).Return(nb, rnibErr)
h.Handle(log,e2Sessions, ¬ificationRequest, messageChannel)
var messageChannel chan<- *models.NotificationResponse
nb := &entities.NodebInfo{RanName:mBuf.Meid, ConnectionStatus:entities.ConnectionStatus_CONNECTED_SETUP_FAILED,}
- var rnibErr common.IRNibError
+ var rnibErr error
readerMock.On("GetNodeb", mBuf.Meid).Return(nb, rnibErr)
h.Handle(log,e2Sessions, ¬ificationRequest, messageChannel)
"e2mgr/logger"
"e2mgr/rNibWriter"
"e2mgr/services"
- "gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common"
"gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities"
"gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader"
)
int(nodebInfo.GetConnectionAttempts()) < m.config.MaxConnectionAttempts
}
-func (m *RanReconnectionManager) updateNodebInfoStatus(nodebInfo *entities.NodebInfo, connectionStatus entities.ConnectionStatus) common.IRNibError {
+func (m *RanReconnectionManager) updateNodebInfoStatus(nodebInfo *entities.NodebInfo, connectionStatus entities.ConnectionStatus) error {
if nodebInfo.ConnectionStatus == connectionStatus {
return nil
}
return nil
}
-func (m *RanReconnectionManager) setConnectionStatusOfUnconnectableRan(nodebInfo *entities.NodebInfo) common.IRNibError {
+func (m *RanReconnectionManager) setConnectionStatusOfUnconnectableRan(nodebInfo *entities.NodebInfo) error {
connectionStatus := nodebInfo.GetConnectionStatus()
if connectionStatus == entities.ConnectionStatus_SHUT_DOWN {
_,_, readerMock, writerMock, ranReconnectionManager := initRanLostConnectionTest(t)
ranName := "test"
origNodebInfo := &entities.NodebInfo{RanName: ranName, GlobalNbId: &entities.GlobalNbId{PlmnId: "xxx", NbId: "yyy"}, ConnectionStatus: entities.ConnectionStatus_SHUT_DOWN}
- var rnibErr common.IRNibError
+ var rnibErr error
readerMock.On("GetNodeb", ranName).Return(origNodebInfo, rnibErr)
err := ranReconnectionManager.ReconnectRan(ranName)
assert.Nil(t, err)
_,_, readerMock, writerMock, ranReconnectionManager := initRanLostConnectionTest(t)
ranName := "test"
origNodebInfo := &entities.NodebInfo{RanName: ranName, GlobalNbId: &entities.GlobalNbId{PlmnId: "xxx", NbId: "yyy"}, ConnectionStatus: entities.ConnectionStatus_SHUTTING_DOWN}
- var rnibErr common.IRNibError
+ var rnibErr error
readerMock.On("GetNodeb", ranName).Return(origNodebInfo, rnibErr)
updatedNodebInfo := *origNodebInfo
updatedNodebInfo.ConnectionStatus = entities.ConnectionStatus_SHUT_DOWN
_,_, readerMock, writerMock, ranReconnectionManager := initRanLostConnectionTest(t)
ranName := "test"
origNodebInfo := &entities.NodebInfo{RanName: ranName, GlobalNbId: &entities.GlobalNbId{PlmnId: "xxx", NbId: "yyy"}, ConnectionStatus: entities.ConnectionStatus_CONNECTING, ConnectionAttempts: 20}
- var rnibErr common.IRNibError
+ var rnibErr error
readerMock.On("GetNodeb", ranName).Return(origNodebInfo, rnibErr)
updatedNodebInfo := *origNodebInfo
updatedNodebInfo.ConnectionStatus = entities.ConnectionStatus_DISCONNECTED
_,_, readerMock, writerMock, ranReconnectionManager := initRanLostConnectionTest(t)
ranName := "test"
origNodebInfo := &entities.NodebInfo{RanName: ranName, GlobalNbId: &entities.GlobalNbId{PlmnId: "xxx", NbId: "yyy"}, ConnectionStatus: entities.ConnectionStatus_SHUTTING_DOWN}
- var rnibErr common.IRNibError
+ var rnibErr error
readerMock.On("GetNodeb", ranName).Return(origNodebInfo, rnibErr)
updatedNodebInfo := *origNodebInfo
updatedNodebInfo.ConnectionStatus = entities.ConnectionStatus_SHUT_DOWN
_,rmrMessengerMock, readerMock, writerMock, ranReconnectionManager := initRanLostConnectionTest(t)
ranName := "test"
origNodebInfo := &entities.NodebInfo{RanName: ranName, GlobalNbId: &entities.GlobalNbId{PlmnId: "xxx", NbId: "yyy"}, ConnectionStatus: entities.ConnectionStatus_CONNECTED, E2ApplicationProtocol:entities.E2ApplicationProtocol_ENDC_X2_SETUP_REQUEST}
- var rnibErr common.IRNibError
+ var rnibErr error
readerMock.On("GetNodeb", ranName).Return(origNodebInfo, rnibErr)
updatedNodebInfo := *origNodebInfo
updatedNodebInfo.ConnectionStatus = entities.ConnectionStatus_CONNECTING
_,_, readerMock, writerMock, ranReconnectionManager := initRanLostConnectionTest(t)
ranName := "test"
origNodebInfo := &entities.NodebInfo{RanName: ranName, GlobalNbId: &entities.GlobalNbId{PlmnId: "xxx", NbId: "yyy"}, ConnectionStatus: entities.ConnectionStatus_CONNECTED}
- var rnibErr common.IRNibError
+ var rnibErr error
readerMock.On("GetNodeb", ranName).Return(origNodebInfo, rnibErr)
updatedNodebInfo := *origNodebInfo
updatedNodebInfo.ConnectionStatus = entities.ConnectionStatus_CONNECTING
var initialNodeb = &entities.NodebInfo{ConnectionStatus: entities.ConnectionStatus_CONNECTED, E2ApplicationProtocol: entities.E2ApplicationProtocol_X2_SETUP_REQUEST}
var argNodeb = &entities.NodebInfo{ConnectionStatus: entities.ConnectionStatus_CONNECTING, E2ApplicationProtocol: entities.E2ApplicationProtocol_X2_SETUP_REQUEST, ConnectionAttempts: 1}
- var rnibErr common.IRNibError
+ var rnibErr error
writerMock.On("UpdateNodebInfo", argNodeb).Return(rnibErr)
payload := e2pdus.PackedX2setupRequest
var initialNodeb = &entities.NodebInfo{ConnectionStatus: entities.ConnectionStatus_CONNECTED, E2ApplicationProtocol: entities.E2ApplicationProtocol_ENDC_X2_SETUP_REQUEST}
var argNodeb = &entities.NodebInfo{ConnectionStatus: entities.ConnectionStatus_CONNECTING, E2ApplicationProtocol: entities.E2ApplicationProtocol_ENDC_X2_SETUP_REQUEST, ConnectionAttempts: 1}
- var rnibErr common.IRNibError
+ var rnibErr error
writerMock.On("UpdateNodebInfo", argNodeb).Return(rnibErr)
payload := e2pdus.PackedEndcX2setupRequest
var initialNodeb = &entities.NodebInfo{ConnectionStatus: entities.ConnectionStatus_CONNECTED, E2ApplicationProtocol: entities.E2ApplicationProtocol_X2_SETUP_REQUEST}
var argNodeb = &entities.NodebInfo{ConnectionStatus: entities.ConnectionStatus_CONNECTING, E2ApplicationProtocol: entities.E2ApplicationProtocol_X2_SETUP_REQUEST, ConnectionAttempts: 1}
var argNodebDisconnected = &entities.NodebInfo{ConnectionStatus: entities.ConnectionStatus_DISCONNECTED, E2ApplicationProtocol: entities.E2ApplicationProtocol_X2_SETUP_REQUEST, ConnectionAttempts: 0}
- var rnibErr common.IRNibError
+ var rnibErr error
writerMock.On("UpdateNodebInfo", argNodeb).Return(rnibErr)
writerMock.On("UpdateNodebInfo", argNodebDisconnected).Return(rnibErr)
var initialNodeb = &entities.NodebInfo{ConnectionStatus: entities.ConnectionStatus_CONNECTED, E2ApplicationProtocol: entities.E2ApplicationProtocol_X2_SETUP_REQUEST}
var argNodeb = &entities.NodebInfo{ConnectionStatus: entities.ConnectionStatus_CONNECTING, E2ApplicationProtocol: entities.E2ApplicationProtocol_X2_SETUP_REQUEST, ConnectionAttempts: 1}
var argNodebDisconnected = &entities.NodebInfo{ConnectionStatus: entities.ConnectionStatus_DISCONNECTED, E2ApplicationProtocol: entities.E2ApplicationProtocol_X2_SETUP_REQUEST, ConnectionAttempts: 0}
- var rnibErr common.IRNibError
+ var rnibErr error
writerMock.On("UpdateNodebInfo", argNodeb).Return(rnibErr)
writerMock.On("UpdateNodebInfo", argNodebDisconnected).Return(common.NewInternalError(fmt.Errorf("DB error")))
var initialNodeb = &entities.NodebInfo{ConnectionStatus: entities.ConnectionStatus_CONNECTED, E2ApplicationProtocol: entities.E2ApplicationProtocol_UNKNOWN_E2_APPLICATION_PROTOCOL}
var argNodeb = &entities.NodebInfo{ConnectionStatus: entities.ConnectionStatus_CONNECTING, E2ApplicationProtocol: entities.E2ApplicationProtocol_UNKNOWN_E2_APPLICATION_PROTOCOL, ConnectionAttempts: 1}
- var rnibErr common.IRNibError
+ var rnibErr error
writerMock.On("UpdateNodebInfo", argNodeb).Return(rnibErr)
payload := e2pdus.PackedX2setupRequest
package mocks
import (
- "gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common"
"gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities"
"github.com/stretchr/testify/mock"
)
mock.Mock
}
-func (m *RnibReaderMock) GetNodeb(inventoryName string) (*entities.NodebInfo, common.IRNibError) {
+func (m *RnibReaderMock) GetNodeb(inventoryName string) (*entities.NodebInfo, error) {
args := m.Called(inventoryName)
errArg := args.Get(1);
if errArg != nil {
- return args.Get(0).(*entities.NodebInfo), errArg.(common.IRNibError);
+ return args.Get(0).(*entities.NodebInfo), errArg.(error);
}
return args.Get(0).(*entities.NodebInfo), nil
}
-func (m *RnibReaderMock) GetNodebByGlobalNbId(nodeType entities.Node_Type, globalNbId *entities.GlobalNbId) (*entities.NodebInfo, common.IRNibError) {
+func (m *RnibReaderMock) GetNodebByGlobalNbId(nodeType entities.Node_Type, globalNbId *entities.GlobalNbId) (*entities.NodebInfo, error) {
args := m.Called(nodeType, globalNbId)
errArg := args.Get(1);
if errArg != nil {
- return args.Get(0).(*entities.NodebInfo), errArg.(common.IRNibError);
+ return args.Get(0).(*entities.NodebInfo), errArg.(error);
}
return args.Get(0).(*entities.NodebInfo), nil
}
-func (m *RnibReaderMock) GetCellList(inventoryName string) (*entities.Cells, common.IRNibError) {
+func (m *RnibReaderMock) GetCellList(inventoryName string) (*entities.Cells, error) {
args := m.Called(inventoryName)
errArg := args.Get(1);
if errArg != nil {
- return args.Get(0).(*entities.Cells), errArg.(common.IRNibError);
+ return args.Get(0).(*entities.Cells), errArg.(error);
}
return args.Get(0).(*entities.Cells), nil
}
-func (m *RnibReaderMock) GetListGnbIds() (*[]*entities.NbIdentity, common.IRNibError) {
+func (m *RnibReaderMock) GetListGnbIds() ([]*entities.NbIdentity, error) {
args := m.Called()
errArg := args.Get(1);
if errArg != nil {
- return args.Get(0).(*[]*entities.NbIdentity), errArg.(common.IRNibError);
+ return args.Get(0).([]*entities.NbIdentity), errArg.(error);
}
- return args.Get(0).(*[]*entities.NbIdentity), nil
+ return args.Get(0).([]*entities.NbIdentity), nil
}
-func (m *RnibReaderMock) GetListEnbIds() (*[]*entities.NbIdentity, common.IRNibError) {
+func (m *RnibReaderMock) GetListEnbIds() ([]*entities.NbIdentity, error) {
args := m.Called()
errArg := args.Get(1);
if errArg != nil {
- return args.Get(0).(*[]*entities.NbIdentity), errArg.(common.IRNibError);
+ return args.Get(0).([]*entities.NbIdentity), errArg.(error);
}
- return args.Get(0).(*[]*entities.NbIdentity), nil
+ return args.Get(0).([]*entities.NbIdentity), nil
}
-func (m *RnibReaderMock) GetCountGnbList() (int, common.IRNibError) {
+func (m *RnibReaderMock) GetCountGnbList() (int, error) {
args := m.Called()
errArg := args.Get(1);
if errArg != nil {
- return args.Int(0), errArg.(common.IRNibError);
+ return args.Int(0), errArg.(error);
}
return args.Int(0), nil
}
-func (m *RnibReaderMock) GetCell(inventoryName string, pci uint32) (*entities.Cell, common.IRNibError) {
+func (m *RnibReaderMock) GetCell(inventoryName string, pci uint32) (*entities.Cell, error) {
args := m.Called(inventoryName, pci)
errArg := args.Get(1);
if errArg != nil {
- return args.Get(0).(*entities.Cell), errArg.(common.IRNibError);
+ return args.Get(0).(*entities.Cell), errArg.(error);
}
return args.Get(0).(*entities.Cell), nil
}
-func (m *RnibReaderMock) GetCellById(cellType entities.Cell_Type, cellId string) (*entities.Cell, common.IRNibError) {
+func (m *RnibReaderMock) GetCellById(cellType entities.Cell_Type, cellId string) (*entities.Cell, error) {
args := m.Called(cellType, cellId)
errArg := args.Get(1);
if errArg != nil {
- return args.Get(0).(*entities.Cell), errArg.(common.IRNibError);
+ return args.Get(0).(*entities.Cell), errArg.(error);
}
return args.Get(0).(*entities.Cell), nil
}
-func (m *RnibReaderMock) GetListNodebIds() ([]*entities.NbIdentity, common.IRNibError) {
+func (m *RnibReaderMock) GetListNodebIds() ([]*entities.NbIdentity, error) {
args := m.Called()
errArg := args.Get(1)
if errArg != nil {
- return args.Get(0).([]*entities.NbIdentity), errArg.(common.IRNibError)
+ return args.Get(0).([]*entities.NbIdentity), errArg.(error)
}
return args.Get(0).([]*entities.NbIdentity), nil
}
-func (m *RnibReaderMock) GetRanLoadInformation(inventoryName string) (*entities.RanLoadInformation, common.IRNibError) {
+func (m *RnibReaderMock) GetRanLoadInformation(inventoryName string) (*entities.RanLoadInformation, error) {
args := m.Called()
errArg := args.Get(1)
if errArg != nil {
- return args.Get(0).(*entities.RanLoadInformation), errArg.(common.IRNibError)
+ return args.Get(0).(*entities.RanLoadInformation), errArg.(error)
}
return args.Get(0).(*entities.RanLoadInformation), nil
package mocks
import (
- "gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common"
"gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities"
"github.com/stretchr/testify/mock"
)
mock.Mock
}
-func (rnibWriterMock *RnibWriterMock) SaveNodeb(nbIdentity *entities.NbIdentity, nb *entities.NodebInfo) common.IRNibError {
+func (rnibWriterMock *RnibWriterMock) SaveNodeb(nbIdentity *entities.NbIdentity, nb *entities.NodebInfo) error {
args := rnibWriterMock.Called(nbIdentity, nb)
errArg := args.Get(0)
if errArg != nil {
- return errArg.(common.IRNibError)
+ return errArg.(error)
}
return nil
}
-func (rnibWriterMock *RnibWriterMock) UpdateNodebInfo(nodebInfo *entities.NodebInfo) common.IRNibError {
+func (rnibWriterMock *RnibWriterMock) UpdateNodebInfo(nodebInfo *entities.NodebInfo) error {
args := rnibWriterMock.Called(nodebInfo)
errArg := args.Get(0)
if errArg != nil {
- return errArg.(common.IRNibError)
+ return errArg.(error)
}
return nil
}
-func (rnibWriterMock *RnibWriterMock) SaveRanLoadInformation(inventoryName string, ranLoadInformation *entities.RanLoadInformation) common.IRNibError {
+func (rnibWriterMock *RnibWriterMock) SaveRanLoadInformation(inventoryName string, ranLoadInformation *entities.RanLoadInformation) error {
args := rnibWriterMock.Called(inventoryName, ranLoadInformation)
errArg := args.Get(0)
if errArg != nil {
- return errArg.(common.IRNibError)
+ return errArg.(error)
}
return nil
package rNibWriter
import (
- "errors"
"fmt"
"gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common"
"gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities"
RNibWriter interface allows saving data to the redis DB
*/
type RNibWriter interface {
- SaveNodeb(nbIdentity *entities.NbIdentity, nb *entities.NodebInfo) common.IRNibError
- UpdateNodebInfo(nodebInfo *entities.NodebInfo) common.IRNibError
- SaveRanLoadInformation(inventoryName string, ranLoadInformation *entities.RanLoadInformation) common.IRNibError
+ SaveNodeb(nbIdentity *entities.NbIdentity, nb *entities.NodebInfo) error
+ UpdateNodebInfo(nodebInfo *entities.NodebInfo) error
+ SaveRanLoadInformation(inventoryName string, ranLoadInformation *entities.RanLoadInformation) error
}
/*
func initPool(poolSize int, newObj func() interface{}, destroyObj func(interface{})) {
writerPool = common.NewPool(poolSize, newObj, destroyObj)
}
-
/*
-GetRNibWriter returns RNibWriter instance from the pool
+GetRNibWriter returns reference to RNibWriter
*/
func GetRNibWriter() RNibWriter {
- return writerPool.Get().(RNibWriter)
+ return &rNibWriterInstance{}
}
-
/*
SaveNodeb saves nodeB entity data in the redis DB according to the specified data model
*/
-func (w *rNibWriterInstance) SaveNodeb(nbIdentity *entities.NbIdentity, entity *entities.NodebInfo) common.IRNibError {
-
+func (*rNibWriterInstance) SaveNodeb(nbIdentity *entities.NbIdentity, entity *entities.NodebInfo) error {
+ w := writerPool.Get().(*rNibWriterInstance)
isNotEmptyIdentity := isNotEmpty(nbIdentity)
if isNotEmptyIdentity && entity.GetNodeType() == entities.Node_UNKNOWN {
- return common.NewValidationError(errors.New(fmt.Sprintf("#rNibWriter.saveNodeB - Unknown responding node type, entity: %v", entity)))
+ return common.NewValidationError(fmt.Sprintf("#rNibWriter.saveNodeB - Unknown responding node type, entity: %v", entity))
}
defer writerPool.Put(w)
data, err := proto.Marshal(entity)
/*
UpdateNodebInfo...
*/
-func (w *rNibWriterInstance) UpdateNodebInfo(nodebInfo *entities.NodebInfo) common.IRNibError {
-
+func (*rNibWriterInstance) UpdateNodebInfo(nodebInfo *entities.NodebInfo) error {
+ w := writerPool.Get().(*rNibWriterInstance)
defer writerPool.Put(w)
nodebNameKey, rNibErr := common.ValidateAndBuildNodeBNameKey(nodebInfo.GetRanName())
/*
SaveRanLoadInformation stores ran load information for the provided ran
*/
-func (w *rNibWriterInstance) SaveRanLoadInformation(inventoryName string, ranLoadInformation *entities.RanLoadInformation) common.IRNibError {
-
+func (*rNibWriterInstance) SaveRanLoadInformation(inventoryName string, ranLoadInformation *entities.RanLoadInformation) error {
+ w := writerPool.Get().(*rNibWriterInstance)
defer writerPool.Put(w)
key, rnibErr := common.ValidateAndBuildRanLoadInformationKey(inventoryName)
writerPool.Close()
}
-func appendEnbCells(nbIdentity *entities.NbIdentity, cells []*entities.ServedCellInfo, pairs []interface{}) ([]interface{}, common.IRNibError) {
+func appendEnbCells(nbIdentity *entities.NbIdentity, cells []*entities.ServedCellInfo, pairs []interface{}) ([]interface{}, error) {
for _, cell := range cells {
cellEntity := entities.Cell{Type: entities.Cell_LTE_CELL, Cell: &entities.Cell_ServedCellInfo{ServedCellInfo: cell}}
cellData, err := proto.Marshal(&cellEntity)
return pairs, nil
}
-func appendGnbCells(nbIdentity *entities.NbIdentity, cells []*entities.ServedNRCell, pairs []interface{}) ([]interface{}, common.IRNibError) {
+func appendGnbCells(nbIdentity *entities.NbIdentity, cells []*entities.ServedNRCell, pairs []interface{}) ([]interface{}, error) {
for _, cell := range cells {
cellEntity := entities.Cell{Type: entities.Cell_NR_CELL, Cell: &entities.Cell_ServedNrCell{ServedNrCell: cell}}
cellData, err := proto.Marshal(&cellEntity)
rNibErr := w.UpdateNodebInfo(nodebInfo)
assert.NotNil(t, rNibErr)
- assert.Equal(t, common.VALIDATION_ERROR, rNibErr.GetCode())
+ assert.IsType(t, &common.ValidationError{}, rNibErr)
}
func TestUpdateNodebInfoMissingGlobalNbId(t *testing.T) {
nbIdentity := &entities.NbIdentity{InventoryName: name, GlobalNbId: &entities.GlobalNbId{PlmnId: "02f829", NbId: "4a952a0a"}}
rNibErr := w.SaveNodeb(nbIdentity, &nb)
assert.NotNil(t, rNibErr)
- assert.Equal(t, common.VALIDATION_ERROR, rNibErr.GetCode())
- assert.Equal(t, "3 VALIDATION_ERROR - #utils.ValidateAndBuildCellIdKey - an empty cell id received", rNibErr.Error())
+ assert.IsType(t, &common.ValidationError{}, rNibErr)
+ assert.Equal(t, "#utils.ValidateAndBuildCellIdKey - an empty cell id received", rNibErr.Error())
}
func TestSaveEnbInventoryNameValidationFailure(t *testing.T) {
nbIdentity := &entities.NbIdentity{InventoryName: "", GlobalNbId: &entities.GlobalNbId{PlmnId: "02f829", NbId: "4a952a0a"}}
rNibErr := w.SaveNodeb(nbIdentity, &nb)
assert.NotNil(t, rNibErr)
- assert.Equal(t, common.VALIDATION_ERROR, rNibErr.GetCode())
- assert.Equal(t, "3 VALIDATION_ERROR - #utils.ValidateAndBuildNodeBNameKey - an empty inventory name received", rNibErr.Error())
+ assert.IsType(t, &common.ValidationError{}, rNibErr)
+ assert.Equal(t, "#utils.ValidateAndBuildNodeBNameKey - an empty inventory name received", rNibErr.Error())
}
func TestSaveEnbOnClosedPool(t *testing.T) {
nbIdentity := &entities.NbIdentity{InventoryName: name, GlobalNbId: &entities.GlobalNbId{PlmnId: "02f829", NbId: "4a952a0a"}}
rNibErr := w.SaveNodeb(nbIdentity, &nb)
assert.NotNil(t, rNibErr)
- assert.Equal(t, common.VALIDATION_ERROR, rNibErr.GetCode())
- assert.Equal(t, "3 VALIDATION_ERROR - #utils.ValidateAndBuildNrCellIdKey - an empty cell id received", rNibErr.Error())
+ assert.IsType(t, &common.ValidationError{}, rNibErr)
+ assert.Equal(t, "#utils.ValidateAndBuildNrCellIdKey - an empty cell id received", rNibErr.Error())
}
func TestSaveGnb(t *testing.T) {
err := w.SaveRanLoadInformation(inventoryName, nil)
assert.NotNil(t, err)
- assert.Equal(t, common.VALIDATION_ERROR, err.GetCode())
+ assert.IsType(t, &common.ValidationError{}, err)
}
func TestSaveRanLoadInformationSdlFailure(t *testing.T) {
rNibErr := w.SaveRanLoadInformation(inventoryName, ranLoadInformation)
assert.NotNil(t, rNibErr)
- assert.Equal(t, common.INTERNAL_ERROR, rNibErr.GetCode())
- assert.Equal(t, expectedErr, rNibErr.GetError())
+ assert.IsType(t, &common.InternalError{}, rNibErr)
}
func generateCellLoadInformation() *entities.CellLoadInformation {
writerPool = nil
initSdlInstanceMock(namespace, 1)
w := GetRNibWriter()
- expectedErr := common.NewValidationError(errors.New("#rNibWriter.saveNodeB - Unknown responding node type, entity: ip:\"localhost\" port:5656 "))
+ expectedErr := common.NewValidationError("#rNibWriter.saveNodeB - Unknown responding node type, entity: ip:\"localhost\" port:5656 ")
nbIdentity := &entities.NbIdentity{InventoryName: "name", GlobalNbId: &entities.GlobalNbId{PlmnId: "02f829", NbId: "4a952a0a"}}
nb := &entities.NodebInfo{}
nb.Port = 5656
func TestGetRNibWriterPoolNotInitializedFailure(t *testing.T) {
writerPool = nil
- assert.Panics(t, func() { GetRNibWriter() })
+ assert.Panics(t, func() { GetRNibWriter().SaveNodeb(nil,nil) })
}
func TestGetRNibWriter(t *testing.T) {
writerPool = nil
initSdlInstanceMock(namespace, 1)
received := GetRNibWriter()
- assert.NotEmpty(t, received)
+ assert.Empty(t, received)
available, created := writerPool.Stats()
assert.Equal(t, 0, available, "number of available objects in the writerPool should be 0")
- assert.Equal(t, 1, created, "number of created objects in the writerPool should be 1")
+ assert.Equal(t, 0, created, "number of created objects in the writerPool should be 0")
writerPool.Close()
}
writerPool.Put(w2)
available, created := writerPool.Stats()
assert.Equal(t, 2, available, "number of available objects in the writerPool should be 2")
- assert.Equal(t, 2, created, "number of created objects in the writerPool should be 2")
+ assert.Equal(t, 0, created, "number of created objects in the writerPool should be 0")
var e error
instanceMock.On("Close").Return(e)
Close()
available, created = writerPool.Stats()
assert.Equal(t, 0, available, "number of available objects in the writerPool should be 0")
- assert.Equal(t, 0, created, "number of created objects in the writerPool should be 0")
}
func TestCloseOnClosedPoolFailure(t *testing.T) {
writerPool.Put(w1)
available, created := writerPool.Stats()
assert.Equal(t, 1, available, "number of available objects in the writerPool should be 1")
- assert.Equal(t, 1, created, "number of created objects in the writerPool should be 1")
+ assert.Equal(t, 0, created, "number of created objects in the writerPool should be 0")
var e error
instanceMock.On("Close").Return(e)
Close()
writerPool.Put(w1)
available, created := writerPool.Stats()
assert.Equal(t, 1, available, "number of available objects in the writerPool should be 1")
- assert.Equal(t, 1, created, "number of created objects in the writerPool should be 1")
+ assert.Equal(t, 0, created, "number of created objects in the writerPool should be 0")
e := errors.New("expected error")
instanceMock.On("Close").Return(e)
Close()
available, created = writerPool.Stats()
assert.Equal(t, 0, available, "number of available objects in the writerPool should be 0")
- assert.Equal(t, 0, created, "number of created objects in the writerPool should be 0")
}
func TestInit(t *testing.T) {
package services
import (
- "gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common"
"gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities"
"gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader"
)
return &RnibReaderService{rnibReaderProvider}
}
-func (s RnibReaderService) GetNodeb(ranName string) (*entities.NodebInfo, common.IRNibError) {
+func (s RnibReaderService) GetNodeb(ranName string) (*entities.NodebInfo, error) {
return s.rnibReaderProvider().GetNodeb(ranName)
}
-func (s RnibReaderService) GetNodebIdList()([]*entities.NbIdentity, common.IRNibError) {
+func (s RnibReaderService) GetNodebIdList()([]*entities.NbIdentity, error) {
return s.rnibReaderProvider().GetListNodebIds()
}