Search in sources :

Example 1 with TerminateSequenceType

use of org.apache.cxf.ws.rm.v200502.TerminateSequenceType in project cxf by apache.

the class Proxy method terminate.

void terminate(DestinationSequence ds) throws RMException {
    ProtocolVariation protocol = ds.getProtocol();
    RMConstants constants = protocol.getConstants();
    OperationInfo oi = reliableEndpoint.getEndpoint(protocol).getEndpointInfo().getService().getInterface().getOperation(constants.getTerminateSequenceOperationName());
    TerminateSequenceType ts = new TerminateSequenceType();
    ts.setIdentifier(ds.getIdentifier());
    ts.setLastMsgNumber(ds.getLastMessageNumber());
    EncoderDecoder codec = protocol.getCodec();
    invoke(oi, protocol, new Object[] { codec.convertToSend(ts) }, this.sequenceContext);
}
Also used : BindingOperationInfo(org.apache.cxf.service.model.BindingOperationInfo) OperationInfo(org.apache.cxf.service.model.OperationInfo) TerminateSequenceType(org.apache.cxf.ws.rm.v200702.TerminateSequenceType)

Example 2 with TerminateSequenceType

use of org.apache.cxf.ws.rm.v200502.TerminateSequenceType in project cxf by apache.

the class Proxy method terminate.

void terminate(SourceSequence ss) throws RMException {
    ProtocolVariation protocol = ss.getProtocol();
    RMConstants constants = protocol.getConstants();
    OperationInfo oi = reliableEndpoint.getEndpoint(protocol).getEndpointInfo().getService().getInterface().getOperation(constants.getTerminateSequenceOperationName());
    TerminateSequenceType ts = new TerminateSequenceType();
    ts.setIdentifier(ss.getIdentifier());
    ts.setLastMsgNumber(ss.getCurrentMessageNr());
    EncoderDecoder codec = protocol.getCodec();
    invoke(oi, protocol, new Object[] { codec.convertToSend(ts) }, this.sequenceContext);
}
Also used : BindingOperationInfo(org.apache.cxf.service.model.BindingOperationInfo) OperationInfo(org.apache.cxf.service.model.OperationInfo) TerminateSequenceType(org.apache.cxf.ws.rm.v200702.TerminateSequenceType)

Example 3 with TerminateSequenceType

use of org.apache.cxf.ws.rm.v200502.TerminateSequenceType in project cxf by apache.

the class ServantTest method createTestTerminateSequenceMessage.

private static Message createTestTerminateSequenceMessage(String sidstr, ProtocolVariation protocol) {
    Message message = new MessageImpl();
    Exchange exchange = new ExchangeImpl();
    exchange.setInMessage(message);
    message.put(Message.REQUESTOR_ROLE, Boolean.FALSE);
    AddressingProperties maps = new AddressingProperties();
    String msgId = "urn:uuid:12345-" + Math.random();
    AttributedURIType id = ContextUtils.getAttributedURI(msgId);
    maps.setMessageID(id);
    maps.setAction(ContextUtils.getAttributedURI(RM10Constants.INSTANCE.getTerminateSequenceAction()));
    maps.setTo(ContextUtils.getAttributedURI(SERVICE_URL));
    maps.setReplyTo(RMUtils.createReference(DECOUPLED_URL));
    message.put(JAXWSAConstants.ADDRESSING_PROPERTIES_INBOUND, maps);
    TerminateSequenceType ts = new TerminateSequenceType();
    Identifier sid = new Identifier();
    sid.setValue(sidstr);
    ts.setIdentifier(sid);
    Object tst = ProtocolVariation.RM10WSA200408.getWSRMNamespace().equals(protocol.getWSRMNamespace()) ? ts : ProtocolVariation.RM10WSA200408.getCodec().convertReceivedTerminateSequence(ts);
    MessageContentsList contents = new MessageContentsList();
    contents.add(tst);
    message.setContent(List.class, contents);
    RMContextUtils.setProtocolVariation(message, protocol);
    return message;
}
Also used : Exchange(org.apache.cxf.message.Exchange) Identifier(org.apache.cxf.ws.rm.v200502.Identifier) Message(org.apache.cxf.message.Message) MessageContentsList(org.apache.cxf.message.MessageContentsList) AttributedURIType(org.apache.cxf.ws.addressing.AttributedURIType) TerminateSequenceType(org.apache.cxf.ws.rm.v200502.TerminateSequenceType) AddressingProperties(org.apache.cxf.ws.addressing.AddressingProperties) MessageImpl(org.apache.cxf.message.MessageImpl) ExchangeImpl(org.apache.cxf.message.ExchangeImpl)

