Package org.apache.sandesha2.wsrm

Examples of org.apache.sandesha2.wsrm.TerminateSequence


      factory = new SOAP11Factory();
      dummyEnvelope = factory.getDefaultEnvelope();
    }

    String rmNamespaceValue = SpecSpecificConstants.getRMNamespaceValue(rmSpecVersion);
    TerminateSequence terminateSequence = new TerminateSequence(rmNamespaceValue);
    Identifier identifier = new Identifier(rmNamespaceValue);
    identifier.setIndentifer(sequenceID);
    terminateSequence.setIdentifier(identifier);
    if(TerminateSequence.isLastMsgNumberRequired(rmNamespaceValue)){
      try
      {
        transaction = storageManager.getTransaction();
        LastMessageNumber lastMessageNumber = new LastMessageNumber(rmNamespaceValue);
        lastMessageNumber.setMessageNumber(SandeshaUtil.getLastMessageNumber(internalSequenceID, storageManager));
        terminateSequence.setLastMessageNumber(lastMessageNumber);
      }
      finally
      {
        // Commit the tran whatever happened
        if(transaction != null) transaction.commit();
      }
    }
    terminateSequence.toSOAPEnvelope(dummyEnvelope);

    return dummyEnvelope;
  }
View Full Code Here


          closeSequenceResponse.fromOMElement(body);
        } else if(Sandesha2Constants.SPEC_2005_02.QNames.CloseSequenceResponse.equals(firstBodyQName)) {
          closeSequenceResponse = new CloseSequenceResponse(namespace);
          closeSequenceResponse.fromOMElement(body);
        } else if(Sandesha2Constants.SPEC_2007_02.QNames.TerminateSequence.equals(firstBodyQName)) {
          terminateSequence = new TerminateSequence(namespace);
          terminateSequence.fromOMElement(body);
        } else if(Sandesha2Constants.SPEC_2005_02.QNames.TerminateSequence.equals(firstBodyQName)) {
          terminateSequence = new TerminateSequence(namespace);
          terminateSequence.fromOMElement(body);
        } else if(Sandesha2Constants.SPEC_2007_02.QNames.TerminateSequenceResponse.equals(firstBodyQName)) {
          terminateSequenceResponse = new TerminateSequenceResponse(namespace);
          terminateSequenceResponse.fromOMElement(body);
        } else if(Sandesha2Constants.SPEC_2005_02.QNames.TerminateSequenceResponse.equals(firstBodyQName)) {
View Full Code Here

    }

    SOAPEnvelope envelope = factory.getDefaultEnvelope();
    terminateRMMessage.setSOAPEnvelop(envelope);

    TerminateSequence terminateSequencePart = new TerminateSequence(factory);
    Identifier identifier = new Identifier(factory);
    identifier.setIndentifer(sequenceId);
    terminateSequencePart.setIdentifier(identifier);
    terminateRMMessage.setMessagePart(Sandesha2Constants.MessageParts.TERMINATE_SEQ,
        terminateSequencePart);

    return terminateRMMessage;
  }
View Full Code Here

      ackProcessor.processMessage(terminateSeqRMMSg);
    }

    //Processing the terminate message
    //TODO Add terminate sequence message logic.
    TerminateSequence terminateSequence = (TerminateSequence) terminateSeqRMMSg.getMessagePart(Sandesha2Constants.MessageParts.TERMINATE_SEQ);
    if (terminateSequence==null)
      throw new SandeshaException ("Terminate Sequence part is not available");
   
    String sequenceId = terminateSequence.getIdentifier().getIdentifier();
    if (sequenceId==null || "".equals(sequenceId))
      throw new SandeshaException ("Invalid sequence id");
   
    ConfigurationContext context = terminateSeqMsg.getConfigurationContext();
