diff --git a/parser/src/main/java/org/dna/mqtt/moquette/messaging/spi/impl/SubscriptionsStore.java b/parser/src/main/java/org/dna/mqtt/moquette/messaging/spi/impl/SubscriptionsStore.java index 44f26c67..bc04ab81 100644 --- a/parser/src/main/java/org/dna/mqtt/moquette/messaging/spi/impl/SubscriptionsStore.java +++ b/parser/src/main/java/org/dna/mqtt/moquette/messaging/spi/impl/SubscriptionsStore.java @@ -190,44 +190,20 @@ public class SubscriptionsStore { return name; } } -// private List subscriptions = new ArrayList(); private TreeNode subscriptions = new TreeNode(null); private static final Logger LOG = LoggerFactory.getLogger(SubscriptionsStore.class); //pesistent Map of clientID, list of Subscriptions private SortedIndex> m_persistent; -// private PageFile pageFile; -// private PageFileFactory factory; /** * Initialize basic store structures, like the FS storage to maintain * client's topics subscriptions */ public void init(MultiIndexFactory multiFactory) { - /*StringBuilder storeFile = new StringBuilder(); - storeFile.append(System.getProperty("user.home")) - .append(File.separator).append("moquette_store.hawtdb");*/ -// String storeFile = Server.STORAGE_FILE_PATH; - -// factory = new PageFileFactory(); -// File tmpFile; -// try { -// tmpFile = new File(storeFile.toString()); -// tmpFile.createNewFile(); -// } catch (IOException ex) { -// LOG.error(null, ex); -// throw new MQTTException("Can't create temp file for subscriptions storage [" + storeFile + "]", ex); -// } -// factory.setFile(/*new File("mydb.dat")*/tmpFile); -// factory.open(); -// PageFile pageFile = factory.getPageFile(); - -// HashIndexFactory> indexFactory = -// new HashIndexFactory>(); BTreeIndexFactory> indexFactory = new BTreeIndexFactory>(); indexFactory.setKeyCodec(StringCodec.INSTANCE); -// m_persistent = indexFactory.openOrCreate(pageFile); m_persistent = (SortedIndex>) multiFactory.openOrCreate("subscriptions", indexFactory); //reaload any subscriptions persisted @@ -316,7 +292,6 @@ public class SubscriptionsStore { } - //TODO this should be static protected static List splitTopic(String topic) throws ParseException { List res = new ArrayList(); String[] splitted = topic.split("/");