Example 4 with TerminateSequenceType

use of org.apache.cxf.ws.rm.v200502.TerminateSequenceType in project cxf by apache.

the class VersionTransformer method convert.

/**
 * Convert 200502 TerminateSequenceType with 200408 WS-Addressing namespace to internal form.
 *
 * @param exposed (non-<code>null</code>)
 * @return converted
 */
public static TerminateSequenceType convert(org.apache.cxf.ws.rm.v200502.TerminateSequenceType exposed) {
    TerminateSequenceType internal = new TerminateSequenceType();
    internal.setIdentifier(convert(exposed.getIdentifier()));
    addAll(exposed.getAny(), internal.getAny());
    putAll(exposed.getOtherAttributes(), internal.getOtherAttributes());
    return internal;
}
Also used : TerminateSequenceType(org.apache.cxf.ws.rm.v200702.TerminateSequenceType)

Example 5 with TerminateSequenceType

use of org.apache.cxf.ws.rm.v200502.TerminateSequenceType in project cxf by apache.

the class RMCaptureOutInterceptor method setTerminateSequence.

private void setTerminateSequence(Message msg, Identifier identifier, ProtocolVariation protocol) throws RMException {
    TerminateSequenceType ts = new TerminateSequenceType();
    ts.setIdentifier(identifier);
    MessageContentsList contents = new MessageContentsList(new Object[] { protocol.getCodec().convertToSend(ts) });
    msg.setContent(List.class, contents);
    // create a new exchange for this output-only exchange
    Exchange newex = new ExchangeImpl();
    Exchange oldex = msg.getExchange();
    newex.put(Bus.class, oldex.getBus());
    newex.put(Endpoint.class, oldex.getEndpoint());
    newex.put(Service.class, oldex.getEndpoint().getService());
    newex.put(Binding.class, oldex.getEndpoint().getBinding());
    newex.setConduit(oldex.getConduit(msg));
    newex.setDestination(oldex.getDestination());
    // Setup the BindingOperationInfo
    RMEndpoint rmep = getManager().getReliableEndpoint(msg);
    OperationInfo oi = rmep.getEndpoint(protocol).getEndpointInfo().getService().getInterface().getOperation(protocol.getConstants().getTerminateSequenceAnonymousOperationName());
    BindingInfo bi = rmep.getBindingInfo(protocol);
    BindingOperationInfo boi = bi.getOperation(oi);
    newex.put(BindingInfo.class, bi);
    newex.put(BindingOperationInfo.class, boi);
    msg.setExchange(newex);
    newex.setOutMessage(msg);
}
Also used : Exchange(org.apache.cxf.message.Exchange) BindingOperationInfo(org.apache.cxf.service.model.BindingOperationInfo) OperationInfo(org.apache.cxf.service.model.OperationInfo) BindingOperationInfo(org.apache.cxf.service.model.BindingOperationInfo) MessageContentsList(org.apache.cxf.message.MessageContentsList) BindingInfo(org.apache.cxf.service.model.BindingInfo) TerminateSequenceType(org.apache.cxf.ws.rm.v200702.TerminateSequenceType) ExchangeImpl(org.apache.cxf.message.ExchangeImpl)

Aggregations

TerminateSequenceType (org.apache.cxf.ws.rm.v200702.TerminateSequenceType)6 BindingOperationInfo (org.apache.cxf.service.model.BindingOperationInfo)3 OperationInfo (org.apache.cxf.service.model.OperationInfo)3 Exchange (org.apache.cxf.message.Exchange)2 ExchangeImpl (org.apache.cxf.message.ExchangeImpl)2 Message (org.apache.cxf.message.Message)2 MessageContentsList (org.apache.cxf.message.MessageContentsList)2 AddressingProperties (org.apache.cxf.ws.addressing.AddressingProperties)2 MessageImpl (org.apache.cxf.message.MessageImpl)1 BindingInfo (org.apache.cxf.service.model.BindingInfo)1 AttributedURIType (org.apache.cxf.ws.addressing.AttributedURIType)1 Identifier (org.apache.cxf.ws.rm.v200502.Identifier)1 TerminateSequenceType (org.apache.cxf.ws.rm.v200502.TerminateSequenceType)1 Identifier (org.apache.cxf.ws.rm.v200702.Identifier)1 TerminateSequenceResponseType (org.apache.cxf.ws.rm.v200702.TerminateSequenceResponseType)1