Search in sources :

Example 26 with SequenceType

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

the class EncoderDecoder10AImpl method decodeSequenceTypeCloseSequence.

public CloseSequenceType decodeSequenceTypeCloseSequence(Element elem) throws JAXBException {
    Unmarshaller unmarshaller = getContext().createUnmarshaller();
    JAXBElement<org.apache.cxf.ws.rm.v200502wsa15.SequenceType> jaxbElement = unmarshaller.unmarshal(elem, org.apache.cxf.ws.rm.v200502wsa15.SequenceType.class);
    org.apache.cxf.ws.rm.v200502wsa15.SequenceType seq = jaxbElement.getValue();
    if (seq.isSetLastMessage()) {
        CloseSequenceType close = new CloseSequenceType();
        close.setIdentifier(VersionTransformer.convert(seq.getIdentifier()));
        close.setLastMsgNumber(seq.getMessageNumber());
        return close;
    }
    return null;
}
Also used : CloseSequenceType(org.apache.cxf.ws.rm.v200702.CloseSequenceType) CreateSequenceType(org.apache.cxf.ws.rm.v200702.CreateSequenceType) TerminateSequenceType(org.apache.cxf.ws.rm.v200702.TerminateSequenceType) CloseSequenceType(org.apache.cxf.ws.rm.v200702.CloseSequenceType) SequenceType(org.apache.cxf.ws.rm.v200702.SequenceType) Unmarshaller(javax.xml.bind.Unmarshaller)

Example 27 with SequenceType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.SequenceType 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()));
        }
    }
}
Also used : QName(javax.xml.namespace.QName) CreateSequenceType(org.apache.cxf.ws.rm.v200702.CreateSequenceType) TerminateSequenceType(org.apache.cxf.ws.rm.v200702.TerminateSequenceType) CloseSequenceType(org.apache.cxf.ws.rm.v200702.CloseSequenceType) SequenceType(org.apache.cxf.ws.rm.v200702.SequenceType) SoapHeader(org.apache.cxf.binding.soap.SoapHeader) AckRequestedType(org.apache.cxf.ws.rm.v200702.AckRequestedType) SequenceAcknowledgement(org.apache.cxf.ws.rm.v200702.SequenceAcknowledgement)

Example 28 with SequenceType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.SequenceType 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()));
        }
    }
}
Also used : QName(javax.xml.namespace.QName) CreateSequenceType(org.apache.cxf.ws.rm.v200702.CreateSequenceType) TerminateSequenceType(org.apache.cxf.ws.rm.v200702.TerminateSequenceType) CloseSequenceType(org.apache.cxf.ws.rm.v200702.CloseSequenceType) SequenceType(org.apache.cxf.ws.rm.v200702.SequenceType) SoapHeader(org.apache.cxf.binding.soap.SoapHeader) AckRequestedType(org.apache.cxf.ws.rm.v200702.AckRequestedType) SequenceAcknowledgement(org.apache.cxf.ws.rm.v200702.SequenceAcknowledgement)

Example 29 with SequenceType

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

the class EncoderDecoder10Impl method decodeSequenceTypeCloseSequence.

public CloseSequenceType decodeSequenceTypeCloseSequence(Element elem) throws JAXBException {
    Unmarshaller unmarshaller = getContext().createUnmarshaller();
    JAXBElement<org.apache.cxf.ws.rm.v200502.SequenceType> jaxbElement = unmarshaller.unmarshal(elem, org.apache.cxf.ws.rm.v200502.SequenceType.class);
    org.apache.cxf.ws.rm.v200502.SequenceType seq = jaxbElement.getValue();
    if (seq.isSetLastMessage()) {
        CloseSequenceType close = new CloseSequenceType();
        close.setIdentifier(VersionTransformer.convert(seq.getIdentifier()));
        close.setLastMsgNumber(seq.getMessageNumber());
        return close;
    }
    return null;
}
Also used : CloseSequenceType(org.apache.cxf.ws.rm.v200702.CloseSequenceType) CreateSequenceType(org.apache.cxf.ws.rm.v200702.CreateSequenceType) TerminateSequenceType(org.apache.cxf.ws.rm.v200702.TerminateSequenceType) CloseSequenceType(org.apache.cxf.ws.rm.v200702.CloseSequenceType) SequenceType(org.apache.cxf.ws.rm.v200702.SequenceType) Unmarshaller(javax.xml.bind.Unmarshaller)

Example 30 with SequenceType

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

the class EncoderDecoder10Impl method decodeSequenceType.

public SequenceType decodeSequenceType(Element elem) throws JAXBException {
    Unmarshaller unmarshaller = getContext().createUnmarshaller();
    JAXBElement<org.apache.cxf.ws.rm.v200502.SequenceType> jaxbElement = unmarshaller.unmarshal(elem, org.apache.cxf.ws.rm.v200502.SequenceType.class);
    return VersionTransformer.convert(jaxbElement.getValue());
}
Also used : CreateSequenceType(org.apache.cxf.ws.rm.v200702.CreateSequenceType) TerminateSequenceType(org.apache.cxf.ws.rm.v200702.TerminateSequenceType) CloseSequenceType(org.apache.cxf.ws.rm.v200702.CloseSequenceType) SequenceType(org.apache.cxf.ws.rm.v200702.SequenceType) Unmarshaller(javax.xml.bind.Unmarshaller)

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