use of org.apache.cxf.ws.rm.v200702.SequenceAcknowledgement 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);
}
use of org.apache.cxf.ws.rm.v200702.SequenceAcknowledgement in project cxf by apache.
the class EncoderDecoder10AImpl method buildHeaderFaultObject.
@Override
protected Object buildHeaderFaultObject(SequenceFault sf) {
org.apache.cxf.ws.rm.v200502wsa15.SequenceFaultType flt = new org.apache.cxf.ws.rm.v200502wsa15.SequenceFaultType();
flt.setFaultCode(sf.getFaultCode());
Object detail = sf.getDetail();
if (detail instanceof Element) {
flt.getAny().add(detail);
} else if (detail instanceof Identifier) {
flt.getAny().add(VersionTransformer.convert200502wsa15((Identifier) detail));
} else if (detail instanceof SequenceAcknowledgement) {
flt.getAny().add(VersionTransformer.convert200502wsa15((SequenceAcknowledgement) detail));
}
Element data = sf.getExtraDetail();
if (data != null) {
flt.getAny().add(data);
}
return flt;
}
use of org.apache.cxf.ws.rm.v200702.SequenceAcknowledgement in project cxf by apache.
the class EncoderDecoder10AImpl method decodeSequenceAcknowledgement.
public SequenceAcknowledgement decodeSequenceAcknowledgement(Element elem) throws JAXBException {
Unmarshaller unmarshaller = getContext().createUnmarshaller();
org.apache.cxf.ws.rm.v200502wsa15.SequenceAcknowledgement ack = (org.apache.cxf.ws.rm.v200502wsa15.SequenceAcknowledgement) unmarshaller.unmarshal(elem);
return VersionTransformer.convert(ack);
}
use of org.apache.cxf.ws.rm.v200702.SequenceAcknowledgement in project cxf by apache.
the class EncoderDecoder10AImpl method buildHeaders.
@Override
protected void buildHeaders(SequenceType seq, Collection<SequenceAcknowledgement> acks, Collection<AckRequestedType> reqs, boolean last, List<Header> headers) throws JAXBException {
if (null != seq) {
LOG.log(Level.FINE, "encoding sequence into RM header");
org.apache.cxf.ws.rm.v200502wsa15.SequenceType toseq = VersionTransformer.convert200502wsa15(seq);
if (last) {
toseq.setLastMessage(new org.apache.cxf.ws.rm.v200502wsa15.SequenceType.LastMessage());
}
JAXBElement<org.apache.cxf.ws.rm.v200502wsa15.SequenceType> element = RMUtils.getWSRM200502WSA200508Factory().createSequence(toseq);
headers.add(new SoapHeader(element.getName(), element, getDataBinding(), true));
}
if (null != acks) {
LOG.log(Level.FINE, "encoding sequence acknowledgement(s) into RM header");
for (SequenceAcknowledgement ack : acks) {
headers.add(new SoapHeader(new QName(getConstants().getWSRMNamespace(), RMConstants.SEQUENCE_ACK_NAME), VersionTransformer.convert200502wsa15(ack), getDataBinding()));
}
}
if (null != reqs) {
LOG.log(Level.FINE, "encoding acknowledgement request(s) into RM header");
for (AckRequestedType req : reqs) {
headers.add(new SoapHeader(new QName(getConstants().getWSRMNamespace(), RMConstants.ACK_REQUESTED_NAME), RMUtils.getWSRM200502WSA200508Factory().createAckRequested(VersionTransformer.convert200502wsa15(req)), getDataBinding()));
}
}
}
use of org.apache.cxf.ws.rm.v200702.SequenceAcknowledgement in project cxf by apache.
the class EncoderDecoder10Impl method buildHeaders.
@Override
protected void buildHeaders(SequenceType seq, Collection<SequenceAcknowledgement> acks, Collection<AckRequestedType> reqs, boolean last, List<Header> headers) throws JAXBException {
if (null != seq) {
LOG.log(Level.FINE, "encoding sequence into RM header");
org.apache.cxf.ws.rm.v200502.SequenceType toseq = VersionTransformer.convert200502(seq);
if (last) {
toseq.setLastMessage(new org.apache.cxf.ws.rm.v200502.SequenceType.LastMessage());
}
JAXBElement<?> element = RMUtils.getWSRM200502Factory().createSequence(toseq);
headers.add(new SoapHeader(element.getName(), element, getDataBinding(), true));
}
if (null != acks) {
LOG.log(Level.FINE, "encoding sequence acknowledgement(s) into RM header");
for (SequenceAcknowledgement ack : acks) {
headers.add(new SoapHeader(new QName(getConstants().getWSRMNamespace(), RMConstants.SEQUENCE_ACK_NAME), VersionTransformer.convert200502(ack), getDataBinding()));
}
}
if (null != reqs) {
LOG.log(Level.FINE, "encoding acknowledgement request(s) into RM header");
for (AckRequestedType req : reqs) {
headers.add(new SoapHeader(new QName(getConstants().getWSRMNamespace(), RMConstants.ACK_REQUESTED_NAME), RMUtils.getWSRM200502Factory().createAckRequested(VersionTransformer.convert200502(req)), getDataBinding()));
}
}
}
Aggregations