Package org.apache.axis2.addressing

Examples of org.apache.axis2.addressing.RelatesTo


                    // If request is REST we assume the responseMessageContext is
                    // REST, so set the variable

                    Options options = responseMessageContext.getOptions();
                    if (options != null) {
                        RelatesTo relatesTo = options.getRelatesTo();
                        if (relatesTo != null) {
                            relatesTo.setValue(msgctx.getMessageID());
                        } else {
                            options.addRelatesTo(new RelatesTo(msgctx.getMessageID()));
                        }
                    }

                    SOAPEnvelope resenvelope =
                        TransportUtils.createSOAPMessage(responseMessageContext);
View Full Code Here


        if (messageCtx.getOptions() != null && messageCtx.getOptions().getRelatesTo() != null) {
            // never take a chance with a NPE at this stage.. so check at each level :-)
            Options options = messageCtx.getOptions();
            if (options != null) {
                RelatesTo relatesTo = options.getRelatesTo();
                if (relatesTo != null) {
                    messageID = relatesTo.getValue();
                }
            }
        } else if (messageCtx.getProperty(SandeshaClientConstants.SEQUENCE_KEY) == null) {
            messageID = (String) messageCtx.getProperty(SynapseConstants.RELATES_TO_FOR_POX);
        }
View Full Code Here

              }
            }

            if (axisOutMsgCtx.getMessageID() != null) {
                response.setRelationships(
                        new RelatesTo[]{new RelatesTo(axisOutMsgCtx.getMessageID())});
            }

            response.setReplyTo(axisOutMsgCtx.getReplyTo());
            response.setFaultTo(axisOutMsgCtx.getFaultTo());
View Full Code Here

            synCtx.setTo(null);
        }

        // set original messageID as relatesTo
        if(synCtx.getMessageID() != null) {
            RelatesTo relatesTo = new RelatesTo(synCtx.getMessageID());
            synCtx.setRelatesTo(new RelatesTo[] { relatesTo });
        }

        synLog.traceOrDebug("End : Fault mediator");
    }
