From 162bb2c15d9576b3eb0c3521a3cdbf7ffbbce4f2 Mon Sep 17 00:00:00 2001 From: crusader Date: Sun, 1 Jul 2018 02:23:57 +0900 Subject: [PATCH] ing --- pom.xml | 2 +- .../overflow/core/model/PublishMessage.java | 34 +++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6f45b4b..18b20b7 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ com.loafle.overflow commons-java jar - 1.0.114-SNAPSHOT + 1.0.115-SNAPSHOT com.loafle.overflow.commons-java diff --git a/src/main/java/com/loafle/overflow/core/model/PublishMessage.java b/src/main/java/com/loafle/overflow/core/model/PublishMessage.java index 582cf27..3b543c6 100644 --- a/src/main/java/com/loafle/overflow/core/model/PublishMessage.java +++ b/src/main/java/com/loafle/overflow/core/model/PublishMessage.java @@ -6,6 +6,7 @@ import java.util.List; public class PublishMessage { private TargetType targetType; private List targets; + private PublishMessageType messageType; private PublishMessageBody message; public void setTargetType(TargetType targetType) { @@ -31,6 +32,20 @@ public class PublishMessage { return targets; } + /** + * @return the messageType + */ + public PublishMessageType getMessageType() { + return messageType; + } + + /** + * @param messageType the messageType to set + */ + public void setMessageType(PublishMessageType messageType) { + this.messageType = messageType; + } + public void setMessage(PublishMessageBody message) { this.message = message; } @@ -53,6 +68,25 @@ public class PublishMessage { } } + public static enum PublishMessageType { + TextMessage((short) 1), BinaryMessage((short) 2), CloseMessage((short) 8), PingMessage((short) 9), + PongMessage((short) 10),; + + private final Short value; + + /** + * @param value + */ + PublishMessageType(final Short value) { + this.value = value; + } + + public Short getValue() { + return this.value; + } + + } + public static class PublishMessageBody { private String jsonrpc = "2.0"; private PublishMessageBodyNotification result;