X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsamples%2Ftoaster-provider%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsample%2Ftoaster%2Fprovider%2FOpendaylightToaster.java;h=2ecd7e7b684fe8bdafd6af17527cbb21daeee83f;hp=b4da5a3d226f05bfd02fe21890ea0307e7efb2ce;hb=b80124e3f7b11cf2f5e5bd4a6b033d855ff4d0d4;hpb=e159106bc148e76fc1e3e3c780bdd740d99e74ed diff --git a/opendaylight/md-sal/samples/toaster-provider/src/main/java/org/opendaylight/controller/sample/toaster/provider/OpendaylightToaster.java b/opendaylight/md-sal/samples/toaster-provider/src/main/java/org/opendaylight/controller/sample/toaster/provider/OpendaylightToaster.java index b4da5a3d22..2ecd7e7b68 100644 --- a/opendaylight/md-sal/samples/toaster-provider/src/main/java/org/opendaylight/controller/sample/toaster/provider/OpendaylightToaster.java +++ b/opendaylight/md-sal/samples/toaster-provider/src/main/java/org/opendaylight/controller/sample/toaster/provider/OpendaylightToaster.java @@ -37,7 +37,9 @@ import org.opendaylight.controller.sal.binding.api.data.DataChangeListener; import org.opendaylight.yangtools.yang.binding.DataObject; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.opendaylight.yangtools.yang.common.RpcError; +import org.opendaylight.yangtools.yang.common.RpcError.ErrorType; import org.opendaylight.yangtools.yang.common.RpcResult; +import org.opendaylight.yangtools.yang.common.RpcError.ErrorSeverity; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -157,14 +159,15 @@ public class OpendaylightToaster implements ToasterService, ToasterProviderRunti LOG.info( "Toaster is already making toast" ); RpcResult result = Rpcs. getRpcResult(false, null, Arrays.asList( - RpcErrors.getRpcError( null, null, null, null, - "Toaster is busy", null, null ) ) ); + RpcErrors.getRpcError( "", "in-use", null, ErrorSeverity.WARNING, + "Toaster is busy", ErrorType.APPLICATION, null ) ) ); return Futures.immediateFuture(result); } else if( outOfBread() ) { RpcResult result = Rpcs. getRpcResult(false, null, Arrays.asList( - RpcErrors.getRpcError( null, null, null, null, - "Toaster is out of bread", null, null ) ) ); + RpcErrors.getRpcError( "out-of-stock", "resource-denied", null, null, + "Toaster is out of bread", + ErrorType.APPLICATION, null ) ) ); return Futures.immediateFuture(result); } else {