From 6bc01b7340931c16f6219f4538e239f9bc157a2e Mon Sep 17 00:00:00 2001 From: Steven Hartley Date: Tue, 30 Jan 2024 13:46:41 -0500 Subject: [PATCH] uProtocol enum value type to CloudEvent enum value mapping (#98) * Remove outdated and unnecessary README * Add CloudEvent attribute Mapping The following provides clean/clear contracts for mapping CloudEvent defined types to uProtocol types. #97 --- pom.xml | 15 --------------- uprotocol/uattributes.proto | 21 +++++++++++---------- uprotocol/uprotocol_options.proto | 3 +++ 3 files changed, 14 insertions(+), 25 deletions(-) diff --git a/pom.xml b/pom.xml index 543db6c..2a41ea7 100644 --- a/pom.xml +++ b/pom.xml @@ -114,21 +114,6 @@ - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.6.0 - - - attach-javadocs - - jar - - - - - org.apache.maven.plugins maven-release-plugin diff --git a/uprotocol/uattributes.proto b/uprotocol/uattributes.proto index 29811a1..4e41088 100644 --- a/uprotocol/uattributes.proto +++ b/uprotocol/uattributes.proto @@ -28,6 +28,7 @@ import "uri.proto"; import "uuid.proto"; + import "uprotocol_options.proto"; option java_package = "org.eclipse.uprotocol.v1"; option java_outer_classname = "UAttributesProto"; @@ -81,9 +82,9 @@ message UAttributes { // validity of the data in the {@link UAttributes}. enum UMessageType { UMESSAGE_TYPE_UNSPECIFIED = 0; // Unspecified message type - UMESSAGE_TYPE_PUBLISH = 1; // Publish or notification - UMESSAGE_TYPE_REQUEST = 2; // Request - UMESSAGE_TYPE_RESPONSE = 3; // Response + UMESSAGE_TYPE_PUBLISH = 1 [(uprotocol.ce_name) = "pub.v1"]; // Publish or notification + UMESSAGE_TYPE_REQUEST = 2 [(uprotocol.ce_name) = "req.v1"]; // Request + UMESSAGE_TYPE_RESPONSE = 3 [(uprotocol.ce_name) = "res.v1"]; // Response } @@ -94,23 +95,23 @@ enum UPriority { UPRIORITY_UNSPECIFIED = 0; // Low Priority. No bandwidth assurance such as File Transfer. - UPRIORITY_CS0 = 1; + UPRIORITY_CS0 = 1 [(uprotocol.ce_name) = "CS0"]; // Standard, undifferentiated application such as General (unclassified). - UPRIORITY_CS1 = 2; + UPRIORITY_CS1 = 2 [(uprotocol.ce_name) = "CS1"]; // Operations, Administration, and Management such as Streamer messages (sub, connect, etc…) - UPRIORITY_CS2 = 3; + UPRIORITY_CS2 = 3 [(uprotocol.ce_name) = "CS2"]; // Multimedia streaming such as Video Streaming - UPRIORITY_CS3 = 4; + UPRIORITY_CS3 = 4 [(uprotocol.ce_name) = "CS3"]; // Real-time interactive such as High priority (rpc events) - UPRIORITY_CS4 = 5; + UPRIORITY_CS4 = 5 [(uprotocol.ce_name) = "CS4"]; // Signaling such as Important - UPRIORITY_CS5 = 6; + UPRIORITY_CS5 = 6 [(uprotocol.ce_name) = "CS5"]; // Network control such as Safety Critical - UPRIORITY_CS6 = 7; + UPRIORITY_CS6 = 7 [(uprotocol.ce_name) = "CS6"]; } diff --git a/uprotocol/uprotocol_options.proto b/uprotocol/uprotocol_options.proto index 7f17f26..c7ffcf2 100644 --- a/uprotocol/uprotocol_options.proto +++ b/uprotocol/uprotocol_options.proto @@ -76,4 +76,7 @@ extend google.protobuf.FieldOptions { extend google.protobuf.EnumValueOptions { // MIME type mapping optional string mime_type = 50500; + + // CloudEvent String representation of the uProtocol enum value + optional string ce_name = 50501; } \ No newline at end of file