Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

get subscriber

  • Loading branch information...
commit 1d1017b30e37d0b4ec0a251915685657c3bcfd9b 1 parent 193d739
Christophe Hamerling chamerling authored
1  ...ient/src/main/java/org/petalslink/dsb/notification/client/http/simple/HTTPSubscriptionManagerClient.java
View
@@ -49,5 +49,4 @@ public boolean unsubscribe(String uuid) throws NotificationException {
}
return result;
}
-
}
20 ...sb-wsn-jbise/src/main/java/org/petalslink/dsb/jbi/se/wsn/services/SubscriptionManagementServiceImpl.java
View
@@ -31,6 +31,7 @@
import org.petalslink.dsb.jbi.se.wsn.api.Topic;
import org.petalslink.dsb.jbi.se.wsn.api.WSNException;
+import com.ebmwebsourcing.wsstar.basenotification.datatypes.api.utils.WsnbException;
import com.ebmwebsourcing.wsstar.wsnb.services.impl.util.Wsnb4ServUtils;
import com.ebmwebsourcing.wsstar.wsnb.services.impl.wsresources.WsnSubscription;
@@ -56,16 +57,14 @@ public SubscriptionManagementServiceImpl(NotificationEngine engine,
public List<Subscription> getSubscriptionsForTopic(Topic topic)
throws WSNException {
-
logger.info("DSB WSB SE : Get subscriptions for topic " + topic);
List<Subscription> result = new ArrayList<Subscription>();
-
List<WsnSubscription> subscriptions = this.engine
.getNotificationManager()
.getSubscriptionManagerEngine()
.getSubscriptions(new QName(topic.ns, topic.name, topic.prefix));
-
+
if (subscriptions != null) {
for (WsnSubscription wsnSubscription : subscriptions) {
Subscription s = toSubscription(wsnSubscription);
@@ -97,17 +96,21 @@ public SubscriptionManagementServiceImpl(NotificationEngine engine,
* @param wsnSubscription
* @return
*/
- public static Subscription toSubscription(WsnSubscription wsnSubscription) {
+ private Subscription toSubscription(WsnSubscription wsnSubscription) {
Subscription result = new Subscription();
if (wsnSubscription == null) {
return result;
}
- if (wsnSubscription.getSubscriptionReference() != null
- && wsnSubscription.getSubscriptionReference().getAddress() != null) {
- result.subscriber = wsnSubscription.getSubscriptionReference()
- .getAddress().getValue().toString();
+ try {
+ if (wsnSubscription.getConsumerEdpRef() != null
+ && wsnSubscription.getConsumerEdpRef().getAddress() != null) {
+ result.subscriber = wsnSubscription.getConsumerEdpRef()
+ .getAddress().getValue().toString();
+ }
+ } catch (WsnbException e) {
+ logger.warning(e.getMessage());
}
result.uuid = Wsnb4ServUtils
@@ -116,5 +119,4 @@ public static Subscription toSubscription(WsnSubscription wsnSubscription) {
return result;
}
-
}
Please sign in to comment.
Something went wrong with that request. Please try again.