View Full Code Here

      SequenceAcknowledgement sequenceAcknowledgement = (SequenceAcknowledgement) rmMsgCtx
          .getMessagePart(Sandesha2Constants.MessageParts.SEQ_ACKNOWLEDGEMENT);
      sequenceId = sequenceAcknowledgement.getIdentifier()
          .getIdentifier();
    } else if (rmMsgCtx.getMessageType() == Sandesha2Constants.MessageTypes.TERMINATE_SEQ) {
      TerminateSequence terminateSequence = (TerminateSequence) rmMsgCtx
          .getMessagePart(Sandesha2Constants.MessageParts.TERMINATE_SEQ);
      sequenceId = terminateSequence.getIdentifier().getIdentifier();
    } else {
      //sequenceId not found.
      return null;
    }
View Full Code Here

              checkForSyncResponses(msgCtx);
           
           
            if (rmMsgCtx.getMessageType()==Sandesha2Constants.MessageTypes.TERMINATE_SEQ) {
              //terminate sending side.
              TerminateSequence terminateSequence = (TerminateSequence) rmMsgCtx.getMessagePart(Sandesha2Constants.MessageParts.TERMINATE_SEQ);
              String sequenceID = terminateSequence.getIdentifier().getIdentifier();
              ConfigurationContext configContext = msgCtx.getConfigurationContext();
             
              TerminateManager.terminateSendingSide(configContext,sequenceID);
            }
View Full Code Here

    MessageContext terminateSeqMsg = terminateSeqRMMsg.getMessageContext();

    // Processing the terminate message
    // TODO Add terminate sequence message logic.
    TerminateSequence terminateSequence = (TerminateSequence) terminateSeqRMMsg
        .getMessagePart(Sandesha2Constants.MessageParts.TERMINATE_SEQ);
    if (terminateSequence == null) {
      String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.noTerminateSeqPart);
      log.debug(message);
      throw new SandeshaException(message);
    }

    String sequenceId = terminateSequence.getIdentifier().getIdentifier();
    if (sequenceId == null || "".equals(sequenceId)) {
      String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.invalidSequenceID, null);
      log.debug(message);
      throw new SandeshaException(message);
    }
View Full Code Here

      String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.terminateAddedPreviously);
      log.debug(message);
      return false;
    }

    TerminateSequence terminateSequencePart = (TerminateSequence) rmMsgCtx
        .getMessagePart(Sandesha2Constants.MessageParts.TERMINATE_SEQ);
    terminateSequencePart.getIdentifier().setIndentifer(outSequenceID);

    rmMsgCtx.setFlow(MessageContext.OUT_FLOW);
    msgContext.setProperty(Sandesha2Constants.APPLICATION_PROCESSING_DONE, "true");

    rmMsgCtx.setTo(new EndpointReference(toAddress));
View Full Code Here

        //InFlow of the reference message get called which could be zero sized (OutOnly operations).
       
        // terminate sending side if this is the WSRM 1.0 spec.
        // If the WSRM versoion is 1.1 termination will happen in the terminate sequence response message.
       
        TerminateSequence terminateSequence = (TerminateSequence) rmMsgCtx
            .getMessagePart(Sandesha2Constants.MessageParts.TERMINATE_SEQ);
        String sequenceID = terminateSequence.getIdentifier().getIdentifier();
        ConfigurationContext configContext = msgCtx.getConfigurationContext();

        String internalSequenceID = SandeshaUtil.getSequenceProperty(sequenceID,
            Sandesha2Constants.SequenceProperties.INTERNAL_SEQUENCE_ID, storageManager);
        String sequencePropertyKey = internalSequenceID; //property key of the sending side is the internal sequence Id.
View Full Code Here

      factory = new SOAP11Factory();
      dummyEnvelope = factory.getDefaultEnvelope();
    }

    String rmNamespaceValue = SpecSpecificConstants.getRMNamespaceValue(rmSpecVersion);
    TerminateSequence terminateSequence = new TerminateSequence(rmNamespaceValue);
    Identifier identifier = new Identifier(rmNamespaceValue);
    identifier.setIndentifer(sequenceID);
    terminateSequence.setIdentifier(identifier);
    terminateSequence.toSOAPEnvelope(dummyEnvelope);

    return dummyEnvelope;
  }
View Full Code Here

TOP

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

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.