Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
uProtocol enum value type to CloudEvent enum value mapping (#98)
Browse files Browse the repository at this point in the history
* Remove outdated and unnecessary README

* Add CloudEvent attribute Mapping

The following provides clean/clear contracts for mapping CloudEvent defined
types to uProtocol types.

#97
  • Loading branch information
Steven Hartley committed Jan 30, 2024
1 parent ed1be74 commit 6bc01b7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 25 deletions.
15 changes: 0 additions & 15 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,21 +114,6 @@
</plugin>

<!-- requirement plugins -->

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.6.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
Expand Down
21 changes: 11 additions & 10 deletions uprotocol/uattributes.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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
}


Expand All @@ -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"];
}
3 changes: 3 additions & 0 deletions uprotocol/uprotocol_options.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 6bc01b7

Please sign in to comment.