Skip to content
This repository was archived by the owner on May 8, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion agrirouter-sdk-java-api/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
Expand All @@ -15,6 +16,10 @@
<groupId>com.agrirouter.proto</groupId>
<artifactId>agrirouter-api-protobuf-definitions</artifactId>
</dependency>
<dependency>
<groupId>com.agrirouter.proto</groupId>
<artifactId>agrirouter-tmt-protobuf-definitions</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
package com.dke.data.agrirouter.api.enums

import agrirouter.technicalmessagetype.Gps

/**
* Enum containing all the content message types the AR is supporting.
*/
enum class ContentMessageType(private val key: String) : TechnicalMessageType {
ISO_11783_TASKDATA_ZIP("iso:11783:-10:taskdata:zip"),
ISO_11783_DEVICE_DESCRIPTION("iso:11783:-10:device_description:protobuf"),
ISO_11783_TIME_LOG("iso:11783:-10:time_log:protobuf"),
SHP_SHAPE_ZIP("shp:shape:zip"),
DOC_PDF("doc:pdf"),
IMG_JPEG("img:jpeg"),
IMG_PNG("img:png"),
IMG_BMP("img:bmp"),
VID_AVI("vid:avi"),
VID_MP4("vid:mp4"),
VID_WMV("vid:wmv"),
GPS_INFO("gps:info");
enum class ContentMessageType(private val key: String, private val typeUrl: String) : TechnicalMessageType {
ISO_11783_TASKDATA_ZIP("iso:11783:-10:taskdata:zip", ""),

//FIXME Since the spec is not public, we can only use those literals.
ISO_11783_DEVICE_DESCRIPTION("iso:11783:-10:device_description:protobuf", "types.agrirouter.com\\efdi.ISO11783_TaskData"),
ISO_11783_TIME_LOG("iso:11783:-10:time_log:protobuf", "types.agrirouter.com\\efdi.TimeLog"),

SHP_SHAPE_ZIP("shp:shape:zip", ""),
DOC_PDF("doc:pdf", ""),
IMG_JPEG("img:jpeg", ""),
IMG_PNG("img:png", ""),
IMG_BMP("img:bmp", ""),
VID_AVI("vid:avi", ""),
VID_MP4("vid:mp4", ""),
VID_WMV("vid:wmv", ""),
GPS_INFO("gps:info", Gps.GPSList.getDescriptor().fullName);

override fun getKey(): String {
return key
}

override fun getTypeUrl(): String {
return typeUrl
}
}
Original file line number Diff line number Diff line change
@@ -1,23 +1,33 @@
package com.dke.data.agrirouter.api.enums

import agrirouter.cloud.registration.CloudVirtualizedAppRegistration
import agrirouter.feed.request.FeedRequests
import agrirouter.request.payload.account.Endpoints
import agrirouter.request.payload.endpoint.Capabilities
import agrirouter.request.payload.endpoint.SubscriptionOuterClass

/**
* Enum containing all the content message types the AR is supporting.
*/
enum class SystemMessageType(private val key: String) : TechnicalMessageType {
EMPTY(""),
DKE_CLOUD_ONBOARD_ENDPOINTS("dke:cloud_onboard_endpoints"),
DKE_CLOUD_OFFBOARD_ENDPOINTS("dke:cloud_offboard_endpoints"),
DKE_CAPABILITIES("dke:capabilities"),
DKE_SUBSCRIPTION("dke:subscription"),
DKE_LIST_ENDPOINTS("dke:list_endpoints"),
DKE_LIST_ENDPOINTS_UNFILTERED("dke:list_endpoints_unfiltered"),
DKE_FEED_CONFIRM("dke:feed_confirm"),
DKE_FEED_DELETE("dke:feed_delete"),
DKE_FEED_MESSAGE_QUERY("dke:feed_message_query"),
DKE_FEED_HEADER_QUERY("dke:feed_header_query");
enum class SystemMessageType(private val key: String, private val typeUrl: String) : TechnicalMessageType {
EMPTY("", ""),
DKE_CLOUD_ONBOARD_ENDPOINTS("dke:cloud_onboard_endpoints", CloudVirtualizedAppRegistration.OnboardingRequest.getDescriptor().fullName),
DKE_CLOUD_OFFBOARD_ENDPOINTS("dke:cloud_offboard_endpoints", CloudVirtualizedAppRegistration.OffboardingRequest.getDescriptor().fullName),
DKE_CAPABILITIES("dke:capabilities", Capabilities.CapabilitySpecification.getDescriptor().fullName),
DKE_SUBSCRIPTION("dke:subscription", SubscriptionOuterClass.Subscription.getDescriptor().fullName),
DKE_LIST_ENDPOINTS("dke:list_endpoints", Endpoints.ListEndpointsQuery.getDescriptor().fullName),
DKE_LIST_ENDPOINTS_UNFILTERED("dke:list_endpoints_unfiltered", Endpoints.ListEndpointsQuery.getDescriptor().fullName),
DKE_FEED_CONFIRM("dke:feed_confirm", FeedRequests.MessageConfirm.getDescriptor().fullName),
DKE_FEED_DELETE("dke:feed_delete", FeedRequests.MessageDelete.getDescriptor().fullName),
DKE_FEED_MESSAGE_QUERY("dke:feed_message_query", FeedRequests.MessageQuery.getDescriptor().fullName),
DKE_FEED_HEADER_QUERY("dke:feed_header_query", FeedRequests.MessageQuery.getDescriptor().fullName);

override fun getKey(): String {
return key
}

override fun getTypeUrl(): String {
return typeUrl
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,9 @@ interface TechnicalMessageType {
*/
fun getKey(): String

/**
* The type url (if present) of the technical message type.
*/
fun getTypeUrl(): String

}
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ default EncodedMessage encode(DeleteMessageParameters parameters) {
}

PayloadParameters payloadParameters = new PayloadParameters();
payloadParameters.setTypeUrl(FeedRequests.MessageDelete.getDescriptor().getFullName());
payloadParameters.setTypeUrl(SystemMessageType.DKE_FEED_DELETE.getTypeUrl());
payloadParameters.setValue(messageContent.build().toByteString());

String encodedMessage =
Expand Down Expand Up @@ -119,7 +119,7 @@ default EncodedMessage encode(ListEndpointsParameters parameters) {
Objects.requireNonNull(parameters.getTechnicalMessageType()).getKey());

PayloadParameters payloadParameters = new PayloadParameters();
payloadParameters.setTypeUrl(Endpoints.ListEndpointsQuery.getDescriptor().getFullName());
payloadParameters.setTypeUrl(SystemMessageType.DKE_LIST_ENDPOINTS.getTypeUrl());
payloadParameters.setValue(messageContent.build().toByteString());

String encodedMessage =
Expand Down Expand Up @@ -163,7 +163,7 @@ default EncodedMessage encode(MessageConfirmationParameters parameters) {
messageContent.addAllMessageIds(Objects.requireNonNull(parameters.getMessageIds()));

PayloadParameters payloadParameters = new PayloadParameters();
payloadParameters.setTypeUrl(FeedRequests.MessageConfirm.getDescriptor().getFullName());
payloadParameters.setTypeUrl(SystemMessageType.DKE_FEED_CONFIRM.getTypeUrl());
payloadParameters.setValue(messageContent.build().toByteString());

String encodedMessage =
Expand Down Expand Up @@ -224,8 +224,7 @@ default EncodedMessage encode(SetCapabilitiesParameters parameters) {
});

PayloadParameters payloadParameters = new PayloadParameters();
payloadParameters.setTypeUrl(
Capabilities.CapabilitySpecification.getDescriptor().getFullName());
payloadParameters.setTypeUrl(SystemMessageType.DKE_CAPABILITIES.getTypeUrl());
payloadParameters.setValue(builder.build().toByteString());

String encodedMessage =
Expand Down Expand Up @@ -281,7 +280,7 @@ default EncodedMessage encodeMessage(SetSubscriptionParameters parameters) {
});

PayloadParameters payloadParameters = new PayloadParameters();
payloadParameters.setTypeUrl(SubscriptionOuterClass.Subscription.getDescriptor().getFullName());
payloadParameters.setTypeUrl(SystemMessageType.DKE_SUBSCRIPTION.getTypeUrl());
payloadParameters.setValue(messageContent.build().toByteString());

String encodedMessage =
Expand Down Expand Up @@ -345,7 +344,7 @@ default EncodedMessage encode(

this.getNativeLogger().trace("Build message payload parameters.");
PayloadParameters payloadParameters = new PayloadParameters();
payloadParameters.setTypeUrl(FeedRequests.MessageQuery.getDescriptor().getFullName());
payloadParameters.setTypeUrl(technicalMessageType.getTypeUrl());
payloadParameters.setValue(messageContent.build().toByteString());

this.getNativeLogger().trace("Encode message.");
Expand Down Expand Up @@ -400,8 +399,7 @@ default EncodedMessage encode(CloudOnboardingParameters parameters) {
});

PayloadParameters payloadParameters = new PayloadParameters();
payloadParameters.setTypeUrl(
CloudVirtualizedAppRegistration.OnboardingRequest.getDescriptor().getFullName());
payloadParameters.setTypeUrl(SystemMessageType.DKE_CLOUD_ONBOARD_ENDPOINTS.getTypeUrl());
payloadParameters.setValue(messageContent.build().toByteString());

String encodedMessage =
Expand Down Expand Up @@ -439,8 +437,7 @@ default EncodedMessage encode(CloudOffboardingParameters parameters) {
parameters.getOnboardingResponse()));

PayloadParameters payloadParameters = new PayloadParameters();
payloadParameters.setTypeUrl(
CloudVirtualizedAppRegistration.OffboardingRequest.getDescriptor().getFullName());
payloadParameters.setTypeUrl(SystemMessageType.DKE_CLOUD_OFFBOARD_ENDPOINTS.getTypeUrl());

payloadParameters.setValue(messageContent.build().toByteString());

Expand Down
10 changes: 10 additions & 0 deletions ci/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,15 @@
<username>DKE-Data</username>
<password>${GITHUB_TOKEN}</password>
</server>
<server>
<id>github-api-protobuf-definitions</id>
<username>DKE-Data</username>
<password>${GITHUB_TOKEN}</password>
</server>
<server>
<id>github-tmt-protobuf-definitions</id>
<username>DKE-Data</username>
<password>${GITHUB_TOKEN}</password>
</server>
</servers>
</settings>
9 changes: 8 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<repository>
<id>github</id>
<name>GitHub DKE-Data Apache Maven Packages</name>
<url>https://maven.pkg.github.com/DKE-Data/agrirouter-api-protobuf-definitions</url>
<url>https://maven.pkg.github.com/DKE-Data/*</url>
</repository>
</repositories>

Expand Down Expand Up @@ -129,6 +129,13 @@
<version>${agrirouter-api-protobuf-definitions.version}</version>
</dependency>

<!-- ADDITIONAL PROTOBUF DEFINITIONS -->
<dependency>
<groupId>com.agrirouter.proto</groupId>
<artifactId>agrirouter-tmt-protobuf-definitions</artifactId>
<version>2.0.0</version>
</dependency>

<!-- REST-ASSURED -->
<dependency>
<groupId>io.rest-assured</groupId>
Expand Down