Search in sources :

Example 6 with StreamNameType

use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.notification._1._0.rev080714.StreamNameType in project netconf by opendaylight.

the class NotificationToMdsalWriter method onStreamUnregistered.

@Override
public void onStreamUnregistered(final StreamNameType stream) {
    final WriteTransaction tx = dataBroker.newWriteOnlyTransaction();
    final InstanceIdentifier<Stream> streamIdentifier = STREAMS.child(Stream.class, new StreamKey(stream));
    tx.delete(LogicalDatastoreType.OPERATIONAL, streamIdentifier);
    try {
        tx.commit().get();
        LOG.debug("Stream {} unregistered successfully.", stream);
    } catch (InterruptedException | ExecutionException e) {
        LOG.warn("Unable to unregister stream {}", stream, e);
    }
}
Also used : WriteTransaction(org.opendaylight.mdsal.binding.api.WriteTransaction) Stream(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netmod.notification.rev080714.netconf.streams.Stream) ExecutionException(java.util.concurrent.ExecutionException) StreamKey(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netmod.notification.rev080714.netconf.streams.StreamKey)

Aggregations

StreamNameType (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.notification._1._0.rev080714.StreamNameType)5 Stream (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netmod.notification.rev080714.netconf.streams.Stream)3 Test (org.junit.Test)2 StreamBuilder (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netmod.notification.rev080714.netconf.streams.StreamBuilder)2 ExecutionException (java.util.concurrent.ExecutionException)1 WriteTransaction (org.opendaylight.mdsal.binding.api.WriteTransaction)1 DOMMountPoint (org.opendaylight.mdsal.dom.api.DOMMountPoint)1 DOMNotificationService (org.opendaylight.mdsal.dom.api.DOMNotificationService)1 DOMRpcResult (org.opendaylight.mdsal.dom.api.DOMRpcResult)1 DOMRpcService (org.opendaylight.mdsal.dom.api.DOMRpcService)1 XmlElement (org.opendaylight.netconf.api.xml.XmlElement)1 NetconfNotification (org.opendaylight.netconf.notifications.NetconfNotification)1 NetconfNotificationListener (org.opendaylight.netconf.notifications.NetconfNotificationListener)1 NotificationListenerRegistration (org.opendaylight.netconf.notifications.NotificationListenerRegistration)1 NotificationsCounter (org.opendaylight.netconf.test.perf.notifications.NotificationsCounter)1 CreateSubscriptionInput (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.notification._1._0.rev080714.CreateSubscriptionInput)1 CreateSubscriptionInputBuilder (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.notification._1._0.rev080714.CreateSubscriptionInputBuilder)1 Streams (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netmod.notification.rev080714.netconf.Streams)1 StreamKey (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netmod.notification.rev080714.netconf.streams.StreamKey)1 ContainerNode (org.opendaylight.yangtools.yang.data.api.schema.ContainerNode)1