/// @param event The event.
/// @param private_ctx The private context.
/// @return the sysrepo return code.
- sysrepo::ErrorCode module_change(Session sess,
- uint32_t /* subscription_id */,
- string_view module_name,
- optional<string_view> /* sub_xpath */,
- Event event,
- uint32_t /* request_id */) {
+ sysrepo::ErrorCode moduleChange(Session sess,
+ uint32_t /* subscription_id */,
+ string_view module_name,
+ optional<string_view> /* sub_xpath */,
+ Event event,
+ uint32_t /* request_id */) {
ostringstream event_type;
switch (event) {
case Event::Update:
}
}
- void event_notif(Session /* session */,
- uint32_t /* subscription_id */,
- NotificationType const notification_type,
- optional<DataNode> const notification_tree,
- NotificationTimeStamp const /* timestamp */) {
+ void eventNotif(Session /* session */,
+ uint32_t /* subscription_id */,
+ NotificationType const notification_type,
+ optional<DataNode> const notification_tree,
+ NotificationTimeStamp const /* timestamp */) {
string n;
switch (notification_type) {
case NotificationType::Realtime:
break;
}
- optional<string> const str(
- notification_tree->printStr(DataFormat::JSON, PrintFlags::WithDefaultsExplicit));
- string const tree(str ? *str : string());
+ string tree;
+ if (notification_tree) {
+ optional<string> const str(
+ notification_tree->printStr(DataFormat::JSON, PrintFlags::WithDefaultsExplicit));
+ if (str) {
+ tree = *str;
+ }
+ }
LOG_INFO(netconf_logger, NETCONF_NOTIFICATION_RECEIVED)
.arg(n)
.arg(service_pair_.first)
Event event,
uint32_t request_id) {
NetconfAgentCallback agent(service_pair);
- return agent.module_change(session, subscription_id, module_name, sub_xpath, event,
- request_id);
+ return agent.moduleChange(session, subscription_id, module_name, sub_xpath, event,
+ request_id);
};
try {
SubscribeOptions options(SubscribeOptions::Default);
optional<DataNode> const notification_tree,
NotificationTimeStamp const timestamp) {
NetconfAgentCallback agent(service_pair);
- return agent.event_notif(session, subscription_id, notification_type, notification_tree,
- timestamp);
+ return agent.eventNotif(session, subscription_id, notification_type, notification_tree,
+ timestamp);
};
try {
auto exception_handler = [model](std::exception& ex) {
"NETCONF_MODULE_REVISION_ERR", "Essential module %1 does NOT have the right revision: expected %2, got %3",
"NETCONF_MODULE_REVISION_WARN", "Module %1 does NOT have the right revision: expected %2, got %3",
"NETCONF_NOTIFICATION_INTERNAL_ERROR", "an internal error occurred while sending an event notification for module %1: %2",
- "NETCONF_NOTIFICATION_RECEIVED", "Received notification of type %1 for module %1: %2",
+ "NETCONF_NOTIFICATION_RECEIVED", "Received notification of type %1 for module %2: '%3'",
"NETCONF_NOT_SUBSCRIBED_TO_NOTIFICATIONS", "subscribing to notifications for %1 server with %2 module failed: %3",
"NETCONF_RUN_EXIT", "application is exiting the event loop",
"NETCONF_SET_CONFIG", "set configuration to %1 server: %2",