SfcGeniusInterfaceServiceManager implements ISfcGeniusInterfaceServiceHandler { @Override public void interfaceStateDown(String interfaceName, BigInteger nodeId) { ReadWriteTransaction readWriteTransaction = dataBroker.newReadWriteTransaction(); SfcGeniusServiceHandler serviceHandler = getSfcGeniusServiceHandler(readWriteTransaction); serviceHandler.interfaceStateDown(interfaceName, nodeId) .thenCompose((aVoid) -> SfcGeniusUtils.toCompletableFuture(readWriteTransaction.submit(), executor)) .handle((aVoid, exception) -> { if (exception != null) { LOG.error("Error handling interface {} state up on {}", interfaceName, nodeId, exception); } return null; }) .join(); } SfcGeniusInterfaceServiceManager(DataBroker dataBroker,
                                            RpcProviderRegistry rpcProviderRegistry,
                                            Executor executor); @Override void bindInterfacesOfServiceFunction(String sfName); @Override void unbindInterfacesOfServiceFunction(String sfName); @Override void interfaceStateUp(String interfaceName, BigInteger dpnId); @Override void interfaceStateDown(String interfaceName, BigInteger nodeId);  }
@Test public void interfaceStateDown() throws Exception { sfcGeniusInterfaceServiceManager.interfaceStateDown("IF1", BigInteger.valueOf(7)); verify(sfcGeniusServiceHandler).interfaceStateDown("IF1", BigInteger.valueOf(7)); verify(readWriteTransaction).submit(); }