Examples of CreateSequenceType


Examples of org.apache.cxf.ws.rm.v200702.CreateSequenceType

        if (null != outMessage) {
            RMContextUtils.storeMAPs(maps, outMessage, false, false);
        }
       
        EncoderDecoder codec = protocol.getCodec();
        CreateSequenceType create = codec.convertReceivedCreateSequence(getParameter(message));
        Destination destination = reliableEndpoint.getDestination();
       
        CreateSequenceResponseType createResponse = new CreateSequenceResponseType();       
        createResponse.setIdentifier(destination.generateSequenceIdentifier());
       
        DestinationPolicyType dp = reliableEndpoint.getManager().getDestinationPolicy();
        Duration supportedDuration = dp.getSequenceExpiration();
        if (null == supportedDuration) {
            supportedDuration = DatatypeFactory.PT0S;
        }
        Expires ex = create.getExpires();
       
        if (null != ex) {
            Duration effectiveDuration = ex.getValue();
            // PT0S represents 0 second and the shortest duration but in ws-rm, considered the longest
            if (DatatypeFactory.PT0S.equals(effectiveDuration)
                || (!DatatypeFactory.PT0S.equals(supportedDuration)
                    &&  supportedDuration.isShorterThan(effectiveDuration)))  {
                effectiveDuration = supportedDuration;
            }
            ex = new Expires();
            ex.setValue(effectiveDuration);
            createResponse.setExpires(ex);
        }
       
        OfferType offer = create.getOffer();
        if (null != offer) {
            AcceptType accept = new AcceptType();
            if (dp.isAcceptOffers()) {
                Source source = reliableEndpoint.getSource();
                LOG.fine("Accepting inbound sequence offer");
                // AddressingProperties maps = RMContextUtils.retrieveMAPs(message, false, false);
                accept.setAcksTo(RMUtils.createReference(maps.getTo().getValue()));
                SourceSequence seq = new SourceSequence(offer.getIdentifier(), null,
                    createResponse.getIdentifier(), protocol);
                seq.setExpires(offer.getExpires());
                seq.setTarget(create.getAcksTo());
                source.addSequence(seq);
                source.setCurrent(createResponse.getIdentifier(), seq)
                if (LOG.isLoggable(Level.FINE)) {
                    LOG.fine("Making offered sequence the current sequence for responses to "
                             + createResponse.getIdentifier().getValue());
                }
            } else {
                if (LOG.isLoggable(Level.FINE)) {
                    LOG.fine("Refusing inbound sequence offer");
                }
                accept.setAcksTo(RMUtils.createNoneReference());
            }
            createResponse.setAccept(accept);
        }
       
        DestinationSequence seq = new DestinationSequence(createResponse.getIdentifier(),
            create.getAcksTo(), destination, protocol);
        seq.setCorrelationID(maps.getMessageID().getValue());
        destination.addSequence(seq);
        LOG.fine("returning " + createResponse);
        return codec.convertToSend(createResponse);
    }
View Full Code Here

Examples of org.apache.cxf.ws.rm.v200702.CreateSequenceType

     */
    public static CreateSequenceType convert(org.apache.cxf.ws.rm.v200502wsa15.CreateSequenceType exposed) {
        if (exposed == null) {
            return null;
        }
        CreateSequenceType internal = new CreateSequenceType();
        internal.setAcksTo(exposed.getAcksTo());
        internal.setExpires(convert(exposed.getExpires()));
        internal.setOffer(convert(exposed.getOffer()));
        addAll(exposed.getAny(), internal.getAny());
        putAll(exposed.getOtherAttributes(), internal.getOtherAttributes());
        return internal;
    }
View Full Code Here

Examples of org.apache.cxf.ws.rm.v200702.CreateSequenceType

     */
    public static CreateSequenceType convert(org.apache.cxf.ws.rm.v200502.CreateSequenceType exposed) {
        if (exposed == null) {
            return null;
        }
        CreateSequenceType internal = new CreateSequenceType();
        internal.setAcksTo(org.apache.cxf.ws.addressing.VersionTransformer.convert(exposed.getAcksTo()));
        internal.setExpires(convert(exposed.getExpires()));
        internal.setOffer(convert(exposed.getOffer()));
        addAll(exposed.getAny(), internal.getAny());
        putAll(exposed.getOtherAttributes(), internal.getOtherAttributes());
        return internal;
    }
View Full Code Here

