cc4af4d5969fec0fab92146b0732df31fa47b430
[controller.git] / opendaylight / config / threadpool-config-impl / src / main / yang / threadpool-impl.yang
1 module threadpool-impl {
2     yang-version 1;
3     namespace "urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl";
4     prefix "th-java";
5
6     import threadpool { prefix th; revision-date 2013-04-09; }
7     import config { prefix config; revision-date 2013-04-05; }
8     import rpc-context { prefix rpcx; revision-date 2013-06-17; }
9
10     organization "Cisco Systems, Inc.";
11
12     contact "Robert Varga <rovarga@cisco.com>";
13
14     description
15         "This module contains the base YANG definitions for
16          thread services pure Java implementation.
17
18         Copyright (c)2013 Cisco Systems, Inc. All rights reserved.;
19
20         This program and the accompanying materials are made available
21         under the terms of the Eclipse Public License v1.0 which
22         accompanies this distribution, and is available at
23         http://www.eclipse.org/legal/epl-v10.html";
24
25     revision "2013-04-05" {
26         description
27             "Updated to work with new anchors.";
28     }
29
30     revision "2013-04-03" {
31         description
32             "Initial revision by Anton Tkacik, Tomas Olvecky and
33              Robert Varga.";
34     }
35
36     identity eventbus {
37         base config:module-type;
38         config:provided-service th:eventbus;
39         config:java-name-prefix EventBus;
40     }
41
42     augment "/config:modules/config:module/config:configuration" {
43         case eventbus {
44             when "/config:modules/config:module/config:type = 'eventbus'";
45             // No real configuration
46         }
47     }
48
49     augment "/config:modules/config:module/config:state" {
50         case eventbus {
51             when "/config:modules/config:module/config:type = 'eventbus'";
52             rpcx:rpc-context-instance "event-bus-rpc";
53         }
54     }
55
56     identity event-bus-rpc;
57
58     identity async-eventbus {
59         base config:module-type;
60         config:provided-service th:eventbus;
61         config:java-name-prefix AsyncEventBus;
62     }
63
64     augment "/config:modules/config:module/config:configuration" {
65         case async-eventbus {
66             when "/config:modules/config:module/config:type = 'async-eventbus'";
67             container threadpool {
68                 uses config:service-ref {
69                     refine type {
70                         //mandatory true;
71                         config:required-identity th:threadpool;
72                     }
73                 }
74             }
75         }
76     }
77
78     augment "/config:modules/config:module/config:state" {
79         case async-eventbus {
80             when "/config:modules/config:module/config:type = 'async-eventbus'";
81             rpcx:rpc-context-instance "event-bus-rpc";
82         }
83     }
84
85     rpc get-dead-events-count {
86         config:java-name-prefix countDeadEvents;
87         input {
88             uses rpcx:rpc-context-ref {
89                 refine context-instance {
90                     rpcx:rpc-context-instance event-bus-rpc;
91                 }
92             }
93         }
94         output {
95             leaf result {
96                 type uint32;
97             }
98         }
99     }
100
101     identity threadfactory-naming {
102         base config:module-type;
103         config:provided-service th:threadfactory;
104         config:java-name-prefix NamingThreadFactory;
105     }
106
107     augment "/config:modules/config:module/config:configuration" {
108         case threadfactory-naming {
109             when "/config:modules/config:module/config:type = 'threadfactory-naming'";
110             leaf name-prefix {
111                 type string;
112             }
113         }
114     }
115 }
116