Minor change, minor readability improve
This commit is contained in:
@@ -408,7 +408,7 @@ public class SimpleMessaging implements IMessaging, EventHandler<ValueEvent> {
|
||||
LOG.debug("processSubscribe invoked");
|
||||
|
||||
for (SubscribeMessage.Couple req : msg.subscriptions()) {
|
||||
QOSType qos = AbstractMessage.QOSType.values()[req.getQos()];
|
||||
QOSType qos = AbstractMessage.QOSType.fromByte(req.getQos());
|
||||
Subscription newSubscription = new Subscription(clientID, req.getTopic(), qos, cleanSession);
|
||||
subscribeSingleTopic(newSubscription, req.getTopic());
|
||||
}
|
||||
@@ -423,7 +423,6 @@ public class SimpleMessaging implements IMessaging, EventHandler<ValueEvent> {
|
||||
}
|
||||
LOG.info("replying with SubAct to MSG ID " + msg.getMessageID());
|
||||
session.write(ackMessage);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,6 +25,10 @@ public abstract class AbstractMessage {
|
||||
public static enum QOSType {
|
||||
|
||||
MOST_ONE, LEAST_ONE, EXACTLY_ONCE, RESERVED;
|
||||
|
||||
public static QOSType fromByte(byte val) {
|
||||
return AbstractMessage.QOSType.values()[val];
|
||||
}
|
||||
}
|
||||
//type
|
||||
protected boolean m_dupFlag;
|
||||
|
||||
Reference in New Issue
Block a user