Added the logic to de-activate subscriptions on client close

This commit is contained in:
selva.andre
2012-09-01 11:44:07 +02:00
parent 4ef628d0e6
commit 599afa76e6
@@ -134,6 +134,19 @@ public class SubscriptionsStore {
child.removeClientSubscriptions(clientID);
}
}
void disconnect(String clientID) {
for (Subscription s : m_subscriptions) {
if (s.clientId.equals(clientID)) {
s.setActive(false);
}
}
//go deep
for (TreeNode child : m_children) {
child.disconnect(clientID);
}
}
}
protected static class Token {
@@ -293,6 +306,10 @@ public class SubscriptionsStore {
m_persistent.remove(clientID);
}
public void disconnect(String clientID) {
subscriptions.disconnect(clientID);
}
public List<Subscription> matches(String topic) {
List<Token> tokens = new ArrayList<Token>();
try {