Package org.apache.cxf.ws.rm.v200702

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


    }
   
    private void purgeCandidates(SourceSequence seq, boolean any) {
        Collection<Long> purged = new ArrayList<Long>();
        Collection<ResendCandidate> resends = new ArrayList<ResendCandidate>();
        Identifier sid = seq.getIdentifier();
        synchronized (this) {
            LOG.fine("Start purging resend candidates.");
            List<ResendCandidate> sequenceCandidates = getSequenceCandidates(seq);
            if (null != sequenceCandidates) {
                for (int i = sequenceCandidates.size() - 1; i >= 0; i--) {
                    ResendCandidate candidate = sequenceCandidates.get(i);
                    long m = candidate.getNumber();
                    if (any || seq.isAcknowledged(m)) {
                        sequenceCandidates.remove(i);
                        candidate.resolved();
                        unacknowledgedCount--;
                        purged.add(m);
                        resends.add(candidate);
                    }
                }
                if (sequenceCandidates.isEmpty()) {
                    candidates.remove(sid.getValue());
                }
            }
            LOG.fine("Completed purging resend candidates.");
        }
        if (purged.size() > 0) {
            RMStore store = manager.getStore();
            if (null != store) {
                store.removeMessages(sid, purged, true);
            }
            RMEndpoint rmEndpoint = seq.getSource().getReliableEndpoint();
            for (ResendCandidate resend: resends) {
                rmEndpoint.handleAcknowledgment(sid.getValue(), resend.getNumber(), resend.getMessage());
            }
        }
    }
View Full Code Here


     * @return ResendCandidate
     */   
    protected ResendCandidate cacheUnacknowledged(Message message) {
        RMProperties rmps = RMContextUtils.retrieveRMProperties(message, true);
        SequenceType st = rmps.getSequence();
        Identifier sid = st.getIdentifier();
        String key = sid.getValue();
       
        ResendCandidate candidate = null;
       
        synchronized (this) {
            List<ResendCandidate> sequenceCandidates = getSequenceCandidates(key);
View Full Code Here

       
        Collection<SequenceAcknowledgement> acks = rmps.getAcks();
        Source source = rme.getSource();
        if (null != acks) {
            for (SequenceAcknowledgement ack : acks) {
                Identifier id = ack.getIdentifier();
                SourceSequence ss = source.getSequence(id);               
                if (null != ss) {
                    ss.setAcknowledged(ack);
                } else {
                    RMConstants consts = protocol.getConstants();
View Full Code Here

            EasyMock.expectLastCall().andReturn(sequence);
        }
        if (messageNumber != null) {
            EasyMock.expect(sequence.getMessageNumber()).andReturn(messageNumber).anyTimes();
        }
        Identifier id = createMock(Identifier.class);
        EasyMock.expect(sequence.getIdentifier()).andReturn(id).anyTimes();
        EasyMock.expect(id.getValue()).andReturn(sid).anyTimes();
        identifiers.add(id);
        sequences.add(sequence);
        return sequence;
    }
View Full Code Here

        return sequence;
    }
   
    private SourceSequence setUpSequence(String sid,  Long[] messageNumbers, boolean[] isAcked) {
        SourceSequence sequence = createMock(SourceSequence.class);
        Identifier id = createMock(Identifier.class);
        sequence.getIdentifier();
        EasyMock.expectLastCall().andReturn(id).anyTimes();
        id.getValue();
        EasyMock.expectLastCall().andReturn(sid).anyTimes();
        identifiers.add(id);
        Source source = createMock(Source.class);
        sequence.getSource();
        EasyMock.expectLastCall().andReturn(source).anyTimes();
View Full Code Here

        // fault is a SoapFault and has a SequenceFault cause
       
        message = setupOutboundFaultMessage();
        SequenceFault sf = new SequenceFault("REASON");
        sf.setFaultCode(RM10Constants.UNKNOWN_SEQUENCE_FAULT_QNAME);
        Identifier sid = new Identifier();
        sid.setValue("SID");
        sf.setSender(true);
        f.initCause(sf);
        message.setContent(Exception.class, f);     
        codec.encode(message);
        verifyHeaders(message, new String[] {RMConstants.SEQUENCE_FAULT_NAME});
View Full Code Here

    }

    private void setUpOutbound() {
        ObjectFactory factory = new ObjectFactory();
        s1 = factory.createSequenceType();
        Identifier sid = factory.createIdentifier();
        sid.setValue("sequence1");
        s1.setIdentifier(sid);
        s1.setMessageNumber(ONE);
        s2 = factory.createSequenceType();
        sid = factory.createIdentifier();
        sid.setValue("sequence2");
        s2.setIdentifier(sid);
        s2.setMessageNumber(TEN);

        ack1 = factory.createSequenceAcknowledgement();
        SequenceAcknowledgement.AcknowledgementRange r =
View Full Code Here

    class DefaultSequenceIdentifierGenerator implements SequenceIdentifierGenerator {

        public Identifier generateSequenceIdentifier() {
            String sequenceID = RMContextUtils.generateUUID();
            Identifier sid = new Identifier();
            sid.setValue(sequenceID);
            return sid;
        }
View Full Code Here

        verifyHeaders(message, new String[] {RMConstants.SEQUENCE_FAULT_NAME});

    }

    private void setUpOutbound() {
        ObjectFactory factory = new ObjectFactory();
        s1 = factory.createSequenceType();
        Identifier sid = factory.createIdentifier();
        sid.setValue("sequence1");
        s1.setIdentifier(sid);
        s1.setMessageNumber(ONE);
        s2 = factory.createSequenceType();
        sid = factory.createIdentifier();
        sid.setValue("sequence2");
        s2.setIdentifier(sid);
        s2.setMessageNumber(TEN);

        ack1 = factory.createSequenceAcknowledgement();
        SequenceAcknowledgement.AcknowledgementRange r =
            factory.createSequenceAcknowledgementAcknowledgementRange();
        r.setLower(ONE);
        r.setUpper(ONE);
        ack1.getAcknowledgementRange().add(r);
        ack1.setIdentifier(s1.getIdentifier());

        ack2 = factory.createSequenceAcknowledgement();
        r = factory.createSequenceAcknowledgementAcknowledgementRange();
        r.setLower(ONE);
        r.setUpper(TEN);
        ack2.getAcknowledgementRange().add(r);
        ack2.setIdentifier(s2.getIdentifier());

        ar1 = factory.createAckRequestedType();
        ar1.setIdentifier(s1.getIdentifier());

        ar2 = factory.createAckRequestedType();
        ar2.setIdentifier(s2.getIdentifier());
    }
View Full Code Here

            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());
            offer.setEndpoint(acksTo);
            create.setOffer(offer);
            setOfferedIdentifier(offer);
        }
       
        InterfaceInfo ii = reliableEndpoint.getEndpoint(protocol).getEndpointInfo()
View Full Code Here

TOP

Related Classes of org.apache.cxf.ws.rm.v200702.OfferType

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.