Bump mdsal to 4.0.0
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / configuration / OpenFlowProviderConfigImpl.java
1 /*
2  * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.openflowplugin.impl.configuration;
9
10 import org.opendaylight.openflowplugin.api.openflow.configuration.ConfigurationProperty;
11 import org.opendaylight.openflowplugin.api.openflow.configuration.ConfigurationService;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.NonZeroUint16Type;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.NonZeroUint32Type;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.OpenflowProviderConfig;
15 import org.opendaylight.yangtools.yang.binding.Augmentation;
16
17 public class OpenFlowProviderConfigImpl implements OpenflowProviderConfig {
18     private final ConfigurationService service;
19
20     public OpenFlowProviderConfigImpl(final ConfigurationService service) {
21         this.service = service;
22     }
23
24     @Override
25     public NonZeroUint16Type getRpcRequestsQuota() {
26         final Integer property = service.getProperty(
27                 ConfigurationProperty.RPC_REQUESTS_QUOTA.toString(),
28                 Integer::valueOf);
29
30         return new NonZeroUint16Type(property);
31     }
32
33     @Override
34     public Boolean isSwitchFeaturesMandatory() {
35         return service.getProperty(ConfigurationProperty.SWITCH_FEATURES_MANDATORY.toString(), Boolean::valueOf);
36     }
37
38     @Override
39     public Long getGlobalNotificationQuota() {
40         return service.getProperty(ConfigurationProperty.GLOBAL_NOTIFICATION_QUOTA.toString(), Long::valueOf);
41     }
42
43     @Override
44     public Boolean isIsStatisticsPollingOn() {
45         return service.getProperty(ConfigurationProperty.IS_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
46     }
47
48     @Override
49     public Boolean isIsTableStatisticsPollingOn() {
50         return service.getProperty(ConfigurationProperty.IS_TABLE_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
51     }
52
53     @Override
54     public Boolean isIsFlowStatisticsPollingOn() {
55         return service.getProperty(ConfigurationProperty.IS_FLOW_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
56     }
57
58     @Override
59     public Boolean isIsGroupStatisticsPollingOn() {
60         return service.getProperty(ConfigurationProperty.IS_GROUP_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
61     }
62
63     @Override
64     public Boolean isIsMeterStatisticsPollingOn() {
65         return service.getProperty(ConfigurationProperty.IS_METER_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
66     }
67
68     @Override
69     public Boolean isIsQueueStatisticsPollingOn() {
70         return service.getProperty(ConfigurationProperty.IS_QUEUE_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
71     }
72
73     @Override
74     public Boolean isIsPortStatisticsPollingOn() {
75         return service.getProperty(ConfigurationProperty.IS_PORT_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
76     }
77
78
79     @Override
80     public Boolean isIsStatisticsRpcEnabled() {
81         return service.getProperty(ConfigurationProperty.IS_STATISTICS_RPC_ENABLED.toString(), Boolean::valueOf);
82     }
83
84     @Override
85     public NonZeroUint32Type getBarrierIntervalTimeoutLimit() {
86         final Long property = service.getProperty(
87                 ConfigurationProperty.BARRIER_INTERVAL_TIMEOUT_LIMIT.toString(),
88                 Long::valueOf);
89
90         return new NonZeroUint32Type(property);
91     }
92
93     @Override
94     public NonZeroUint16Type getBarrierCountLimit() {
95         final Integer property = service.getProperty(
96                 ConfigurationProperty.BARRIER_COUNT_LIMIT.toString(),
97                 Integer::valueOf);
98
99         return new NonZeroUint16Type(property);
100     }
101
102     @Override
103     public NonZeroUint32Type getEchoReplyTimeout() {
104         final Long property = service.getProperty(
105                 ConfigurationProperty.ECHO_REPLY_TIMEOUT.toString(),
106                 Long::valueOf);
107
108         return new NonZeroUint32Type(property);
109     }
110
111     @Override
112     public Integer getThreadPoolMinThreads() {
113         return service.getProperty(ConfigurationProperty.THREAD_POOL_MIN_THREADS.toString(), Integer::valueOf);
114     }
115
116     @Override
117     public NonZeroUint16Type getThreadPoolMaxThreads() {
118         final Integer property = service.getProperty(
119                 ConfigurationProperty.THREAD_POOL_MAX_THREADS.toString(),
120                 Integer::valueOf);
121
122         return new NonZeroUint16Type(property);
123     }
124
125     @Override
126     public Long getThreadPoolTimeout() {
127         return service.getProperty(ConfigurationProperty.THREAD_POOL_TIMEOUT.toString(), Long::valueOf);
128     }
129
130     @Override
131     public Boolean isEnableFlowRemovedNotification() {
132         return service.getProperty(ConfigurationProperty.ENABLE_FLOW_REMOVED_NOTIFICATION.toString(), Boolean::valueOf);
133     }
134
135     @Override
136     public Boolean isSkipTableFeatures() {
137         return service.getProperty(ConfigurationProperty.SKIP_TABLE_FEATURES.toString(), Boolean::valueOf);
138     }
139
140     @Override
141     public Boolean isEnableEqualRole() {
142         return service.getProperty(ConfigurationProperty.ENABLE_EQUAL_ROLE.toString(), Boolean::valueOf);
143     }
144
145     @Override
146     public NonZeroUint32Type getBasicTimerDelay() {
147         final Long property = service.getProperty(
148                 ConfigurationProperty.BASIC_TIMER_DELAY.toString(),
149                 Long::valueOf);
150
151         return new NonZeroUint32Type(property);
152     }
153
154     @Override
155     public NonZeroUint32Type getMaximumTimerDelay() {
156         final Long property = service.getProperty(
157                 ConfigurationProperty.MAXIMUM_TIMER_DELAY.toString(),
158                 Long::valueOf);
159
160         return new NonZeroUint32Type(property);
161     }
162
163     @Override
164     public Boolean isUseSingleLayerSerialization() {
165         return service.getProperty(ConfigurationProperty.USE_SINGLE_LAYER_SERIALIZATION.toString(), Boolean::valueOf);
166     }
167
168     @Override
169     public <E extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
170             .openflow.provider.config.rev160510.OpenflowProviderConfig>> E augmentation(
171                     java.lang.Class<E> augmentationType) {
172         return null;
173     }
174
175     @Override
176     public Integer getDeviceConnectionRateLimitPerMin() {
177         return service.getProperty(ConfigurationProperty.DEVICE_CONNECTION_RATE_LIMIT_PER_MIN.toString(),
178                 Integer::valueOf);
179     }
180 }