Package org.apache.sandesha2.wsrm

Examples of org.apache.sandesha2.wsrm.SequenceAcknowledgement


     
      //In case of ack messages sequenceId is decided based on the sequenceId of the first
      //sequence Ack. In other words Sandesha2 does not expect to receive two SequenceAcknowledgements
      //of different RM specifications in the same incoming message.
     
      SequenceAcknowledgement sequenceAcknowledgement = (SequenceAcknowledgement) sequenceAckIter.next();
      sequenceID = sequenceAcknowledgement.getIdentifier().getIdentifier();
    } else if (messageType == Sandesha2Constants.MessageTypes.ACK_REQUEST) {
      Iterator ackRequestIter = rmMessageContext
          .getMessageParts(Sandesha2Constants.MessageParts.ACK_REQUEST);
 
      //In case of ack request messages sequenceId is decided based on the sequenceId of the first
View Full Code Here


    RMMsgContext closeSeqResponseRMMsg = RMMsgCreator.createCloseSeqResponseMsg(rmMsgCtx, rmdBean);
    MessageContext closeSequenceResponseMsg = closeSeqResponseRMMsg.getMessageContext();

    while (sequenceAckIter.hasNext()) {
      SequenceAcknowledgement sequenceAcknowledgement = (SequenceAcknowledgement) sequenceAckIter.next();
      closeSeqResponseRMMsg.setMessagePart(Sandesha2Constants.MessageParts.SEQ_ACKNOWLEDGEMENT,
          sequenceAcknowledgement);
    }
   
    closeSeqResponseRMMsg.setFlow(MessageContext.OUT_FLOW);
View Full Code Here

        sequenceId,  storageManager, true);
   
    // copy over the ack parts
    Iterator iter = ackRMMessage.getMessageParts(Sandesha2Constants.MessageParts.SEQ_ACKNOWLEDGEMENT);
    while (iter.hasNext()) {
      SequenceAcknowledgement seqAck = (SequenceAcknowledgement) iter.next();
      terminateSeqResponseRMMsg.setMessagePart(Sandesha2Constants.MessageParts.SEQ_ACKNOWLEDGEMENT, seqAck);
    }
   
    terminateSeqResponseRMMsg.addSOAPEnvelope();
View Full Code Here

      log.debug("Entry: RMMsgCreator::addAckMessage " + sequenceId);
   
    String rmVersion = rmdBean.getRMVersion();
    String rmNamespaceValue = SpecSpecificConstants.getRMNamespaceValue(rmVersion);

    SequenceAcknowledgement sequenceAck = new SequenceAcknowledgement(rmNamespaceValue);
    Identifier id = new Identifier(rmNamespaceValue);
    id.setIndentifer(sequenceId);
    sequenceAck.setIdentifier(id);

    ArrayList ackRangeArrayList = SandeshaUtil.getAckRangeArrayList(rmdBean.getServerCompletedMessages(), rmNamespaceValue);
    sequenceAck.setAckRanges(ackRangeArrayList);

    if (rmdBean.isClosed()) {
      // sequence is closed. so add the 'Final' part.
      if (SpecSpecificConstants.isAckFinalAllowed(rmVersion)) {
        AckFinal ackFinal = new AckFinal(rmNamespaceValue);
        sequenceAck.setAckFinal(ackFinal);
      }
    }

    applicationMsg.setMessagePart(Sandesha2Constants.MessageParts.SEQ_ACKNOWLEDGEMENT, sequenceAck);
View Full Code Here

    //In case of ack messages RM Namespace is decided based on the sequenceId of the last
    //sequence Ack. In other words Sandesha2 does not expect to receive two SequenceAcknowledgements
    //of different RM specifications in the same incoming message
    for (Iterator iter = elements.getSequenceAcknowledgements();iter.hasNext();) {
      SequenceAcknowledgement sequenceAck = (SequenceAcknowledgement) iter.next();
      rmMsgContext.setMessagePart(Sandesha2Constants.MessageParts.SEQ_ACKNOWLEDGEMENT, sequenceAck);
      rmNamespace = sequenceAck.getNamespaceValue();
    }

    if (elements.getTerminateSequence() != null) {
      rmMsgContext.setMessagePart(Sandesha2Constants.MessageParts.TERMINATE_SEQ, elements.getTerminateSequence());
      rmNamespace = elements.getTerminateSequence().getNamespaceValue();
View Full Code Here

        rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.APPLICATION);
     
      sequenceID = sequence.getIdentifier().getIdentifier();
    } else if (sequenceAcknowledgementsIter.hasNext()) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.ACK);
      SequenceAcknowledgement sequenceAcknowledgement = (SequenceAcknowledgement) sequenceAcknowledgementsIter.next();
     
      //if there is only on sequenceAck, sequenceId will be set. Otherwise it will not be.
      if (!sequenceAcknowledgementsIter.hasNext())
        sequenceID = sequenceAcknowledgement.getIdentifier().getIdentifier();
    } else if (ackRequestedIter.hasNext()) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.ACK_REQUEST);
      AckRequested ackRequest = (AckRequested) ackRequestedIter.next();

      //if there is only on sequenceAck, sequenceId will be set. Otherwise it will not be.
