Search in sources :

Example 1 with CloseSequenceResponseType

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;
}
Also used : Identifier(org.apache.cxf.ws.rm.v200702.Identifier) Message(org.apache.cxf.message.Message) CloseSequenceResponseType(org.apache.cxf.ws.rm.v200702.CloseSequenceResponseType) CloseSequenceType(org.apache.cxf.ws.rm.v200702.CloseSequenceType) AddressingProperties(org.apache.cxf.ws.addressing.AddressingProperties)

Aggregations

Message (org.apache.cxf.message.Message)1 AddressingProperties (org.apache.cxf.ws.addressing.AddressingProperties)1 CloseSequenceResponseType (org.apache.cxf.ws.rm.v200702.CloseSequenceResponseType)1 CloseSequenceType (org.apache.cxf.ws.rm.v200702.CloseSequenceType)1 Identifier (org.apache.cxf.ws.rm.v200702.Identifier)1