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.api.openflow.configuration;
11 import com.google.common.collect.ImmutableMap;
12 import java.util.Locale;
16 * Enum of property keys. All keys from OpenFlowPlugin configuration file are parsed to this enum.
17 * Each enum value represents one working configuration key in format
18 * ENUM.name().toLowerCase().replace('_', '-'), so for example ConfigurationProperty.IS_STATISTICS_POLLING_ON
19 * represents 'is-statistics-polling-on' configuration key.
21 public enum ConfigurationProperty {
23 * Is statistics polling on property type.
25 IS_STATISTICS_POLLING_ON,
27 * Barrier count limit property type.
31 * Barrier interval timeout limit property type.
33 BARRIER_INTERVAL_TIMEOUT_LIMIT,
35 * Echo reply timeout property type.
39 * Enable flow removed notification property type.
41 ENABLE_FLOW_REMOVED_NOTIFICATION,
43 * Skip table features property type.
47 * Basic timer delay property type.
51 * Maximum timer delay property type.
55 * Switch features mandatory property type.
57 SWITCH_FEATURES_MANDATORY,
59 * Is statistics rpc enabled property type.
62 IS_STATISTICS_RPC_ENABLED,
64 * Use single layer serialization property type.
66 USE_SINGLE_LAYER_SERIALIZATION,
68 * Rpc requests quota property type.
72 * Global notification quota property type.
74 GLOBAL_NOTIFICATION_QUOTA,
76 * Thread pool min threads property type.
78 THREAD_POOL_MIN_THREADS,
80 * Thread pool max threads property type.
82 THREAD_POOL_MAX_THREADS,
84 * Thread pool timeout property type.
88 private static final Map<String, ConfigurationProperty> KEY_VALUE_MAP;
91 * Get property type from property key.
93 * @param key the property key
94 * @return the property type
96 public static ConfigurationProperty forValue(final String key) {
97 return KEY_VALUE_MAP.get(key);
101 final ConfigurationProperty[] values = values();
102 final ImmutableMap.Builder<String, ConfigurationProperty> builder = ImmutableMap.builder();
104 for (final ConfigurationProperty value : values) {
105 builder.put(value.toString(), value);
108 KEY_VALUE_MAP = builder.build();
112 * Converts enum name to property key.
114 * @return the property key
117 public String toString() {
118 return this.name().toLowerCase(Locale.ENGLISH).replace('_', '-');