use of com.google.common.util.concurrent.FluentFuture in project bgpcep by opendaylight.
the class BmpMonitoringStationImpl method closeServiceInstance.
@Override
public synchronized FluentFuture<? extends CommitInfo> closeServiceInstance() {
LOG.info("BMP Monitor Singleton Service {} instance closed, Monitor Id {}", getIdentifier().getName(), monitorId.getValue());
if (channel != null) {
channel.close().addListener((ChannelFutureListener) future -> {
Preconditions.checkArgument(future.isSuccess(), "Channel failed to close: %s", future.cause());
BmpMonitoringStationImpl.this.sessionManager.close();
});
}
final DOMDataTreeWriteTransaction wTx = domDataBroker.newWriteOnlyTransaction();
wTx.delete(LogicalDatastoreType.OPERATIONAL, yangMonitorId);
LOG.info("BMP monitoring station {} closed.", monitorId.getValue());
return wTx.commit();
}
Aggregations