-
- private Optional<UUID> getBridgeUUID(InstanceIdentifier<OvsdbBridgeAugmentation> ovsdbManagedNodeIid) {
- Optional<UUID> result = Optional.absent();
- ReadOnlyTransaction transaction = db.newReadOnlyTransaction();
- CheckedFuture<Optional<OvsdbBridgeAugmentation>, ReadFailedException> future
- = transaction.read(LogicalDatastoreType.OPERATIONAL, ovsdbManagedNodeIid);
- Optional<OvsdbBridgeAugmentation> optional;
- try {
- optional = future.get();
- if (optional.isPresent()) {
- OvsdbBridgeAugmentation bridge = (OvsdbBridgeAugmentation) optional.get();
- if (bridge != null && bridge.getBridgeUuid() != null) {
- result = Optional.of(new UUID(bridge.getBridgeUuid().getValue()));
- }
- }
- } catch (InterruptedException e) {
- LOG.warn("Unable to retrieve bridge from operational store",e);
- } catch (ExecutionException e) {
- LOG.warn("Unable to retrieve bridge from operational store",e);
- }
- transaction.close();
- return result;
- }
-