MemorySessionStore: Session class added

MemorySessionStore$Session: clientSession field added
MemorySessionStore#pendingAck: secondPhaseStore & inflightStore &
inboundFlightMeessageToGuid added

ClientSession#cleanup missed these messages
SubscriptionsDirectoryTest: fixed
SessionsStore#dropInFlightMessagesInSession: changed to cleanSession
This commit is contained in:
Andreas Mager
2017-06-02 18:09:23 +02:00
parent 46a215bd2c
commit fcb7870a38
7 changed files with 169 additions and 126 deletions
@@ -323,9 +323,18 @@ class MapDBSessionsStore implements ISessionsStore, ISubscriptionsStore {
}
@Override
public void dropInFlightMessagesInSession(String clientID) {
public void cleanSession(String clientID) {
// remove also the messages stored of type QoS1/2
LOG.info("Removing stored messages with QoS 1 and 2. ClientId={}", clientID);
m_secondPhaseStore.remove(clientID);
outboundFlightMessages.remove(clientID);
m_inFlightIds.remove(clientID);
LOG.info("Wiping existing subscriptions. ClientId={}", clientID);
wipeSubscriptions(clientID);
//remove also the enqueued messages
dropQueue(clientID);
}
static String inboundMessageId2MessagesMapName(String clientID) {