Separated ISessionsStore and IMessagesStore Memory implementations

This commit is contained in:
andsel
2015-11-19 00:16:18 +01:00
parent 892eecfa2b
commit f438ef7f49
7 changed files with 210 additions and 279 deletions
@@ -36,22 +36,6 @@ import java.util.concurrent.TimeUnit;
*/
public class MapDBPersistentStore {
/**
* Factory method to create message store backed by MapDB
* */
public IMessagesStore messagesStore() {
//TODO check m_db is valid and
IMessagesStore msgStore = new MapDBMessagesStore(m_db);
msgStore.initStore();
return msgStore;
}
public ISessionsStore sessionsStore(IMessagesStore msgStore) {
ISessionsStore sessionsStore = new MapDBSessionsStore(m_db, msgStore);
sessionsStore.initStore();
return sessionsStore;
}
/**
* This is a DTO used to persist minimal status (clean session and activation status) of
* a session.
@@ -76,6 +60,22 @@ public class MapDBPersistentStore {
public MapDBPersistentStore(String storePath) {
this.m_storePath = storePath;
}
/**
* Factory method to create message store backed by MapDB
* */
public IMessagesStore messagesStore() {
//TODO check m_db is valid and
IMessagesStore msgStore = new MapDBMessagesStore(m_db);
msgStore.initStore();
return msgStore;
}
public ISessionsStore sessionsStore(IMessagesStore msgStore) {
ISessionsStore sessionsStore = new MapDBSessionsStore(m_db, msgStore);
sessionsStore.initStore();
return sessionsStore;
}
public void initStore() {
if (m_storePath == null || m_storePath.isEmpty()) {