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.AbstractAugmentable;
16 import org.opendaylight.yangtools.yang.common.Uint16;
17 import org.opendaylight.yangtools.yang.common.Uint32;
19 // FIXME: Rename this to "ConfigurationOpenflowProviderConfig" or some such. OpenFlowProviderConfigImpl is taken as
20 // Builder-based (guaranteed to work).
21 public class OpenFlowProviderConfigImpl extends AbstractAugmentable<OpenflowProviderConfig>
22 implements OpenflowProviderConfig {
23 private final ConfigurationService service;
25 public OpenFlowProviderConfigImpl(final ConfigurationService service) {
26 this.service = service;
30 public NonZeroUint16Type getRpcRequestsQuota() {
31 return new NonZeroUint16Type(service.<Uint16>getProperty(
32 ConfigurationProperty.RPC_REQUESTS_QUOTA.toString(), Uint16::valueOf));
36 public Boolean getSwitchFeaturesMandatory() {
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 getIsStatisticsPollingOn() {
47 return service.getProperty(ConfigurationProperty.IS_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
51 public Boolean getIsTableStatisticsPollingOn() {
52 return service.getProperty(ConfigurationProperty.IS_TABLE_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
56 public Boolean getIsFlowStatisticsPollingOn() {
57 return service.getProperty(ConfigurationProperty.IS_FLOW_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
61 public Boolean getIsGroupStatisticsPollingOn() {
62 return service.getProperty(ConfigurationProperty.IS_GROUP_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
66 public Boolean getIsMeterStatisticsPollingOn() {
67 return service.getProperty(ConfigurationProperty.IS_METER_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
71 public Boolean getIsQueueStatisticsPollingOn() {
72 return service.getProperty(ConfigurationProperty.IS_QUEUE_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
76 public Boolean getIsPortStatisticsPollingOn() {
77 return service.getProperty(ConfigurationProperty.IS_PORT_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
81 public Boolean getIsStatisticsRpcEnabled() {
82 return service.getProperty(ConfigurationProperty.IS_STATISTICS_RPC_ENABLED.toString(), Boolean::valueOf);
86 public NonZeroUint32Type getBarrierIntervalTimeoutLimit() {
87 return new NonZeroUint32Type(service.<Uint32>getProperty(
88 ConfigurationProperty.BARRIER_INTERVAL_TIMEOUT_LIMIT.toString(), Uint32::valueOf));
92 public NonZeroUint16Type getBarrierCountLimit() {
93 return new NonZeroUint16Type(service.<Uint16>getProperty(
94 ConfigurationProperty.BARRIER_COUNT_LIMIT.toString(), Uint16::valueOf));
98 public NonZeroUint32Type getEchoReplyTimeout() {
99 return new NonZeroUint32Type(service.<Uint32>getProperty(
100 ConfigurationProperty.ECHO_REPLY_TIMEOUT.toString(), Uint32::valueOf));
104 public Uint16 getThreadPoolMinThreads() {
105 return service.<Uint16>getProperty(ConfigurationProperty.THREAD_POOL_MIN_THREADS.toString(), Uint16::valueOf);
109 public NonZeroUint16Type getThreadPoolMaxThreads() {
110 return new NonZeroUint16Type(service.<Uint16>getProperty(
111 ConfigurationProperty.THREAD_POOL_MAX_THREADS.toString(), Uint16::valueOf));
115 public Uint32 getThreadPoolTimeout() {
116 return service.getProperty(ConfigurationProperty.THREAD_POOL_TIMEOUT.toString(), Uint32::valueOf);
120 public Boolean getEnableFlowRemovedNotification() {
121 return service.getProperty(ConfigurationProperty.ENABLE_FLOW_REMOVED_NOTIFICATION.toString(), Boolean::valueOf);
125 public Boolean getSkipTableFeatures() {
126 return service.getProperty(ConfigurationProperty.SKIP_TABLE_FEATURES.toString(), Boolean::valueOf);
130 public Boolean getEnableEqualRole() {
131 return service.getProperty(ConfigurationProperty.ENABLE_EQUAL_ROLE.toString(), Boolean::valueOf);
135 public NonZeroUint32Type getBasicTimerDelay() {
136 return new NonZeroUint32Type(service.<Uint32>getProperty(
137 ConfigurationProperty.BASIC_TIMER_DELAY.toString(), Uint32::valueOf));
141 public NonZeroUint32Type getMaximumTimerDelay() {
142 return new NonZeroUint32Type(service.<Uint32>getProperty(
143 ConfigurationProperty.MAXIMUM_TIMER_DELAY.toString(), Uint32::valueOf));
147 public Boolean getUseSingleLayerSerialization() {
148 return service.getProperty(ConfigurationProperty.USE_SINGLE_LAYER_SERIALIZATION.toString(), Boolean::valueOf);
152 public Uint16 getDeviceConnectionRateLimitPerMin() {
153 return service.getProperty(
154 ConfigurationProperty.DEVICE_CONNECTION_RATE_LIMIT_PER_MIN.toString(), Uint16::valueOf);
158 public Uint16 getDeviceConnectionHoldTimeInSeconds() {
159 return service.getProperty(
160 ConfigurationProperty.DEVICE_CONNECTION_HOLD_TIME_IN_SECONDS.toString(), Uint16::valueOf);
164 public NonZeroUint32Type getDeviceDatastoreRemovalDelay() {
165 return new NonZeroUint32Type(service.<Uint32>getProperty(
166 ConfigurationProperty.DEVICE_DATASTORE_REMOVAL_DELAY.toString(), Uint32::valueOf));