// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
-func NewRanSetupManager(logger *logger.Logger, rmrService *services.RmrService, rnibWriterProvider func() rNibWriter.RNibWriter) *RanSetupManager {
+func NewRanSetupManager(logger *logger.Logger, rmrSender *rmrsender.RmrSender, rnibDataService services.RNibDataService) *RanSetupManager {
- logger: logger,
- rnibWriterProvider: rnibWriterProvider,
- rmrService: rmrService,
+ logger: logger,
+ rnibDataService: rnibDataService,
+ rmrSender: rmrSender,
// Update retries and connection status
nodebInfo.ConnectionStatus = status
nodebInfo.ConnectionAttempts++
// Update retries and connection status
nodebInfo.ConnectionStatus = status
nodebInfo.ConnectionAttempts++
if err != nil {
m.logger.Errorf("#RanSetupManager.updateConnectionStatus - Ran name: %s - Failed updating RAN's connection status to %v : %s", nodebInfo.RanName, status, err)
} else {
if err != nil {
m.logger.Errorf("#RanSetupManager.updateConnectionStatus - Ran name: %s - Failed updating RAN's connection status to %v : %s", nodebInfo.RanName, status, err)
} else {
// Update retries and connection status
nodebInfo.ConnectionStatus = entities.ConnectionStatus_DISCONNECTED
nodebInfo.ConnectionAttempts--
// Update retries and connection status
nodebInfo.ConnectionStatus = entities.ConnectionStatus_DISCONNECTED
nodebInfo.ConnectionAttempts--
if err != nil {
m.logger.Errorf("#RanSetupManager.updateConnectionStatusDisconnected - Ran name: %s - Failed updating RAN's connection status to DISCONNECTED : %s", nodebInfo.RanName, err)
} else {
if err != nil {
m.logger.Errorf("#RanSetupManager.updateConnectionStatusDisconnected - Ran name: %s - Failed updating RAN's connection status to DISCONNECTED : %s", nodebInfo.RanName, err)
} else {
- response := &models.NotificationResponse{MgsType: rmrMsgType, RanName: nodebInfo.RanName, Payload: request.GetMessageAsBytes(m.logger)}
- if err := m.rmrService.SendRmrMessage(response); err != nil {
+ msg := models.NewRmrMessage(rmrMsgType, nodebInfo.RanName, request.GetMessageAsBytes(m.logger))
+
+ err = m.rmrSender.Send(msg)
+
+ if err != nil {