From 6fcfaee1aba933482c59dd8c86f9047a9685f860 Mon Sep 17 00:00:00 2001 From: CyB3RC0nN0R Date: Mon, 6 Jan 2020 18:00:43 +0100 Subject: [PATCH] Added MessageStatusChangeEvent, moved MessageEvent back to envoy-client. --- src/main/java/envoy/event/MessageEvent.java | 30 ------------- .../envoy/event/MessageStatusChangeEvent.java | 43 +++++++++++++++++++ 2 files changed, 43 insertions(+), 30 deletions(-) delete mode 100644 src/main/java/envoy/event/MessageEvent.java create mode 100644 src/main/java/envoy/event/MessageStatusChangeEvent.java diff --git a/src/main/java/envoy/event/MessageEvent.java b/src/main/java/envoy/event/MessageEvent.java deleted file mode 100644 index 45a7f40..0000000 --- a/src/main/java/envoy/event/MessageEvent.java +++ /dev/null @@ -1,30 +0,0 @@ -package envoy.event; - -import envoy.data.Message; - -/** - * Project: envoy-common
- * File: MessageCreationEvent.java
- * Created: 4 Dec 2019
- * - * @author Kai S. K. Engelbart - */ -public class MessageEvent implements Event { - - /** - * the {@link Message} attached to this {@link MessageEvent}. - */ - protected final Message message; - - /** - * Initializes a {@link MessageEvent} conveying information about a - * {@link Message} object. - * - * @param message the {@link Message} object to attach to this event - * @since Envoy v0.2-alpha - */ - public MessageEvent(Message message) { this.message = message; } - - @Override - public Message get() { return message; } -} diff --git a/src/main/java/envoy/event/MessageStatusChangeEvent.java b/src/main/java/envoy/event/MessageStatusChangeEvent.java new file mode 100644 index 0000000..bf17b0e --- /dev/null +++ b/src/main/java/envoy/event/MessageStatusChangeEvent.java @@ -0,0 +1,43 @@ +package envoy.event; + +import envoy.data.Message; + +/** + * Project: envoy-common
+ * File: MessageStatusChangeEvent.java
+ * Created: 6 Jan 2020
+ * + * @author Kai S. K. Engelbart + * @since Envoy Common v0.2-alpha + */ +public class MessageStatusChangeEvent implements Event { + + private final long messageId; + private final Message.MessageStatus messageStatus; + + /** + * Initializes a {@link MessageStatusChangeEvent}. + * + * @param messageId the ID of the {@link Message} this event is related to + * @param messageStatus the status of the {@link Message} this event is related + * to + * @since Envoy Common v0.2-alpha + */ + public MessageStatusChangeEvent(long messageId, Message.MessageStatus messageStatus) { + this.messageId = messageId; + this.messageStatus = messageStatus; + } + + /** + * @return the status of the {@link Message} this event is related to + * @since Envoy Common v0.2-alpha + */ + @Override + public Message.MessageStatus get() { return messageStatus; } + + /** + * @return the ID of the {@link Message} this event is related to + * @since Envoy Common v0.2-alpha + */ + public long getMessageId() { return messageId; } +}