SfcOvsUtil { public static Object submitCallable(Callable callable, ExecutorService executor) { Future future = null; Object result = null; future = executor.submit(callable); try { result = future.get(); } catch (InterruptedException | ExecutionException e) { LOG.warn("{} failed to: {}", callable.toString(), e); } return result; }  static Object submitCallable(Callable callable, ExecutorService executor); static InstanceIdentifier<Topology> buildOvsdbTopologyIID(); static InstanceIdentifier<Node> buildOvsdbNodeIID(OvsdbBridgeAugmentation ovsdbBridge); static InstanceIdentifier<Node> buildOvsdbNodeIID(String serviceFunctionForwarderName); static InstanceIdentifier<Node> buildOvsdbNodeIID(NodeId nodeId); static InstanceIdentifier<OvsdbBridgeAugmentation> buildOvsdbBridgeIID(OvsdbBridgeAugmentation ovsdbBridge); static InstanceIdentifier<OvsdbBridgeAugmentation> buildOvsdbBridgeIID(NodeId nodeId); static InstanceIdentifier<OvsdbBridgeAugmentation> buildOvsdbBridgeIID(String serviceFunctionForwarderName); static InstanceIdentifier<OvsdbTerminationPointAugmentation> buildOvsdbTerminationPointAugmentationIID(
            OvsdbBridgeAugmentation ovsdbBridge, OvsdbTerminationPointAugmentation ovsdbTerminationPoint); static InstanceIdentifier<TerminationPoint> buildOvsdbTerminationPointIID(String sffName,
            String sffDataPlaneLocatorName); static IpAddress convertStringToIpAddress(String ipAddressString); static String convertIpAddressToString(IpAddress ipAddress); static boolean putOvsdbTerminationPoints(OvsdbBridgeAugmentation ovsdbBridge,
                                                    List<SffDataPlaneLocator> sffDataPlaneLocatorList, ExecutorService executor); static boolean putOvsdbBridge(OvsdbBridgeAugmentation ovsdbBridge, ExecutorService executor); static boolean deleteOvsdbNode(InstanceIdentifier<Node> ovsdbNodeIID, ExecutorService executor); static boolean deleteOvsdbTerminationPoint(InstanceIdentifier<TerminationPoint> ovsdbTerminationPointIID,
            ExecutorService executor); static ServiceFunctionForwarder augmentSffWithOpenFlowNodeId(ServiceFunctionForwarder sff); static Ip getSffVxlanDataLocator(ServiceFunctionForwarder sff); static Node lookupTopologyNode(ServiceFunctionForwarder serviceFunctionForwarder, ExecutorService executor); static String getOpenFlowNodeIdForSff(ServiceFunctionForwarder serviceFunctionForwarder); static Node getManagerNodeByIp(IpAddress ip, ExecutorService executor); static OvsdbNodeAugmentation getOvsdbNodeAugmentation(OvsdbNodeRef nodeRef, ExecutorService executor); static Long getOfPortByName(String nodeName, String portName); static Long getVxlanOfPort(String nodeName); static Long getVxlanGpeOfPort(String nodeName); static Long getDpdkOfPort(String nodeName, String dpdkPortName); static final String OVSDB_OPTION_LOCAL_IP; static final String OVSDB_OPTION_REMOTE_IP; static final String OVSDB_OPTION_DST_PORT; static final String OVSDB_OPTION_NSP; static final String OVSDB_OPTION_NSI; static final String OVSDB_OPTION_IN_NSP; static final String OVSDB_OPTION_IN_NSI; static final String OVSDB_OPTION_OUT_NSP; static final String OVSDB_OPTION_OUT_NSI; static final String OVSDB_OPTION_NSHC1; static final String OVSDB_OPTION_NSHC2; static final String OVSDB_OPTION_NSHC3; static final String OVSDB_OPTION_NSHC4; static final String OVSDB_OPTION_KEY; static final String OVSDB_OPTION_EXTS; static final String OVSDB_OPTION_GPE; static final String OVSDB_OPTION_VALUE_FLOW; static final String DPL_NAME_DPDK; static final String DPL_NAME_DPDKVHOST; static final String DPL_NAME_DPDKVHOSTUSER; static final String DPL_NAME_INTERNAL; static final PortNumber NSH_VXLAN_TUNNEL_PORT; }
@Test public void testSubmitCallable() throws Exception { class CallableTestSuccess implements Callable { @Override public String call() throws Exception { return testString; } } class CallableTestException implements Callable { @Override public Object call() throws Exception { throw new InterruptedException(); } } ExecutorService executorService = Executors.newFixedThreadPool(10); Object object = SfcOvsUtil.submitCallable(new CallableTestSuccess(), executorService); assertNotNull("Must not be null", object); assertEquals("Must be equal", object, testString); object = SfcOvsUtil.submitCallable(new CallableTestException(), executorService); assertNull("Must be null", object); }