nandorsoma commented on code in PR #6225:
URL: https://github.com/apache/nifi/pull/6225#discussion_r952881239
##########
nifi-nar-bundles/nifi-mqtt-bundle/nifi-mqtt-processors/src/main/java/org/apache/nifi/processors/mqtt/common/MqttConstants.java:
##########
@@ -67,14 +69,45 @@ public class MqttConstants {
*/
public static final AllowableValue ALLOWABLE_VALUE_MQTT_VERSION_AUTO =
new
AllowableValue(String.valueOf(MqttConnectOptions.MQTT_VERSION_DEFAULT),
- "AUTO",
+ "v3 AUTO",
"Start with v3.1.1 and fallback to v3.1.0 if not supported
by a broker");
+ public static final AllowableValue ALLOWABLE_VALUE_MQTT_VERSION_500 =
+ new
AllowableValue(String.valueOf(MqttVersion.MQTT_VERSION_5_0.getNumericValue()),
+ "v5.0");
+
public static final AllowableValue ALLOWABLE_VALUE_MQTT_VERSION_311 =
- new
AllowableValue(String.valueOf(MqttConnectOptions.MQTT_VERSION_3_1_1),
+ new
AllowableValue(String.valueOf(MqttVersion.MQTT_VERSION_3_1_1.getNumericValue()),
"v3.1.1");
public static final AllowableValue ALLOWABLE_VALUE_MQTT_VERSION_310 =
- new
AllowableValue(String.valueOf(MqttConnectOptions.MQTT_VERSION_3_1),
+ new
AllowableValue(String.valueOf(MqttVersion.MQTT_VERSION_3_1.getNumericValue()),
"v3.1.0");
+
+ public enum MqttVersion {
+ MQTT_VERSION_3_1(3),
+ MQTT_VERSION_3_1_1(4),
+ MQTT_VERSION_5_0(5);
+
+ private final int numericValue;
+
+ MqttVersion(int numericValue) {
+ this.numericValue = numericValue;
+ }
+
+ public int getNumericValue() {
+ return numericValue;
+ }
+ }
+
+ public enum SupportedSchemes {
+ TCP,
+ SSL,
+ WS,
+ WSS;
+
+ public static String getValuesAsString(String delimiter) {
+ return String.join(delimiter, Arrays.stream(values()).map(value ->
value.name().toLowerCase()).toArray(String[]::new));
+ }
+ }
Review Comment:
Changed and renamed based on the review of @turcsanyip .
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]