BwmonitorImpl implements AltoBwmonitorService { @Override public Future<RpcResult<BwmonitorUnsubscribeOutput>> bwmonitorUnsubscribe(BwmonitorUnsubscribeInput input) { List<String> ports = input.getPortId(); BwmonitorUnsubscribeOutputBuilder builder = new BwmonitorUnsubscribeOutputBuilder() .setResult(true); if (ports != null) { WriteTransaction transaction = db.newWriteOnlyTransaction(); for (String port : ports) { bwFetchingService.removeListeningPort(port); InstanceIdentifier<Port> iid = InstanceIdentifier.create(Speeds.class) .child(Port.class, new PortKey(port)); transaction.delete(LogicalDatastoreType.OPERATIONAL, iid); } transaction.submit(); } return RpcResultBuilder.success(builder.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 testBwmonitorUnsubscribe() throws Exception { service1.bwmonitorUnsubscribe(new BwmonitorUnsubscribeInputBuilder() .setPortId(Arrays.asList("tsetPort1")) .build()); }