@SuppressWarnings("unchecked") @Test public void testGetOvsdbBridgeFromTerminationPoint() { when(readTransaction.read(any(LogicalDatastoreType.class), any(InstanceIdentifier.class))) .thenReturn(ovsdbBridgeFuture); assertNotNull(OvsdbHelper.getOvsdbBridgeFromTerminationPoint(tpIid, dataBroker)); verify(readTransaction).read(any(LogicalDatastoreType.class), any(InstanceIdentifier.class)); }
public static OvsdbBridgeAugmentation getOvsdbBridgeFromTerminationPoint( InstanceIdentifier<OvsdbTerminationPointAugmentation> tpIid, DataBroker dataBroker) { InstanceIdentifier<Node> nodeIid = tpIid.firstIdentifierOf(Node.class); if (nodeIid != null) { InstanceIdentifier<OvsdbBridgeAugmentation> ovsdbBridgeIid = nodeIid.augmentation(OvsdbBridgeAugmentation.class); if (ovsdbBridgeIid != null) { ReadTransaction transaction = dataBroker.newReadOnlyTransaction(); Optional<OvsdbBridgeAugmentation> ovsdbBridge = readFromDs(LogicalDatastoreType.OPERATIONAL, ovsdbBridgeIid, transaction); if (ovsdbBridge.isPresent()) { return ovsdbBridge.get(); } } } return null; }
OvsdbHelper { public static OvsdbBridgeAugmentation getOvsdbBridgeFromTerminationPoint( InstanceIdentifier<OvsdbTerminationPointAugmentation> tpIid, DataBroker dataBroker) { InstanceIdentifier<Node> nodeIid = tpIid.firstIdentifierOf(Node.class); if (nodeIid != null) { InstanceIdentifier<OvsdbBridgeAugmentation> ovsdbBridgeIid = nodeIid.augmentation(OvsdbBridgeAugmentation.class); if (ovsdbBridgeIid != null) { ReadTransaction transaction = dataBroker.newReadOnlyTransaction(); Optional<OvsdbBridgeAugmentation> ovsdbBridge = readFromDs(LogicalDatastoreType.OPERATIONAL, ovsdbBridgeIid, transaction); if (ovsdbBridge.isPresent()) { return ovsdbBridge.get(); } } } return null; } }
OvsdbHelper { public static OvsdbBridgeAugmentation getOvsdbBridgeFromTerminationPoint( InstanceIdentifier<OvsdbTerminationPointAugmentation> tpIid, DataBroker dataBroker) { InstanceIdentifier<Node> nodeIid = tpIid.firstIdentifierOf(Node.class); if (nodeIid != null) { InstanceIdentifier<OvsdbBridgeAugmentation> ovsdbBridgeIid = nodeIid.augmentation(OvsdbBridgeAugmentation.class); if (ovsdbBridgeIid != null) { ReadTransaction transaction = dataBroker.newReadOnlyTransaction(); Optional<OvsdbBridgeAugmentation> ovsdbBridge = readFromDs(LogicalDatastoreType.OPERATIONAL, ovsdbBridgeIid, transaction); if (ovsdbBridge.isPresent()) { return ovsdbBridge.get(); } } } return null; }  }
OvsdbHelper { public static OvsdbBridgeAugmentation getOvsdbBridgeFromTerminationPoint( InstanceIdentifier<OvsdbTerminationPointAugmentation> tpIid, DataBroker dataBroker) { InstanceIdentifier<Node> nodeIid = tpIid.firstIdentifierOf(Node.class); if (nodeIid != null) { InstanceIdentifier<OvsdbBridgeAugmentation> ovsdbBridgeIid = nodeIid.augmentation(OvsdbBridgeAugmentation.class); if (ovsdbBridgeIid != null) { ReadTransaction transaction = dataBroker.newReadOnlyTransaction(); Optional<OvsdbBridgeAugmentation> ovsdbBridge = readFromDs(LogicalDatastoreType.OPERATIONAL, ovsdbBridgeIid, transaction); if (ovsdbBridge.isPresent()) { return ovsdbBridge.get(); } } } return null; }  static OvsdbBridgeAugmentation getOvsdbBridgeFromTerminationPoint(
            InstanceIdentifier<OvsdbTerminationPointAugmentation> tpIid, DataBroker dataBroker); static Node getNodeFromBridgeRef(OvsdbBridgeRef bridgeRef, DataBroker dataBroker); static OvsdbTerminationPointAugmentation getOvsdbTerminationPoint(
            InstanceIdentifier<OvsdbTerminationPointAugmentation> tpIid, DataBroker dataBroker); static Node getNode(Node node, List<TerminationPoint> tps,
            OvsdbBridgeAugmentation ovsdbBridgeAugmentation); static OvsdbBridgeAugmentation buildOvsdbBridgeAugmentation(OvsdbBridgeAugmentation bridge,
            OvsdbNodeAugmentation ovsdbNode); static List<TerminationPoint> buildTerminationPoints(OvsdbBridgeAugmentation bridge,
            OvsdbTerminationPointAugmentation ovsdbTp, AbstractTunnelType tunnelType); static String generateTpName(OvsdbBridgeAugmentation bridge, AbstractTunnelType tunnelType); static OvsdbTerminationPointAugmentation buildOvsdbTerminationPointAugmentation(
            OvsdbBridgeAugmentation bridge, List<Options> options, AbstractTunnelType tunnelType); static void setOption(List<Options> options, String key, String value); static IpAddress getManagerIp(OvsdbNodeAugmentation ovsdbNode); static IpAddress getNodeIp(OvsdbNodeAugmentation ovsdbNode); static List<ControllerEntry> buildControllerEntries(IpAddress ip); static OvsdbNodeAugmentation getManagerNode(OvsdbBridgeAugmentation bridge, DataBroker dataBroker); static Node getTopologyNode(InstanceIdentifier<Node> nodeIid, DataBroker dataBroker); static void createTunnelPort(InstanceIdentifier<Node> nodeIid,
            Node node, AbstractTunnelType tunnelType, DataBroker dataBroker); }
