Package org.apache.sandesha2.wsrm

Examples of org.apache.sandesha2.wsrm.Sequence


            .getConfigurationContext());
    SequencePropertyBeanMgr seqPropMgr = storageManager
        .getSequencePropretyBeanMgr();

    //setting acked msg no range
    Sequence sequence = (Sequence) rmMsgCtx
        .getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
    String sequenceId = sequence.getIdentifier().getIdentifier();
    ConfigurationContext configCtx = rmMsgCtx.getMessageContext()
        .getConfigurationContext();
    if (configCtx == null)
      throw new SandeshaException("Configuration Context is null");

    SequencePropertyBean msgsBean = seqPropMgr.retrieve(sequenceId,
        Sandesha2Constants.SequenceProperties.RECEIVED_MESSAGES);

    long msgNo = sequence.getMessageNumber().getMessageNumber();
    if (msgNo == 0)
      throw new SandeshaException("Wrong message number");

    String messagesStr = (String) msgsBean.getValue();
View Full Code Here


    StorageManager storageManager = SandeshaUtil
        .getSandeshaStorageManager(msgCtx.getConfigurationContext());
    SequencePropertyBeanMgr seqPropMgr = storageManager
        .getSequencePropretyBeanMgr();

    Sequence sequence = (Sequence) rmMsgCtx
        .getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
    String sequenceId = sequence.getIdentifier().getIdentifier();
    ConfigurationContext configCtx = rmMsgCtx.getMessageContext()
        .getConfigurationContext();
    if (configCtx == null)
      throw new SandeshaException("Configuration Context is null");

    AckRequested ackRequested = (AckRequested) rmMsgCtx
        .getMessagePart(Sandesha2Constants.MessageParts.ACK_REQUEST);
    LastMessage lastMessage = (LastMessage) sequence.getLastMessage();

    //Setting the ack depending on AcksTo.
    SequencePropertyBean acksToBean = seqPropMgr.retrieve(sequenceId,
        Sandesha2Constants.SequenceProperties.ACKS_TO_EPR);
