Package org.apache.cxf.ws.eventing

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


                    expires);

            resp.getWriter().append("<h3>Subscription request</h3>");
            resp.getWriter().append(convertJAXBElementToStringAndEscapeHTML(sub));

            SubscribeResponse subscribeResponse = requestorClient.subscribeOp(sub);

            resp.getWriter().append("<h3>Response from Event Source</h3>");
            resp.getWriter().append(convertJAXBElementToStringAndEscapeHTML(subscribeResponse));

            resp.getWriter().append("<br/><a href=\"index.jsp\">Back to main page</a>");
View Full Code Here


        String endToURL = TestUtil.generateRandomURLWithLocalTransport();
        endToAddr.setValue(endToURL);
        endToERT.setAddress(endToAddr);
        subscribe.setEndTo(endToERT);

        SubscribeResponse response = eventSourceClient.subscribeOp(subscribe);
        Element referenceParams = (Element)response.getSubscriptionManager()
                .getReferenceParameters().getAny().get(0);

        Server endToEndpoint = createEndToEndpointWithReferenceParametersAssertion(endToURL, myParams);

        TestingEndToEndpointImpl.RECEIVED_ENDS.set(0);
View Full Code Here

        DeliveryType delivery = new DeliveryType();
        subscribe.setDelivery(delivery);

        subscribe.getDelivery().getContent().add(createDummyNotifyTo());

        SubscribeResponse resp = eventSourceClient.subscribeOp(subscribe);
        Assert.assertTrue(
                "Specification requires that EventSource return a xs:duration "
                        + "expirationType if a xs:duration was requested by client",
                DurationAndDateUtil.isDuration(resp.getGrantedExpires().getValue()));

        // we specify a xs:dateTime
        subscribe = new Subscribe();
        exp = new ExpirationType();
        XMLGregorianCalendar dateRequest =
                (XMLGregorianCalendar)DurationAndDateUtil.parseDurationOrTimestamp("2138-06-26T12:23:12.000-01:00");
        exp.setValue(DurationAndDateUtil.convertToXMLString(dateRequest));
        subscribe.setExpires(exp);
        delivery = new DeliveryType();
        subscribe.setDelivery(delivery);
        subscribe.getDelivery().getContent().add(createDummyNotifyTo());
        resp = eventSourceClient.subscribeOp(subscribe);
        Assert.assertTrue(
                "Specification requires that EventSource return a "
                        + "xs:dateTime expirationType if a xs:dateTime was requested by client",
                DurationAndDateUtil.isXMLGregorianCalendar(resp.getGrantedExpires().getValue()));
        XMLGregorianCalendar returned = DurationAndDateUtil.parseXMLGregorianCalendar(
                resp.getGrantedExpires().getValue());
        System.out.println("granted expiration: " + returned.normalize().toXMLFormat());
        System.out.println("requested expiration: " + dateRequest.normalize().toXMLFormat());
        Assert.assertTrue("Server should have returned exactly the same date as we requested",
                returned.equals(dateRequest));

        // we don't specify anything
        subscribe = new Subscribe();
        delivery = new DeliveryType();
        subscribe.setDelivery(delivery);
        subscribe.getDelivery().getContent().add(createDummyNotifyTo());
        resp = eventSourceClient.subscribeOp(subscribe);
        Assert.assertTrue(
                "Specification requires that EventSource return a xs:duration "
                        + "expirationType if no specific expirationType was requested by client",
                DurationAndDateUtil.isDuration(resp.getGrantedExpires().getValue()));
    }
View Full Code Here

        exp.setValue(DurationAndDateUtil.convertToXMLString(dateRequest));
        exp.setBestEffort(true);
        subscribe.setExpires(exp);
        subscribe.setDelivery(delivery);
        subscribe.getDelivery().getContent().add(createDummyNotifyTo());
        SubscribeResponse resp = eventSourceClient.subscribeOp(subscribe);
        Assert.assertTrue(
                "Specification requires that EventSource return a "
                        + "xs:dateTime expirationType if a xs:dateTime was requested by client",
                DurationAndDateUtil.isXMLGregorianCalendar(resp.getGrantedExpires().getValue()));
    }
View Full Code Here

                DurationAndDateUtil.convertToXMLString(DurationAndDateUtil.parseDurationOrTimestamp("PT0S")));
        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());
        System.out.println("EXPIRES: " + response.getGrantedExpires().getValue());
        Assert.assertTrue("GetStatus operation should return a XMLGregorianCalendar",
                DurationAndDateUtil.isXMLGregorianCalendar(response.getGrantedExpires().getValue()));
    }
View Full Code Here

                DurationAndDateUtil.convertToXMLString(DurationAndDateUtil.parseDurationOrTimestamp("PT0S")));
        subscribe.setExpires(exp);
        DeliveryType delivery = new DeliveryType();
        subscribe.setDelivery(delivery);
        subscribe.getDelivery().getContent().add(createDummyNotifyTo());
        SubscribeResponse subscribeResponse = eventSourceClient.subscribeOp(subscribe);

        SubscriptionManagerEndpoint client = createSubscriptionManagerClient(
                subscribeResponse.getSubscriptionManager().getReferenceParameters());
        UnsubscribeResponse unsubscribeResponse = client.unsubscribeOp(new Unsubscribe());
        Assert.assertNotNull(unsubscribeResponse);

        try {
            client.getStatusOp(new GetStatus());
View Full Code Here

                        .parseDurationOrTimestamp("2018-10-21T14:52:46.826+02:00")))// 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());
        String expirationBefore = response.getGrantedExpires().getValue();
        System.out.println("EXPIRES before renew: " + expirationBefore);
        Assert.assertTrue(expirationBefore.length() > 0);
View Full Code Here

                .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());
        String expirationBefore = response.getGrantedExpires().getValue();
        System.out.println("EXPIRES before renew: " + expirationBefore);
        Assert.assertTrue(expirationBefore.length() > 0);
View Full Code Here

    protected abstract SubscriptionManagerInterfaceForEventSources getSubscriptionManagerBackend();

    protected SubscribeResponse generateResponseMessageFor(SubscriptionTicketGrantingResponse dbResponse,
                                                           boolean shouldConvertToDuration) {
        SubscribeResponse ret = new SubscribeResponse();
        // SubscriptionManager part
        ret.setSubscriptionManager(dbResponse.getSubscriptionManagerReference());
        // Expires part
        if (shouldConvertToDuration) {
            ret.setGrantedExpires(
                    DurationAndDateUtil.toExpirationTypeContainingDuration(dbResponse.getExpires()));
        } else {
            ret.setGrantedExpires(
                    DurationAndDateUtil.toExpirationTypeContainingGregorianCalendar(dbResponse.getExpires()));
        }
        return ret;
    }
View Full Code Here

TOP

Related Classes of org.apache.cxf.ws.eventing.SubscribeResponse

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.