BwmonitorImpl implements AltoBwmonitorService { @Override public Future<RpcResult<BwmonitorSubscribeOutput>> bwmonitorSubscribe(BwmonitorSubscribeInput input) { boolean success = true; if(!dataTreeInitialized) { success = initializeDataTree(); } if (success) { List<String> ports = input.getPortId(); if (ports != null) { for (String port : ports) { success = BwmonitorUtils.writeToSpeeds(port, 0L, 0L, 0L, 0L, db); if (success) { bwFetchingService.addListeningPort(port); LOG.debug("Subscribe node: {}", port); } else { LOG.debug("Fail to register node: {}", port); break; } } } } return RpcResultBuilder.success(new BwmonitorSubscribeOutputBuilder() .setResult(success).build()).buildFuture(); } BwmonitorImpl(DataBroker dataBroker); @Override Future<RpcResult<BwmonitorSubscribeOutput>> bwmonitorSubscribe(BwmonitorSubscribeInput input); @Override Future<RpcResult<BwmonitorQueryOutput>> bwmonitorQuery(BwmonitorQueryInput input); @Override Future<RpcResult<BwmonitorUnsubscribeOutput>> bwmonitorUnsubscribe(BwmonitorUnsubscribeInput input); void close();  }
@Test public void testBwmonitorSubscribe() throws Exception { service1.bwmonitorSubscribe(new BwmonitorSubscribeInputBuilder() .setPortId(Arrays.asList("testPort1")) .build()); }