Search in sources :

Example 36 with SequenceType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.SequenceType in project cxf by apache.

the class RedeliveryQueueImpl method getRedeliveryStatus.

public RetryStatus getRedeliveryStatus(DestinationSequence seq, long num) {
    List<RedeliverCandidate> sequenceCandidates = getSequenceCandidates(seq);
    if (null != sequenceCandidates) {
        for (int i = 0; i < sequenceCandidates.size(); i++) {
            RedeliverCandidate candidate = sequenceCandidates.get(i);
            RMProperties properties = RMContextUtils.retrieveRMProperties(candidate.getMessage(), false);
            SequenceType st = properties.getSequence();
            if (num == st.getMessageNumber()) {
                return candidate;
            }
        }
    }
    return null;
}
Also used : SequenceType(org.apache.cxf.ws.rm.v200702.SequenceType) Endpoint(org.apache.cxf.endpoint.Endpoint) RMProperties(org.apache.cxf.ws.rm.RMProperties)

Example 37 with SequenceType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.SequenceType in project cxf by apache.

the class RedeliveryQueueImpl method getUndeliveredMessageNumbers.

public List<Long> getUndeliveredMessageNumbers(DestinationSequence seq) {
    List<Long> undelivered = new ArrayList<>();
    List<RedeliverCandidate> sequenceCandidates = getSequenceCandidates(seq);
    if (null != sequenceCandidates) {
        for (int i = 0; i < sequenceCandidates.size(); i++) {
            RedeliverCandidate candidate = sequenceCandidates.get(i);
            RMProperties properties = RMContextUtils.retrieveRMProperties(candidate.getMessage(), false);
            SequenceType st = properties.getSequence();
            undelivered.add(st.getMessageNumber());
        }
    }
    return undelivered;
}
Also used : ArrayList(java.util.ArrayList) SequenceType(org.apache.cxf.ws.rm.v200702.SequenceType) Endpoint(org.apache.cxf.endpoint.Endpoint) RMProperties(org.apache.cxf.ws.rm.RMProperties)

Example 38 with SequenceType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.SequenceType in project cxf by apache.

the class RetransmissionQueueImpl method getDefaultResender.

/**
 * Create default Resender logic.
 *
 * @return default Resender
 */
protected final Resender getDefaultResender() {
    return new Resender() {

        public void resend(Message message, boolean requestAcknowledge) {
            RMProperties properties = RMContextUtils.retrieveRMProperties(message, true);
            SequenceType st = properties.getSequence();
            if (st != null) {
                LOG.log(Level.INFO, "RESEND_MSG", st.getMessageNumber());
            }
            if (message instanceof SoapMessage) {
                doResend((SoapMessage) message);
            } else {
                doResend(new SoapMessage(message));
            }
        }
    };
}
Also used : SoapMessage(org.apache.cxf.binding.soap.SoapMessage) Message(org.apache.cxf.message.Message) SequenceType(org.apache.cxf.ws.rm.v200702.SequenceType) RMProperties(org.apache.cxf.ws.rm.RMProperties) SoapMessage(org.apache.cxf.binding.soap.SoapMessage)

Example 39 with SequenceType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.SequenceType in project cxf by apache.

the class DestinationSequenceTest method setUpMessage.

private Message setUpMessage(String messageNr, boolean useuri) {
    Message message = control.createMock(Message.class);
    Exchange exchange = control.createMock(Exchange.class);
    EasyMock.expect(message.getExchange()).andReturn(exchange);
    EasyMock.expect(exchange.getOutMessage()).andReturn(null);
    EasyMock.expect(exchange.getOutFaultMessage()).andReturn(null);
    RMProperties rmps = control.createMock(RMProperties.class);
    EasyMock.expect(message.get(RMMessageConstants.RM_PROPERTIES_INBOUND)).andReturn(rmps);
    SequenceType st = control.createMock(SequenceType.class);
    EasyMock.expect(rmps.getSequence()).andReturn(st);
    Long val = new Long(messageNr);
    EasyMock.expect(st.getMessageNumber()).andReturn(val);
    if (useuri) {
        EasyMock.expect(rmps.getNamespaceURI()).andReturn(RM10Constants.NAMESPACE_URI);
    }
    return message;
}
Also used : Exchange(org.apache.cxf.message.Exchange) Message(org.apache.cxf.message.Message) SequenceType(org.apache.cxf.ws.rm.v200702.SequenceType)

Aggregations

SequenceType (org.apache.cxf.ws.rm.v200702.SequenceType)33 CloseSequenceType (org.apache.cxf.ws.rm.v200702.CloseSequenceType)12 RMProperties (org.apache.cxf.ws.rm.RMProperties)11 CreateSequenceType (org.apache.cxf.ws.rm.v200702.CreateSequenceType)11 TerminateSequenceType (org.apache.cxf.ws.rm.v200702.TerminateSequenceType)11 Message (org.apache.cxf.message.Message)8 Identifier (org.apache.cxf.ws.rm.v200702.Identifier)7 SequenceType (com.evolveum.midpoint.xml.ns._public.common.common_3.SequenceType)6 IOException (java.io.IOException)6 Unmarshaller (javax.xml.bind.Unmarshaller)5 AckRequestedType (org.apache.cxf.ws.rm.v200702.AckRequestedType)5 SoapMessage (org.apache.cxf.binding.soap.SoapMessage)4 Endpoint (org.apache.cxf.endpoint.Endpoint)4 Exchange (org.apache.cxf.message.Exchange)4 AddressingProperties (org.apache.cxf.ws.addressing.AddressingProperties)4 SequenceAcknowledgement (org.apache.cxf.ws.rm.v200702.SequenceAcknowledgement)4 Test (org.junit.Test)4 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)3 SystemException (com.evolveum.midpoint.util.exception.SystemException)3 File (java.io.File)3