use of org.opendaylight.yang.gen.v1.tag.opendaylight.org._2017.controller.yang.lowlevel.control.rev170215.UnsubscribeYnlOutput in project controller by opendaylight.
the class MdsalLowLevelTestProvider method unsubscribeYnl.
@Override
public Future<RpcResult<UnsubscribeYnlOutput>> unsubscribeYnl(final UnsubscribeYnlInput input) {
LOG.debug("Received unsubscribe-ynl, input: {}", input);
if (!ynlRegistrations.containsKey(input.getId())) {
final RpcError rpcError = RpcResultBuilder.newError(ErrorType.APPLICATION, "missing-registration", "No ynl listener with this id registered.");
final RpcResult<UnsubscribeYnlOutput> result = RpcResultBuilder.<UnsubscribeYnlOutput>failed().withRpcError(rpcError).build();
return Futures.immediateFuture(result);
}
final ListenerRegistration<YnlListener> reg = ynlRegistrations.remove(input.getId());
final UnsubscribeYnlOutput output = reg.getInstance().getOutput();
reg.close();
return Futures.immediateFuture(RpcResultBuilder.<UnsubscribeYnlOutput>success().withResult(output).build());
}
Aggregations