* Listens on changes in netconf notification stream availability and writes
* changes to the data store.
*/
-public final class NotificationToMdsalWriter implements AutoCloseable, NetconfNotificationCollector.NetconfNotificationStreamListener {
+public final class NotificationToMdsalWriter implements AutoCloseable, NetconfNotificationCollector
+ .NetconfNotificationStreamListener {
private static final Logger LOG = LoggerFactory.getLogger(NotificationToMdsalWriter.class);
Futures.addCallback(submit, new FutureCallback<Void>() {
@Override
- public void onSuccess(Void aVoid) {
+ public void onSuccess(Void avoid) {
LOG.debug("Streams cleared successfully");
}
}
/**
- * Invoke by blueprint
+ * Invoked by blueprint.
*/
public void start() {
notificationRegistration = netconfNotificationCollector.registerStreamListener(this);
public void onStreamRegistered(Stream stream) {
final WriteTransaction tx = dataBroker.newWriteOnlyTransaction();
- final InstanceIdentifier streamIdentifier = InstanceIdentifier.create(Netconf.class).child(Streams.class).
- builder().child(Stream.class, stream.getKey()).build();
+ final InstanceIdentifier streamIdentifier = InstanceIdentifier.create(Netconf.class).child(Streams.class)
+ .builder().child(Stream.class, stream.getKey()).build();
tx.merge(LogicalDatastoreType.OPERATIONAL, streamIdentifier, stream, true);
try {
final WriteTransaction tx = dataBroker.newWriteOnlyTransaction();
final StreamKey streamKey = new StreamKey(stream);
- final InstanceIdentifier streamIdentifier = InstanceIdentifier.create(Netconf.class).child(Streams.class).
- builder().child(Stream.class, streamKey).build();
+ final InstanceIdentifier streamIdentifier = InstanceIdentifier.create(Netconf.class).child(Streams.class)
+ .builder().child(Stream.class, streamKey).build();
tx.delete(LogicalDatastoreType.OPERATIONAL, streamIdentifier);