View Full Code Here

    //error and stop this fault being dispatched as the response message.
   
    SOAPFault faultPart = envelope.getBody().getFault();
   
    if (faultPart!=null) {
      RelatesTo relatesTo = msgContext.getRelatesTo();
      if (relatesTo!=null) {
        String relatesToValue = relatesTo.getValue();
        OperationContext operationContext = configContext.getOperationContext(relatesToValue);
        if (operationContext!=null) {
          MessageContext requestMessage = operationContext.getMessageContext(OperationContextFactory.MESSAGE_LABEL_OUT_VALUE);
          if (requestMessage!=null) {
            if(SandeshaUtil.isRetriableOnFaults(requestMessage)){
View Full Code Here

        }
      }
    } else if (rmMsgContext.getMessageType()!=Sandesha2Constants.MessageTypes.UNKNOWN) {
      //droping other known message types if, an suitable operation context is not available,
      //and if a relates to value is present.
      RelatesTo relatesTo = rmMsgContext.getRelatesTo();
      if (relatesTo!=null) {
        String value = relatesTo.getValue();
       
        //TODO do not drop, relationshipTypes other than reply
       
        ConfigurationContext configurationContext = rmMsgContext.getMessageContext().getConfigurationContext();
        OperationContext operationContextFromMap = configurationContext.getOperationContext(value);
View Full Code Here

      String message = "New sequence Id is null";
      log.debug(message);
      throw new SandeshaException(message);
    }

    RelatesTo relatesTo = createSeqResponseRMMsgCtx.getMessageContext()
                    .getRelatesTo();
    if (relatesTo==null) {
      String message = "Invalid create sequence message. RelatesTo part is not available";
      log.error("Invalid create sequence response message. RelatesTo part is not available");
      throw new SandeshaException ("Invalid create sequence message. RelatesTo part is not available");
    }
    String createSeqMsgId = relatesTo.getValue();


    SenderBeanMgr retransmitterMgr = storageManager
        .getRetransmitterBeanMgr();
    CreateSeqBeanMgr createSeqMgr = storageManager.getCreateSeqBeanMgr();
View Full Code Here

        // Deciding whether this is the last message. We assume it is if it relates to
        // a message which arrived with the LastMessage flag on it.
        RMDBean rmdBean = SandeshaUtil.getRMDBeanFromSequenceId(storageManager, inboundSequence);     
        // Get the last in message
        String lastRequestId = rmdBean.getLastInMessageId();
        RelatesTo relatesTo = msgContext.getRelatesTo();
        if(relatesTo != null && lastRequestId != null &&
            lastRequestId.equals(relatesTo.getValue())) {
          lastMessage = true;
        }
       
        //or a constant property may call it as the last msg
        Boolean inboundLast = (Boolean) msgContext.getProperty(Sandesha2Constants.MessageContextProperties.INBOUND_LAST_MESSAGE);
        if (inboundLast!=null && inboundLast.booleanValue())
          lastMessage = true;
      }
     
      if (lastMessage) {
        rmsBean.setLastOutMessage(messageNumber);
       
        if (msgContext.getTo() == null || (msgContext.getTo() != null && msgContext.getTo().isWSAddressingAnonymous())) {
          if (log.isDebugEnabled())
            log.debug("Rewriting anonymous EPR for LastMessage to the one stored in the RMSBean");
          msgContext.setTo(rmsBean.getToEndpointReference());
        }
      }
 
      // set this as the response highest message.
      rmsBean.setHighestOutMessageNumber(messageNumber);
     
      // saving the used message number
      //Save the expected replies if it's not a dummy msg and it's an outIn MEP
      String specVersion = SequenceManager.getSpecVersion(rmMsgCtx.getMessageContext(), storageManager);
      if (!dummyMessage) {
        rmsBean.setNextMessageNumber(messageNumber);
       
        // Identify the MEP associated with the message.
        AxisOperation op = msgContext.getAxisOperation();
        int mep = WSDLConstants.MEP_CONSTANT_INVALID;
        if(op != null) {
          mep = op.getAxisSpecificMEPConstant();
        }
       
        EndpointReference replyTo = msgContext.getReplyTo();
       
        if(mep == WSDLConstants.MEP_CONSTANT_OUT_IN){
          // We only match up requests and replies when we are doing sync interactions
          if (log.isDebugEnabled()) log.debug("MEP OUT_IN")
          if(replyTo == null || replyTo.hasAnonymousAddress()) {
            long expectedReplies = rmsBean.getExpectedReplies();
            rmsBean.setExpectedReplies(expectedReplies + 1);
          }
         
          // If we support the RM anonymous URI then rewrite the ws-a anon to use the RM equivalent.
          //(do should be done only for WSRM 1.1)
          if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion)) {
            if (log.isDebugEnabled()) log.debug("SPEC_1_1");
            String oldAddress = (replyTo == null) ? null : replyTo.getAddress();
            EndpointReference newReplyTo = SandeshaUtil.rewriteEPR(rmsBean, msgContext
                .getReplyTo(), configContext);
            String newAddress = (newReplyTo == null) ? null : newReplyTo.getAddress();
            if(newAddress != null && !newAddress.equals(oldAddress)){
              msgContext.setReplyTo(newReplyTo);
            }
          }
        }
        // Set the faultTo to anonymous to make sure we get Sandesha faults back.
        if(mep == WSDLConstants.MEP_CONSTANT_OUT_ONLY
          || (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(specVersion) && replyTo == null)) {
          if (log.isDebugEnabled())
            log.debug("Setting the faultTo to anonymous as a oneWay MEP is being used and fault msgs can then be delivered back on the backchannel");
          if(msgContext.getFaultTo() == null)
            msgContext.setFaultTo(new EndpointReference(AddressingConstants.Final.WSA_ANONYMOUS_URL));
        }
      }
     
      boolean startPolling = false;
      // We should poll for any reply-to that uses the anonymous URI, when MakeConnection
      // is enabled.
      if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion)) {
        SandeshaPolicyBean policy = SandeshaUtil.getPropertyBean(msgContext.getConfigurationContext().getAxisConfiguration());
        if(policy.isEnableMakeConnection()) {
          EndpointReference reference = rmsBean.getAcksToEndpointReference();
          if(reference == null || reference.hasAnonymousAddress()) {
            rmsBean.setPollingMode(true);
            startPolling = true;
            //ensure addressing is turned on since we require it if we want to use makeConnection
            if (log.isDebugEnabled()) log.debug("Ensuring that WS-A is enabled for msg " + msgContext);
            msgContext.setProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES,Boolean.FALSE);
          }
        }
      }

      if (log.isDebugEnabled()) log.debug("App msg using replyTo EPR as " + msgContext.getReplyTo() + " and faultTo EPR as " + msgContext.getFaultTo());
     
      RelatesTo relatesTo = msgContext.getRelatesTo();
      if(relatesTo != null) {
        rmsBean.setHighestOutRelatesTo(relatesTo.getValue());
      }
 
      // setting async ack endpoint for the server side. (if present)
      if (serverSide) {
        if (rmsBean.getToEndpointReference() != null) {
View Full Code Here

      String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.newSeqIdIsNull);
      log.debug(message);
      throw new SandeshaException(message);
    }

    RelatesTo relatesTo = createSeqResponseRMMsgCtx.getMessageContext().getRelatesTo();
    String createSeqMsgId = null;
    if (relatesTo != null) {
      createSeqMsgId = relatesTo.getValue();
    } else {
      // Work out the related message from the operation context
      OperationContext context = createSeqResponseRMMsgCtx.getMessageContext().getOperationContext();
      MessageContext createSeq = context.getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
      if(createSeq != null) createSeqMsgId = createSeq.getMessageID();
View Full Code Here

            msgCtx.setEnvelope(envelope);
            // set the RMSMessageDto properties
            msgCtx.getOptions().setAction(jmsAxis2MessageContext.getAction());
            if (jmsAxis2MessageContext.getRelatesToMessageId() != null) {
                msgCtx.addRelatesTo(new RelatesTo(jmsAxis2MessageContext.getRelatesToMessageId()));
            }
            msgCtx.setMessageID(jmsAxis2MessageContext.getMessageID());
            msgCtx.getOptions().setAction(jmsAxis2MessageContext.getAction());

            AxisService axisService =
View Full Code Here

TOP

Related Classes of org.apache.axis2.addressing.RelatesTo

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.