Minor change, added a factory method for ClientTopicCouple built from Subscription
This commit is contained in:
@@ -628,8 +628,7 @@ public class ProtocolProcessor {
|
||||
}
|
||||
|
||||
private boolean subscribeSingleTopic(final Subscription newSubscription) {
|
||||
final ClientTopicCouple couple = new ClientTopicCouple(newSubscription.getClientId(), newSubscription.getTopicFilter());
|
||||
subscriptions.add(couple);
|
||||
subscriptions.add(newSubscription.asClientTopicCouple());
|
||||
|
||||
//scans retained messages to be published to the new subscription
|
||||
//TODO this is ugly, it does a linear scan on potential big dataset
|
||||
|
||||
@@ -17,6 +17,7 @@ package io.moquette.spi.impl.subscriptions;
|
||||
|
||||
import java.io.Serializable;
|
||||
import io.moquette.proto.messages.AbstractMessage.QOSType;
|
||||
import io.moquette.spi.ISessionsStore.ClientTopicCouple;
|
||||
|
||||
/**
|
||||
* Maintain the information about which Topic a certain ClientID is subscribed
|
||||
@@ -100,4 +101,8 @@ public class Subscription implements Serializable {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public ClientTopicCouple asClientTopicCouple() {
|
||||
return new ClientTopicCouple(this.clientId, this.topicFilter);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user