Package org.apache.sandesha2.wsrm

Examples of org.apache.sandesha2.wsrm.AckRequested


    msgContext.setOperationContext(opcontext);
    msgContext.setAxisOperation(outInAxisOp);
   
    Iterator iterator = ackRequestRMMsg.getMessageParts(Sandesha2Constants.MessageParts.ACK_REQUEST);
   
    AckRequested ackRequested = null;
    while (iterator.hasNext()) {
      ackRequested = (AckRequested) iterator.next();
    }
   
    if (iterator.hasNext()) {
      String message = "Passed message has more than one AckRequest. You can have only one";
      throw new SandeshaException (message);
    }
   
    if (ackRequested==null) {
      String message = "No AckRequested part was present in the message";
      throw new SandeshaException (message);
    }
   
    ackRequested.getIdentifier().setIndentifer(outSequenceID);
   
    ackRequestRMMsg.setFlow(MessageContext.OUT_FLOW);
    msgContext.setProperty(Sandesha2Constants.APPLICATION_PROCESSING_DONE, "true");

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


      dummyEnvelope = factory.getDefaultEnvelope();
    }

    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

          .getMessageParts(Sandesha2Constants.MessageParts.ACK_REQUEST);
 
      //In case of ack request messages sequenceId is decided based on the sequenceId of the first
      //AckRequested.
     
      AckRequested ackReq = (AckRequested) ackRequestIter.next();
      sequenceID = ackReq.getIdentifier().getIdentifier();
    } else if (messageType == Sandesha2Constants.MessageTypes.CLOSE_SEQUENCE) {
      CloseSequence closeSequence = (CloseSequence) rmMessageContext
          .getMessagePart(Sandesha2Constants.MessageParts.CLOSE_SEQUENCE);
      sequenceID = closeSequence.getIdentifier().getIdentifier();
    } else if (messageType == Sandesha2Constants.MessageTypes.CLOSE_SEQUENCE_RESPONSE) {
View Full Code Here

    } 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<AckRequested> ackRequests = rmMsgContext.getAckRequests();
      AckRequested ackRequest = 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.
   
View Full Code Here

          .getAckRequests();
 
      //In case of ack request messages sequenceId is decided based on the sequenceId of the first
      //AckRequested.
     
      AckRequested ackReq = (AckRequested) ackRequestIter.next();
      sequenceID = ackReq.getIdentifier().getIdentifier();
    } else if (messageType == Sandesha2Constants.MessageTypes.CLOSE_SEQUENCE) {
      CloseSequence closeSequence = rmMessageContext.getCloseSequence();
      sequenceID = closeSequence.getIdentifier().getIdentifier();
    } else if (messageType == Sandesha2Constants.MessageTypes.CLOSE_SEQUENCE_RESPONSE) {
      CloseSequenceResponse closeSequenceResponse = rmMessageContext.getCloseSequenceResponse();;
View Full Code Here

      AcknowledgementProcessor ackProcessor = new AcknowledgementProcessor();
      ackProcessor.processInMessage(rmMsgCtx);
    }
   
    //TODO process embedded ack requests
    AckRequested ackRequested = (AckRequested) rmMsgCtx.getMessagePart(Sandesha2Constants.MessageParts.ACK_REQUEST);
    if (ackRequested!=null) {
      ackRequested.setMustUnderstand(false);
      rmMsgCtx.addSOAPEnvelope();
    }

    //Processing the application message.
    MessageContext msgCtx = rmMsgCtx.getMessageContext();
View Full Code Here

    ConfigurationContext configCtx = rmMsgCtx.getMessageContext()
        .getConfigurationContext();
    if (configCtx == null)
      throw new SandeshaException("Configuration Context is null");

    AckRequested ackRequested = (AckRequested) rmMsgCtx
        .getMessagePart(Sandesha2Constants.MessageParts.ACK_REQUEST);
   
    if (ackRequested!=null) {
      //setting mustundestand=false for the ackRequested header block.
      ackRequested.setMustUnderstand(false);
      rmMsgCtx.addSOAPEnvelope();
    }
   
     RMMsgContext ackRMMessage = AcknowledgementManager.generateAckMessage(rmMsgCtx,sequenceId);
   
View Full Code Here

            sequence.setLastMessage(new LastMessage(factory,rmNamespaceValue));
        }
      }
    }

    AckRequested ackRequested = null;

    boolean addAckRequested = false;
    //if (!lastMessage)
//    addAckRequested = true;   //TODO decide the policy to add the ackRequested tag

    // setting the Sequnece id.
    // Set send = true/false depending on the availability of the out
    // sequence id.
    String identifierStr = null;
    if (outSequenceBean == null || outSequenceBean.getValue() == null) {
      identifierStr = Sandesha2Constants.TEMP_SEQUENCE_ID;

    } else {
      identifierStr = (String) outSequenceBean.getValue();
    }

    Identifier id1 = new Identifier(factory,rmNamespaceValue);
    id1.setIndentifer(identifierStr);
    sequence.setIdentifier(id1);
    rmMsg.setMessagePart(Sandesha2Constants.MessageParts.SEQUENCE,sequence);

    if (addAckRequested) {
      ackRequested = new AckRequested(factory,rmNamespaceValue);
      Identifier id2 = new Identifier(factory,rmNamespaceValue);
      id2.setIndentifer(identifierStr);
      ackRequested.setIdentifier(id2);
      rmMsg.setMessagePart(Sandesha2Constants.MessageParts.ACK_REQUEST,
          ackRequested);
    }

    try {
View Full Code Here

      dummyEnvelope = factory.getDefaultEnvelope();
    }
   
    String rmNamespaceValue = SpecSpecificConstants.getRMNamespaceValue(rmSpecVersion);
   
    AckRequested ackRequested = new AckRequested (factory,rmNamespaceValue);
    Identifier identifier = new Identifier (factory,rmNamespaceValue);
    identifier.setIndentifer(outSequenceID);
    ackRequested.setIdentifier(identifier);
   
    ackRequested.toSOAPEnvelope(dummyEnvelope);
   
    OMElement ackRequestedHeaderBlock = dummyEnvelope.getHeader().getFirstChildWithName(new QName (rmNamespaceValue,Sandesha2Constants.WSRM_COMMON.ACK_REQUESTED));
   
    String oldAction = options.getAction();
   
View Full Code Here

  private static final Log log = LogFactory.getLog(AckRequestedProcessor.class);
 
  public void processInMessage(RMMsgContext rmMsgCtx) throws SandeshaException {
   
   
    AckRequested ackRequested = (AckRequested) rmMsgCtx.getMessagePart(Sandesha2Constants.MessageParts.ACK_REQUEST);
    if (ackRequested==null) {
      throw new SandeshaException ("Message identified as of type ackRequested does not have an AckRequeted element");
    }
   
      //settting must understand to false.
    ackRequested.setMustUnderstand(false);
    rmMsgCtx.addSOAPEnvelope();
   
    MessageContext msgContext = rmMsgCtx.getMessageContext();
   
    String sequenceID = ackRequested.getIdentifier().getIdentifier();
   
    ConfigurationContext configurationContext = rmMsgCtx.getMessageContext().getConfigurationContext();
    StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configurationContext);
    SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
   
View Full Code Here

TOP

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

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.