/** * Registers notification listener to receive a set of notifications. * @see DOMNotificationService#registerNotificationListener(DOMNotificationListener, SchemaPath...) * @param listener listener * @param notificationPath notification path * @return */ ListenerRegistration<DOMNotificationListener> registerNotificationListener(DOMNotificationListener listener, SchemaPath notificationPath) { return notificationService.registerNotificationListener(listener, notificationPath); }
@Override public <T extends DOMNotificationListener> ListenerRegistration<T> registerNotificationListener(final T listener, final Collection<SchemaPath> types) { // Controller events are sub-interfaces of MD-SAL events, hence direct routing is okay final ListenerRegistration<?> reg = delegate().registerNotificationListener(listener::onNotification, types); return new AbstractListenerRegistration<T>(listener) { @Override protected void removeRegistration() { reg.close(); } }; }
@Override public <T extends DOMNotificationListener> ListenerRegistration<T> registerNotificationListener(final T listener, final Collection<SchemaPath> types) { return delegate().registerNotificationListener(listener, types); }
@Override public <T extends DOMNotificationListener> ListenerRegistration<T> registerNotificationListener(final T listener, final Collection<SchemaPath> types) { return delegate().registerNotificationListener(listener, types); }
@Override public <T extends DOMNotificationListener> ListenerRegistration<T> registerNotificationListener(final T listener, final SchemaPath... types) { return delegate().registerNotificationListener(listener, types); } }
@Override public <T extends DOMNotificationListener> ListenerRegistration<T> registerNotificationListener(final T listener, final SchemaPath... types) { return delegate().registerNotificationListener(listener, types); } }
private void registerListener(DOMNotificationService notifyService){ this.listenerReg = notifyService.registerNotificationListener(this,SchemaPath.create(true, TopicNotification.QNAME)); }
private YangpushDOMNotificationListener registerNotificationListnerPushUpdateForaNewDevice(Optional<DOMMountPoint> mountPoint, String node_name) { // register notification listener for PUSH-UPDATE //BUG: NotificationListner should be one instance or multiple?? YangpushDOMNotificationListener listener = new YangpushDOMNotificationListener(this.globalDomDataBroker); final Optional<DOMNotificationService> service = mountPoint.get().getService(DOMNotificationService.class); QName qname = PushUpdate.QNAME; SchemaPath schemaPath = SchemaPath.create(true, qname); @SuppressWarnings("unused") final ListenerRegistration<YangpushDOMNotificationListener> accessTopologyListenerListenerRegistration = service .get().registerNotificationListener(listener, schemaPath); this.notifyListnerRegister.put(node_name, listener); return listener; }
@Override public <T extends NotificationListener> ListenerRegistration<T> registerNotificationListener(final T listener) { final BindingDOMNotificationListenerAdapter domListener = new BindingDOMNotificationListenerAdapter(codec, listener); final ListenerRegistration<BindingDOMNotificationListenerAdapter> domRegistration = domNotifService.registerNotificationListener(domListener, domListener.getSupportedNotifications()); return new ListenerRegistrationImpl<>(listener, domRegistration); }
@Override public <T extends Notification> ListenerRegistration<NotificationListener<T>> registerNotificationListener( final Class<T> type, final NotificationListener<T> listener) { final FunctionalNotificationListenerAdapter<T> adapter = new FunctionalNotificationListenerAdapter<>(codec, type, listener); final SchemaPath domType = SchemaPath.create(true, BindingReflections.findQName(type)); final ListenerRegistration<?> domReg = domService.registerNotificationListener(adapter, domType); return new AbstractListenerRegistration<NotificationListener<T>>(listener) { @Override protected void removeRegistration() { domReg.close(); } }; }
private Messaging4TransportProviderImpl(final YangInstanceIdentifier id, final AmqpUserAgent userAgent, final DOMDataBroker dataBroker, final DOMNotificationService notificationService) { identifier = id; try { Session session = AmqpPublisher.getAmqpSession(userAgent.getHost(), userAgent.getPort(), userAgent.getUsername(), userAgent.getPassword()); MessageProducer producer = session.createProducer(AmqpConfig.getDestination(Messaging4TransportConstants. AMQP_TOPIC_EVENT_DESTINATION)); producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT); } catch (final Exception e) { throw new IllegalStateException("Unable to connect to the AMQP server", e); } notificationReg = notificationService.registerNotificationListener(this, TOPIC_NOTIFICATION_PATH); final YangInstanceIdentifier receiverPath = identifier; final DOMDataTreeIdentifier receiverConfigPath = new DOMDataTreeIdentifier(LogicalDatastoreType.CONFIGURATION, receiverPath); // configurationReg = dataBroker.registerDataChangeListener(); //receiverConfigPath, this); // todo: registerDataTreeChangeListener LOG.info("AMQP user agent initialized. id: {}", id); }