use of org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.ToasterRestockedBuilder in project controller by opendaylight.
the class OpendaylightToaster method restockToaster.
/**
* RestConf RPC call implemented from the ToasterService interface.
* Restocks the bread for the toaster, resets the toastsMade counter to 0, and sends a
* ToasterRestocked notification.
*/
@Override
public Future<RpcResult<java.lang.Void>> restockToaster(final RestockToasterInput input) {
LOG.info("restockToaster: " + input);
amountOfBreadInStock.set(input.getAmountOfBreadToStock());
if (amountOfBreadInStock.get() > 0) {
ToasterRestocked reStockedNotification = new ToasterRestockedBuilder().setAmountOfBread(input.getAmountOfBreadToStock()).build();
notificationProvider.offerNotification(reStockedNotification);
}
return Futures.immediateFuture(RpcResultBuilder.<Void>success().build());
}
Aggregations