Examples of org.apache.cxf.ws.rm.v200702.CreateSequenceType

                        EndpointReferenceType defaultAcksTo,
                        RelatesToType relatesTo,
                        boolean isServer, final ProtocolVariation protocol) throws RMException {
       
        SourcePolicyType sp = reliableEndpoint.getManager().getSourcePolicy();
        CreateSequenceType create = new CreateSequenceType();       

        String address = sp.getAcksTo();
        EndpointReferenceType acksTo = null;
        if (null != address) {
            acksTo = RMUtils.createReference(address);
        } else {
            acksTo = defaultAcksTo;
        }
        create.setAcksTo(acksTo);

        Duration d = sp.getSequenceExpiration();
        if (null != d) {
            Expires expires = new Expires();
            expires.setValue(d)
            create.setExpires(expires);
        }
       
        if (sp.isIncludeOffer()) {
            OfferType offer = new OfferType();
            d = sp.getOfferedSequenceExpiration();
            if (null != d) {
                Expires expires = new Expires();
                expires.setValue(d)
                offer.setExpires(expires);
            }
            offer.setIdentifier(reliableEndpoint.getSource().generateSequenceIdentifier());
            create.setOffer(offer);
            setOfferedIdentifier(offer);
        }
       
        InterfaceInfo ii = reliableEndpoint.getEndpoint(protocol).getEndpointInfo()
            .getService().getInterface();
View Full Code Here

Examples of org.apache.cxf.ws.rm.v200702.CreateSequenceType

        if (null != outMessage) {
            RMContextUtils.storeMAPs(maps, outMessage, false, false);
        }
       
        EncoderDecoder codec = protocol.getCodec();
        CreateSequenceType create = codec.convertReceivedCreateSequence(getParameter(message));
        Destination destination = reliableEndpoint.getDestination();
       
        CreateSequenceResponseType createResponse = new CreateSequenceResponseType();       
        createResponse.setIdentifier(destination.generateSequenceIdentifier());
       
        DestinationPolicyType dp = reliableEndpoint.getManager().getDestinationPolicy();
        Duration supportedDuration = dp.getSequenceExpiration();
        if (null == supportedDuration) {
            supportedDuration = DatatypeFactory.PT0S;
        }
        Expires ex = create.getExpires();
       
        if (null != ex) {
            Duration effectiveDuration = ex.getValue();
            // PT0S represents 0 second and the shortest duration but in ws-rm, considered the longest
            if (DatatypeFactory.PT0S.equals(effectiveDuration)
                || (!DatatypeFactory.PT0S.equals(supportedDuration)
                    &&  supportedDuration.isShorterThan(effectiveDuration)))  {
                effectiveDuration = supportedDuration;
            }
            ex = new Expires();
            ex.setValue(effectiveDuration);
            createResponse.setExpires(ex);
        }
       
        OfferType offer = create.getOffer();
        if (null != offer) {
            AcceptType accept = new AcceptType();
            if (dp.isAcceptOffers()) {
                Source source = reliableEndpoint.getSource();
                LOG.fine("Accepting inbound sequence offer");
                // AddressingProperties maps = RMContextUtils.retrieveMAPs(message, false, false);
                accept.setAcksTo(RMUtils.createReference(maps.getTo().getValue()));
                SourceSequence seq = new SourceSequence(offer.getIdentifier(), null,
                    createResponse.getIdentifier(), protocol);
                seq.setExpires(offer.getExpires());
                seq.setTarget(create.getAcksTo());
                source.addSequence(seq);
                source.setCurrent(createResponse.getIdentifier(), seq)
                if (LOG.isLoggable(Level.FINE)) {
                    LOG.fine("Making offered sequence the current sequence for responses to "
                             + createResponse.getIdentifier().getValue());
                }
            } else {
                if (LOG.isLoggable(Level.FINE)) {
                    LOG.fine("Refusing inbound sequence offer");
                }
                accept.setAcksTo(RMUtils.createNoneReference());
            }
            createResponse.setAccept(accept);
        }
       
        DestinationSequence seq = new DestinationSequence(createResponse.getIdentifier(),
            create.getAcksTo(), destination, protocol);
        seq.setCorrelationID(maps.getMessageID().getValue());
        destination.addSequence(seq);
        LOG.fine("returning " + createResponse);
        return codec.convertToSend(createResponse);
    }
View Full Code Here

Examples of org.objectweb.celtix.ws.rm.CreateSequenceType

       
        assertNotNull(CreateSequenceRequest.createDataBindingCallback());
       
        Object[] params = req.getObjectMessageContext().getMessageObjects();
        assertEquals(1, params.length);
        CreateSequenceType cs = (CreateSequenceType)params[0];
       
        assertEquals(VersionTransformer.convert(getEPR("acksTo")).getAddress().getValue(),
                     cs.getAcksTo().getAddress().getValue());
        assertNull(cs.getExpires());
       
        // default is to include offers
       
        OfferType offer = cs.getOffer();
        assertNotNull(offer);
        assertNull(offer.getExpires());
        assertNotNull(offer.getIdentifier());
       
        control.verify();
