import org.opendaylight.controller.sal.binding.api.AbstractBindingAwareProvider;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
import org.opendaylight.controller.sal.binding.api.AbstractBindingAwareProvider;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
final NotificationProviderService notificationService = session.getSALService(NotificationProviderService.class);
final String name = "flow:1";
final TopologyKey key = new TopologyKey(new TopologyId(name));
final InstanceIdentifier<Topology> path = InstanceIdentifier
final NotificationProviderService notificationService = session.getSALService(NotificationProviderService.class);
final String name = "flow:1";
final TopologyKey key = new TopologyKey(new TopologyId(name));
final InstanceIdentifier<Topology> path = InstanceIdentifier
- .builder(NetworkTopology.class)
- .child(Topology.class, key)
- .build();
+ .create(NetworkTopology.class)
+ .child(Topology.class, key);
final FlowCapableTopologyExporter listener = new FlowCapableTopologyExporter(processor, path);
this.listenerRegistration = notificationService.registerNotificationListener(listener);
final FlowCapableTopologyExporter listener = new FlowCapableTopologyExporter(processor, path);
this.listenerRegistration = notificationService.registerNotificationListener(listener);
- final DataModificationTransaction tx = dataService.beginTransaction();
- tx.putOperationalData(path, new TopologyBuilder().setKey(key).build());
+ final ReadWriteTransaction tx = dataBroker.newReadWriteTransaction();
+ tx.put(LogicalDatastoreType.OPERATIONAL, path, new TopologyBuilder().setKey(key).build(), true);
} catch (InterruptedException | ExecutionException e) {
LOG.warn("Initial topology export failed, continuing anyway", e);
}
} catch (InterruptedException | ExecutionException e) {
LOG.warn("Initial topology export failed, continuing anyway", e);
}