Package org.apache.sandesha2.wsrm

Examples of org.apache.sandesha2.wsrm.SequenceAcknowledgement


    ArrayList<Range> ackRangeArrayList = SandeshaUtil.getAckRangeArrayList(rmdBean.getServerCompletedMessages(), rmNamespaceValue);
    if(ackRangeArrayList!=null && ackRangeArrayList.size()!=0){
      if(LoggingControl.isAnyTracingEnabled() && log.isDebugEnabled())
        log.debug("RMMsgCreator::addAckMessage : there are messages to ack " + ackRangeArrayList);
      //there are actually messages to ack
      SequenceAcknowledgement sequenceAck = new SequenceAcknowledgement(rmNamespaceValue, isPiggybacked);
      Identifier id = new Identifier(rmNamespaceValue);
      id.setIndentifer(sequenceId);
      sequenceAck.setIdentifier(id);

      sequenceAck.setAckRanges(ackRangeArrayList);
     
      if (rmdBean.isClosed()) {
        // sequence is closed. so add the 'Final' part.
        if(LoggingControl.isAnyTracingEnabled() && log.isDebugEnabled())
          log.debug("RMMsgCreator::addAckMessage : sequence closed");
        if (SpecSpecificConstants.isAckFinalAllowed(rmVersion)) {
          sequenceAck.setAckFinal(true);
        }
      }

      applicationMsg.addSequenceAcknowledgement(sequenceAck);
View Full Code Here


    if (log.isDebugEnabled())
      log.debug("Enter: AcknowledgementProcessor::processAckHeaders");

    Iterator<SequenceAcknowledgement> iter = message.getSequenceAcknowledgements();
    while(iter.hasNext()){
      SequenceAcknowledgement sa = (SequenceAcknowledgement)iter.next();
      processAckHeader(message, sa.getOriginalSequenceAckElement(), sa);
    }

    if (log.isDebugEnabled())
      log.debug("Exit: AcknowledgementProcessor::processAckHeaders");
  }
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
    while(sequenceAcknowledgementsIter.hasNext()){
      SequenceAcknowledgement sequenceAck = (SequenceAcknowledgement) sequenceAcknowledgementsIter.next();
      rmNamespace = sequenceAck.getNamespaceValue();
    }

    if (terminateSequence != null) {
      rmNamespace = terminateSequence.getNamespaceValue();
    }

    if (terminateSequenceResponse != null) {
      rmNamespace = terminateSequenceResponse.getNamespaceValue();
    }

    //In case of ack request messages RM Namespace is decided based on the sequenceId of the last
    //ack request.
    while(ackRequestedIter.hasNext()){
      AckRequested ackRequest = (AckRequested) ackRequestedIter.next();
      rmNamespace = ackRequest.getNamespaceValue();
    }

    if (closeSequence != null) {
      rmNamespace = closeSequence.getNamespaceValue();
    }

    if (closeSequenceResponse != null) {
      rmNamespace = closeSequenceResponse.getNamespaceValue();
    }
   
    if (makeConnection != null) {
      if (Sandesha2Constants.SPEC_2007_02.MC_NS_URI.equals(makeConnection.getNamespaceValue()))
        rmNamespace = Sandesha2Constants.SPEC_2007_02.NS_URI;
    }
   
    if (rmMsgContext.getMessagePending() != null) {
      //MessagePending only supported in 1.1 namespace... no need to check the namespace value
      rmNamespace = Sandesha2Constants.SPEC_2007_02.NS_URI;
    }
    if (rmNamespace!=null)
      rmMsgContext.setRMNamespaceValue(rmNamespace);
     
    sequenceAcknowledgementsIter = rmMsgContext.getSequenceAcknowledgements();
    ackRequestedIter = rmMsgContext.getAckRequests();
   
    // Setting message type.
    if (createSequence != null) {
      rmMsgContext.setMessageType(Sandesha2Constants.MessageTypes.CREATE_SEQ);
    } else if (createSequenceResponse != null) {
      rmMsgContext.setMessageType(Sandesha2Constants.MessageTypes.CREATE_SEQ_RESPONSE);
      sequenceID = createSequenceResponse.getIdentifier().getIdentifier();
    } else if (terminateSequence != null) {
      rmMsgContext.setMessageType(Sandesha2Constants.MessageTypes.TERMINATE_SEQ);
      sequenceID = terminateSequence.getIdentifier().getIdentifier();
    } else if (terminateSequenceResponse != null) {
      rmMsgContext.setMessageType(Sandesha2Constants.MessageTypes.TERMINATE_SEQ_RESPONSE);
      sequenceID = terminateSequenceResponse.getIdentifier().getIdentifier();
    } else if (sequence != null) {
     
      Sequence seq = rmMsgContext.getSequence();
      boolean lastMessage = seq.getLastMessage();
      SOAPEnvelope envelope = rmMsgContext.getSOAPEnvelope();
     
      if (lastMessage && envelope.getBody().getFirstOMChild()==null) {
        //the message is an empty body last message
        rmMsgContext.setMessageType(Sandesha2Constants.MessageTypes.LAST_MESSAGE);
      }else
        rmMsgContext.setMessageType(Sandesha2Constants.MessageTypes.APPLICATION);
     
      sequenceID = sequence.getIdentifier().getIdentifier();
    } else if (makeConnection != null){
      rmMsgContext.setMessageType(Sandesha2Constants.MessageTypes.MAKE_CONNECTION_MSG);
      if (makeConnection.getIdentifier()!=null) {
        sequenceID = makeConnection.getIdentifier().getIdentifier();
      } else if (makeConnection.getAddress()!=null){
        //TODO get sequenceId based on the anonymous address.
      }
    } else if (ackRequestedIter.hasNext()) {
      rmMsgContext.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) {
      rmMsgContext.setMessageType(Sandesha2Constants.MessageTypes.CLOSE_SEQUENCE);
      sequenceID = closeSequence.getIdentifier().getIdentifier();
    } else if (closeSequenceResponse != null) {
      rmMsgContext.setMessageType(Sandesha2Constants.MessageTypes.CLOSE_SEQUENCE_RESPONSE);
      sequenceID = closeSequenceResponse.getIdentifier().getIdentifier();
     
      // As an ACK can be piggybacked on all the other message types - check for ACK last.
    } else if (sequenceAcknowledgementsIter.hasNext()) {
      rmMsgContext.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
      rmMsgContext.setMessageType(Sandesha2Constants.MessageTypes.UNKNOWN);
   
    if (sequenceID!=null)
      rmMsgContext.setProperty(Sandesha2Constants.MessageContextProperties.SEQUENCE_ID,sequenceID);
View Full Code Here

     
      //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<AckRequested> ackRequestIter = rmMessageContext
          .getAckRequests();
 
      //In case of ack request messages sequenceId is decided based on the sequenceId of the first
View Full Code Here

    RMMsgContext applicationRMMsg = new RMMsgContext(messageContext);
   
    String rmNamespaceValue = SpecSpecificConstants.getRMNamespaceValue(Sandesha2Constants.SPEC_VERSIONS.v1_1);
       
    //setup the sequenceAck portion of the msg
    SequenceAcknowledgement sequenceAck = new SequenceAcknowledgement(rmNamespaceValue, true);
    // Set the sequenceId
    Identifier id = new Identifier(rmNamespaceValue);
    id.setIndentifer(sequenceIDAck);
    sequenceAck.setIdentifier(id);
   
    // Set the Invalid range!
    Range ackRange = new Range(1,3);
    sequenceAck.addAcknowledgementRanges(ackRange);

    // Set the SequenceAcknowledgement part in the message
    applicationRMMsg.addSequenceAcknowledgement(sequenceAck);
   
    applicationRMMsg.addSOAPEnvelope();
View Full Code Here

    sequence.setIdentifier(sequenceID);
    sequence.setMessageNumber(1);
    applicationRMMsg.setSequence(sequence);
   
    //setup the sequenceAck portion of the msg
    SequenceAcknowledgement sequenceAck = new SequenceAcknowledgement(rmNamespaceValue, true);
    // Set the sequenceId
    Identifier id = new Identifier(rmNamespaceValue);
    id.setIndentifer(sequenceIDAck);
    sequenceAck.setIdentifier(id);
   
    // Set the Invalid range!
    Range ackRange = new Range(1,3);
    sequenceAck.addAcknowledgementRanges(ackRange);

    // Set the SequenceAcknowledgement part in the message
    applicationRMMsg.addSequenceAcknowledgement(sequenceAck);
   
    applicationRMMsg.addSOAPEnvelope();
View Full Code Here

      if(sequence != null){
        sequence.toHeader(header);
      }
      //there can be more than one sequence ack or ack request in a single message.
      for (Iterator<SequenceAcknowledgement> iter=sequenceAcknowledgements.iterator();iter.hasNext();) {
        SequenceAcknowledgement sequenceAck = (SequenceAcknowledgement) iter.next();
        sequenceAck.toHeader(header);
      }
      for (Iterator<AckRequested> iter=ackRequests.iterator();iter.hasNext();) {
        AckRequested ackReq = (AckRequested) iter.next();
        ackReq.toHeader(header);
      }
View Full Code Here

        if(!isProcessed){
          if(WSRM_COMMON.SEQUENCE.equals(localName)){
            sequence = new Sequence(namespace);
            sequence.fromHeaderBlock(element);
          }else if(WSRM_COMMON.SEQUENCE_ACK.equals(localName)){
            SequenceAcknowledgement sequenceAcknowledgement = new SequenceAcknowledgement(namespace, false);
            sequenceAcknowledgement.fromHeaderBlock(element);
            sequenceAcknowledgements.add(sequenceAcknowledgement);
          }else if(WSRM_COMMON.ACK_REQUESTED.equals(localName)){
            AckRequested ackRequest = new AckRequested(namespace);
            ackRequest.fromHeaderBlock(element);
            ackRequests.add(ackRequest);
View Full Code Here

      if(sequence != null){
        sequence.toHeader(header);
      }
      //there can be more than one sequence ack or ack request in a single message.
      for (Iterator<SequenceAcknowledgement> iter=sequenceAcknowledgements.iterator();iter.hasNext();) {
        SequenceAcknowledgement sequenceAck = (SequenceAcknowledgement) iter.next();
        sequenceAck.toHeader(header);
      }
      for (Iterator<AckRequested> iter=ackRequests.iterator();iter.hasNext();) {
        AckRequested ackReq = (AckRequested) iter.next();
        ackReq.toHeader(header);
      }
View Full Code Here

        if(!isProcessed){
          if(WSRM_COMMON.SEQUENCE.equals(localName)){
            sequence = new Sequence(namespace);
            sequence.fromHeaderBlock(element);
          }else if(WSRM_COMMON.SEQUENCE_ACK.equals(localName)){
            SequenceAcknowledgement sequenceAcknowledgement = new SequenceAcknowledgement(namespace, false);
            sequenceAcknowledgement.fromHeaderBlock(element);
            sequenceAcknowledgements.add(sequenceAcknowledgement);
          }else if(WSRM_COMMON.ACK_REQUESTED.equals(localName)){
            AckRequested ackRequest = new AckRequested(namespace);
            ackRequest.fromHeaderBlock(element);
            ackRequests.add(ackRequest);
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.