BUG-832 Refactor netconf connector
[controller.git] / opendaylight / md-sal / sal-netconf-connector / src / main / yang / odl-sal-netconf-connector-cfg.yang
1 module odl-sal-netconf-connector-cfg {
2     yang-version 1;
3     namespace "urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf";
4     prefix "sal-netconf";
5
6     import config { prefix config; revision-date 2013-04-05; }
7     import threadpool {prefix th;}
8     import netty {prefix netty;}
9     import opendaylight-md-sal-dom {prefix dom;}
10     import opendaylight-md-sal-binding {prefix md-sal-binding; revision-date 2013-10-28;}
11     import odl-netconf-cfg { prefix cfg-net; revision-date 2014-04-08; }
12
13     description
14         "Service definition for Binding Aware MD-SAL.";
15
16     revision "2013-10-28" {
17         description
18             "Initial revision";
19     }
20
21     identity sal-netconf-connector {
22         base config:module-type;
23         config:java-name-prefix NetconfConnector;
24     }
25
26     grouping server {
27         leaf address {
28             type string;
29         }
30
31         leaf port {
32             type uint32;
33         }
34     }
35
36     augment "/config:modules/config:module/config:configuration" {
37         case sal-netconf-connector {
38             when "/config:modules/config:module/config:type = 'sal-netconf-connector'";
39
40             leaf address {
41                 type string;
42             }
43
44             leaf port {
45                 type uint32;
46             }
47
48             leaf tcp-only {
49                 type boolean;
50             }
51
52             leaf username {
53                 type string;
54             }
55
56             leaf password {
57                 type string;
58             }
59
60             container dom-registry {
61                 uses config:service-ref {
62                     refine type {
63                         mandatory true;
64                         config:required-identity dom:dom-broker-osgi-registry;
65                     }
66                 }
67             }
68
69             container binding-registry {
70                 uses config:service-ref {
71                     refine type {
72                         // FIXME BUG-944 make mandatory (remove backwards compatibility)
73                         mandatory false;
74                         config:required-identity md-sal-binding:binding-broker-osgi-registry;
75                     }
76                 }
77             }
78
79             // FIXME BUG-944 remove backwards compatibility
80             // Deprecated, replaced by client dispatcher.
81             // This dependency will be removed in near future and all configurations of netconf-connector need to be changed to use dispatcher dependency.
82             container boss-thread-group {
83                 uses config:service-ref {
84                     refine type {
85                         mandatory false;
86                         config:required-identity netty:netty-threadgroup;
87                     }
88                 }
89             }
90
91             // FIXME BUG-944 remove backwards compatibility
92             // Deprecated, replaced by client dispatcher.
93             // This dependency will be removed in near future and all configurations of netconf-connector need to be changed to use dispatcher dependency.
94             container worker-thread-group {
95                 uses config:service-ref {
96                     refine type {
97                         mandatory false;
98                         config:required-identity netty:netty-threadgroup;
99                     }
100                 }
101             }
102
103             container event-executor {
104                 uses config:service-ref {
105                     refine type {
106                         config:required-identity netty:netty-event-executor;
107                     }
108                 }
109             }
110
111             container processing-executor {
112                 uses config:service-ref {
113                     refine type {
114                         // FIXME BUG-944 make mandatory (remove backwards compatibility)
115                         mandatory false;
116                         config:required-identity th:threadpool;
117                     }
118                 }
119
120                 description "Makes up for flaws in netty threading design";
121             }
122
123             // Replaces thread group dependencies
124             container client-dispatcher {
125                 uses config:service-ref {
126                     refine type {
127                         mandatory false;
128                         config:required-identity cfg-net:netconf-client-dispatcher;
129                     }
130                 }
131             }
132
133             leaf connection-timeout-millis {
134                 description "Specifies timeout in milliseconds after which connection must be established.";
135                 type uint32;
136                 default 20000;
137             }
138
139             leaf max-connection-attempts {
140                 description "Maximum number of connection retries. Non positive value or null is interpreted as infinity.";
141                 type uint32;
142                 default 0; // retry forever
143             }
144
145             leaf between-attempts-timeout-millis {
146                 description "Initial timeout in milliseconds to wait between connection attempts. Will be multiplied by sleep-factor with every additional attempt";
147                 type uint16;
148                 default 2000;
149             }
150
151             leaf sleep-factor {
152                 type decimal64 {
153                     fraction-digits 1;
154                 }
155                 default 1.5;
156             }
157         }
158     }
159 }