-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Code cleaned up. Generalized blocking client and async client.
- Loading branch information
Showing
10 changed files
with
518 additions
and
1,643 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,7 @@ | |
|
||
# Maven | ||
log/ | ||
target/ | ||
target/ | ||
|
||
# Project | ||
dependency-reduced-pom.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
src/main/java/org/apache/jmeter/protocol/mqtt/data/objects/Message.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package org.apache.jmeter.protocol.mqtt.data.objects; | ||
|
||
import org.eclipse.paho.client.mqttv3.MqttMessage; | ||
|
||
/** | ||
* | ||
*/ | ||
public class Message { | ||
private byte[] payload; | ||
private int qos = 0; | ||
private boolean retained = false; | ||
private boolean dup = false; | ||
private long currentTimestamp; | ||
|
||
public Message(byte[] payload, int qos, boolean retained, boolean dup, long currentTimestamp) { | ||
this.payload = payload; | ||
this.qos = qos; | ||
this.retained = retained; | ||
this.dup = dup; | ||
this.currentTimestamp = currentTimestamp; | ||
} | ||
|
||
public Message(MqttMessage mqttMessage) { | ||
this.payload = mqttMessage.getPayload(); | ||
this.qos = mqttMessage.getQos(); | ||
this.retained = mqttMessage.isRetained(); | ||
this.dup = mqttMessage.isDuplicate(); | ||
this.currentTimestamp = System.currentTimeMillis(); | ||
} | ||
|
||
public byte[] getPayload() { | ||
return payload; | ||
} | ||
|
||
public int getQos() { | ||
return qos; | ||
} | ||
|
||
public boolean isRetained() { | ||
return retained; | ||
} | ||
|
||
public void setRetained(boolean retained) { | ||
this.retained = retained; | ||
} | ||
|
||
public boolean isDup() { | ||
return dup; | ||
} | ||
|
||
public long getCurrentTimestamp() { | ||
return currentTimestamp; | ||
} | ||
} |
Oops, something went wrong.