Examples of Subscribe


Examples of org.apache.cxf.ws.eventing.Subscribe

     * Tests the Renew operation, while specifying an xs:duration in the renew request,
     * eg. the subscriber requests to prolong the subscription by a specific amount of time.
     */
    @Test
    public void renewWithDuration() throws IOException {
        Subscribe subscribe = new Subscribe();
        ExpirationType exp = new ExpirationType();
        exp.setValue(DurationAndDateUtil
                .convertToXMLString(DurationAndDateUtil.parseDurationOrTimestamp("PT5M0S")))// 5 minutes
        subscribe.setExpires(exp);
        DeliveryType delivery = new DeliveryType();
        subscribe.setDelivery(delivery);
        subscribe.getDelivery().getContent().add(createDummyNotifyTo());
        SubscribeResponse resp = eventSourceClient.subscribeOp(subscribe);

        SubscriptionManagerEndpoint client = createSubscriptionManagerClient(
                resp.getSubscriptionManager().getReferenceParameters());
        GetStatusResponse response = client.getStatusOp(new GetStatus());
View Full Code Here

Examples of org.apache.cxf.ws.eventing.Subscribe

    static final String NOTIFICATION_TEST_PORT = allocatePort(NotificationTest.class);

    @Test
    public void basicReceptionOfEvents() throws IOException {
        NotificatorService service = createNotificatorService();
        Subscribe subscribe = new Subscribe();
        ExpirationType exp = new ExpirationType();
        exp.setValue(
                DurationAndDateUtil.convertToXMLString(DurationAndDateUtil.parseDurationOrTimestamp("PT0S")));
        subscribe.setExpires(exp);

        EndpointReferenceType eventSinkERT = new EndpointReferenceType();

        AttributedURIType eventSinkAddr = new AttributedURIType();
        String url = TestUtil.generateRandomURLWithHttpTransport(NOTIFICATION_TEST_PORT);
        eventSinkAddr.setValue(url);
        eventSinkERT.setAddress(eventSinkAddr);
        subscribe.setDelivery(new DeliveryType());
        subscribe.getDelivery().getContent()
            .add(new ObjectFactory().createNotifyTo(eventSinkERT));


        eventSourceClient.subscribeOp(subscribe);
        eventSourceClient.subscribeOp(subscribe);
View Full Code Here

Examples of org.apache.cxf.ws.eventing.Subscribe

    }
   
    @Test
    public void basicReceptionOfWrappedEvents() throws IOException {
        NotificatorService service = createNotificatorService();
        Subscribe subscribe = new Subscribe();
        ExpirationType exp = new ExpirationType();
        exp.setValue(
                DurationAndDateUtil.convertToXMLString(DurationAndDateUtil.parseDurationOrTimestamp("PT0S")));
        subscribe.setExpires(exp);

        EndpointReferenceType eventSinkERT = new EndpointReferenceType();

        AttributedURIType eventSinkAddr = new AttributedURIType();
        String url = TestUtil.generateRandomURLWithHttpTransport(NOTIFICATION_TEST_PORT);
        eventSinkAddr.setValue(url);
        eventSinkERT.setAddress(eventSinkAddr);
        subscribe.setDelivery(new DeliveryType());
        subscribe.getDelivery().getContent().add(new ObjectFactory().createNotifyTo(eventSinkERT));
        FormatType formatType = new FormatType();
        formatType.setName(EventingConstants.DELIVERY_FORMAT_WRAPPED);
        subscribe.setFormat(formatType);

        eventSourceClient.subscribeOp(subscribe);
        eventSourceClient.subscribeOp(subscribe);
        eventSourceClient.subscribeOp(subscribe);
View Full Code Here

Examples of org.apache.juddi.xlt.action.SOAP.Subscribe

   
    //FindBusinessByName findBusinessByName = new FindBusinessByName(authToken,
    //    businessName);
    //if (findBusinessByName.preValidate())
    //{
        Subscribe subscribe = new Subscribe(authToken, registerBusiness.getBusinessDetail().getBusinessEntity().get(0).getBusinessKey());
        subscribe.run();
       
        System.out.println(subscribe.getSubscriptionKey());
    //}
    //else
    //{
    //  RegisterBusiness
    //}
View Full Code Here

Examples of org.apache.muse.ws.notification.impl.Subscribe

    public SubscriptionClient subscribe(EndpointReference consumer,
                                        Filter filter,
                                        Date termination)
        throws SoapFault
    {
        Subscribe sub = new Subscribe(consumer, filter, termination);
       
        Element responseXML = invoke(WsnConstants.SUBSCRIBE_URI, sub.toXML());
       
        SubscribeResponse response = new SubscribeResponse(responseXML);
        EndpointReference epr = response.getSubscriptionReference();
       
        return new SubscriptionClient(epr, getSource());
View Full Code Here

Examples of org.apache.tuscany.sca.binding.notification.encoding.Subscribe

                crp.addProperty(cbi);
                epr.setReferenceProperties(crp);
            }
            ConsumerReference cr = new ConsumerReference();
            cr.setReference(epr);
            sub = new Subscribe();
            sub.setConsumerReference(cr);
        }
View Full Code Here

Examples of org.apache.tuscany.sca.binding.notification.encoding.Subscribe

        eaed.start();
       
        XMLInputFactory xif = XMLInputFactory.newInstance();
        XMLStreamReader reader = xif.createXMLStreamReader(new StringReader(testSubscribe));
        reader.next();
        Subscribe subscribe = (Subscribe)der.decode(reader);
        Assert.assertEquals(subscribe.getConsumerReference().getReference().getEndpointAddress().getAddress().toString(), testUrl);
       
        XMLOutputFactory xof = XMLOutputFactory.newInstance();
        StringWriter testWriter = new StringWriter();
        XMLStreamWriter writer = xof.createXMLStreamWriter(testWriter);
        der.encode(subscribe, writer);
View Full Code Here

Examples of org.apache.tuscany.sca.binding.notification.encoding.Subscribe

                crp.addProperty(cbi);
                epr.setReferenceProperties(crp);
            }
            ConsumerReference cr = new ConsumerReference();
            cr.setReference(epr);
            sub = new Subscribe();
            sub.setConsumerReference(cr);
        }
View Full Code Here

Examples of org.apache.tuscany.sca.binding.notification.encoding.Subscribe

    public void handle(Map<String, String> headers, ServletInputStream istream, int contentLength, ServletOutputStream ostream) {

        try {
            EncodingObject eo = EncodingUtils.decodeFromStream(encodingRegistry, istream);
            if (eo instanceof Subscribe) {
                Subscribe sub = (Subscribe)eo;
                addSubscriber(sub.getConsumerReference().getReference());
            } else if (eo instanceof ConnectionOverride) {
                ConnectionOverride co = (ConnectionOverride)eo;
                replaceSubscribers(co.getBrokerConsumerReference().getReference());
            } else if (eo instanceof ReplaceBrokerConnection) {
                ReplaceBrokerConnection rbc = (ReplaceBrokerConnection)eo;
View Full Code Here

Examples of org.apache.tuscany.sca.binding.notification.encoding.Subscribe

                crp.addProperty(cbi);
                epr.setReferenceProperties(crp);
            }
            ConsumerReference cr = new ConsumerReference();
            cr.setReference(epr);
            sub = new Subscribe();
            sub.setConsumerReference(cr);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.