+ private Set<Port> getInterfaces(final Uuid deviceId) {
+ final Set<Port> interfaces = new HashSet<>();
+ InstanceIdentifier<Ports> path = InstanceIdentifier.create(Neutron.class).child(Ports.class);
+
+ try (ReadOnlyTransaction tx = broker.newReadOnlyTransaction()) {
+ final CheckedFuture<Optional<Ports>, ReadFailedException> future = tx.read(LogicalDatastoreType.CONFIGURATION, path);
+ Optional<Ports> optional = future.checkedGet();
+ if (optional.isPresent()) {
+ for (final Port port : optional.get().getPort()) {
+ if (port.getDeviceOwner().equals("network:router_interface") && port.getDeviceId().equals(deviceId.getValue())) {
+ interfaces.add(port);
+ }
+ }
+ }
+ } catch (final ReadFailedException e) {
+ LOG.warn("Failed to read {}", path, e);
+ }
+
+ return interfaces;
+ }
+