Added the logic to de-activate subscriptions on client close
This commit is contained in:
@@ -134,6 +134,19 @@ public class SubscriptionsStore {
|
|||||||
child.removeClientSubscriptions(clientID);
|
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 {
|
protected static class Token {
|
||||||
@@ -293,6 +306,10 @@ public class SubscriptionsStore {
|
|||||||
m_persistent.remove(clientID);
|
m_persistent.remove(clientID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void disconnect(String clientID) {
|
||||||
|
subscriptions.disconnect(clientID);
|
||||||
|
}
|
||||||
|
|
||||||
public List<Subscription> matches(String topic) {
|
public List<Subscription> matches(String topic) {
|
||||||
List<Token> tokens = new ArrayList<Token>();
|
List<Token> tokens = new ArrayList<Token>();
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user