View Full Code Here

        QName headerName = new QName(Sandesha2Constants.SPEC_NS_URIS[i], Sandesha2Constants.WSRM_COMMON.SEQUENCE_ACK);
       
        Iterator acks = header.getChildrenWithName(headerName);
        while(acks.hasNext()) {
          OMElement ack = (OMElement) acks.next();
          SequenceAcknowledgement seqAck = new SequenceAcknowledgement(headerName.getNamespaceURI());
          seqAck.fromOMElement(ack);
          processAckHeader(message, ack, seqAck);
        }
      }     
    }
View Full Code Here

    if (rmVersion == null)
      throw new SandeshaException(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.cannotDecideRMVersion));

    String rmNamespaceValue = SpecSpecificConstants.getRMNamespaceValue(rmVersion);

    SequenceAcknowledgement sequenceAck = new SequenceAcknowledgement(rmNamespaceValue);
    Identifier id = new Identifier(rmNamespaceValue);
    id.setIndentifer(sequenceId);
    sequenceAck.setIdentifier(id);

    SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropertyBeanMgr();

    SequencePropertyBean seqBean = seqPropMgr.retrieve(sequencePropertyKey,
        Sandesha2Constants.SequenceProperties.SERVER_COMPLETED_MESSAGES);
    String msgNoList = (String) seqBean.getValue();

    ArrayList ackRangeArrayList = SandeshaUtil.getAckRangeArrayList(msgNoList, factory, rmNamespaceValue);
    Iterator iterator = ackRangeArrayList.iterator();
    while (iterator.hasNext()) {
      AcknowledgementRange ackRange = (AcknowledgementRange) iterator.next();
      sequenceAck.addAcknowledgementRanges(ackRange);
    }

    SequencePropertyBean sequenceClosedBean = seqPropMgr.retrieve(sequencePropertyKey,
        Sandesha2Constants.SequenceProperties.SEQUENCE_CLOSED);

    if (sequenceClosedBean != null && Sandesha2Constants.VALUE_TRUE.equals(sequenceClosedBean.getValue())) {
      // sequence is closed. so add the 'Final' part.
      if (SpecSpecificConstants.isAckFinalAllowed(rmVersion)) {
        AckFinal ackFinal = new AckFinal(rmNamespaceValue);
        sequenceAck.setAckFinal(ackFinal);
      }
    }

    applicationMsg.setMessagePart(Sandesha2Constants.MessageParts.SEQ_ACKNOWLEDGEMENT, sequenceAck);

    sequenceAck.toOMElement(envelope.getHeader());
   
    if (applicationMsg.getWSAAction()==null) {
      applicationMsg.setAction(SpecSpecificConstants.getSequenceAcknowledgementAction(SandeshaUtil.getRMVersion(
          sequenceId, storageManager)));
      applicationMsg.setSOAPAction(SpecSpecificConstants.getSequenceAcknowledgementSOAPAction(SandeshaUtil
View Full Code Here

    //In case of ack messages RM Namespace is decided based on the sequenceId of the last
    //sequence Ack. In other words Sandesha2 does not expect to receive two SequenceAcknowledgements
    //of different RM specifications in the same incoming message
    for (Iterator iter = elements.getSequenceAcknowledgements();iter.hasNext();) {
      SequenceAcknowledgement sequenceAck = (SequenceAcknowledgement) iter.next();
      rmMsgContext.setMessagePart(Sandesha2Constants.MessageParts.SEQ_ACKNOWLEDGEMENT, sequenceAck);
      rmNamespace = sequenceAck.getNamespaceValue();
    }

    if (elements.getTerminateSequence() != null) {
      rmMsgContext.setMessagePart(Sandesha2Constants.MessageParts.TERMINATE_SEQ, elements.getTerminateSequence());
      rmNamespace = elements.getTerminateSequence().getNamespaceValue();
View Full Code Here

    } else if (rmMsgCtx.getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE) != null) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.APPLICATION);
      sequenceID = sequence.getIdentifier().getIdentifier();
    } else if (sequenceAcknowledgementsIter.hasNext()) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.ACK);
      SequenceAcknowledgement sequenceAcknowledgement = (SequenceAcknowledgement) sequenceAcknowledgementsIter.next();
     
      //if there is only on sequenceAck, sequenceId will be set. Otherwise it will not be.
      if (!sequenceAcknowledgementsIter.hasNext())
        sequenceID = sequenceAcknowledgement.getIdentifier().getIdentifier();
    } else if (ackRequestedIter.hasNext()) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.ACK_REQUEST);
      AckRequested ackRequest = (AckRequested) ackRequestedIter.next();

      //if there is only on sequenceAck, sequenceId will be set. Otherwise it will not be.
View Full Code Here

TOP

Related Classes of org.apache.sandesha2.wsrm.SequenceAcknowledgement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.