Search in sources :

Example 1 with ToasterRestocked

use of org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.ToasterRestocked 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());
}
Also used : ToasterRestocked(org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.ToasterRestocked) ToasterRestockedBuilder(org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.ToasterRestockedBuilder)

Aggregations

ToasterRestocked (org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.ToasterRestocked)1 ToasterRestockedBuilder (org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.ToasterRestockedBuilder)1