Added username to all messages. From a consumer perspective the username is more useful than a clientID which is often autogenerated.
This commit is contained in:
+33
-27
@@ -1,27 +1,33 @@
|
||||
package io.moquette.interception.messages;
|
||||
|
||||
import io.moquette.parser.proto.messages.AbstractMessage;
|
||||
import io.moquette.spi.impl.subscriptions.Subscription;
|
||||
|
||||
/**
|
||||
* @author Wagner Macedo
|
||||
*/
|
||||
public class InterceptSubscribeMessage {
|
||||
private final Subscription subscription;
|
||||
|
||||
public InterceptSubscribeMessage(Subscription subscription) {
|
||||
this.subscription = subscription;
|
||||
}
|
||||
|
||||
public String getClientID() {
|
||||
return subscription.getClientId();
|
||||
}
|
||||
|
||||
public AbstractMessage.QOSType getRequestedQos() {
|
||||
return subscription.getRequestedQos();
|
||||
}
|
||||
|
||||
public String getTopicFilter() {
|
||||
return subscription.getTopicFilter();
|
||||
}
|
||||
}
|
||||
package io.moquette.interception.messages;
|
||||
|
||||
import io.moquette.parser.proto.messages.AbstractMessage;
|
||||
import io.moquette.spi.impl.subscriptions.Subscription;
|
||||
|
||||
/**
|
||||
* @author Wagner Macedo
|
||||
*/
|
||||
public class InterceptSubscribeMessage {
|
||||
private final Subscription subscription;
|
||||
private final String username;
|
||||
|
||||
public InterceptSubscribeMessage(Subscription subscription, String username) {
|
||||
this.subscription = subscription;
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getClientID() {
|
||||
return subscription.getClientId();
|
||||
}
|
||||
|
||||
public AbstractMessage.QOSType getRequestedQos() {
|
||||
return subscription.getRequestedQos();
|
||||
}
|
||||
|
||||
public String getTopicFilter() {
|
||||
return subscription.getTopicFilter();
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user