/** * Create an instance of {@link FilterType } * */ public FilterType createFilterType() { return new FilterType(); }
/** * Create an instance of {@link FilterType } * */ public FilterType createFilterType() { return new FilterType(); }
/** * Create an instance of {@link FilterType } * */ public FilterType createFilterType() { return new FilterType(); }
@Override protected Object startSubscription(TopicExpressionType topic) { try { Subscribe subscribeRequest = new Subscribe(); subscribeRequest.setConsumerReference(notificationBroker.getEpr()); subscribeRequest.setFilter(new FilterType()); subscribeRequest.getFilter().getAny().add( new JAXBElement<TopicExpressionType>(AbstractSubscription.QNAME_TOPIC_EXPRESSION, TopicExpressionType.class, topic)); SubscribeResponse response = notificationProducer.subscribe(subscribeRequest); return WSNHelper.getInstance() .getPort(response.getSubscriptionReference(), SubscriptionManager.class); } catch (Exception e) { LOGGER.log(Level.INFO, "Error while subscribing on-demand publisher", e); return null; } }
/** * Creates a {@link Subscribe WS-Notification Subscribe message} from the * specified subscriber's endpoint and topic information. * * @param subscriberEndpoint * subscriber's endpoint. * @param topic * the QName associated to the topic to subscribe to. * * @return a WS-Notification Subscribe message with the specified * subscriber's endpoint and topic information. */ public static Subscribe createSubscribeMessage(String subscriberEndpoint, QName topic) { Subscribe subscribeRequest = new Subscribe(); FilterType filterType = new FilterType(); JAXBElement<TopicExpressionType> jaxbElement = new JAXBElement<TopicExpressionType>( WsnConstants.TOPIC_EXPRESSION_QNAME, TopicExpressionType.class, createTopicExpressionType(topic)); filterType.getAny().add(jaxbElement); subscribeRequest.setFilter(filterType); subscribeRequest.setConsumerReference(WSNHelper.createWSA(subscriberEndpoint)); return subscribeRequest; }
subscribeRequest.setFilter(new FilterType()); if (topic != null) { TopicExpressionType topicExp = new TopicExpressionType();