OpenDayLight TSDR Yang通知收集器问题
我们正试图在MG版本下的TSDR项目中使用yang notification collector功能。 有几个问题:OpenDayLight TSDR Yang通知收集器问题,opendaylight,Opendaylight,我们正试图在MG版本下的TSDR项目中使用yang notification collector功能。 有几个问题: TSDR“Yang Notification Collector”是否是TSDR中的完整功能?它仅位于TSDR的主分支上。我们确实编译了ODL镁(Java11)的主版本 此功能的构造函数订阅要侦听的通知。 我们有构造函数设置来监听NETCONF通知,该通知来自一个“NETCONF testtool”模拟器,该模拟器正在使用适当的方法进行通知 例如,我们正试图强制它侦听如下通知
// Code Change - add specific QNAME for notification to listen on
private static final QName TEST_QNAME = QName.create("urn:ietf:params:xml:ns:netconf:notification:1.0",
"2008-07-14", "onu-presence-state-change").intern();
@Inject
public YangNotificationCollectorLogger(final TsdrCollectorSpiService collectorSPIService,
final SchedulerService schedulerService, final DOMSchemaService domSchemaService,
final DOMNotificationService notificationService, final NotificationSubscription configuration) {
super(collectorSPIService, schedulerService, "TSDRYangCollector");
this.codecFactory = CODEC.getShared(domSchemaService.getGlobalContext());
// Code Change Force to look for specific notification
NotificationSubscription newConfiguration = new NotificationSubscriptionBuilder().setNotifications(
Arrays.asList(new NotificationsBuilder().setNotification(
TEST_QNAME.toString()).build())).build();
List<SchemaPath> notificationsToListen = new ArrayList<>();
// Code Change Force code to look for specific notification..
//Optional.ofNullable(configuration.getNotifications()).orElse(Collections.emptyList()).stream().forEach(
Optional.ofNullable(newConfiguration.getNotifications()).orElse(Collections.emptyList()).stream().forEach(
notification -> {
final SchemaPath notificationToListen =
SchemaPath.create(true, QName.create(notification.getNotification()));
notificationsToListen.add(notificationToListen);
LOG.info("Registered for notification {}", notificationToListen);
});
//代码更改-为要侦听的通知添加特定的QNAME
私有静态最终QName测试_QName=QName.create(“urn:ietf:params:xml:ns:netconf:notification:1.0”,
“2008-07-14”,“onu存在状态更改”).intern();
@注入
公共信息收集日志(最终TsdrCollectorSpiService collectorSPIService,
最终SchedulerService SchedulerService,最终DOMSchemaService DOMSchemaService,
最终通知服务(通知服务,最终通知订阅配置){
超级(collectorSPIService,schedulerService,“TSDRYangCollector”);
this.codecFactory=CODEC.getShared(domSchemaService.getGlobalContext());
//代码更改强制查找特定通知
NotificationSubscription newConfiguration=新建NotificationSubscriptionBuilder().setNotifications(
Arrays.asList(新建NotificationsBuilder().setNotification(
TEST_QNAME.toString()).build()).build();
List notificationsToListen=new ArrayList();
//代码更改强制代码查找特定通知。。
//可选.ofNullable(configuration.getNotifications()).orElse(Collections.emptyList()).stream().forEach(
可选.ofNullable(newConfiguration.getNotifications()).orElse(Collections.emptyList()).stream().forEach(
通知->{
最终方案通知列表=
create(true,QName.create(notification.getNotification());
notificationsToListen.add(notificationToListen);
LOG.info(“注册为通知{}”,notificationToListen);
});
当ODL karaf.log显示以下内容时,注册完成:
注册通知AbsoluteSchemaPath{path=[(urn:ietf:params:xml:ns:netconf:notification:1.0?revision=2008-07-14)onu存在状态更改]}
当模拟器发出通知时,ODL会在karaf.log上报告它(启用调试)。
通知如下:
<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
<eventTime>2021-05-21T16:47:00.123Z</eventTime>
<interfaces-state xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
<interface>
<name>channeltermination.1</name>
<channel-termination xmlns="urn:bbf:yang:bbf-xpon">
<onu-presence-state-change xmlns="urn:bbf:yang:bbf-xpon-onu-state"/>
</channel-termination>
</interface>
</interfaces-state>
</notification>
2021-05-21T16:47:00.123Z
渠道终止
但是,yang通知管理器不识别此通知,因此从不调用“onNotification”方法-它从不看到通知。上述方法是否有明显的错误
我们还尝试为“urn:ietf:params:xml:ns:yang:ietf接口”设置通知,但仍然没有成功。
ODL日志示例:
2021-05-26T18:32:26871 | INFO | Blueprint Extender:1 | YangNotificationCollectorLogger | 386-org.opendaylight.tsdr.yang-notification-collector-1.11.3 |注册通知绝对模式{path=[(urn:ietf:params:xml:ns:yang:ietf interfaces?revision=2018-02-20)interfaces state]]