View Full Code Here

Examples of org.objectweb.celtix.ws.rm.CreateSequenceType

                                      ContextUtils.WSA_OBJECT_FACTORY.createRelatesToType());
        assertNotNull(req);
       
        Object[] params = req.getObjectMessageContext().getMessageObjects();
        assertEquals(1, params.length);
        CreateSequenceType cs = (CreateSequenceType)params[0];
       
        assertEquals(NON_ANONYMOUS_ACKSTO_ADDRESS,
                     cs.getAcksTo().getAddress().getValue());
        assertEquals(ONE_DAY, cs.getExpires().getValue());
        assertNull(cs.getOffer());
       
        control.verify();
    }
View Full Code Here

Examples of org.objectweb.celtix.ws.rm.CreateSequenceType

   
    private void setMessageParameters(RMSource source, EndpointReferenceType defaultAcksTo) {
        SourcePolicyType sourcePolicies = source.getSourcePolicies();
        assert null != sourcePolicies;
       
        CreateSequenceType cs = RMUtils.getWSRMFactory().createCreateSequenceType();
       
        String address = sourcePolicies.getAcksTo();
        EndpointReferenceType acksTo = null;
        if (null != address) {
            acksTo = RMUtils.createReference(address);
        } else {
            acksTo = defaultAcksTo;
        }
        cs.setAcksTo(acksTo);

        Duration d = sourcePolicies.getSequenceExpiration();
        if (null != d) {
            Expires expires = RMUtils.getWSRMFactory().createExpires();
            expires.setValue(d)
            cs.setExpires(expires);
        }
       
        if (sourcePolicies.isIncludeOffer()) {
            OfferType offer = RMUtils.getWSRMFactory().createOfferType();
            d = sourcePolicies.getOfferedSequenceExpiration();
            if (null != d) {
                Expires expires = RMUtils.getWSRMFactory().createExpires();
                expires.setValue(d)
                offer.setExpires(expires);
            }
            offer.setIdentifier(source.generateSequenceIdentifier());
            cs.setOffer(offer);
        }
       
        getObjectMessageContext().setMessageObjects(new Object[] {cs});
    }
View Full Code Here

Examples of org.objectweb.celtix.ws.rm.CreateSequenceType

                                                getProxy().getOfferedIdentifier());

            return;
        } else if (RMUtils.getRMConstants().getCreateSequenceAction().equals(action)) {
            Object[] parameters = (Object[])context.get(ObjectMessageContext.METHOD_PARAMETERS);
            CreateSequenceType cs = (CreateSequenceType)parameters[0];

            final CreateSequenceResponseType csr =
                getServant().createSequence(getDestination(), cs, maps);
           
            Runnable response = new Runnable() {
                public void run() {
                    try {
                        getProxy().createSequenceResponse(maps, csr);
                    } catch (IOException ex) {
                        ex.printStackTrace();
                    } catch (SequenceFault sf) {
                        sf.printStackTrace();
                    }
                }
            };
            getBinding().getBus().getWorkQueueManager().getAutomaticWorkQueue().execute(response);
   
            return;
        } else if (RMUtils.getRMConstants().getTerminateSequenceAction().equals(action)) {
            Object[] parameters = (Object[])context.get(ObjectMessageContext.METHOD_PARAMETERS);
            TerminateSequenceType cs = (TerminateSequenceType)parameters[0];

            getServant().terminateSequence(getDestination(), cs.getIdentifier());
        }
       
        // for application AND out of band messages

        if (null != rmps) {           
View Full Code Here

Examples of org.servicemix.ws.xmlbeans.rm.CreateSequenceType

    SequenceStore sequenceStore = new NonPersistentSequenceStore();
    private static final BigInteger MAX_INTEGER = new BigInteger(""+Integer.MAX_VALUE);
   
    public CreateSequenceResponseDocument createSequence(CreateSequenceDocument requestDoc) {
        CreateSequenceType createSequence = requestDoc.getCreateSequence();
        Sequence s = new Sequence();
        s.acksTo = createSequence.getAcksTo();
        if(createSequence.isSetExpires())
            s.expires = convertToLocalTime(createSequence.getExpires());
       
        sequenceStore.create(s);
       
        CreateSequenceResponseDocument responseDoc = CreateSequenceResponseDocument.Factory.newInstance();
        CreateSequenceResponseType response = responseDoc.addNewCreateSequenceResponse();
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.