Merge "Replace tabs with spaces in config yang files"
[controller.git] / opendaylight / config / threadpool-config-impl / src / main / yang / threadpool-impl.yang
1 // vi: set smarttab et sw=4 tabstop=4:
2 module threadpool-impl {
3     yang-version 1;
4     namespace "urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl";
5     prefix "th-java";
6
7     import threadpool { prefix th; revision-date 2013-04-09; }
8     import config { prefix config; revision-date 2013-04-05; }
9     import rpc-context { prefix rpcx; revision-date 2013-06-17; }
10
11     organization "Cisco Systems, Inc.";
12
13     contact "Robert Varga <rovarga@cisco.com>";
14
15     description
16         "This module contains the base YANG definitions for
17          thread services pure Java implementation.
18
19         Copyright (c)2013 Cisco Systems, Inc. All rights reserved.;
20
21         This program and the accompanying materials are made available
22         under the terms of the Eclipse Public License v1.0 which
23         accompanies this distribution, and is available at
24         http://www.eclipse.org/legal/epl-v10.html";
25
26     revision "2013-04-05" {
27         description
28             "Updated to work with new anchors.";
29     }
30
31     revision "2013-04-03" {
32         description
33             "Initial revision by Anton Tkacik, Tomas Olvecky and
34              Robert Varga.";
35     }
36
37     identity eventbus {
38         base config:module-type;
39         config:provided-service th:eventbus;
40         config:java-name-prefix EventBus;
41     }
42
43     augment "/config:modules/config:module/config:configuration" {
44         case eventbus {
45             when "/config:modules/config:module/config:type = 'eventbus'";
46             // No real configuration
47         }
48     }
49
50     augment "/config:modules/config:module/config:state" {
51         case eventbus {
52             when "/config:modules/config:module/config:type = 'eventbus'";
53             rpcx:rpc-context-instance "event-bus-rpc";
54         }
55     }
56
57     identity event-bus-rpc;
58
59     identity async-eventbus {
60         base config:module-type;
61         config:provided-service th:eventbus;
62         config:java-name-prefix AsyncEventBus;
63     }
64
65     augment "/config:modules/config:module/config:configuration" {
66         case async-eventbus {
67             when "/config:modules/config:module/config:type = 'async-eventbus'";
68             container threadpool {
69                 uses config:service-ref {
70                     refine type {
71                         //mandatory true;
72                         config:required-identity th:threadpool;
73                     }
74                 }
75             }
76         }
77     }
78
79     augment "/config:modules/config:module/config:state" {
80         case async-eventbus {
81             when "/config:modules/config:module/config:type = 'async-eventbus'";
82             rpcx:rpc-context-instance "event-bus-rpc";
83         }
84     }
85
86     rpc get-dead-events-count {
87         config:java-name-prefix countDeadEvents;
88         input {
89             uses rpcx:rpc-context-ref {
90                 refine context-instance {
91                     rpcx:rpc-context-instance event-bus-rpc;
92                 }
93             }
94         }
95         output {
96             leaf result {
97                 type uint32;
98             }
99         }
100     }
101
102     identity threadfactory-naming {
103         base config:module-type;
104         config:provided-service th:threadfactory;
105         config:java-name-prefix NamingThreadFactory;
106     }
107
108     augment "/config:modules/config:module/config:configuration" {
109         case threadfactory-naming {
110             when "/config:modules/config:module/config:type = 'threadfactory-naming'";
111             leaf name-prefix {
112                 type string;
113             }
114         }
115     }
116
117     identity threadpool-fixed {
118         base config:module-type;
119         config:provided-service th:threadpool;
120         config:java-name-prefix FixedThreadPool;
121     }
122
123     augment "/config:modules/config:module/config:configuration" {
124         case threadpool-fixed {
125             when "/config:modules/config:module/config:type = 'threadpool-fixed'";
126             leaf max-thread-count {
127                 type uint16;
128             }
129
130             container threadFactory {
131                 uses config:service-ref {
132                     refine type {
133                         //mandatory true;
134                         config:required-identity th:threadfactory;
135                     }
136                 }
137             }
138         }
139     }
140
141     identity threadpool-flexible {
142         base config:module-type;
143         config:provided-service th:threadpool;
144         config:java-name-prefix FlexibleThreadPool;
145     }
146
147     augment "/config:modules/config:module/config:configuration" {
148         case threadpool-flexible {
149             when "/config:modules/config:module/config:type = 'threadpool-flexible'";
150             leaf max-thread-count {
151                 type uint16;
152             }
153             leaf minThreadCount {
154                 type uint16;
155             }
156             leaf keepAliveMillis {
157                 type uint32;
158             }
159
160             container threadFactory {
161                 uses config:service-ref {
162                     refine type {
163                        // mandatory true;
164                         config:required-identity th:threadfactory;
165                     }
166                 }
167             }
168         }
169     }
170
171     identity threadpool-scheduled {
172         base config:module-type;
173         config:provided-service th:scheduled-threadpool;
174         config:java-name-prefix ScheduledThreadPool;
175     }
176
177     augment "/config:modules/config:module/config:configuration" {
178         case threadpool-scheduled {
179             when "/config:modules/config:module/config:type = 'threadpool-scheduled'";
180             leaf max-thread-count {
181                 type uint16;
182             }
183
184             container threadFactory {
185                 uses config:service-ref {
186                     refine type {
187                      //   mandatory true;
188                         config:required-identity th:threadfactory;
189                     }
190                 }
191             }
192         }
193     }
194 }
195