use of com.evolveum.midpoint.xml.ns._public.common.common_3.SequenceType in project cxf by apache.
the class RetransmissionQueueImplTest method setUpSequenceType.
private SequenceType setUpSequenceType(Message message, String sid, Long messageNumber) {
RMProperties rmps = createMock(RMProperties.class);
if (message != null) {
message.get(RMMessageConstants.RM_PROPERTIES_OUTBOUND);
EasyMock.expectLastCall().andReturn(rmps);
}
properties.add(rmps);
SequenceType sequence = createMock(SequenceType.class);
if (message != null) {
rmps.getSequence();
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;
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.SequenceType in project cxf by apache.
the class RMSoapInInterceptorTest method testDecodeAcksRequested.
@Test
public void testDecodeAcksRequested() throws XMLStreamException {
SoapMessage message = setUpInboundMessage("resources/Retransmission.xml");
RMSoapInInterceptor codec = new RMSoapInInterceptor();
codec.handleMessage(message);
RMProperties rmps = RMContextUtils.retrieveRMProperties(message, false);
Collection<AckRequestedType> requested = rmps.getAcksRequested();
assertNotNull(requested);
assertEquals(1, requested.size());
AckRequestedType ar = requested.iterator().next();
assertNotNull(ar);
assertEquals(ar.getIdentifier().getValue(), SEQ_IDENTIFIER);
SequenceType s = rmps.getSequence();
assertNotNull(s);
assertEquals(s.getIdentifier().getValue(), SEQ_IDENTIFIER);
assertEquals(s.getMessageNumber(), MSG2_MESSAGE_NUMBER);
assertNull(rmps.getAcks());
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.SequenceType in project cxf by apache.
the class RMSoapInInterceptorTest method testDecodeSequence.
@Test
public void testDecodeSequence() throws XMLStreamException {
SoapMessage message = setUpInboundMessage("resources/Message1.xml");
RMSoapInInterceptor codec = new RMSoapInInterceptor();
codec.handleMessage(message);
RMProperties rmps = RMContextUtils.retrieveRMProperties(message, false);
SequenceType st = rmps.getSequence();
assertNotNull(st);
assertEquals(st.getIdentifier().getValue(), SEQ_IDENTIFIER);
assertEquals(st.getMessageNumber(), MSG1_MESSAGE_NUMBER);
assertNull(rmps.getAcks());
assertNull(rmps.getAcksRequested());
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.SequenceType in project cxf by apache.
the class Destination method processingComplete.
void processingComplete(Message message) {
SequenceType sequenceType = RMContextUtils.retrieveRMProperties(message, false).getSequence();
if (null == sequenceType) {
return;
}
DestinationSequence seq = getSequence(sequenceType.getIdentifier());
if (null != seq) {
long mn = sequenceType.getMessageNumber().longValue();
seq.processingComplete(mn);
seq.purgeAcknowledged(mn);
// remove acknowledged undelivered message
seq.removeDeliveringMessageNumber(mn);
if (seq.isTerminated() && seq.allAcknowledgedMessagesDelivered()) {
removeSequence(seq);
}
}
CachedOutputStream saved = (CachedOutputStream) message.remove(RMMessageConstants.SAVED_CONTENT);
if (saved != null) {
saved.releaseTempFileHold();
try {
saved.close();
} catch (IOException e) {
// ignore
}
}
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.SequenceType in project cxf by apache.
the class EncoderDecoder method buildHeaders.
/**
* Builds an element containing WS-RM headers. This adds the appropriate WS-RM namespace declaration to the element,
* and then adds any WS-RM headers set in the supplied properties as child elements.
*
* @param rmps
* @param qname constructed element name
* @return element (<code>null</code> if none)
*/
public void buildHeaders(RMProperties rmps, List<Header> headers) throws JAXBException {
// check if there's anything to insert
SequenceType seq = rmps.getSequence();
Collection<SequenceAcknowledgement> acks = rmps.getAcks();
Collection<AckRequestedType> reqs = rmps.getAcksRequested();
if (seq == null && acks == null && reqs == null) {
return;
}
buildHeaders(seq, acks, reqs, rmps.isLastMessage(), headers);
}
Aggregations