Bug 809: Enhancements to the toaster example
[controller.git] / opendaylight / md-sal / samples / toaster-consumer / src / main / yang / kitchen-service-impl.yang
similarity index 55%
rename from opendaylight/md-sal/samples/toaster-consumer/src/main/yang/toaster-consumer-impl.yang
rename to opendaylight/md-sal/samples/toaster-consumer/src/main/yang/kitchen-service-impl.yang
index 8bc1a5cc22ba1f0e1ca2e82af68961bedebcb71e..d22dfc619a30327612e7e72b76e3bfb22786f97f 100644 (file)
@@ -1,35 +1,40 @@
 // vi: set smarttab et sw=4 tabstop=4:
-module toaster-consumer-impl {
+module kitchen-service-impl {
 
     yang-version 1;
-    namespace "urn:opendaylight:params:xml:ns:yang:controller:config:toaster-consumer:impl";
-    prefix "toaster-consumer-impl";
+    namespace "urn:opendaylight:params:xml:ns:yang:controller:config:kitchen-service:impl";
+    prefix "kitchen-service-impl";
 
     import config { prefix config; revision-date 2013-04-05; }
     import rpc-context { prefix rpcx; revision-date 2013-06-17; }
 
-    import toaster-consumer { prefix toaster-consumer; revision-date 2014-01-31; }
     import opendaylight-md-sal-binding { prefix mdsal; revision-date 2013-10-28; }
 
     description
         "This module contains the base YANG definitions for
-        toaster-consumer impl implementation.";
+        kitchen-service impl implementation.";
 
     revision "2014-01-31" {
         description
             "Initial revision.";
     }
 
-    // This is the definition of a service implementation
-    identity toaster-consumer-impl {
+    // This is the definition of kitchen service interface identity.
+    identity kitchen-service {
+        base "config:service-type";
+        config:java-class "org.opendaylight.controller.sample.kitchen.api.KitchenService";
+    }
+
+    // This is the definition of kitchen service implementation module identity. 
+    identity kitchen-service-impl {
             base config:module-type;
-            config:provided-service toaster-consumer:toaster-consumer;
-            config:java-name-prefix ToasterConsumer;
+            config:provided-service kitchen-service;
+            config:java-name-prefix KitchenService;
     }
 
     augment "/config:modules/config:module/config:configuration" {
-        case toaster-consumer-impl {
-            when "/config:modules/config:module/config:type = 'toaster-consumer-impl'";
+        case kitchen-service-impl {
+            when "/config:modules/config:module/config:type = 'kitchen-service-impl'";
 
             container rpc-registry {
                 uses config:service-ref {
@@ -48,30 +53,31 @@ module toaster-consumer-impl {
                     }
                 }
             }
-
         }
     }
-
+    
     augment "/config:modules/config:module/config:state" {
-        case toaster-consumer-impl {
-            when "/config:modules/config:module/config:type = 'toaster-consumer-impl'";
-            rpcx:rpc-context-instance "make-hash-brown-toast-rpc";
+        case kitchen-service-impl {
+            when "/config:modules/config:module/config:type = 'kitchen-service-impl'";
+            
+            rpcx:rpc-context-instance "make-scrambled-with-wheat-rpc";
         }
     }
 
-    identity make-hash-brown-toast-rpc;
+    identity make-scrambled-with-wheat-rpc;
 
-    rpc make-hash-brown-toast {
+    rpc make-scrambled-with-wheat  {
+        description
+          "Shortcut JMX call to make breakfast with scrambled eggs and wheat toast for testing.";
+          
         input {
             uses rpcx:rpc-context-ref {
                 refine context-instance {
-                    rpcx:rpc-context-instance make-hash-brown-toast-rpc;
+                    rpcx:rpc-context-instance make-scrambled-with-wheat-rpc;
                 }
             }
-            leaf doneness {
-                type uint16;
-            }
         }
+        
         output {
             leaf result {
                 type boolean;