This commit is contained in:
crusader 2018-07-01 02:23:57 +09:00
parent 5d7ed7c369
commit 162bb2c15d
2 changed files with 35 additions and 1 deletions

View File

@ -13,7 +13,7 @@
<groupId>com.loafle.overflow</groupId> <groupId>com.loafle.overflow</groupId>
<artifactId>commons-java</artifactId> <artifactId>commons-java</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<version>1.0.114-SNAPSHOT</version> <version>1.0.115-SNAPSHOT</version>
<name>com.loafle.overflow.commons-java</name> <name>com.loafle.overflow.commons-java</name>
<properties> <properties>

View File

@ -6,6 +6,7 @@ import java.util.List;
public class PublishMessage { public class PublishMessage {
private TargetType targetType; private TargetType targetType;
private List<String> targets; private List<String> targets;
private PublishMessageType messageType;
private PublishMessageBody message; private PublishMessageBody message;
public void setTargetType(TargetType targetType) { public void setTargetType(TargetType targetType) {
@ -31,6 +32,20 @@ public class PublishMessage {
return targets; 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) { public void setMessage(PublishMessageBody message) {
this.message = 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 { public static class PublishMessageBody {
private String jsonrpc = "2.0"; private String jsonrpc = "2.0";
private PublishMessageBodyNotification result; private PublishMessageBodyNotification result;