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;
17 public class OpenFlowProviderConfigImpl implements OpenflowProviderConfig {
18 private final ConfigurationService service;
20 public OpenFlowProviderConfigImpl(final ConfigurationService service) {
21 this.service = service;
25 public NonZeroUint16Type getRpcRequestsQuota() {
26 final Integer property = service.getProperty(
27 ConfigurationProperty.RPC_REQUESTS_QUOTA.toString(),
30 return new NonZeroUint16Type(property);
34 public Boolean isSwitchFeaturesMandatory() {
35 return service.getProperty(ConfigurationProperty.SWITCH_FEATURES_MANDATORY.toString(), Boolean::valueOf);
39 public Long getGlobalNotificationQuota() {
40 return service.getProperty(ConfigurationProperty.GLOBAL_NOTIFICATION_QUOTA.toString(), Long::valueOf);
44 public Boolean isIsStatisticsPollingOn() {
45 return service.getProperty(ConfigurationProperty.IS_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
49 public Boolean isIsTableStatisticsPollingOn() {
50 return service.getProperty(ConfigurationProperty.IS_TABLE_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
54 public Boolean isIsFlowStatisticsPollingOn() {
55 return service.getProperty(ConfigurationProperty.IS_FLOW_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
59 public Boolean isIsGroupStatisticsPollingOn() {
60 return service.getProperty(ConfigurationProperty.IS_GROUP_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
64 public Boolean isIsMeterStatisticsPollingOn() {
65 return service.getProperty(ConfigurationProperty.IS_METER_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
69 public Boolean isIsQueueStatisticsPollingOn() {
70 return service.getProperty(ConfigurationProperty.IS_QUEUE_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
74 public Boolean isIsPortStatisticsPollingOn() {
75 return service.getProperty(ConfigurationProperty.IS_PORT_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
80 public Boolean isIsStatisticsRpcEnabled() {
81 return service.getProperty(ConfigurationProperty.IS_STATISTICS_RPC_ENABLED.toString(), Boolean::valueOf);
85 public NonZeroUint32Type getBarrierIntervalTimeoutLimit() {
86 final Long property = service.getProperty(
87 ConfigurationProperty.BARRIER_INTERVAL_TIMEOUT_LIMIT.toString(),
90 return new NonZeroUint32Type(property);
94 public NonZeroUint16Type getBarrierCountLimit() {
95 final Integer property = service.getProperty(
96 ConfigurationProperty.BARRIER_COUNT_LIMIT.toString(),
99 return new NonZeroUint16Type(property);
103 public NonZeroUint32Type getEchoReplyTimeout() {
104 final Long property = service.getProperty(
105 ConfigurationProperty.ECHO_REPLY_TIMEOUT.toString(),
108 return new NonZeroUint32Type(property);
112 public Integer getThreadPoolMinThreads() {
113 return service.getProperty(ConfigurationProperty.THREAD_POOL_MIN_THREADS.toString(), Integer::valueOf);
117 public NonZeroUint16Type getThreadPoolMaxThreads() {
118 final Integer property = service.getProperty(
119 ConfigurationProperty.THREAD_POOL_MAX_THREADS.toString(),
122 return new NonZeroUint16Type(property);
126 public Long getThreadPoolTimeout() {
127 return service.getProperty(ConfigurationProperty.THREAD_POOL_TIMEOUT.toString(), Long::valueOf);
131 public Boolean isEnableFlowRemovedNotification() {
132 return service.getProperty(ConfigurationProperty.ENABLE_FLOW_REMOVED_NOTIFICATION.toString(), Boolean::valueOf);
136 public Boolean isSkipTableFeatures() {
137 return service.getProperty(ConfigurationProperty.SKIP_TABLE_FEATURES.toString(), Boolean::valueOf);
141 public Boolean isEnableEqualRole() {
142 return service.getProperty(ConfigurationProperty.ENABLE_EQUAL_ROLE.toString(), Boolean::valueOf);
146 public NonZeroUint32Type getBasicTimerDelay() {
147 final Long property = service.getProperty(
148 ConfigurationProperty.BASIC_TIMER_DELAY.toString(),
151 return new NonZeroUint32Type(property);
155 public NonZeroUint32Type getMaximumTimerDelay() {
156 final Long property = service.getProperty(
157 ConfigurationProperty.MAXIMUM_TIMER_DELAY.toString(),
160 return new NonZeroUint32Type(property);
164 public Boolean isUseSingleLayerSerialization() {
165 return service.getProperty(ConfigurationProperty.USE_SINGLE_LAYER_SERIALIZATION.toString(), Boolean::valueOf);
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) {
176 public Integer getDeviceConnectionRateLimitPerMin() {
177 return service.getProperty(ConfigurationProperty.DEVICE_CONNECTION_RATE_LIMIT_PER_MIN.toString(),