From 58288a95b8f3eec2a09c677a33c7a9df74c4f250 Mon Sep 17 00:00:00 2001 From: Claudio Atzori Date: Mon, 15 Feb 2021 15:28:53 +0100 Subject: [PATCH] WIP: collectorWorker error reporting, added report messages --- .../src/main/java/eu/dnetlib/dhp/message/Message.java | 6 ++++++ .../src/main/java/eu/dnetlib/dhp/message/MessageType.java | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/dhp-common/src/main/java/eu/dnetlib/dhp/message/Message.java b/dhp-common/src/main/java/eu/dnetlib/dhp/message/Message.java index 0cbb6c859..ecccf8a43 100644 --- a/dhp-common/src/main/java/eu/dnetlib/dhp/message/Message.java +++ b/dhp-common/src/main/java/eu/dnetlib/dhp/message/Message.java @@ -19,6 +19,8 @@ public class Message implements Serializable { private Map body; + public Message() {} + public Message(final MessageType messageType, final String workflowId) { this(messageType, workflowId, new LinkedHashMap<>()); } @@ -33,6 +35,10 @@ public class Message implements Serializable { return messageType; } + public void setMessageType(MessageType messageType) { + this.messageType = messageType; + } + public String getWorkflowId() { return workflowId; } diff --git a/dhp-common/src/main/java/eu/dnetlib/dhp/message/MessageType.java b/dhp-common/src/main/java/eu/dnetlib/dhp/message/MessageType.java index 30f152c96..75ffb8ef5 100644 --- a/dhp-common/src/main/java/eu/dnetlib/dhp/message/MessageType.java +++ b/dhp-common/src/main/java/eu/dnetlib/dhp/message/MessageType.java @@ -1,11 +1,12 @@ package eu.dnetlib.dhp.message; +import java.io.Serializable; import java.util.Optional; import org.apache.commons.lang3.StringUtils; -public enum MessageType { +public enum MessageType implements Serializable { ONGOING, REPORT;