Package org.apache.axis2.addressing

Examples of org.apache.axis2.addressing.RelatesTo


        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

                } else if (SynapseConstants.HEADER_FAULT.equals(qName.getLocalPart())) {
                    synCtx.setFaultTo(new EndpointReference(value));
                } else if (SynapseConstants.HEADER_REPLY_TO.equals(qName.getLocalPart())) {
                    synCtx.setReplyTo(new EndpointReference(value));
                } else if (SynapseConstants.HEADER_RELATES_TO.equals(qName.getLocalPart())) {
                    synCtx.setRelatesTo(new RelatesTo[] { new RelatesTo(value) });
                } else {
                    addCustomHeader(synCtx, value);
                }
            } else {
                addCustomHeader(synCtx, value);
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

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

    // set this as the response highest message.
    rmsBean.setHighestOutMessageNumber(messageNumber);
   
    // saving the used message number, and the expected reply count
    boolean startPolling = false;
    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.getAxisSpecifMEPConstant();
      }

      if(mep == WSDLConstants.MEP_CONSTANT_OUT_IN) {
        // We only match up requests and replies when we are doing sync interactions
        EndpointReference replyTo = msgContext.getReplyTo();
        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(rmMsgCtx.getRMSpecVersion())) {
          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)) {
            // We have rewritten the replyTo. If this is the first message that we have needed to
            // rewrite then we should set the sequence up for polling, and once we have saved the
            // changes to the sequence then we can start the polling thread.
            msgContext.setReplyTo(newReplyTo);
            if (!rmsBean.isPollingMode()) {
              rmsBean.setPollingMode(true);
              startPolling = true;
            }
          }
        }
      }
    }
   
    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.getToEPR() != null) {
View Full Code Here

    ConfigurationContext configCtx = rmMsgCtx.getMessageContext().getConfigurationContext();

    StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configCtx, configCtx
        .getAxisConfiguration());

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

    // If we are doing sync 2-way over WSRM 1.0, then we may just have received one of
    // the reply messages that we were looking for. If so we can remove the matching sender bean.
    int mep = msgCtx.getAxisOperation().getAxisSpecifMEPConstant();
    if(specVersion!=null && specVersion.equals(Sandesha2Constants.SPEC_VERSIONS.v1_0) &&
        mep == WSDLConstants.MEP_CONSTANT_OUT_IN) {
      RelatesTo relatesTo = msgCtx.getRelatesTo();
      if(relatesTo != null) {
        String messageId = relatesTo.getValue();
        SenderBean matcher = new SenderBean();
        matcher.setMessageID(messageId);
        SenderBean sender = storageManager.getSenderBeanMgr().findUnique(matcher);
        if(sender != null) {
          if(log.isDebugEnabled()) log.debug("Deleting sender for sync-2-way message");
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

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

    RelatesTo relatesTo = createSeqResponseRMMsgCtx.getMessageContext().getRelatesTo();
    if (relatesTo == null) {
      String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.relatesToNotAvailable);
      log.error(message);
      throw new SandeshaException(message);
    }
    String createSeqMsgId = relatesTo.getValue();

    SenderBeanMgr senderBeanMgr = storageManager.getSenderBeanMgr();
    RMSBeanMgr rmsBeanMgr = storageManager.getRMSBeanMgr();

    RMSBean rmsBean = rmsBeanMgr.retrieve(createSeqMsgId);
View Full Code Here

        callbackStore.put(MsgID, callback);
    }

    public void receive(MessageContext messageCtx) throws AxisFault {

        RelatesTo relatesTO = messageCtx.getOptions().getRelatesTo();
        String messageID    = relatesTO.getValue();
        Callback callback   = (Callback) callbackStore.get(messageID);

        if (callback != null) {
            callbackStore.remove(messageID);
            callback.onComplete(new AsyncResult(messageCtx));
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.