use of org.apache.cxf.ws.rm.v200702.AckRequestedType in project cxf by apache.
the class EncoderDecoder10AImpl method decodeAckRequestedType.
public AckRequestedType decodeAckRequestedType(Element elem) throws JAXBException {
Unmarshaller unmarshaller = getContext().createUnmarshaller();
JAXBElement<org.apache.cxf.ws.rm.v200502wsa15.AckRequestedType> jaxbElement = unmarshaller.unmarshal(elem, org.apache.cxf.ws.rm.v200502wsa15.AckRequestedType.class);
return VersionTransformer.convert(jaxbElement.getValue());
}
use of org.apache.cxf.ws.rm.v200702.AckRequestedType in project cxf by apache.
the class RMOutInterceptor method addAckRequest.
/**
* Add AcknowledgementRequested to message if needed. The AckRequest mode set either in the message
* properties or in the source policy is used to determine whether AcknowledgementRequested is always
* added, never added, or added only when we're waiting for the acknowledgement to a previously-sent
* message.
*
* @param msg
* @param rmpsIn
* @param seq
* @param sequence
*/
protected void addAckRequest(Message msg, RMProperties rmpsIn, SourceSequence seq, SequenceType sequence) {
AckRequestModeType mode = (AckRequestModeType) msg.get(RMMessageConstants.ACK_REQUEST_MODE);
if (mode == null) {
mode = AckRequestModeType.PENDING;
SourcePolicyType policy = getManager().getSourcePolicy();
if (policy.isSetAckRequestMode()) {
mode = policy.getAckRequestMode();
}
}
if (AckRequestModeType.ALWAYS == mode || (mode == AckRequestModeType.PENDING && seq.needAcknowledge(rmpsIn.getMessageNumber()))) {
Collection<AckRequestedType> reqs = rmpsIn.getAcksRequested();
if (reqs == null) {
reqs = new ArrayList<>();
}
Identifier identifier = new Identifier();
identifier.setValue(sequence.getIdentifier().getValue());
AckRequestedType ackRequest = new AckRequestedType();
ackRequest.setIdentifier(identifier);
reqs.add(ackRequest);
rmpsIn.setAcksRequested(reqs);
}
}
use of org.apache.cxf.ws.rm.v200702.AckRequestedType in project cxf by apache.
the class VersionTransformer method convert.
/**
* Convert 200502 wsrm:SequenceAcknowledgement with 200508 WS-Addressing namespace to internal form.
*
* @param exposed (non-<code>null</code>)
* @return converted
*/
public static AckRequestedType convert(org.apache.cxf.ws.rm.v200502wsa15.AckRequestedType exposed) {
AckRequestedType internal = new AckRequestedType();
internal.setIdentifier(convert(exposed.getIdentifier()));
addAll(exposed.getAny(), internal.getAny());
putAll(exposed.getOtherAttributes(), internal.getOtherAttributes());
return internal;
}
use of org.apache.cxf.ws.rm.v200702.AckRequestedType in project cxf by apache.
the class VersionTransformer method convert.
/**
* Convert 200502 wsrm:SequenceAcknowledgement with 200408 WS-Addressing namespace to internal form.
*
* @param exposed (non-<code>null</code>)
* @return converted
*/
public static AckRequestedType convert(org.apache.cxf.ws.rm.v200502.AckRequestedType exposed) {
AckRequestedType internal = new AckRequestedType();
internal.setIdentifier(convert(exposed.getIdentifier()));
addAll(exposed.getAny(), internal.getAny());
putAll(exposed.getOtherAttributes(), internal.getOtherAttributes());
return internal;
}
use of org.apache.cxf.ws.rm.v200702.AckRequestedType 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());
}
Aggregations