diff --git a/specification/src/main/asciidoc/chapters/Sparkplug_6_Payloads.adoc b/specification/src/main/asciidoc/chapters/Sparkplug_6_Payloads.adoc index 06fe94a0..ead1c438 100644 --- a/specification/src/main/asciidoc/chapters/Sparkplug_6_Payloads.adoc +++ b/specification/src/main/asciidoc/chapters/Sparkplug_6_Payloads.adoc @@ -160,36 +160,35 @@ enum DataType { Boolean = 11; String = 12; DateTime = 13; - Text = 14; // Additional Metric Types - UUID = 15; - DataSet = 16; - Bytes = 17; - File = 18; - Template = 19; + UUID = 14; + DataSet = 15; + Bytes = 16; + File = 17; + Template = 18; // Additional PropertyValue Types - PropertySet = 20; - PropertySetList = 21; + PropertySet = 19; + PropertySetList = 20; // Array Types - Int8Array = 22; - Int16Array = 23; - Int32Array = 24; - Int64Array = 25; - UInt8Array = 26; - UInt16Array = 27; - UInt32Array = 28; - UInt64Array = 29; - FloatArray = 30; - DoubleArray = 31; - BooleanArray = 32; - StringArray = 33; - DateTimeArray = 34; + Int8Array = 21; + Int16Array = 22; + Int32Array = 23; + Int64Array = 24; + UInt8Array = 25; + UInt16Array = 26; + UInt32Array = 27; + UInt64Array = 28; + FloatArray = 29; + DoubleArray = 30; + BooleanArray = 31; + StringArray = 32; + DateTimeArray = 33; // Command Type - Command = 35; // A callable command/function metric - the value is carried in the Metric 'command' field + Command = 34; // A callable command/function metric - the value is carried in the Metric 'command' field } // Per-metric operation, used only within NMMETA/DMMETA (modified metadata) messages to denote a @@ -265,7 +264,7 @@ message Payload { repeated float float_values = 6; // Float repeated double double_values = 7; // Double repeated bool boolean_values = 8; // Boolean - repeated string string_values = 9; // String, Text + repeated string string_values = 9; // String // The indexes of the elements that are null. Omitted entirely when none are. repeated uint32 null_indexes = 10; @@ -1674,36 +1673,35 @@ enum DataType { Boolean = 11; String = 12; DateTime = 13; - Text = 14; // Additional Metric Types - UUID = 15; - DataSet = 16; - Bytes = 17; - File = 18; - Template = 19; + UUID = 14; + DataSet = 15; + Bytes = 16; + File = 17; + Template = 18; // Additional PropertyValue Types - PropertySet = 20; - PropertySetList = 21; + PropertySet = 19; + PropertySetList = 20; // Array Types - Int8Array = 22; - Int16Array = 23; - Int32Array = 24; - Int64Array = 25; - UInt8Array = 26; - UInt16Array = 27; - UInt32Array = 28; - UInt64Array = 29; - FloatArray = 30; - DoubleArray = 31; - BooleanArray = 32; - StringArray = 33; - DateTimeArray = 34; + Int8Array = 21; + Int16Array = 22; + Int32Array = 23; + Int64Array = 24; + UInt8Array = 25; + UInt16Array = 26; + UInt32Array = 27; + UInt64Array = 28; + FloatArray = 29; + DoubleArray = 30; + BooleanArray = 31; + StringArray = 32; + DateTimeArray = 33; // Command Type - Command = 35; // A callable command/function metric - the value is carried in the Metric 'command' field + Command = 34; // A callable command/function metric - the value is carried in the Metric 'command' field } ---- @@ -1772,44 +1770,40 @@ representation it interoperates with is signed, so the ceiling is 2262-04-11 as link:#operational_behavior_timestamps[Timestamps] section. A DateTime carried in an array or a DataSet.Column uses the int64_values array of the ValueArray, as the link:#payloads_p_datatype_array[Array Types] section describes. -* _Text_ -** String value (UTF-8) -** Google Protocol Buffer Type: string -** Sparkplug enum value: 14 [[payloads_p_datatype_additional]] * *Additional Types* ** _UUID_ *** UUID value as a UTF-8 string *** Google Protocol Buffer Type: string -*** Sparkplug enum value: 15 +*** Sparkplug enum value: 14 ** _DataSet_ *** DataSet as defined link:#payloads_p_dataset[here] *** Google Protocol Buffer Type: none – defined in Sparkplug -*** Sparkplug enum value: 16 +*** Sparkplug enum value: 15 ** _Bytes_ *** Array of bytes *** Google Protocol Buffer Type: bytes -*** Sparkplug enum value: 17 +*** Sparkplug enum value: 16 ** _File_ *** Array of bytes representing a file *** Google Protocol Buffer Type: bytes -*** Sparkplug enum value: 18 +*** Sparkplug enum value: 17 ** _Template_ *** Template as defined link:#payloads_p_template[here] *** Google Protocol Buffer Type: none – defined in Sparkplug -*** Sparkplug enum value: 19 +*** Sparkplug enum value: 18 [[payloads_p_datatype_propertyvalue]] * *Additional PropertyValue Types* ** _PropertySet_ *** PropertySet as defined link:#payloads_p_propertyset[here] *** Google Protocol Buffer Type: none – defined in Sparkplug -*** Sparkplug enum value: 20 +*** Sparkplug enum value: 19 ** _PropertySetList_ *** PropertySetList as defined link:#payloads_p_propertysetlist[here] *** Google Protocol Buffer Type: none – defined in Sparkplug -*** Sparkplug enum value: 21 +*** Sparkplug enum value: 20 [[payloads_p_datatype_array]] * *Array Types* @@ -1848,43 +1842,43 @@ null_indexes to [1]. ** _Int8Array_ *** Elements are carried in the sint32_values field of the ValueArray -*** Sparkplug enum value: 22 +*** Sparkplug enum value: 21 ** _Int16Array_ *** Elements are carried in the sint32_values field of the ValueArray -*** Sparkplug enum value: 23 +*** Sparkplug enum value: 22 ** _Int32Array_ *** Elements are carried in the sint32_values field of the ValueArray -*** Sparkplug enum value: 24 +*** Sparkplug enum value: 23 ** _Int64Array_ *** Elements are carried in the sint64_values field of the ValueArray -*** Sparkplug enum value: 25 +*** Sparkplug enum value: 24 ** _UInt8Array_ *** Elements are carried in the uint32_values field of the ValueArray -*** Sparkplug enum value: 26 +*** Sparkplug enum value: 25 ** _UInt16Array_ *** Elements are carried in the uint32_values field of the ValueArray -*** Sparkplug enum value: 27 +*** Sparkplug enum value: 26 ** _UInt32Array_ *** Elements are carried in the uint32_values field of the ValueArray -*** Sparkplug enum value: 28 +*** Sparkplug enum value: 27 ** _UInt64Array_ *** Elements are carried in the uint64_values field of the ValueArray -*** Sparkplug enum value: 29 +*** Sparkplug enum value: 28 ** _FloatArray_ *** Elements are carried in the float_values field of the ValueArray -*** Sparkplug enum value: 30 +*** Sparkplug enum value: 29 ** _DoubleArray_ *** Elements are carried in the double_values field of the ValueArray -*** Sparkplug enum value: 31 +*** Sparkplug enum value: 30 ** _BooleanArray_ *** Elements are carried in the boolean_values field of the ValueArray -*** Sparkplug enum value: 32 +*** Sparkplug enum value: 31 ** _StringArray_ *** Elements are carried in the string_values field of the ValueArray -*** Sparkplug enum value: 33 +*** Sparkplug enum value: 32 ** _DateTimeArray_ *** Elements are carried in the int64_values field of the ValueArray -*** Sparkplug enum value: 34 +*** Sparkplug enum value: 33 [[payloads_p_datatype_command]] * *Command Type* @@ -1893,7 +1887,7 @@ null_indexes to [1]. object as defined link:#payloads_p_command[here]. A Command metric carries its content in the Metric _command_ field rather than the _value_ field. *** Google Protocol Buffer Type: none – defined in Sparkplug -*** Sparkplug enum value: 35 +*** Sparkplug enum value: 34 [[payloads_payload_representation_on_host_applications]] ==== Payload Representation on Host Applications diff --git a/tck/src/main/java/org/eclipse/sparkplug/impl/exception/json/DataSetDeserializer.java b/tck/src/main/java/org/eclipse/sparkplug/impl/exception/json/DataSetDeserializer.java index 2298ae66..c89cdb8d 100644 --- a/tck/src/main/java/org/eclipse/sparkplug/impl/exception/json/DataSetDeserializer.java +++ b/tck/src/main/java/org/eclipse/sparkplug/impl/exception/json/DataSetDeserializer.java @@ -117,7 +117,6 @@ private Value getValueFromNode(JsonNode nodeValue, DataSetDataType type) { case UInt32: case Int64: return new Value(type, (long) nodeValue.asLong()); - case Text: case String: return new Value(type, nodeValue.asText()); case UInt64: diff --git a/tck/src/main/java/org/eclipse/sparkplug/impl/exception/message/SparkplugBPayloadEncoder.java b/tck/src/main/java/org/eclipse/sparkplug/impl/exception/message/SparkplugBPayloadEncoder.java index a1157a5c..30d648ea 100644 --- a/tck/src/main/java/org/eclipse/sparkplug/impl/exception/message/SparkplugBPayloadEncoder.java +++ b/tck/src/main/java/org/eclipse/sparkplug/impl/exception/message/SparkplugBPayloadEncoder.java @@ -215,7 +215,6 @@ private SparkplugBProto.Payload.PropertySet.Builder convertPropertySet(PropertyS builder.setUint64Value(bigIntegerToUnsignedLong((BigInteger) value.getValue())); break; case String: - case Text: builder.setStringValue((String) value.getValue()); break; case PropertySet: @@ -288,7 +287,6 @@ private SparkplugBProto.Payload.Template.Parameter.Builder setParameterValue( case UInt64: builder.getTypedValueBuilder().setUint64Value(bigIntegerToUnsignedLong((BigInteger) value)); break; - case Text: case String: builder.getTypedValueBuilder().setStringValue((String) value); break; @@ -356,7 +354,6 @@ private SparkplugBProto.Payload.Metric.Builder setMetricValue(SparkplugBProto.Pa metricBuilder.getValueBuilder().setUint64Value(bigIntegerToUnsignedLong((BigInteger) metric.getValue())); break; case String: - case Text: case UUID: metricBuilder.getValueBuilder().setStringValue((String) metric.getValue()); break; @@ -741,7 +738,6 @@ private void addDataSetValue(SparkplugBProto.Payload.DataSet.Column.Builder colu va.addBooleanValues(toBoolean(raw)); break; case String: - case Text: va.addStringValues((String) raw); break; default: @@ -813,7 +809,6 @@ private void addDataSetPlaceholder(SparkplugBProto.Payload.DataSet.Column.Builde va.addBooleanValues(false); break; case String: - case Text: va.addStringValues(""); break; default: diff --git a/tck/src/main/java/org/eclipse/sparkplug/impl/exception/model/DataSetDataType.java b/tck/src/main/java/org/eclipse/sparkplug/impl/exception/model/DataSetDataType.java index 407a755d..abd588e3 100644 --- a/tck/src/main/java/org/eclipse/sparkplug/impl/exception/model/DataSetDataType.java +++ b/tck/src/main/java/org/eclipse/sparkplug/impl/exception/model/DataSetDataType.java @@ -37,7 +37,6 @@ public enum DataSetDataType { Boolean(11, Boolean.class), String(12, String.class), DateTime(13, Date.class), - Text(14, String.class), // Unknown Unknown(0, Object.class); @@ -99,8 +98,6 @@ public static DataSetDataType fromInteger(int i) { return String; case 13: return DateTime; - case 14: - return Text; default: return Unknown; } diff --git a/tck/src/main/java/org/eclipse/sparkplug/impl/exception/model/MetricDataType.java b/tck/src/main/java/org/eclipse/sparkplug/impl/exception/model/MetricDataType.java index 7e1e5f7d..390dc7fd 100644 --- a/tck/src/main/java/org/eclipse/sparkplug/impl/exception/model/MetricDataType.java +++ b/tck/src/main/java/org/eclipse/sparkplug/impl/exception/model/MetricDataType.java @@ -40,31 +40,30 @@ public enum MetricDataType { Boolean(11, Boolean.class), String(12, String.class), DateTime(13, Date.class), - Text(14, String.class), // Custom Types for Metrics - UUID(15, String.class), - DataSet(16, DataSet.class), - Bytes(17, byte[].class), - File(18, File.class), - Template(19, Template.class), + UUID(14, String.class), + DataSet(15, DataSet.class), + Bytes(16, byte[].class), + File(17, File.class), + Template(18, Template.class), // PropertyValue Types (20 and 21) are NOT metric datatypes // Array Types - Int8Array(22, Byte[].class), - Int16Array(23, Short[].class), - Int32Array(24, Integer[].class), - Int64Array(25, Long[].class), - UInt8Array(26, Short[].class), - UInt16Array(27, Integer[].class), - UInt32Array(28, Long[].class), - UInt64Array(29, BigInteger[].class), - FloatArray(30, Float[].class), - DoubleArray(31, Double[].class), - BooleanArray(32, Boolean[].class), - StringArray(33, String[].class), - DateTimeArray(34, Date[].class), + Int8Array(21, Byte[].class), + Int16Array(22, Short[].class), + Int32Array(23, Integer[].class), + Int64Array(24, Long[].class), + UInt8Array(25, Short[].class), + UInt16Array(26, Integer[].class), + UInt32Array(27, Long[].class), + UInt64Array(28, BigInteger[].class), + FloatArray(29, Float[].class), + DoubleArray(30, Double[].class), + BooleanArray(31, Boolean[].class), + StringArray(32, String[].class), + DateTimeArray(33, Date[].class), // Unknown Unknown(0, Object.class); @@ -131,42 +130,40 @@ public static MetricDataType fromInteger(int i) { case 13: return DateTime; case 14: - return Text; - case 15: return UUID; - case 16: + case 15: return DataSet; - case 17: + case 16: return Bytes; - case 18: + case 17: return File; - case 19: + case 18: return Template; - case 22: + case 21: return Int8Array; - case 23: + case 22: return Int16Array; - case 24: + case 23: return Int32Array; - case 25: + case 24: return Int64Array; - case 26: + case 25: return UInt8Array; - case 27: + case 26: return UInt16Array; - case 28: + case 27: return UInt32Array; - case 29: + case 28: return UInt64Array; - case 30: + case 29: return FloatArray; - case 31: + case 30: return DoubleArray; - case 32: + case 31: return BooleanArray; - case 33: + case 32: return StringArray; - case 34: + case 33: return DateTimeArray; default: return Unknown; diff --git a/tck/src/main/java/org/eclipse/sparkplug/impl/exception/model/ParameterDataType.java b/tck/src/main/java/org/eclipse/sparkplug/impl/exception/model/ParameterDataType.java index 38022663..3f7bbd3e 100644 --- a/tck/src/main/java/org/eclipse/sparkplug/impl/exception/model/ParameterDataType.java +++ b/tck/src/main/java/org/eclipse/sparkplug/impl/exception/model/ParameterDataType.java @@ -39,7 +39,6 @@ public enum ParameterDataType { Boolean(11, Boolean.class), String(12, String.class), DateTime(13, Date.class), - Text(14, String.class), // Unknown Unknown(0, Object.class); @@ -104,8 +103,6 @@ public static ParameterDataType fromInteger(int i) { return String; case 13: return DateTime; - case 14: - return Text; default: return Unknown; } diff --git a/tck/src/main/java/org/eclipse/sparkplug/impl/exception/model/PropertyDataType.java b/tck/src/main/java/org/eclipse/sparkplug/impl/exception/model/PropertyDataType.java index afe91f9d..3edf3833 100644 --- a/tck/src/main/java/org/eclipse/sparkplug/impl/exception/model/PropertyDataType.java +++ b/tck/src/main/java/org/eclipse/sparkplug/impl/exception/model/PropertyDataType.java @@ -40,11 +40,10 @@ public enum PropertyDataType { Boolean(11, Boolean.class), String(12, String.class), DateTime(13, Date.class), - Text(14, String.class), // Custom Types for PropertySets - PropertySet(20, PropertySet.class), - PropertySetList(21, List.class), + PropertySet(19, PropertySet.class), + PropertySetList(20, List.class), // Unknown Unknown(0, Object.class); @@ -113,11 +112,9 @@ public static PropertyDataType fromInteger(int i) { return String; case 13: return DateTime; - case 14: - return Text; - case 20: + case 19: return PropertySet; - case 21: + case 20: return PropertySetList; default: return Unknown; diff --git a/tck/src/main/java/org/eclipse/sparkplug/tck/test/common/Utils.java b/tck/src/main/java/org/eclipse/sparkplug/tck/test/common/Utils.java index b9ec84d1..79962c91 100644 --- a/tck/src/main/java/org/eclipse/sparkplug/tck/test/common/Utils.java +++ b/tck/src/main/java/org/eclipse/sparkplug/tck/test/common/Utils.java @@ -226,7 +226,6 @@ private static Payload.TypedValue.ValueCase expectedValueCase(DataType datatype) case Boolean: return Payload.TypedValue.ValueCase.BOOLEAN_VALUE; case String: - case Text: case UUID: return Payload.TypedValue.ValueCase.STRING_VALUE; case Bytes: diff --git a/tck/src/main/java/org/eclipse/sparkplug/tck/test/edge/SendComplexDataTest.java b/tck/src/main/java/org/eclipse/sparkplug/tck/test/edge/SendComplexDataTest.java index 969a526b..191832cb 100644 --- a/tck/src/main/java/org/eclipse/sparkplug/tck/test/edge/SendComplexDataTest.java +++ b/tck/src/main/java/org/eclipse/sparkplug/tck/test/edge/SendComplexDataTest.java @@ -658,7 +658,7 @@ public boolean checkTemplate(final @NotNull PublishPacket packet) { if (p.getTypedValue().hasDatatype()) { int curtype = p.getTypedValue().getDatatype().getNumber(); // -type-value asks the narrower question: is it a Basic Data Type - boolean isBasicType = curtype >= 0 && curtype <= DataType.Text.getNumber(); + boolean isBasicType = curtype >= 0 && curtype <= DataType.DateTime.getNumber(); if (!isBasicType) { logger.info("FOR {} the TYPE is: {} AND {}", p.getName(), curtype, p); } diff --git a/tck/src/main/java/org/eclipse/sparkplug/tck/utility/EdgeNode.java b/tck/src/main/java/org/eclipse/sparkplug/tck/utility/EdgeNode.java index 793a19e2..81a1ed4f 100644 --- a/tck/src/main/java/org/eclipse/sparkplug/tck/utility/EdgeNode.java +++ b/tck/src/main/java/org/eclipse/sparkplug/tck/utility/EdgeNode.java @@ -25,7 +25,6 @@ import static org.eclipse.sparkplug.impl.exception.model.MetricDataType.Int8; import static org.eclipse.sparkplug.impl.exception.model.MetricDataType.String; import static org.eclipse.sparkplug.impl.exception.model.MetricDataType.Template; -import static org.eclipse.sparkplug.impl.exception.model.MetricDataType.Text; import static org.eclipse.sparkplug.impl.exception.model.MetricDataType.UInt16; import static org.eclipse.sparkplug.impl.exception.model.MetricDataType.UInt32; import static org.eclipse.sparkplug.impl.exception.model.MetricDataType.UInt64; @@ -414,7 +413,6 @@ private List newMetrics(boolean isBirth) throws SparkplugException { metrics.add(new MetricBuilder("Boolean", Boolean, random.nextBoolean()).createMetric()); metrics.add(new MetricBuilder("String", String, newUUID()).createMetric()); metrics.add(new MetricBuilder("DateTime", DateTime, new Date()).createMetric()); - metrics.add(new MetricBuilder("Text", Text, newUUID()).createMetric()); metrics.add(new MetricBuilder("UUID", UUID, newUUID()).createMetric()); // metrics.add(new MetricBuilder("Bytes", Bytes, // randomBytes(20)).createMetric()); @@ -512,7 +510,6 @@ private Template newTemplate(boolean isDef, String templatRef) throws SparkplugE metrics.add(new MetricBuilder("MyBoolean", Boolean, random.nextBoolean()).createMetric()); metrics.add(new MetricBuilder("MyString", String, newUUID()).createMetric()); metrics.add(new MetricBuilder("MyDateTime", DateTime, new Date()).createMetric()); - metrics.add(new MetricBuilder("MyText", Text, newUUID()).createMetric()); metrics.add(new MetricBuilder("MyUUID", UUID, newUUID()).createMetric()); return new TemplateBuilder().version("v1.0").templateRef(templatRef).definition(isDef) @@ -524,12 +521,11 @@ private DataSet newDataSet() throws SparkplugException { return new DataSetBuilder(14).addColumnName("Int8s").addColumnName("Int16s").addColumnName("Int32s") .addColumnName("Int64s").addColumnName("UInt8s").addColumnName("UInt16s").addColumnName("UInt32s") .addColumnName("UInt64s").addColumnName("Floats").addColumnName("Doubles").addColumnName("Booleans") - .addColumnName("Strings").addColumnName("Dates").addColumnName("Texts").addType(DataSetDataType.Int8) + .addColumnName("Strings").addColumnName("Dates").addType(DataSetDataType.Int8) .addType(DataSetDataType.Int16).addType(DataSetDataType.Int32).addType(DataSetDataType.Int64) .addType(DataSetDataType.UInt8).addType(DataSetDataType.UInt16).addType(DataSetDataType.UInt32) .addType(DataSetDataType.UInt64).addType(DataSetDataType.Float).addType(DataSetDataType.Double) .addType(DataSetDataType.Boolean).addType(DataSetDataType.String).addType(DataSetDataType.DateTime) - .addType(DataSetDataType.Text) .addRow(new RowBuilder().addValue(new Value(DataSetDataType.Int8, (byte) random.nextInt())) .addValue(new Value(DataSetDataType.Int16, (short) random.nextInt())) .addValue(new Value(DataSetDataType.Int32, random.nextInt())) @@ -542,8 +538,7 @@ private DataSet newDataSet() throws SparkplugException { .addValue(new Value(DataSetDataType.Double, random.nextDouble())) .addValue(new Value(DataSetDataType.Boolean, random.nextBoolean())) .addValue(new Value(DataSetDataType.String, newUUID())) - .addValue(new Value(DataSetDataType.DateTime, new Date())) - .addValue(new Value(DataSetDataType.Text, newUUID())).createRow()) + .addValue(new Value(DataSetDataType.DateTime, new Date())).createRow()) .addRow(new RowBuilder().addValue(new Value(DataSetDataType.Int8, (byte) random.nextInt())) .addValue(new Value(DataSetDataType.Int16, (short) random.nextInt())) .addValue(new Value(DataSetDataType.Int32, random.nextInt())) @@ -556,8 +551,7 @@ private DataSet newDataSet() throws SparkplugException { .addValue(new Value(DataSetDataType.Double, random.nextDouble())) .addValue(new Value(DataSetDataType.Boolean, random.nextBoolean())) .addValue(new Value(DataSetDataType.String, newUUID())) - .addValue(new Value(DataSetDataType.DateTime, new Date())) - .addValue(new Value(DataSetDataType.Text, newUUID())).createRow()) + .addValue(new Value(DataSetDataType.DateTime, new Date())).createRow()) .createDataSet(); }