Search in sources :

Example 6 with CloseSequenceType

use of org.apache.cxf.ws.rm.v200702.CloseSequenceType 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

CloseSequenceType (org.apache.cxf.ws.rm.v200702.CloseSequenceType)6 Message (org.apache.cxf.message.Message)4 AddressingProperties (org.apache.cxf.ws.addressing.AddressingProperties)3 SequenceType (org.apache.cxf.ws.rm.v200702.SequenceType)3 IOException (java.io.IOException)2 Unmarshaller (javax.xml.bind.Unmarshaller)2 Exchange (org.apache.cxf.message.Exchange)2 ExchangeImpl (org.apache.cxf.message.ExchangeImpl)2 MessageImpl (org.apache.cxf.message.MessageImpl)2 AttributedURIType (org.apache.cxf.ws.addressing.AttributedURIType)2 CreateSequenceType (org.apache.cxf.ws.rm.v200702.CreateSequenceType)2 TerminateSequenceType (org.apache.cxf.ws.rm.v200702.TerminateSequenceType)2 HashMap (java.util.HashMap)1 Fault (org.apache.cxf.interceptor.Fault)1 FaultListener (org.apache.cxf.logging.FaultListener)1 MessageContentsList (org.apache.cxf.message.MessageContentsList)1 BindingOperationInfo (org.apache.cxf.service.model.BindingOperationInfo)1 OperationInfo (org.apache.cxf.service.model.OperationInfo)1 EndpointReferenceType (org.apache.cxf.ws.addressing.EndpointReferenceType)1 RMMessage (org.apache.cxf.ws.rm.persistence.RMMessage)1