Package org.apache.sandesha2.wsrm

Examples of org.apache.sandesha2.wsrm.AcknowledgementRange


    rmsBean.setInternalSequenceID(SandeshaUtil.getInternalSequenceID(seqID, null));
    rmsBean.setToEPR(AddressingConstants.Final.WSA_ANONYMOUS_URL);
    rmsBean.setAcksToEPR(AddressingConstants.Final.WSA_ANONYMOUS_URL);
    rmsBean.setReplyToEPR(AddressingConstants.Final.WSA_ANONYMOUS_URL);
    rmsBean.setRMVersion(Sandesha2Constants.SPEC_VERSIONS.v1_1);
    rmsBean.setClientCompletedMessages(new RangeString());
    rmsBean.setNextMessageNumber(4);
    rmsBean.setHighestOutMessageNumber(3);
   
    SenderBean bean1 = getSenderBean(seqID, 1, 1);
    SenderBean bean2 = getSenderBean(seqID, 0, 2);
View Full Code Here


    }

    //In case of ack request messages RM Namespace is decided based on the sequenceId of the last
    //ack request.
    for (Iterator iter = elements.getAckRequests();iter.hasNext();) {
      AckRequested ackRequest = (AckRequested) iter.next();
      rmMsgContext.setMessagePart(Sandesha2Constants.MessageParts.ACK_REQUEST, ackRequest);
      rmNamespace = ackRequest.getNamespaceValue();
    }

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

      //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.
      if (!ackRequestedIter.hasNext())
        sequenceID = ackRequest.getIdentifier().getIdentifier();
    } else if (closeSequence != null) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.CLOSE_SEQUENCE);
      sequenceID = closeSequence.getIdentifier().getIdentifier();
    } else if (closeSequenceResponse != null) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.CLOSE_SEQUENCE_RESPONSE);
View Full Code Here

    Identifier id = new Identifier(rmNamespaceValue);
    id.setIndentifer(sequenceId);
    sequenceAck.setIdentifier(id);
   
    // Set the Invalid range!
    AcknowledgementRange ackRange = new AcknowledgementRange(rmNamespaceValue);
    ackRange.setLowerValue(1);
    ackRange.setUpperValue(3);
    sequenceAck.addAcknowledgementRanges(ackRange);

    // Set the SequenceAcknowledgement part in the message
    applicationRMMsg.setMessagePart(Sandesha2Constants.MessageParts.SEQ_ACKNOWLEDGEMENT, sequenceAck);
    applicationRMMsg.addSOAPEnvelope();
View Full Code Here

   
    List sequenceAckList = sequenceAcknowledgement.getAcknowledgementRanges();
    Iterator it = sequenceAckList.iterator();

    while (it.hasNext()) {
      AcknowledgementRange acknowledgementRange = (AcknowledgementRange) it.next();
      long upper = acknowledgementRange.getUpperValue();
      long lower = acknowledgementRange.getLowerValue();

      if (lower > upper) {
        invalidAck = true;         
        // check upper isn't bigger than the highest out msg number
      } else if ( upper > rmsBean.getHighestOutMessageNumber() ) {
View Full Code Here

    ArrayList ackRanges = new ArrayList(); //the final ack ranges that we will build up

    Range[] ranges = completedMessageRanges.getRanges();
    for(int i=0; i<ranges.length; i++){
      AcknowledgementRange ackRange = new AcknowledgementRange(rmNamespaceValue);
      ackRange.setLowerValue(ranges[i].lowerValue);
      ackRange.setUpperValue(ranges[i].upperValue);
      ackRanges.add(ackRange);     
    }
   
    return ackRanges;
  }
View Full Code Here

    // is any new information in this ack message
    RangeString completedMessages = rmsBean.getClientCompletedMessages();
    long numberOfNewMessagesAcked = 0;

    while(ackRangeIterator.hasNext()) {
      AcknowledgementRange ackRange = (AcknowledgementRange) ackRangeIterator.next();
      long lower = ackRange.getLowerValue();
      long upper = ackRange.getUpperValue();
      Range ackedRange = new Range(lower, upper);
      // Quick check to see if the whole range is already covered
      if(!completedMessages.isRangeCompleted(ackedRange)) {
        //we now know that this range is complete so we update it. This should aggregate the
        //ranges together and tell us which numbers are newly acked
View Full Code Here

    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);
View Full Code Here

    input.setReSend(true);
    Collection retransmitterEntriesOfSequence = senderBeanMgr.find(input);

    ArrayList ackedMessagesList = new ArrayList();
    while (ackRangeIterator.hasNext()) {
      AcknowledgementRange ackRange = (AcknowledgementRange) ackRangeIterator.next();
      long lower = ackRange.getLowerValue();
      long upper = ackRange.getUpperValue();

      for (long messageNo = lower; messageNo <= upper; messageNo++) {
        SenderBean retransmitterBean = getSenderEntry(retransmitterEntriesOfSequence, messageNo);
        if (retransmitterBean != null) {
          senderBeanMgr.delete(retransmitterBean.getMessageID());
View Full Code Here

  }

  private static long getNoOfMessagesAcked(Iterator ackRangeIterator) {
    long noOfMsgs = 0;
    while (ackRangeIterator.hasNext()) {
      AcknowledgementRange acknowledgementRange = (AcknowledgementRange) ackRangeIterator.next();
      long lower = acknowledgementRange.getLowerValue();
      long upper = acknowledgementRange.getUpperValue();

      for (long i = lower; i <= upper; i++) {
        noOfMsgs++;
      }
    }
View Full Code Here

TOP

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

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.