Barrier turn on/off-add switcher value to Config-Subsystem
[openflowjava.git] / openflow-protocol-impl / src / main / yang / openflow-switch-connection-provider-impl.yang
index 4ca3188622ff2ef96c596364b6cd40746e100886..aead17584718b7698f4a9aeb83396a85d97783c8 100644 (file)
@@ -7,6 +7,7 @@ module openflow-switch-connection-provider-impl {
     import openflow-switch-connection-provider {prefix openflow-switch-connection-provider; revision-date 2014-03-28; }
     import ietf-inet-types {prefix ietf-inet; revision-date 2010-09-24; }
     import openflow-configuration {prefix of-config; revision-date 2014-06-30; }
+    import rpc-context { prefix rpcx; revision-date 2013-06-17; }
 
     description
         "openflow-switch-connection-provider";
@@ -22,11 +23,24 @@ module openflow-switch-connection-provider-impl {
         config:java-name-prefix SwitchConnectionProvider;
     }
 
+    identity statistics-collection-service-impl {
+        description
+            "This is the definition of statistics collection module identity.";
+        base config:module-type;
+        config:provided-service openflow-switch-connection-provider:statistics-collection-service;
+        config:java-name-prefix StatisticsCollection;
+    }
 
     augment "/config:modules/config:module/config:configuration" {
         case openflow-switch-connection-provider-impl {
             when "/config:modules/config:module/config:type = 'openflow-switch-connection-provider-impl'";
 
+            leaf use-barrier {
+                description "Enable barrier in Openflow java";
+                type boolean;
+                default true;
+            }
+
             leaf port {
                 description "local listening port";
                 type uint16;
@@ -92,9 +106,14 @@ module openflow-switch-connection-provider-impl {
                     type uint16;
                 }
             }
+        }
+
+        case statistics-collection-service-impl {
+            when "/config:modules/config:module/config:type = 'statistics-collection-service-impl'";
+
             container statistics {
                 leaf statistics-collect {
-                    description "Toggle of collecting statistics";
+                    description "Toggle statistics collecting";
                     type boolean;
                 }
                 leaf log-report-delay {
@@ -102,6 +121,67 @@ module openflow-switch-connection-provider-impl {
                     type uint16;
                 }
             }
+            list openflow-switch-connection-provider {
+                uses config:service-ref {
+                    refine type {
+                        mandatory true;
+                        config:required-identity openflow-switch-connection-provider:openflow-switch-connection-provider;
+                    }
+                }
+            }
+        }
+    }
+
+    augment "/config:modules/config:module/config:state" {
+        case statistics-collection-service-impl {
+            when "/config:modules/config:module/config:type = 'statistics-collection-service-impl'";
+
+            description
+                "MXBean designed for Message Statistic providing to JConsole.";
+
+            leaf msgStatistics {
+                type string;
+            }
+
+            rpcx:rpc-context-instance "print-ofjava-statistics-rpc";
+            rpcx:rpc-context-instance "reset-ofjava-statistics-rpc";
+        }
+    }
+
+    identity print-ofjava-statistics-rpc;
+    identity reset-ofjava-statistics-rpc;
+
+    rpc print-ofjava-statistics {
+        description
+            "Shortcut JMX call to printOfjavaStatistics.";
+        input {
+            uses rpcx:rpc-context-ref {
+                refine context-instance {
+                    rpcx:rpc-context-instance print-ofjava-statistics-rpc;
+                }
+            }
+        }
+        output {
+            leaf result {
+                type string;
+            }
+        }
+    }
+
+    rpc reset-ofjava-statistics {
+        description
+            "Shortcut JMX call to resetOfjavaStatistics.";
+        input {
+            uses rpcx:rpc-context-ref {
+                refine context-instance {
+                    rpcx:rpc-context-instance reset-ofjava-statistics-rpc;
+                }
+            }
+        }
+        output {
+            leaf result {
+                type string;
+            }
         }
     }
 }
\ No newline at end of file