Examples of ExpirationType


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

            throw new UnknownSubscription();
        }
        LOG.info("[subscription=" + ticket.getUuid() + "] Requested renew expiration: "
                + requestedExpiration.getValue());
        LOG.fine("[subscription=" + ticket.getUuid() + "] Current expiration: " + ticket.getExpires().toXMLFormat());
        ExpirationType response = new ExpirationType();
        XMLGregorianCalendar grantedExpires;
        if (DurationAndDateUtil.isDuration(requestedExpiration.getValue())) {
            // duration was requested
            javax.xml.datatype.Duration requestedDuration = DurationAndDateUtil
                    .parseDuration(requestedExpiration.getValue());
            javax.xml.datatype.Duration grantedDuration = requestedDuration;
            LOG.info("[subscription=" + ticket.getUuid() + "] Granted renewal duration: " + grantedDuration.toString());
            grantedExpires = getDatabase().findById(uuid)
                    .getExpires();       // NOW() or current Expires() ????
            grantedExpires.add(grantedDuration);
            response.setValue(grantedDuration.toString());
        } else {
            // end-date was requested
            grantedExpires = DurationAndDateUtil.parseXMLGregorianCalendar(requestedExpiration.getValue());
            LOG.info("[subscription=" + ticket.getUuid() + "] Granted expiration: " + grantedExpires.toXMLFormat());
            response.setValue(grantedExpires.toXMLFormat());
        }
        getDatabase().findById(uuid).setExpires(grantedExpires);
        return response;
    }
View Full Code Here

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

        throw new IllegalArgumentException(
                "convertToXMLString requires either an instance of XMLGregorianCalendar or Duration");
    }

    public static ExpirationType toExpirationTypeContainingGregorianCalendar(XMLGregorianCalendar date) {
        ExpirationType et = new ExpirationType();
        et.setValue(date.toXMLFormat());
        return et;
    }
View Full Code Here

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

        et.setValue(date.toXMLFormat());
        return et;
    }

    public static ExpirationType toExpirationTypeContainingDuration(XMLGregorianCalendar date) {
        ExpirationType et = new ExpirationType();
        XMLGregorianCalendar now = factory.newXMLGregorianCalendar(new GregorianCalendar());
        XMLGregorianCalendar then = factory.newXMLGregorianCalendar(date.toGregorianCalendar());
        long durationMillis = then.toGregorianCalendar().getTimeInMillis()
                - now.toGregorianCalendar().getTimeInMillis();
        Duration duration = factory.newDuration(durationMillis);
        et.setValue(duration.toString());
        return et;
    }
View Full Code Here

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

    @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();
View Full Code Here

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

   
    @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();
View Full Code Here

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

    @Test
    public void withWSAAction() throws Exception {
        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();
View Full Code Here

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

    @Test
    public void withReferenceParameters() throws Exception {
        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();
View Full Code Here

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

     */
    @Test
    public void withFilter() 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();

View Full Code Here

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

     */
    @Test
    public void withFilterNegative() 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();

View Full Code Here

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

     */
    @Test
    public void withFilter2() 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();

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.