Package org.apache.sandesha2.wsrm

Examples of org.apache.sandesha2.wsrm.AckRequested


    } else if (messageType == Sandesha2Constants.MessageTypes.ACK) {
      SequenceAcknowledgement sequenceAcknowledgement = (SequenceAcknowledgement) rmMessageContext
          .getMessagePart(Sandesha2Constants.MessageParts.SEQ_ACKNOWLEDGEMENT);
      sequenceID = sequenceAcknowledgement.getIdentifier().getIdentifier();
    } else if (messageType == Sandesha2Constants.MessageTypes.ACK_REQUEST) {
      AckRequested ackRequested = (AckRequested) rmMessageContext
          .getMessagePart(Sandesha2Constants.MessageParts.ACK_REQUEST);
      sequenceID = ackRequested.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


    CreateSequenceResponse createSequenceResponse = (CreateSequenceResponse) rmMsgCtx.getMessagePart(Sandesha2Constants.MessageParts.CREATE_SEQ_RESPONSE);
    TerminateSequence terminateSequence = (TerminateSequence) rmMsgCtx.getMessagePart(Sandesha2Constants.MessageParts.TERMINATE_SEQ);
    TerminateSequenceResponse terminateSequenceResponse = (TerminateSequenceResponse) rmMsgCtx.getMessagePart(Sandesha2Constants.MessageParts.TERMINATE_SEQ_RESPONSE);
    SequenceAcknowledgement sequenceAcknowledgement = (SequenceAcknowledgement) rmMsgCtx.getMessagePart(Sandesha2Constants.MessageParts.SEQ_ACKNOWLEDGEMENT);
    Sequence sequence = (Sequence) rmMsgCtx.getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
    AckRequested ackRequest = (AckRequested) rmMsgCtx.getMessagePart(Sandesha2Constants.MessageParts.ACK_REQUEST);
    CloseSequence closeSequence = (CloseSequence) rmMsgCtx.getMessagePart(Sandesha2Constants.MessageParts.CLOSE_SEQUENCE);
    CloseSequenceResponse closeSequenceResponse = (CloseSequenceResponse) rmMsgCtx.getMessagePart(Sandesha2Constants.MessageParts.CLOSE_SEQUENCE_RESPONSE);
   
    //Setting message type.
    if (createSequence != null) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.CREATE_SEQ);
    }else if (createSequenceResponse != null) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.CREATE_SEQ_RESPONSE);
      sequenceID = createSequenceResponse.getIdentifier().getIdentifier();
    }else if (terminateSequence != null) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.TERMINATE_SEQ);
      sequenceID = terminateSequence.getIdentifier().getIdentifier();
    }else if (terminateSequenceResponse != null) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.TERMINATE_SEQ_RESPONSE);
      sequenceID = terminateSequenceResponse.getIdentifier().getIdentifier();
    }else if (rmMsgCtx.getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE) != null) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.APPLICATION);
      sequenceID = sequence.getIdentifier().getIdentifier();
    } else if (sequenceAcknowledgement != null) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.ACK);
      sequenceID = sequenceAcknowledgement.getIdentifier().getIdentifier();
    } else if (ackRequest != null) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.ACK_REQUEST);
      sequenceID = ackRequest.getIdentifier().getIdentifier();
    } else if (closeSequence != null) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.CLOSE_SEQUENCE);
      sequenceID = closeSequence.getIdentifier().getIdentifier();
    } else if (closeSequenceResponse != null) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.CLOSE_SEQUENCE_RESPONSE);
View Full Code Here

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

      sequencePart.setIdentifier(identifier);

      AckRequested ackRequestedPart = (AckRequested) applicaionRMMsg
          .getMessagePart(Sandesha2Constants.MessageParts.ACK_REQUEST);
      if (ackRequestedPart != null) {
        Identifier id1 = new Identifier(factory,assumedRMNamespace);
        id1.setIndentifer(newOutSequenceId);
        ackRequestedPart.setIdentifier(id1);
      }

      try {
        applicaionRMMsg.addSOAPEnvelope();
      } catch (AxisFault e) {
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

      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.toHeader(dummyEnvelope.getHeader());

    return dummyEnvelope;
  }
View Full Code Here

    }

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

      log.debug("Enter: AckRequestedProcessor::processAckRequestHeaders");

    boolean msgCtxPaused = false;
    Iterator<AckRequested> ackRequests = message.getAckRequests();
    while(ackRequests.hasNext()){
      AckRequested ackReq = (AckRequested)ackRequests.next();
      boolean paused = processAckRequestedHeader(message, ackReq.getOriginalAckRequestedElement(), ackReq);
      //if not already paused we might be now
      if(!msgCtxPaused){
        msgCtxPaused = paused;
      }
    }
View Full Code Here

    getConfigurationContext().registerOperationContext(ackRequestRMMsg.getMessageId(), opcontext);
    getMsgContext().setOperationContext(opcontext);
   
    Iterator<AckRequested> iterator = ackRequestRMMsg.getAckRequests();
   
    AckRequested ackRequested = null;
    while (iterator.hasNext()) {
      ackRequested = (AckRequested) iterator.next();
    }
   
    if (iterator.hasNext()) {
View Full Code Here

      log.debug("Entry: RMMsgCreator::addAckRequest " + sequenceId);
   
    String rmVersion = rmsBean.getRMVersion();
    String rmNamespaceValue = SpecSpecificConstants.getRMNamespaceValue(rmVersion);
   
    AckRequested ackRequest = new AckRequested(rmNamespaceValue)
   
    Identifier id = new Identifier(rmNamespaceValue);
    id.setIndentifer(sequenceId);
    ackRequest.setIdentifier(id);
    ackRequest.setMustUnderstand(true);
    applicationMsg.addAckRequested(ackRequest);

    if (applicationMsg.getWSAAction()==null) {
      applicationMsg.setAction(SpecSpecificConstants.getAckRequestAction(rmVersion));
      applicationMsg.setSOAPAction(SpecSpecificConstants.getAckRequestSOAPAction(rmVersion));
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.