X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fo1%2FSessionHandler.cpp;h=7c745ac5c0947849f88e85c05c6a8a41116748e4;hb=a31737d4988c5e02d4998c16973b1048fa2be9a4;hp=bc6ec9f98e07325b2066d26d11073e2c717ef44b;hpb=834004e09017b5b86cb738be98a7a1be79c0a9b0;p=o-du%2Fl2.git diff --git a/src/o1/SessionHandler.cpp b/src/o1/SessionHandler.cpp index bc6ec9f98..7c745ac5c 100644 --- a/src/o1/SessionHandler.cpp +++ b/src/o1/SessionHandler.cpp @@ -24,7 +24,7 @@ #include "sysrepo.h" #include "SessionHandler.hpp" #include "InitConfig.hpp" -#include +#include "NrCellCb.hpp" using namespace std; /* Default constructor */ @@ -50,15 +50,46 @@ bool SessionHandler::init() { try { - O1_LOG("\nO1 SessionHandler : Initialization done"); mConn = createConnection(); - O1_LOG("\nO1 SessionHandler : Initialization done"); - mSess = createSession(mConn); - mSub = createSubscribe(mSess); - O1_LOG("\nO1 SessionHandler : Initialization done"); - //InitConfig initConf; - InitConfig::instance().init(mSess); - return true; + if(mConn != NULL) + { + O1_LOG("\nO1 SessionHandler : Connection created"); + //removing nacm module temperary for auth issue resolve + //mConn.remove_module("ietf-netconf-acm"); + mSess = createSession(mConn); + if(mSess != NULL) + { + O1_LOG("\nO1 SessionHandler : Session created"); + mSub = createSubscribe(mSess); + if(mSub != NULL) + { + O1_LOG("\nO1 SessionHandler : Subscription created"); + if(InitConfig::instance().init(mSess)) + { + return true; + } + else + { + return false; + } + } + else + { + O1_LOG("\nO1 SessionHandler : Subscription failed"); + return false; + } + } + else + { + O1_LOG("\nO1 SessionHandler : Session failed"); + return false; + } + } + else + { + O1_LOG("\nO1 SessionHandler : connection failed"); + return false; + } } catch( const std::exception& e ) { @@ -124,6 +155,15 @@ bool SessionHandler::subscribeModule(sysrepo::S_Subscribe subscrb) subscrb->oper_get_items_subscribe(ALARM_MODULE_NAME_ORAN, \ ALARM_MODULE_PATH_ORAN, \ alarmOranCb); + + sysrepo::S_Callback nrCellCb(new NrCellCb()); + + subscrb->oper_get_items_subscribe(CELL_STATE_MODULE_NAME, \ + CELL_STATE_MODULE_PATH, \ + nrCellCb); + subscrb->module_change_subscribe(CELL_STATE_MODULE_NAME, nrCellCb); + + return true; }