OvsdbHelper { public static OvsdbBridgeAugmentation getOvsdbBridgeFromTerminationPoint( InstanceIdentifier<OvsdbTerminationPointAugmentation> tpIid, DataBroker dataBroker) { InstanceIdentifier<Node> nodeIid = tpIid.firstIdentifierOf(Node.class); if (nodeIid != null) { InstanceIdentifier<OvsdbBridgeAugmentation> ovsdbBridgeIid = nodeIid.augmentation(OvsdbBridgeAugmentation.class); if (ovsdbBridgeIid != null) { ReadTransaction transaction = dataBroker.newReadOnlyTransaction(); Optional<OvsdbBridgeAugmentation> ovsdbBridge = readFromDs(LogicalDatastoreType.OPERATIONAL, ovsdbBridgeIid, transaction); if (ovsdbBridge.isPresent()) { return ovsdbBridge.get(); } } } return null; }  static OvsdbBridgeAugmentation getOvsdbBridgeFromTerminationPoint(
            InstanceIdentifier<OvsdbTerminationPointAugmentation> tpIid, DataBroker dataBroker); static Node getNodeFromBridgeRef(OvsdbBridgeRef bridgeRef, DataBroker dataBroker); static OvsdbTerminationPointAugmentation getOvsdbTerminationPoint(
            InstanceIdentifier<OvsdbTerminationPointAugmentation> tpIid, DataBroker dataBroker); static Node getNode(Node node, List<TerminationPoint> tps,
            OvsdbBridgeAugmentation ovsdbBridgeAugmentation); static OvsdbBridgeAugmentation buildOvsdbBridgeAugmentation(OvsdbBridgeAugmentation bridge,
            OvsdbNodeAugmentation ovsdbNode); static List<TerminationPoint> buildTerminationPoints(OvsdbBridgeAugmentation bridge,
            OvsdbTerminationPointAugmentation ovsdbTp, AbstractTunnelType tunnelType); static String generateTpName(OvsdbBridgeAugmentation bridge, AbstractTunnelType tunnelType); static OvsdbTerminationPointAugmentation buildOvsdbTerminationPointAugmentation(
            OvsdbBridgeAugmentation bridge, List<Options> options, AbstractTunnelType tunnelType); static void setOption(List<Options> options, String key, String value); static IpAddress getManagerIp(OvsdbNodeAugmentation ovsdbNode); static IpAddress getNodeIp(OvsdbNodeAugmentation ovsdbNode); static List<ControllerEntry> buildControllerEntries(IpAddress ip); static OvsdbNodeAugmentation getManagerNode(OvsdbBridgeAugmentation bridge, DataBroker dataBroker); static Node getTopologyNode(InstanceIdentifier<Node> nodeIid, DataBroker dataBroker); static void createTunnelPort(InstanceIdentifier<Node> nodeIid,
            Node node, AbstractTunnelType tunnelType, DataBroker dataBroker);  }