Simplyfied creation of HazelcastMsg from InterceptPublishMessage

This commit is contained in:
andsel
2016-07-22 13:19:16 +02:00
parent 29fd6d03b9
commit 8cc588d766
3 changed files with 15 additions and 19 deletions
@@ -1,5 +1,7 @@
package io.moquette.interception;
import io.moquette.interception.messages.InterceptPublishMessage;
import java.io.Serializable;
/**
@@ -8,17 +10,15 @@ import java.io.Serializable;
public class HazelcastMsg implements Serializable {
private final String clientId;
private final String userName;
private final byte qos;
private final byte[] payload;
private final String topic;
public HazelcastMsg(String clientId, String topic, byte qos, byte[] payload, String userName) {
this.clientId = clientId;
this.qos = qos;
this.payload = payload;
this.userName = userName;
this.topic = topic;
public HazelcastMsg(InterceptPublishMessage msg) {
this.clientId = msg.getClientID();
this.topic = msg.getTopicName();
this.qos = msg.getQos().byteValue();
this.payload = msg.getPayload().array();
}
public String getClientId() {
@@ -33,10 +33,6 @@ public class HazelcastMsg implements Serializable {
return payload;
}
public String getUserName() {
return userName;
}
public String getTopic() {
return topic;
}