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 * Is table statistics polling on property type.
29 IS_TABLE_STATISTICS_POLLING_ON,
31 * Is flow statistics polling on property type.
33 IS_FLOW_STATISTICS_POLLING_ON,
35 * Is group statistics polling on property type.
37 IS_GROUP_STATISTICS_POLLING_ON,
39 * Is meter statistics polling on property type.
41 IS_METER_STATISTICS_POLLING_ON,
43 * Is port statistics polling on property type.
45 IS_PORT_STATISTICS_POLLING_ON,
47 * Is queue statistics polling on property type.
49 IS_QUEUE_STATISTICS_POLLING_ON,
51 * Barrier count limit property type.
55 * Barrier interval timeout limit property type.
57 BARRIER_INTERVAL_TIMEOUT_LIMIT,
59 * Echo reply timeout property type.
63 * Enable flow removed notification property type.
65 ENABLE_FLOW_REMOVED_NOTIFICATION,
67 * Skip table features property type.
71 * Basic timer delay property type.
75 * Maximum timer delay property type.
79 * Switch features mandatory property type.
81 SWITCH_FEATURES_MANDATORY,
83 * Is statistics rpc enabled property type.
86 IS_STATISTICS_RPC_ENABLED,
88 * Use single layer serialization property type.
90 USE_SINGLE_LAYER_SERIALIZATION,
92 * Rpc requests quota property type.
96 * Global notification quota property type.
98 GLOBAL_NOTIFICATION_QUOTA,
100 * Thread pool min threads property type.
102 THREAD_POOL_MIN_THREADS,
104 * Thread pool max threads property type.
106 THREAD_POOL_MAX_THREADS,
108 * Thread pool timeout property type.
112 * Enable or disable equal role functionality.
116 * Device connection rate limit property type.
118 DEVICE_CONNECTION_RATE_LIMIT_PER_MIN,
120 * Device connection hold time property type.
122 DEVICE_CONNECTION_HOLD_TIME_IN_SECONDS,
124 * Delay for Device removal from Operational DataStore.
126 DEVICE_DATASTORE_REMOVAL_DELAY,
128 * Enable or disable customtrustmanager which adds switch certificate attributes to TLS
129 * failure notification property type.
131 ENABLE_CUSTOM_TRUST_MANAGER;
133 private static final Map<String, ConfigurationProperty> KEY_VALUE_MAP;
136 * Get property type from property key.
138 * @param key the property key
139 * @return the property type
141 public static ConfigurationProperty forValue(final String key) {
142 return KEY_VALUE_MAP.get(key);
146 final ConfigurationProperty[] values = values();
147 final ImmutableMap.Builder<String, ConfigurationProperty> builder = ImmutableMap.builder();
149 for (final ConfigurationProperty value : values) {
150 builder.put(value.toString(), value);
153 KEY_VALUE_MAP = builder.build();
157 * Converts enum name to property key.
159 * @return the property key
162 public String toString() {
163 return this.name().toLowerCase(Locale.ENGLISH).replace('_', '-');