use of org.apache.cxf.ws.rm.v200702.CloseSequenceResponseType in project cxf by apache.
the class Servant method closeSequence.
public Object closeSequence(Message message) {
LOG.fine("Closing sequence");
CloseSequenceType close = (CloseSequenceType) getParameter(message);
// check if the terminated sequence was created in response to a a createSequence
// request
Destination destination = reliableEndpoint.getDestination();
Identifier sid = close.getIdentifier();
DestinationSequence closedSeq = destination.getSequence(sid);
if (null == closedSeq) {
// TODO
LOG.severe("No such sequence.");
return null;
}
closedSeq.scheduleImmediateAcknowledgement();
closedSeq.setLastMessageNumber(close.getLastMsgNumber());
CloseSequenceResponseType closeResponse = new CloseSequenceResponseType();
closeResponse.setIdentifier(close.getIdentifier());
AddressingProperties maps = RMContextUtils.retrieveMAPs(message, false, false);
Message outMessage = message.getExchange().getOutMessage();
if (null == outMessage) {
// outMessage may be null e.g. if ReplyTo is not set for TS
outMessage = ContextUtils.createMessage(message.getExchange());
message.getExchange().setOutMessage(outMessage);
}
if (null != outMessage) {
RMContextUtils.storeMAPs(maps, outMessage, false, false);
}
return closeResponse;
}
Aggregations