Package org.apache.sandesha2.wsrm

Examples of org.apache.sandesha2.wsrm.Identifier


  public boolean processInMessage(RMMsgContext rmMsgCtx, Transaction transaction) throws AxisFault {
    if(log.isDebugEnabled()) log.debug("Enter: MakeConnectionProcessor::processInMessage " + rmMsgCtx.getSOAPEnvelope().getBody());

    MakeConnection makeConnection = (MakeConnection) rmMsgCtx.getMessagePart(Sandesha2Constants.MessageParts.MAKE_CONNECTION);
    Address address = makeConnection.getAddress();
    Identifier identifier = makeConnection.getIdentifier();
   
    ConfigurationContext configurationContext = rmMsgCtx.getConfigurationContext();
    StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configurationContext,configurationContext.getAxisConfiguration());
   
    SenderBeanMgr senderBeanMgr = storageManager.getSenderBeanMgr();
   
    //selecting the set of SenderBeans that suit the given criteria.
    SenderBean findSenderBean = new SenderBean ();
    findSenderBean.setSend(true);
    findSenderBean.setTransportAvailable(false);
   
    if (address!=null)
      findSenderBean.setToAddress(address.getAddress());
   
    if (identifier!=null)
      findSenderBean.setSequenceID(identifier.getIdentifier());
   
    // Set the time to send field to be now
    findSenderBean.setTimeToSend(System.currentTimeMillis());
   
    //finding the beans that go with the criteria of the passed SenderBean
View Full Code Here


    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();

    // --------------------------------------------
View Full Code Here

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

    // --------------------------------------------
View Full Code Here

    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();

    // --------------------------------------------
View Full Code Here

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

    CloseSequence sequence = new CloseSequence(rmNamespaceValue);
    Identifier id1 = new Identifier(rmNamespaceValue);
    id1.setIndentifer(uuid);
    sequence.setIdentifier(id1);
    applicationRMMsg.setMessagePart(Sandesha2Constants.MessageParts.CLOSE_SEQUENCE, sequence);
    applicationRMMsg.addSOAPEnvelope();

    // --------------------------------------------
View Full Code Here

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

    AckRequested sequence = new AckRequested(rmNamespaceValue);
    Identifier id1 = new Identifier(rmNamespaceValue);
    id1.setIndentifer(uuid);
    sequence.setIdentifier(id1);
    applicationRMMsg.setMessagePart(Sandesha2Constants.MessageParts.CLOSE_SEQUENCE, sequence);
    applicationRMMsg.addSOAPEnvelope();

    // --------------------------------------------
View Full Code Here

    boolean continueSending = MessageRetransmissionAdjuster.adjustRetransmittion(
        rmMsgContext, senderBean, rmMsgContext.getConfigurationContext(), storageManager);
    if(!continueSending) return false;
   
    Identifier id = null;

    if(messageType == Sandesha2Constants.MessageTypes.APPLICATION ||
       messageType == Sandesha2Constants.MessageTypes.LAST_MESSAGE) {
     
      String namespace = SpecSpecificConstants.getRMNamespaceValue(rmVersion);
      Sequence sequence = (Sequence) rmMsgContext.getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
      if(sequence == null) {
        sequence = new Sequence(namespace);
       
        MessageNumber msgNumber = new MessageNumber(namespace);
        msgNumber.setMessageNumber(senderBean.getMessageNumber());
        sequence.setMessageNumber(msgNumber);

        if(senderBean.isLastMessage() &&
            SpecSpecificConstants.isLastMessageIndicatorRequired(rmVersion)) {
          sequence.setLastMessage(new LastMessage(namespace));
        }
       
        // We just create the id here, we will add the value in later
        id = new Identifier(namespace);
        sequence.setIdentifier(id);
       
        rmMsgContext.setMessagePart(Sandesha2Constants.MessageParts.SEQUENCE, sequence);
       
      }
     
    } else if(messageType == Sandesha2Constants.MessageTypes.TERMINATE_SEQ) {
      TerminateSequence terminate = (TerminateSequence) rmMsgContext.getMessagePart(Sandesha2Constants.MessageParts.TERMINATE_SEQ);
      id = terminate.getIdentifier();

    } else if(messageType == Sandesha2Constants.MessageTypes.CLOSE_SEQUENCE) {
      CloseSequence close = (CloseSequence) rmMsgContext.getMessagePart(Sandesha2Constants.MessageParts.CLOSE_SEQUENCE);
      id = close.getIdentifier();
   
    } else if(messageType == Sandesha2Constants.MessageTypes.ACK_REQUEST) {
      // The only time that we can have a message of this type is when we are sending a
      // stand-alone ack request, and in that case we only expect to find a single ack
      // request header in the message.
      Iterator ackRequests = rmMsgContext.getMessageParts(Sandesha2Constants.MessageParts.ACK_REQUEST);
      AckRequested ackRequest = (AckRequested) ackRequests.next();
      if (ackRequests.hasNext()) {
        throw new SandeshaException (SandeshaMessageHelper.getMessage(SandeshaMessageKeys.ackRequestMultipleParts));
      }
      id = ackRequest.getIdentifier();
    }
   
    // TODO consider adding an extra ack request, as we are about to send the message and we
    // know which sequence it is associated with.

    if(id != null && !senderBean.getSequenceID().equals(id.getIdentifier())) {
      id.setIndentifer(senderBean.getSequenceID());

      // Write the changes back into the message context
      rmMsgContext.addSOAPEnvelope();
    }
   
View Full Code Here

    }

    String rmNamespaceValue = SpecSpecificConstants.getRMNamespaceValue(rmSpecVersion);

    AckRequested ackRequested = new AckRequested(rmNamespaceValue);
    Identifier identifier = new Identifier(rmNamespaceValue);
    identifier.setIndentifer(sequenceID);
    ackRequested.setIdentifier(identifier);

    ackRequested.toSOAPEnvelope(dummyEnvelope);

    return dummyEnvelope;
View Full Code Here

    }

    String rmNamespaceValue = SpecSpecificConstants.getRMNamespaceValue(rmSpecVersion);

    CloseSequence closeSequence = new CloseSequence(rmNamespaceValue);
    Identifier identifier = new Identifier(rmNamespaceValue);
    identifier.setIndentifer(sequenceID);
    closeSequence.setIdentifier(identifier);

    closeSequence.toSOAPEnvelope(dummyEnvelope);

    return dummyEnvelope;
View Full Code Here

      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.Identifier

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.