Package org.activemq.ws.xmlbeans.notification.base

Examples of org.activemq.ws.xmlbeans.notification.base.SubscribeResponseDocument$SubscribeResponse$Factory


        // START SNIPPET: subscribe
        SubscribeDocument subrequest = SubscribeDocument.Factory.newInstance();
        SubscribeDocument.Subscribe subscribe = subrequest.addNewSubscribe();
        subscribe.setTopicExpression( TopicExpressionConverter.toTopicExpression(topic) );
        subscribe.setUseNotify(true);
        SubscribeResponseDocument subresponse = broker.Subscribe(subrequest);
        // END SNIPPET: subscribe


        System.out.println("Sub request: "+subrequest);
        System.out.println("Sub response: "+subresponse);
        assertNotNull(subresponse);
       
        return subresponse.getSubscribeResponse().getSubscriptionReference();
    }
View Full Code Here


            SubscribeDocument requestDoc = SubscribeDocument.Factory.newInstance();
            Subscribe subscribe = requestDoc.addNewSubscribe();
            subscribe.setTopicExpression( TopicExpressionConverter.toTopicExpression(topic) );
            subscribe.setUseNotify(true);
            subscribe.setConsumerReference(endpointReference);
            SubscribeResponseDocument reponse = p.Subscribe(requestDoc);
        } else {
            UnsubscribeDocument requestDoc = UnsubscribeDocument.Factory.newInstance();
            Unsubscribe unsubscribe = requestDoc.addNewUnsubscribe();           
        }
    }
View Full Code Here

       
        EndpointReferenceType endpointReference = subscriptionManager.register( subscription );
        subscription.setEndpointReference(endpointReference);
       
        // Send response.
        SubscribeResponseDocument responseDoc = SubscribeResponseDocument.Factory.newInstance();
        responseDoc.addNewSubscribeResponse().setSubscriptionReference(endpointReference);
        return responseDoc;
    }
View Full Code Here

            subscription.create(subscribeRequest);
            if (manager != null) {
                subscription.setManager(manager);
            }
            subscription.register();
            SubscribeResponse response = new SubscribeResponse();
            response.setSubscriptionReference(createEndpointReference(subscription.getAddress()));
            success = true;
            return response;
        } catch (EndpointRegistrationException e) {
            SubscribeCreationFailedFaultType fault = new SubscribeCreationFailedFaultType();
            throw new SubscribeCreationFailedFault("Unable to register endpoint", fault, e);
View Full Code Here

                JAXBContext jaxbContext = JAXBContext.newInstance(Subscribe.class);
                Source src = exchange.getMessage("in").getContent();
                Object input = jaxbContext.createUnmarshaller().unmarshal(src);
                if (input instanceof Subscribe) {
                    subscription = (Subscribe) input;
                    SubscribeResponse response = new SubscribeResponse();
                    String wsaAddress = getService().getNamespaceURI() + "/" + getService().getLocalPart() + "/"
                            + subscriptionEndpoint;
                    response.setSubscriptionReference(AbstractWSAClient.createWSA(wsaAddress));
                    StringWriter writer = new StringWriter();
                    jaxbContext.createMarshaller().marshal(response, writer);
                    NormalizedMessage out = exchange.createMessage();
                    out.setContent(new StringSource(writer.toString()));
                    exchange.setMessage(out, "out");
View Full Code Here

        }
        if (raw) {
            subscribeRequest.setSubscriptionPolicy(new Subscribe.SubscriptionPolicy());
            subscribeRequest.getSubscriptionPolicy().getAny().add(new UseRaw());
        }
        SubscribeResponse response = (SubscribeResponse) request(subscribeRequest);
        return new Subscription(response.getSubscriptionReference(), getClient());
    }
View Full Code Here

        if (topic == null) {
            InvalidFilterFaultType fault = new InvalidFilterFaultType();
            throw new InvalidFilterFault("Must specify a topic to subscribe on", fault);
        }
        PublisherSubscription pub = new PublisherSubscription(topic);
        SubscribeResponse response = new SubscribeResponse();
        response.setSubscriptionReference(pub.getEpr());
        callback.subscribe(topic);
        return response;
    }
View Full Code Here

      subscription.create(subscribeRequest);
            if (manager != null) {
                subscription.setManager(manager);
            }
            subscription.register();
      SubscribeResponse response = new SubscribeResponse();
      response.setSubscriptionReference(createEndpointReference(subscription.getAddress()));
      success = true;
      return response;
    } catch (EndpointRegistrationException e) {
      SubscribeCreationFailedFaultType fault = new SubscribeCreationFailedFaultType();
      throw new SubscribeCreationFailedFault("Unable to register endpoint", fault, e);
View Full Code Here

            subscription.create(subscribeRequest);
            if (manager != null) {
                subscription.setManager(manager);
            }
            subscription.register();
            SubscribeResponse response = new SubscribeResponse();
            response.setSubscriptionReference(subscription.getEpr());
            success = true;
            return response;
        } catch (EndpointRegistrationException e) {
            LOGGER.log(Level.WARNING, "Unable to register new endpoint", e);
            SubscribeCreationFailedFaultType fault = new SubscribeCreationFailedFaultType();
View Full Code Here

        if (topic == null) {
            InvalidFilterFaultType fault = new InvalidFilterFaultType();
            throw new InvalidFilterFault("Must specify a topic to subscribe on", fault);
        }
        PublisherSubscription pub = new PublisherSubscription(topic);
        SubscribeResponse response = new SubscribeResponse();
        response.setSubscriptionReference(pub.getEpr());
        callback.subscribe(topic);
        return response;
    }
View Full Code Here

TOP

Related Classes of org.activemq.ws.xmlbeans.notification.base.SubscribeResponseDocument$SubscribeResponse$Factory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.