944a63dbf6f75b0b9408300376edc1b5ed2cf94b
[yangtools.git] / yang / yang-parser-impl / src / test / resources / sal-broker-impl / opendaylight-dom-broker-impl.yang
1 module opendaylight-sal-dom-broker-impl {
2     yang-version 1;
3     namespace "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl";
4     prefix "broker";
5
6     import config { prefix config; revision-date 2013-04-05; }
7     import ietf-yang-types { prefix yang; }
8     import opendaylight-md-sal-dom { prefix sal; }
9     import opendaylight-md-sal-common { prefix common; }
10     import opendaylight-config-dom-datastore { prefix config-dom-store-spi; }
11     import opendaylight-operational-dom-datastore { prefix operational-dom-store-spi; }
12     import rpc-context { prefix rpcx; revision-date 2013-06-17; }
13
14     description
15         "Service definition for Binding Aware MD-SAL. Note: The dom-inmemory-data-broker
16         utilizes configurable config-dom-datastore and operation-dom-datastore.
17         If configuration is not done for this stores then it defaults
18         to InMemoryDOMDataStore";
19
20     revision "2013-10-28" {
21         description
22                 "Initial revision";
23     }
24
25     identity dom-broker-impl {
26         base config:module-type;
27         config:provided-service sal:dom-broker-osgi-registry;
28         config:java-name-prefix DomBrokerImpl;
29     }
30
31     identity dom-inmemory-data-broker {
32         base config:module-type;
33         config:provided-service sal:dom-async-data-broker;
34     }
35
36     identity schema-service-singleton {
37         base config:module-type;
38         config:provided-service sal:schema-service;
39         config:java-name-prefix SchemaServiceImplSingleton;
40     }
41
42     typedef max-queue-depth {
43         type uint32 {
44             range 1..1073741824;
45         }
46     }
47
48     augment "/config:modules/config:module/config:configuration" {
49         case dom-broker-impl {
50             when "/config:modules/config:module/config:type = 'dom-broker-impl'";
51
52             container async-data-broker {
53                 uses config:service-ref {
54                     refine type {
55                         mandatory false;
56                         config:required-identity sal:dom-async-data-broker;
57                     }
58                 }
59             }
60
61             container root-schema-service {
62                 uses config:service-ref {
63                     refine type {
64                         mandatory false;
65                         config:required-identity sal:schema-service;
66                     }
67                 }
68             }
69
70             leaf notification-queue-depth {
71                 description "Maximum number of elements in the notification queue, must be
72                                 power-of-two.";
73                 type max-queue-depth;
74                 default 65536;
75             }
76             leaf notification-queue-spin {
77                 description "Number of milliseconds notification queue should spin for new
78                                 requests before parking.";
79                 type uint16;
80                 units milliseconds;
81                 default 1;
82             }
83             leaf notification-queue-park {
84                 description "Number of milliseconds notification queue should park for new
85                                 requests before blocking.";
86                 type uint16;
87                 units milliseconds;
88                 default 30;
89             }
90         }
91     }
92
93     grouping dom-broker-config {
94         container schema-service {
95             uses config:service-ref {
96                 refine type {
97                     mandatory false;
98                     config:required-identity sal:schema-service;
99                 }
100             }
101         }
102
103         container config-data-store {
104             uses config:service-ref {
105                 refine type {
106                     mandatory false;
107                     config:required-identity config-dom-store-spi:config-dom-datastore;
108                 }
109             }
110         }
111
112         container operational-data-store {
113             uses config:service-ref {
114                 refine type {
115                     mandatory false;
116                     config:required-identity operational-dom-store-spi:operational-dom-datastore;
117                 }
118             }
119         }
120
121         leaf max-data-broker-future-callback-queue-size {
122             default 1000;
123             type uint16;
124             description "The maximum queue size for the data broker's commit future callback
125                         executor.";
126         }
127
128         leaf max-data-broker-future-callback-pool-size {
129             default 20;
130             type uint16;
131             description "The maximum thread pool size for the data broker's commit future
132                         callback executor.";
133         }
134
135         leaf max-data-broker-commit-queue-size {
136             default 5000;
137             type uint16;
138             description "The maximum queue size for the data broker's commit executor.";
139         }
140     }
141
142     grouping dom-broker-operational {
143         leaf total-commits {
144             type uint64;
145         }
146
147         leaf average-commit {
148             type uint64;
149             units ns;
150         }
151
152         leaf longest-commit-duration {
153             type uint64;
154             units ns;
155         }
156
157         leaf longest-commit-timestamp {
158             type yang:date-and-time;
159         }
160
161         leaf shortest-commit-duration {
162             type uint64;
163             units ns;
164         }
165
166         leaf shortest-commit-timestamp {
167             type yang:date-and-time;
168         }
169
170         rpcx:rpc-context-instance dom-broker-rpc-ctx;
171     }
172
173     identity dom-broker-rpc-ctx;
174
175     rpc reset-statistics {
176         description
177                 "JMX call to clear the toasts-made counter.";
178
179         input {
180             uses rpcx:rpc-context-ref {
181                 refine context-instance {
182                     rpcx:rpc-context-instance dom-broker-rpc-ctx;
183                 }
184             }
185         }
186     }
187
188     augment "/config:modules/config:module/config:configuration" {
189         case dom-inmemory-data-broker {
190             when "/config:modules/config:module/config:type = 'dom-inmemory-data-broker'";
191
192             uses dom-broker-config;
193         }
194     }
195
196     augment "/config:modules/config:module/config:state" {
197         case dom-inmemory-data-broker {
198             when "/config:modules/config:module/config:type = 'dom-inmemory-data-broker'";
199
200             uses dom-broker-operational;
201         }
202     }
203
204     augment "/config:modules/config:module/config:state" {
205         case schema-service-singleton {
206             when "/config:modules/config:module/config:type = 'schema-service-singleton'";
207         }
208     }
209
210     augment "/config:modules/config:module/config:state" {
211         case dom-broker-impl {
212             when "/config:modules/config:module/config:type = 'dom-broker-impl'";
213             container data {
214                 uses common:data-state;
215             }
216         }
217     }
218 }