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.common.Uint16;
17 import org.opendaylight.yangtools.yang.common.Uint32;
19 public class OpenFlowProviderConfigImpl implements OpenflowProviderConfig {
20 private final ConfigurationService service;
22 public OpenFlowProviderConfigImpl(final ConfigurationService service) {
23 this.service = service;
27 public NonZeroUint16Type getRpcRequestsQuota() {
28 final Integer property = service.getProperty(
29 ConfigurationProperty.RPC_REQUESTS_QUOTA.toString(),
32 return new NonZeroUint16Type(property);
36 public Boolean isSwitchFeaturesMandatory() {
37 return service.getProperty(ConfigurationProperty.SWITCH_FEATURES_MANDATORY.toString(), Boolean::valueOf);
41 public Uint32 getGlobalNotificationQuota() {
42 return service.getProperty(ConfigurationProperty.GLOBAL_NOTIFICATION_QUOTA.toString(), Uint32::valueOf);
46 public Boolean isIsStatisticsPollingOn() {
47 return service.getProperty(ConfigurationProperty.IS_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
51 public Boolean isIsTableStatisticsPollingOn() {
52 return service.getProperty(ConfigurationProperty.IS_TABLE_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
56 public Boolean isIsFlowStatisticsPollingOn() {
57 return service.getProperty(ConfigurationProperty.IS_FLOW_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
61 public Boolean isIsGroupStatisticsPollingOn() {
62 return service.getProperty(ConfigurationProperty.IS_GROUP_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
66 public Boolean isIsMeterStatisticsPollingOn() {
67 return service.getProperty(ConfigurationProperty.IS_METER_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
71 public Boolean isIsQueueStatisticsPollingOn() {
72 return service.getProperty(ConfigurationProperty.IS_QUEUE_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
76 public Boolean isIsPortStatisticsPollingOn() {
77 return service.getProperty(ConfigurationProperty.IS_PORT_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
82 public Boolean isIsStatisticsRpcEnabled() {
83 return service.getProperty(ConfigurationProperty.IS_STATISTICS_RPC_ENABLED.toString(), Boolean::valueOf);
87 public NonZeroUint32Type getBarrierIntervalTimeoutLimit() {
88 final Long property = service.getProperty(
89 ConfigurationProperty.BARRIER_INTERVAL_TIMEOUT_LIMIT.toString(),
92 return new NonZeroUint32Type(property);
96 public NonZeroUint16Type getBarrierCountLimit() {
97 final Integer property = service.getProperty(
98 ConfigurationProperty.BARRIER_COUNT_LIMIT.toString(),
101 return new NonZeroUint16Type(property);
105 public NonZeroUint32Type getEchoReplyTimeout() {
106 final Long property = service.getProperty(
107 ConfigurationProperty.ECHO_REPLY_TIMEOUT.toString(),
110 return new NonZeroUint32Type(property);
114 public Uint16 getThreadPoolMinThreads() {
115 return service.getProperty(ConfigurationProperty.THREAD_POOL_MIN_THREADS.toString(), Uint16::valueOf);
119 public NonZeroUint16Type getThreadPoolMaxThreads() {
120 final Integer property = service.getProperty(
121 ConfigurationProperty.THREAD_POOL_MAX_THREADS.toString(),
124 return new NonZeroUint16Type(property);
128 public Uint32 getThreadPoolTimeout() {
129 return service.getProperty(ConfigurationProperty.THREAD_POOL_TIMEOUT.toString(), Uint32::valueOf);
133 public Boolean isEnableFlowRemovedNotification() {
134 return service.getProperty(ConfigurationProperty.ENABLE_FLOW_REMOVED_NOTIFICATION.toString(), Boolean::valueOf);
138 public Boolean isSkipTableFeatures() {
139 return service.getProperty(ConfigurationProperty.SKIP_TABLE_FEATURES.toString(), Boolean::valueOf);
143 public Boolean isEnableEqualRole() {
144 return service.getProperty(ConfigurationProperty.ENABLE_EQUAL_ROLE.toString(), Boolean::valueOf);
148 public NonZeroUint32Type getBasicTimerDelay() {
149 final Long property = service.getProperty(
150 ConfigurationProperty.BASIC_TIMER_DELAY.toString(),
153 return new NonZeroUint32Type(property);
157 public NonZeroUint32Type getMaximumTimerDelay() {
158 final Long property = service.getProperty(
159 ConfigurationProperty.MAXIMUM_TIMER_DELAY.toString(),
162 return new NonZeroUint32Type(property);
166 public Boolean isUseSingleLayerSerialization() {
167 return service.getProperty(ConfigurationProperty.USE_SINGLE_LAYER_SERIALIZATION.toString(), Boolean::valueOf);
171 public <E extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
172 .openflow.provider.config.rev160510.OpenflowProviderConfig>> E augmentation(
173 final java.lang.Class<E> augmentationType) {
178 public Uint16 getDeviceConnectionRateLimitPerMin() {
179 return service.getProperty(ConfigurationProperty.DEVICE_CONNECTION_RATE_LIMIT_PER_MIN.toString(),
184 public Uint16 getDeviceConnectionHoldTimeInSeconds() {
185 return service.getProperty(ConfigurationProperty.DEVICE_CONNECTION_HOLD_TIME_IN_SECONDS.toString(),