Refactory, moved SubscriptionStore related method directly in the subscriptioStore from ProtocolProcessro
This commit is contained in:
@@ -274,7 +274,6 @@ public class ProtocolProcessor {
|
||||
private void cleanSession(String clientID) {
|
||||
LOG.info("cleaning old saved subscriptions for client <{}>", clientID);
|
||||
//remove from log all subscriptions
|
||||
//m_sessionsStore.wipeSubscriptions(clientID);
|
||||
subscriptions.removeForClient(clientID);
|
||||
|
||||
//remove also the messages stored of type QoS1/2
|
||||
@@ -578,7 +577,6 @@ public class ProtocolProcessor {
|
||||
}
|
||||
|
||||
subscriptions.removeSubscription(topic, clientID);
|
||||
m_sessionsStore.removeSubscription(topic, clientID);
|
||||
m_interceptor.notifyTopicUnsubscribed(topic, clientID);
|
||||
}
|
||||
|
||||
@@ -619,7 +617,6 @@ public class ProtocolProcessor {
|
||||
//send SUBACK with 0x80 for this topic filter
|
||||
return false;
|
||||
}
|
||||
m_sessionsStore.addNewSubscription(newSubscription);
|
||||
subscriptions.add(newSubscription);
|
||||
|
||||
//notify the Observables
|
||||
|
||||
+3
-1
@@ -179,6 +179,7 @@ public class SubscriptionsStore {
|
||||
}
|
||||
|
||||
public void add(Subscription newSubscription) {
|
||||
m_sessionsStore.addNewSubscription(newSubscription);
|
||||
addDirect(newSubscription);
|
||||
}
|
||||
|
||||
@@ -205,6 +206,7 @@ public class SubscriptionsStore {
|
||||
}
|
||||
//spin lock repeating till we can, swap root, if can't swap just re-do the operation
|
||||
} while(!subscriptions.compareAndSet(oldRoot, couple.root));
|
||||
m_sessionsStore.removeSubscription(topic, clientID);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -213,7 +215,7 @@ public class SubscriptionsStore {
|
||||
public void clearAllSubscriptions() {
|
||||
SubscriptionTreeCollector subsCollector = new SubscriptionTreeCollector();
|
||||
bfsVisit(subscriptions.get(), subsCollector, 0);
|
||||
|
||||
|
||||
List<Subscription> allSubscriptions = subsCollector.getResult();
|
||||
for (Subscription subscription : allSubscriptions) {
|
||||
removeSubscription(subscription.getTopicFilter(), subscription.getClientId());
|
||||
|
||||
Reference in New Issue
Block a user