use of org.apache.cxf.ws.rm.v200702.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);
}
use of org.apache.cxf.ws.rm.v200702.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);
}
use of org.apache.cxf.ws.rm.v200702.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;
}
use of org.apache.cxf.ws.rm.v200702.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;
}
use of org.apache.cxf.ws.rm.v200702.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);
}
Aggregations