View Full Code Here

          .getStoredMessageContext(key);

      RMMsgContext applicaionRMMsg = MsgInitializer
          .initializeMessage(applicationMsg);

      Sequence sequencePart = (Sequence) applicaionRMMsg
          .getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
      if (sequencePart == null)
        throw new SandeshaException("Sequence part is null");

      Identifier identifier = new Identifier(factory);
      identifier.setIndentifer(newOutSequenceId);

      sequencePart.setIdentifier(identifier);

      AckRequested ackRequestedPart = (AckRequested) applicaionRMMsg
          .getMessagePart(Sandesha2Constants.MessageParts.ACK_REQUEST);
      if (ackRequestedPart != null) {
        Identifier id1 = new Identifier(factory);
View Full Code Here

    RMMsgContext rmMsgCtx = MsgInitializer
        .initializeMessage(messageContext);
    String sequenceId = null;

    if (rmMsgCtx.getMessageType() == Sandesha2Constants.MessageTypes.APPLICATION) {
      Sequence sequence = (Sequence) rmMsgCtx
          .getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
      if (sequence == null)
        throw new SandeshaException(
            "Sequence part not found in the application message");

      sequenceId = sequence.getIdentifier().getIdentifier();

    } else if (rmMsgCtx.getMessageType() == Sandesha2Constants.MessageTypes.ACK) {
      SequenceAcknowledgement sequenceAcknowledgement = (SequenceAcknowledgement) rmMsgCtx
          .getMessagePart(Sandesha2Constants.MessageParts.SEQ_ACKNOWLEDGEMENT);
      sequenceId = sequenceAcknowledgement.getIdentifier()
View Full Code Here

            MessageContext msgToInvoke = SandeshaUtil
                .getStoredMessageContext(key);

            RMMsgContext rmMsg = MsgInitializer
                .initializeMessage(msgToInvoke);
            Sequence seq = (Sequence) rmMsg
                .getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
            long msgNo = seq.getMessageNumber().getMessageNumber();

            try {
              //Invoking the message.
              new AxisEngine(msgToInvoke.getConfigurationContext())
                  .receive(msgToInvoke);

              ServiceContext serviceContext = msgToInvoke
                  .getServiceContext();
              Object debug = null;
              if (serviceContext != null) {
                debug = msgToInvoke
                    .getProperty(Sandesha2ClientAPI.SANDESHA_DEBUG_MODE);
                if (debug != null && "on".equals(debug)) {
                  System.out
                      .println("DEBUG: Invoker invoking a '"
                          + SandeshaUtil
                              .getMessageTypeString(rmMsg
                                  .getMessageType())
                          + "' message.");
                }
              }

              //deleting the message entry.
              storageMapMgr.delete(key);

            } catch (AxisFault e) {
              throw new SandeshaException(e.getMessage());
            }

            //undating the next mst to invoke
            nextMsgno++;
            stMapIt = storageMapMgr
                .find(
                    new InvokerBean(null, nextMsgno,
                        sequenceId)).iterator();

            //terminate (AfterInvocation)
            if (rmMsg.getMessageType() == Sandesha2Constants.MessageTypes.APPLICATION) {
              Sequence sequence = (Sequence) rmMsg
                  .getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
              if (sequence.getLastMessage() != null) {
                TerminateManager.terminateAfterInvocation(
                    context, sequenceId);
               
                //exit from current iteration. (since an entry was removed)
                break currentIteration;
View Full Code Here

    boolean drop = false;

    if (rmMsgContext.getMessageType() == Sandesha2Constants.MessageTypes.APPLICATION) {

      Sequence sequence = (Sequence) rmMsgContext
          .getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
      String sequenceId = null;

      if (sequence != null) {
        sequenceId = sequence.getIdentifier().getIdentifier();
      }

      long msgNo = sequence.getMessageNumber().getMessageNumber();

      if (sequenceId != null && msgNo > 0) {
        StorageManager storageManager = SandeshaUtil
            .getSandeshaStorageManager(rmMsgContext
                .getMessageContext().getConfigurationContext());
        SequencePropertyBeanMgr seqPropMgr = storageManager
            .getSequencePropretyBeanMgr();
        SequencePropertyBean receivedMsgsBean = seqPropMgr.retrieve(
            sequenceId,
            Sandesha2Constants.SequenceProperties.RECEIVED_MESSAGES);
        if (receivedMsgsBean != null) {
          String receivedMsgStr = (String) receivedMsgsBean
              .getValue();
          ArrayList msgNoArrList = SandeshaUtil
              .getSplittedMsgNoArraylist(receivedMsgStr);

          Iterator iterator = msgNoArrList.iterator();
          while (iterator.hasNext()) {
            String temp = (String) iterator.next();
            String msgNoStr = new Long(msgNo).toString();
            if (msgNoStr.equals(temp)) {
              drop = true;
            }
          }
         
        }

        if (drop == false) {
          //Checking for RM specific EMPTY_BODY LASTMESSAGE.
          SOAPBody body = rmMsgContext.getSOAPEnvelope().getBody();
          boolean emptyBody = false;
          if (body.getChildElements().hasNext() == false) {
            emptyBody = true;
          }

          if (emptyBody) {
            boolean lastMessage = false;
            if (sequence.getLastMessage() != null) {
              System.out
                  .println("Empty Body Last Message Received");
              drop = true;

              if (receivedMsgsBean == null) {
View Full Code Here

  }

  private void processDroppedMessage(RMMsgContext rmMsgContext)
      throws SandeshaException {
    if (rmMsgContext.getMessageType() == Sandesha2Constants.MessageTypes.APPLICATION) {
      Sequence sequence = (Sequence) rmMsgContext
          .getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
      String sequenceId = null;

      if (sequence != null) {
        sequenceId = sequence.getIdentifier().getIdentifier();
      }

      StorageManager storageManager = SandeshaUtil
          .getSandeshaStorageManager(rmMsgContext.getMessageContext()
              .getConfigurationContext());
View Full Code Here

          .getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);

      RMMsgContext requestRMMsgCtx = MsgInitializer
          .initializeMessage(reqMsgCtx);

      Sequence reqSequence = (Sequence) requestRMMsgCtx
          .getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
      if (reqSequence == null)
        throw new SandeshaException("Sequence part is null");

      String incomingSeqId = reqSequence.getIdentifier().getIdentifier();
      if (incomingSeqId == null || incomingSeqId == "")
        throw new SandeshaException("Invalid seqence Id");

      internalSequenceId = incomingSeqId;
View Full Code Here

      rmMsg.setTo(toEPR);

    if (replyToEPR != null)
      rmMsg.setReplyTo(replyToEPR);

    Sequence sequence = new Sequence(factory);

    MessageNumber msgNumber = new MessageNumber(factory);
    msgNumber.setMessageNumber(messageNumber);
    sequence.setMessageNumber(msgNumber);

    boolean lastMessage = false;
    //setting last message
    if (msg.isServerSide()) {
      //server side
      String incomingSeqId = internalSequenceId;
      MessageContext requestMsg = null;

      try {
        requestMsg = msg.getOperationContext().getMessageContext(
            WSDLConstants.MESSAGE_LABEL_IN_VALUE);
      } catch (AxisFault e) {
        throw new SandeshaException(e.getMessage());
      }

      RMMsgContext reqRMMsgCtx = MsgInitializer
          .initializeMessage(requestMsg);
      Sequence requestSequence = (Sequence) reqRMMsgCtx
          .getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
      if (requestSequence == null)
        throw new SandeshaException("Request Sequence is null");

      if (requestSequence.getLastMessage() != null) {
        lastMessage = true;
        sequence.setLastMessage(new LastMessage(factory));

        //saving the last message no.
        SequencePropertyBean lastOutMsgBean = new SequencePropertyBean(
View Full Code Here

   
    // Generate the Sequence field.
    // -------------------------------
    String rmNamespaceValue = SpecSpecificConstants.getRMNamespaceValue(Sandesha2Constants.SPEC_VERSIONS.v1_1);

    Sequence sequence = new Sequence(rmNamespaceValue);
    MessageNumber msgNumber = new MessageNumber(rmNamespaceValue);
    msgNumber.setMessageNumber(1);
    sequence.setMessageNumber(msgNumber);
    Identifier id1 = new Identifier(rmNamespaceValue);
    id1.setIndentifer(uuid);
    sequence.setIdentifier(id1);
    applicationRMMsg.setMessagePart(Sandesha2Constants.MessageParts.SEQUENCE, sequence);
    applicationRMMsg.addSOAPEnvelope();

    // --------------------------------------------
    // Finished generating Sequence part
View Full Code Here

TOP

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

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.