Search in sources :

Example 1 with StreamKey

use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netmod.notification.rev080714.netconf.streams.StreamKey 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

ExecutionException (java.util.concurrent.ExecutionException)1 WriteTransaction (org.opendaylight.mdsal.binding.api.WriteTransaction)1 Stream (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netmod.notification.rev080714.netconf.streams.Stream)1 StreamKey (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netmod.notification.rev080714.netconf.streams.StreamKey)1