BUG 3067: Added support for blocking if schema is not available.
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / main / yang / opendaylight-binding-broker-impl.yang
1 module opendaylight-sal-binding-broker-impl {
2     yang-version 1;
3     namespace "urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl";
4     prefix "binding-impl";
5
6     import config { prefix config; revision-date 2013-04-05; }
7     import opendaylight-md-sal-binding {prefix sal;}
8     import opendaylight-md-sal-dom {prefix dom;}
9     import opendaylight-md-sal-common {prefix common;}
10
11     description
12         "Service definition for Binding Aware MD-SAL.";
13
14     revision "2013-10-28" {
15         description
16             "Initial revision";
17     }
18
19     identity binding-dom-mapping-service {
20         base config:service-type;
21         config:java-class "org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec";
22     }
23
24     /* FIXME: move to opendaylight-md-sal-binding (cannot be there due to Class name confict with old implementation)*/
25     identity binding-new-notification-service {
26         base config:service-type;
27         config:java-class "org.opendaylight.controller.md.sal.binding.api.NotificationService";
28     }
29
30     /* TODO: move to opendaylight-md-sal-binding (cannot be there due to Class name confict with old implementation)*/
31     identity binding-new-notification-publish-service {
32         base config:service-type;
33         config:java-class "org.opendaylight.controller.md.sal.binding.api.NotificationPublishService";
34     }
35
36     identity binding-broker-impl {
37         base config:module-type;
38         config:provided-service sal:binding-broker-osgi-registry;
39         config:provided-service sal:binding-rpc-registry;
40         config:java-name-prefix BindingBrokerImpl;
41     }
42
43     identity binding-data-compatible-broker {
44         base config:module-type;
45         config:provided-service sal:binding-data-broker;
46         config:provided-service sal:binding-data-consumer-broker;
47         config:java-name-prefix ForwardedCompatibleDataBrokerImpl;
48     }
49
50     identity binding-forwarded-data-broker {
51         base config:module-type;
52         config:provided-service sal:binding-async-data-broker;
53         config:java-name-prefix BindingAsyncDataBrokerImpl;
54     }
55
56     identity binding-rpc-broker {
57         base config:module-type;
58         config:provided-service sal:binding-rpc-registry;
59         config:java-name-prefix RpcBrokerImpl;
60     }
61
62     identity binding-notification-broker {
63         base config:module-type;
64         config:provided-service sal:binding-notification-service;
65         config:provided-service sal:binding-notification-subscription-service;
66         config:java-name-prefix NotificationBrokerImpl;
67     }
68
69     identity runtime-generated-mapping {
70         base config:module-type;
71         config:provided-service binding-dom-mapping-service;
72         config:provided-service sal:binding-codec-tree-factory;
73         config:provided-service sal:binding-normalized-node-serializer;
74         config:java-name-prefix RuntimeMapping;
75     }
76
77     identity binding-notification-adapter {
78         base config:module-type;
79         config:provided-service binding-new-notification-service;
80         config:java-name-prefix BindingNotificationAdapter;
81     }
82
83     identity binding-notification-publish-adapter {
84         base config:module-type;
85         config:provided-service binding-new-notification-publish-service;
86         config:java-name-prefix BindingNotificationPublishAdapter;
87     }
88
89     grouping dom-forwarding-component {
90         container dom-async-broker {
91                 uses config:service-ref {
92                     refine type {
93                         mandatory true;
94                         config:required-identity dom:dom-broker-osgi-registry;
95                     }
96                 }
97             }
98
99         container binding-mapping-service {
100             uses config:service-ref {
101                 refine type {
102                     mandatory true;
103                     config:required-identity binding-dom-mapping-service;
104                 }
105             }
106         }
107     }
108
109     augment "/config:modules/config:module/config:configuration" {
110         case binding-broker-impl {
111             when "/config:modules/config:module/config:type = 'binding-broker-impl'";
112
113             /*
114             container rpc-registry {
115                 uses config:service-ref {
116                     refine type {
117                         mandatory true;
118                         config:required-identity sal:binding-rpc-registry;
119                     }
120                 }
121             }*/
122             container binding-broker-impl {
123                 uses dom-forwarding-component;
124     
125                 container data-broker {
126                     uses config:service-ref {
127                         refine type {
128                             mandatory false;
129                             config:required-identity sal:binding-data-broker;
130                         }
131                     }
132                 }
133     
134                 container notification-service {
135                     uses config:service-ref {
136                         refine type {
137                             mandatory true;
138                             config:required-identity sal:binding-notification-service;
139                         }
140                     }
141                 }
142     
143                 container root-data-broker {
144                     uses config:service-ref {
145                         refine type {
146                             mandatory false;
147                             config:required-identity sal:binding-async-data-broker;
148                         }
149                     }
150                 }
151             }
152         }
153     }
154
155     augment "/config:modules/config:module/config:configuration" {
156         case binding-data-compatible-broker {
157             when "/config:modules/config:module/config:type = 'binding-data-compatible-broker'";
158
159             container binding-data-compatible-broker {
160                 container data-broker {
161                     uses config:service-ref {
162                         refine type {
163                             mandatory false;
164                             config:required-identity sal:binding-async-data-broker;
165                         }
166                     }
167                 }
168             }
169         }
170     }
171
172     augment "/config:modules/config:module/config:configuration" {
173         case binding-forwarded-data-broker {
174             when "/config:modules/config:module/config:type = 'binding-forwarded-data-broker'";
175             container binding-forwarded-data-broker {
176                 container dom-async-broker {
177                     uses config:service-ref {
178                         refine type {
179                             mandatory true;
180                             config:required-identity dom:dom-async-data-broker;
181                         }
182                     }
183                 }
184
185                 container binding-mapping-service {
186                     uses config:service-ref {
187                         refine type {
188                             mandatory true;
189                             config:required-identity binding-dom-mapping-service;
190                         }
191                     }
192                 }
193
194                 container schema-service {
195                     uses config:service-ref {
196                         refine type {
197                             mandatory true;
198                             config:required-identity dom:schema-service;
199                         }
200                     }
201                 }
202             }
203         }
204     }
205
206
207     augment "/config:modules/config:module/config:configuration" {
208         case runtime-generated-mapping {
209             when "/config:modules/config:module/config:type = 'runtime-generated-mapping'";
210             leaf wait-for-schema {
211                 default "false";
212                 type boolean;
213             }
214         }
215     }
216
217     augment "/config:modules/config:module/config:state" {
218         case binding-rpc-broker {
219             when "/config:modules/config:module/config:type = 'binding-rpc-broker'";
220             uses common:rpc-state;
221         }
222     }
223
224     augment "/config:modules/config:module/config:configuration" {
225         case binding-notification-broker {
226             when "/config:modules/config:module/config:type = 'binding-notification-broker'";
227             container notification-adapter {
228                 uses config:service-ref {
229                     refine type {
230                         mandatory false;
231                         config:required-identity binding-new-notification-service;
232                     }
233                 }
234             }
235
236             container notification-publish-adapter {
237                 uses config:service-ref {
238                     refine type {
239                         mandatory false;
240                         config:required-identity binding-new-notification-publish-service;
241                     }
242                 }
243             }
244         }
245     }
246
247     augment "/config:modules/config:module/config:state" {
248         case binding-notification-broker {
249             when "/config:modules/config:module/config:type = 'binding-notification-broker'";
250             uses common:notification-state;
251         }
252     }
253
254     augment "/config:modules/config:module/config:configuration" {
255         case binding-notification-adapter {
256             when "/config:modules/config:module/config:type = 'binding-notification-adapter'";
257             container binding-notification-adapter {
258                 uses dom-forwarding-component;
259             }
260         }
261     }
262
263     augment "/config:modules/config:module/config:configuration" {
264         case binding-notification-publish-adapter {
265             when "/config:modules/config:module/config:type = 'binding-notification-publish-adapter'";
266             container binding-notification-publish-adapter {
267                 uses dom-forwarding-component;
268             }
269         }
270     }
271 }