use of org.apache.cxf.ws.rm.v200702.SequenceType in project cxf by apache.
the class VersionTransformer method convert.
/**
* Convert 200502 wsrm:SequenceType with 200408 WS-Addressing namespace to internal form.
*
* @param exposed (non-<code>null</code>)
* @return converted
*/
public static SequenceType convert(org.apache.cxf.ws.rm.v200502.SequenceType exposed) {
SequenceType internal = new SequenceType();
internal.setIdentifier(convert(exposed.getIdentifier()));
internal.setMessageNumber(exposed.getMessageNumber());
addAll(exposed.getAny(), internal.getAny());
putAll(exposed.getOtherAttributes(), internal.getOtherAttributes());
return internal;
}
use of org.apache.cxf.ws.rm.v200702.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;
}
use of org.apache.cxf.ws.rm.v200702.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;
}
use of org.apache.cxf.ws.rm.v200702.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));
}
}
};
}
use of org.apache.cxf.ws.rm.v200702.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;
}
Aggregations