Permalink
Browse files

Expose more methods for topic/subscription management

  • Loading branch information...
1 parent ddadb59 commit b0e384a8a43439ac43abbc113d1c38da939843a0 @chamerling chamerling committed Nov 15, 2012
@@ -664,6 +664,38 @@ public void deleteAllForTopic(QName topic) {
// delete the map entry
this.uuidsPerTopics.remove(topic);
}
+
+ /**
+ *
+ * @param uuid
+ * @return
+ */
+ public WsnSubscription getSubscription(String uuid) {
+ return this.subscriptions.get(uuid);
+ }
+
+ /**
+ *
+ * @param topic
+ * @return
+ */
+ public List<WsnSubscription> getSubscriptions(QName topic) {
+ List<WsnSubscription> result = new ArrayList<WsnSubscription>();
+ if (topic == null) {
+ return result;
+ }
+
+ List<String> uuids = uuidsPerTopics.get(topic);
+ if (uuids != null) {
+ for (String id : uuids) {
+ WsnSubscription subscription = getSubscription(id);
+ if (subscription != null) {
+ result.add(subscription);
+ }
+ }
+ }
+ return result;
+ }
}

0 comments on commit b0e384a

Please sign in to comment.