use of com.swiftmq.swiftlet.store.DurableStoreEntry in project swiftmq-ce by iitsoftware.
the class DurableSubscriberStoreImpl method next.
public synchronized Object next() {
String name = iterFiles[iterPos];
iterClientId = name.substring(0, name.indexOf(DELIMITER));
iterDurableName = name.substring(name.indexOf(DELIMITER) + 1, name.indexOf(EXTENSION));
DurableStoreEntry entry = null;
try {
entry = getDurableStoreEntry(iterClientId, iterDurableName);
} catch (Exception e) {
throw new RuntimeException(e.toString());
}
iterPos++;
return entry;
}
use of com.swiftmq.swiftlet.store.DurableStoreEntry in project swiftmq-ce by iitsoftware.
the class DurableSubscriberStoreImpl method getDurableStoreEntry.
public synchronized DurableStoreEntry getDurableStoreEntry(String clientId, String durableName) throws StoreException {
String filename = getDurableFilename(clientId, durableName);
File f = new File(dir, filename);
if (!f.exists())
throw new StoreException(f.getAbsolutePath() + " does not exists");
Map map = null;
try {
ObjectInputStream ois = new ObjectInputStream(new FileInputStream(f));
map = (HashMap) ois.readObject();
ois.close();
} catch (Exception e) {
throw new StoreException(e.toString());
}
DurableStoreEntry entry = new DurableStoreEntry(clientId, durableName, (String) map.get("topicName"), (String) map.get("selector"), map.get("noLocal") != null);
return entry;
}
use of com.swiftmq.swiftlet.store.DurableStoreEntry in project swiftmq-ce by iitsoftware.
the class TopicManagerImpl method loadDurables.
private HashMap loadDurables() throws Exception {
HashMap map = new HashMap();
durableStore = ctx.storeSwiftlet.getDurableSubscriberStore();
for (Iterator iter = durableStore.iterator(); iter.hasNext(); ) {
DurableStoreEntry entry = (DurableStoreEntry) iter.next();
map.put(entry.getClientId() + DURABLE_DELIMITER + entry.getDurableName(), new DurableSubscription(entry));
}
return map;
}
Aggregations