2 * Copyright (c) 2017 Pantheon Technologies s.r.o. and others. All rights reserved.
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
8 package org.opendaylight.openflowplugin.impl.configuration;
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 import org.opendaylight.yangtools.yang.binding.DataContainer;
18 public class OpenFlowProviderConfigImpl implements OpenflowProviderConfig {
19 private final ConfigurationService service;
21 public OpenFlowProviderConfigImpl(final ConfigurationService service) {
22 this.service = service;
26 public NonZeroUint16Type getRpcRequestsQuota() {
27 final Integer property = service.getProperty(
28 ConfigurationProperty.RPC_REQUESTS_QUOTA.toString(),
31 return new NonZeroUint16Type(property);
35 public Boolean isSwitchFeaturesMandatory() {
36 return service.getProperty(ConfigurationProperty.SWITCH_FEATURES_MANDATORY.toString(), Boolean::valueOf);
40 public Long getGlobalNotificationQuota() {
41 return service.getProperty(ConfigurationProperty.GLOBAL_NOTIFICATION_QUOTA.toString(), Long::valueOf);
45 public Boolean isIsStatisticsPollingOn() {
46 return service.getProperty(ConfigurationProperty.IS_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
50 public Boolean isIsTableStatisticsPollingOn() {
51 return service.getProperty(ConfigurationProperty.IS_TABLE_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
55 public Boolean isIsFlowStatisticsPollingOn() {
56 return service.getProperty(ConfigurationProperty.IS_FLOW_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
60 public Boolean isIsGroupStatisticsPollingOn() {
61 return service.getProperty(ConfigurationProperty.IS_GROUP_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
65 public Boolean isIsMeterStatisticsPollingOn() {
66 return service.getProperty(ConfigurationProperty.IS_METER_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
70 public Boolean isIsQueueStatisticsPollingOn() {
71 return service.getProperty(ConfigurationProperty.IS_QUEUE_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
75 public Boolean isIsPortStatisticsPollingOn() {
76 return service.getProperty(ConfigurationProperty.IS_PORT_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
81 public Boolean isIsStatisticsRpcEnabled() {
82 return service.getProperty(ConfigurationProperty.IS_STATISTICS_RPC_ENABLED.toString(), Boolean::valueOf);
86 public NonZeroUint32Type getBarrierIntervalTimeoutLimit() {
87 final Long property = service.getProperty(
88 ConfigurationProperty.BARRIER_INTERVAL_TIMEOUT_LIMIT.toString(),
91 return new NonZeroUint32Type(property);
95 public NonZeroUint16Type getBarrierCountLimit() {
96 final Integer property = service.getProperty(
97 ConfigurationProperty.BARRIER_COUNT_LIMIT.toString(),
100 return new NonZeroUint16Type(property);
104 public NonZeroUint32Type getEchoReplyTimeout() {
105 final Long property = service.getProperty(
106 ConfigurationProperty.ECHO_REPLY_TIMEOUT.toString(),
109 return new NonZeroUint32Type(property);
113 public Integer getThreadPoolMinThreads() {
114 return service.getProperty(ConfigurationProperty.THREAD_POOL_MIN_THREADS.toString(), Integer::valueOf);
118 public NonZeroUint16Type getThreadPoolMaxThreads() {
119 final Integer property = service.getProperty(
120 ConfigurationProperty.THREAD_POOL_MAX_THREADS.toString(),
123 return new NonZeroUint16Type(property);
127 public Long getThreadPoolTimeout() {
128 return service.getProperty(ConfigurationProperty.THREAD_POOL_TIMEOUT.toString(), Long::valueOf);
132 public Boolean isEnableFlowRemovedNotification() {
133 return service.getProperty(ConfigurationProperty.ENABLE_FLOW_REMOVED_NOTIFICATION.toString(), Boolean::valueOf);
137 public Boolean isSkipTableFeatures() {
138 return service.getProperty(ConfigurationProperty.SKIP_TABLE_FEATURES.toString(), Boolean::valueOf);
142 public Boolean isEnableEqualRole() {
143 return service.getProperty(ConfigurationProperty.ENABLE_EQUAL_ROLE.toString(), Boolean::valueOf);
147 public NonZeroUint32Type getBasicTimerDelay() {
148 final Long property = service.getProperty(
149 ConfigurationProperty.BASIC_TIMER_DELAY.toString(),
152 return new NonZeroUint32Type(property);
156 public NonZeroUint32Type getMaximumTimerDelay() {
157 final Long property = service.getProperty(
158 ConfigurationProperty.MAXIMUM_TIMER_DELAY.toString(),
161 return new NonZeroUint32Type(property);
165 public Boolean isUseSingleLayerSerialization() {
166 return service.getProperty(ConfigurationProperty.USE_SINGLE_LAYER_SERIALIZATION.toString(), Boolean::valueOf);
170 public <E extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
171 .openflow.provider.config.rev160510.OpenflowProviderConfig>> E augmentation(
172 java.lang.Class<E> augmentationType) {
177 public Class<? extends DataContainer> getImplementedInterface() {
178 return OpenflowProviderConfig.class;
182 public Integer getDeviceConnectionRateLimitPerMin() {
183 return service.getProperty(ConfigurationProperty.DEVICE_CONNECTION_RATE_LIMIT_PER_MIN.toString(),