/** * Create an instance of {@link TopicExpressionType } * */ public TopicExpressionType createTopicExpressionType() { return new TopicExpressionType(); }
/** * Create an instance of {@link TopicExpressionType } * */ public TopicExpressionType createTopicExpressionType() { return new TopicExpressionType(); }
/** * Create an instance of {@link TopicExpressionType } * */ public TopicExpressionType createTopicExpressionType() { return new TopicExpressionType(); }
public TopicExpressionType toTopicExpression(String name) { TopicExpressionType answer = new TopicExpressionType(); answer.getContent().add(name); answer.setDialect(SIMPLE_DIALECT); return answer; }
/** * Creates a topic expression type from the specified topic information. * * @param topic * the QName associated to the topic of the topic expression type * to build. * * @return a topic expression type from the specified topic information. */ public static TopicExpressionType createTopicExpressionType(QName topic) { TopicExpressionType topicExpressionType = new TopicExpressionType(); topicExpressionType.getOtherAttributes().put( topic, topic.getNamespaceURI()); topicExpressionType.setDialect(WsnConstants.TOPIC_EXPRESSION_DIALECT); topicExpressionType.getContent().add( topic.getPrefix() + ":" + topic.getLocalPart()); return topicExpressionType; }
/** * Creates a topic expression type with a {@code simpleExpressionType} * element from the specified topic information. * * @param topic * the QName associated to the topic of the topic expression type * to build. * * @return a topic expression type with a {@code simpleExpressionType} * element from the specified topic information. */ public static TopicExpressionType createTopicExpressionTypeWithSimpleExpressionType(QName topic) { TopicExpressionType topicExpressionType = new TopicExpressionType(); topicExpressionType.setDialect(WsnConstants.SIMPLE_TOPIC_EXPRESSION_DIALECT); JAXBElement<QName> simpleTopicExpression = new JAXBElement<QName>( WsnConstants.SIMPLE_TOPIC_EXPRESSION_QNAME, QName.class, null, topic); topicExpressionType.getContent().add(simpleTopicExpression); return topicExpressionType; }
public List<Object> getCurrentMessage(String topic) //CHECKSTYLE:OFF - WS-Notification spec throws a lot of faults throws TopicNotSupportedFault, TopicExpressionDialectUnknownFault, MultipleTopicsSpecifiedFault, InvalidTopicExpressionFault, ResourceUnknownFault, NoCurrentMessageOnTopicFault { //CHECKSTYLE:ON GetCurrentMessage getCurrentMessageRequest = new GetCurrentMessage(); if (topic != null) { TopicExpressionType topicExp = new TopicExpressionType(); topicExp.getContent().add(topic); getCurrentMessageRequest.setTopic(topicExp); } GetCurrentMessageResponse response = getBroker().getCurrentMessage(getCurrentMessageRequest); return response.getAny(); }
public void notify(Referencable publisher, String topic, Object msg) { getBroker(); if (this.context != null) { try { DOMResult result = new DOMResult(); context.createMarshaller().marshal(msg, result); msg = result.getNode(); if (msg instanceof Document) { msg = ((Document)msg).getDocumentElement(); } } catch (JAXBException e) { //ignore, we'll try and let the runtime handle it as is } } Notify notify = new Notify(); NotificationMessageHolderType holder = new NotificationMessageHolderType(); if (publisher != null) { holder.setProducerReference(publisher.getEpr()); } if (topic != null) { TopicExpressionType topicExp = new TopicExpressionType(); topicExp.getContent().add(topic); holder.setTopic(topicExp); } holder.setMessage(new NotificationMessageHolderType.Message()); holder.getMessage().setAny(msg); notify.getNotificationMessage().add(holder); getBroker().notify(notify); }
public Registration registerPublisher(Referencable publisher, List<String> topics, boolean demand) //CHECKSTYLE:OFF - WS-Notification spec throws a lot of faults throws TopicNotSupportedFault, PublisherRegistrationFailedFault, UnacceptableInitialTerminationTimeFault, InvalidTopicExpressionFault, ResourceUnknownFault, PublisherRegistrationRejectedFault { //CHECKSTYLE:ON RegisterPublisher registerPublisherRequest = new RegisterPublisher(); registerPublisherRequest.setPublisherReference(publisher.getEpr()); if (topics != null) { for (String topic : topics) { TopicExpressionType topicExp = new TopicExpressionType(); topicExp.getContent().add(topic); registerPublisherRequest.getTopic().add(topicExp); } } registerPublisherRequest.setDemand(demand); RegisterPublisherResponse response = getBroker().registerPublisher(registerPublisherRequest); return new Registration(response.getPublisherRegistrationReference()); }
private static void RegisterProducer(String t) { try { RegisterPublisher req = new RegisterPublisher(); TopicExpressionType localtopic = new TopicExpressionType(); if (Utility.stringIsNullOrEmpty(configuredWSN_DIALECT)) { localtopic.setDialect(WSNConstants.WST_TOPICEXPRESSION_SIMPLE); } else { localtopic.setDialect(configuredWSN_DIALECT); } if (Utility.stringIsNullOrEmpty(t)) { localtopic.getContent().add("fgsmsAlerts"); } else { localtopic.getContent().add(t); } req.getTopic().add(localtopic); RegisterPublisherResponse registerPublisher = notificationPort.registerPublisher(req); log.log(Level.INFO, String.format(SLACommon.getBundleString("WSNTopicRegisteredSuccess"), t)); isMainTopicRegistered = true; } catch (Exception ex) { log.log(Level.ERROR, String.format(SLACommon.getBundleString("WSNTopicRegisteredFailed"), t), ex); } }
TopicExpressionType topicExpression = new TopicExpressionType(); if (hasSimpleExpressionType) { JAXBElement<QName> simpleTopicExpression =
subscribeRequest.setFilter(new FilterType()); if (topic != null) { TopicExpressionType topicExp = new TopicExpressionType(); topicExp.getContent().add(topic); subscribeRequest.getFilter().getAny().add(
NotificationMessageHolderType msg = new NotificationMessageHolderType(); TopicExpressionType tet = new TopicExpressionType(); if (Utility.stringIsNullOrEmpty(configuredWSN_DIALECT) && Utility.stringIsNullOrEmpty(dialect)) { tet.setDialect(WSNConstants.WST_TOPICEXPRESSION_SIMPLE);