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
9 package org.opendaylight.openflowplugin.impl.configuration;
11 import org.opendaylight.openflowplugin.api.openflow.configuration.ConfigurationProperty;
12 import org.opendaylight.openflowplugin.api.openflow.configuration.ConfigurationService;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.NonZeroUint16Type;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.NonZeroUint32Type;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.OpenflowProviderConfig;
16 import org.opendaylight.yangtools.yang.binding.Augmentation;
17 import org.opendaylight.yangtools.yang.binding.DataContainer;
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 Long getGlobalNotificationQuota() {
42 return service.getProperty(ConfigurationProperty.GLOBAL_NOTIFICATION_QUOTA.toString(), Long::valueOf);
46 public Boolean isIsStatisticsPollingOn() {
47 return service.getProperty(ConfigurationProperty.IS_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
51 public Boolean isIsStatisticsRpcEnabled() {
52 return service.getProperty(ConfigurationProperty.IS_STATISTICS_RPC_ENABLED.toString(), Boolean::valueOf);
56 public NonZeroUint32Type getBarrierIntervalTimeoutLimit() {
57 final Long property = service.getProperty(
58 ConfigurationProperty.BARRIER_INTERVAL_TIMEOUT_LIMIT.toString(),
61 return new NonZeroUint32Type(property);
65 public NonZeroUint16Type getBarrierCountLimit() {
66 final Integer property = service.getProperty(
67 ConfigurationProperty.BARRIER_COUNT_LIMIT.toString(),
70 return new NonZeroUint16Type(property);
74 public NonZeroUint32Type getEchoReplyTimeout() {
75 final Long property = service.getProperty(
76 ConfigurationProperty.ECHO_REPLY_TIMEOUT.toString(),
79 return new NonZeroUint32Type(property);
83 public Integer getThreadPoolMinThreads() {
84 return service.getProperty(ConfigurationProperty.THREAD_POOL_MIN_THREADS.toString(), Integer::valueOf);
88 public NonZeroUint16Type getThreadPoolMaxThreads() {
89 final Integer property = service.getProperty(
90 ConfigurationProperty.THREAD_POOL_MAX_THREADS.toString(),
93 return new NonZeroUint16Type(property);
97 public Long getThreadPoolTimeout() {
98 return service.getProperty(ConfigurationProperty.THREAD_POOL_TIMEOUT.toString(), Long::valueOf);
102 public Boolean isEnableFlowRemovedNotification() {
103 return service.getProperty(ConfigurationProperty.ENABLE_FLOW_REMOVED_NOTIFICATION.toString(), Boolean::valueOf);
107 public Boolean isSkipTableFeatures() {
108 return service.getProperty(ConfigurationProperty.SKIP_TABLE_FEATURES.toString(), Boolean::valueOf);
112 public NonZeroUint32Type getBasicTimerDelay() {
113 final Long property = service.getProperty(
114 ConfigurationProperty.BASIC_TIMER_DELAY.toString(),
117 return new NonZeroUint32Type(property);
121 public NonZeroUint32Type getMaximumTimerDelay() {
122 final Long property = service.getProperty(
123 ConfigurationProperty.MAXIMUM_TIMER_DELAY.toString(),
126 return new NonZeroUint32Type(property);
130 public Boolean isUseSingleLayerSerialization() {
131 return service.getProperty(ConfigurationProperty.USE_SINGLE_LAYER_SERIALIZATION.toString(), Boolean::valueOf);
135 public <E extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.OpenflowProviderConfig>> E getAugmentation(java.lang.Class<E> augmentationType) {
140 public Class<? extends DataContainer> getImplementedInterface() {
141 return OpenflowProviderConfig.class;