/** * It is possible for us (Synapse) to cause the creation of a duplicate relatesTo as we * try to hold onto the outgoing message ID even for POX messages using the relates to * Now once we get a response, make sure we remove any trace of this before we proceed any * further * @param mc the message context from which a possibly duplicated relatesTo should be removed * @param relates the existing relatedTo array of the message */ private void removeDuplicateRelatesTo(MessageContext mc, RelatesTo[] relates) { int insertPos = 0; RelatesTo[] newRelates = new RelatesTo[relates.length]; for (RelatesTo current : relates) { boolean found = false; for (int j = 0; j < newRelates.length && j < insertPos; j++) { if (newRelates[j].equals(current) || newRelates[j].getValue().equals(current.getValue())) { found = true; break; } } if (!found) { newRelates[insertPos++] = current; } } RelatesTo[] trimmedRelates = new RelatesTo[insertPos]; System.arraycopy(newRelates, 0, trimmedRelates, 0, insertPos); mc.setRelationships(trimmedRelates); }
/** * It is possible for us (Synapse) to cause the creation of a duplicate relatesTo as we * try to hold onto the outgoing message ID even for POX messages using the relates to * Now once we get a response, make sure we remove any trace of this before we proceed any * further * @param mc the message context from which a possibly duplicated relatesTo should be removed * @param relates the existing relatedTo array of the message */ private void removeDuplicateRelatesTo(MessageContext mc, RelatesTo[] relates) { int insertPos = 0; RelatesTo[] newRelates = new RelatesTo[relates.length]; for (RelatesTo current : relates) { boolean found = false; for (int j = 0; j < newRelates.length && j < insertPos; j++) { if (newRelates[j].equals(current) || newRelates[j].getValue().equals(current.getValue())) { found = true; break; } } if (!found) { newRelates[insertPos++] = current; } } RelatesTo[] trimmedRelates = new RelatesTo[insertPos]; System.arraycopy(newRelates, 0, trimmedRelates, 0, insertPos); mc.setRelationships(trimmedRelates); }
public AxisOperation findOperation(AxisService service, MessageContext messageContext) throws AxisFault { RelatesTo relatesTo = messageContext.getRelatesTo(); if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) { log.debug(messageContext.getLogIDString() + " Checking for OperationContext using RelatesTo : " + relatesTo); } if ((relatesTo != null) && (relatesTo.getValue() != null)) { ConfigurationContext configurationContext = messageContext.getConfigurationContext(); OperationContext operationContext = configurationContext.getOperationContext(relatesTo.getValue()); if (operationContext != null) { if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) { log.debug(messageContext.getLogIDString() + " Found OperationContext: " + operationContext); } return operationContext.getAxisOperation(); } } return null; }
public AxisOperation findOperation(AxisService service, MessageContext messageContext) throws AxisFault { RelatesTo relatesTo = messageContext.getRelatesTo(); if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) { log.debug(messageContext.getLogIDString() + " Checking for OperationContext using RelatesTo : " + relatesTo); } if ((relatesTo != null) && (relatesTo.getValue() != null)) { ConfigurationContext configurationContext = messageContext.getConfigurationContext(); OperationContext operationContext = configurationContext.getOperationContext(relatesTo.getValue()); if (operationContext != null) { if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) { log.debug(messageContext.getLogIDString() + " Found OperationContext: " + operationContext); } return operationContext.getAxisOperation(); } } return null; }
public AxisService findService(MessageContext messageContext) throws AxisFault { RelatesTo relatesTo = messageContext.getRelatesTo(); if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) { log.debug(messageContext.getLogIDString() + " Checking for OperationContext using RelatesTo : " + relatesTo); } if ((relatesTo != null) && (relatesTo.getValue() != null)) { ConfigurationContext configurationContext = messageContext.getConfigurationContext(); OperationContext operationContext = configurationContext.getOperationContext(relatesTo.getValue()); if (operationContext != null) { if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) { log.debug(messageContext.getLogIDString() + " Found OperationContext: " + operationContext); } return operationContext.getServiceContext().getAxisService(); } } return null; }
public AxisService findService(MessageContext messageContext) throws AxisFault { RelatesTo relatesTo = messageContext.getRelatesTo(); if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) { log.debug(messageContext.getLogIDString() + " Checking for OperationContext using RelatesTo : " + relatesTo); } if ((relatesTo != null) && (relatesTo.getValue() != null)) { ConfigurationContext configurationContext = messageContext.getConfigurationContext(); OperationContext operationContext = configurationContext.getOperationContext(relatesTo.getValue()); if (operationContext != null) { if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) { log.debug(messageContext.getLogIDString() + " Found OperationContext: " + operationContext); } return operationContext.getServiceContext().getAxisService(); } } return null; }
public void receive(MessageContext msgContext) throws AxisFault { RelatesTo relatesTO = msgContext.getOptions().getRelatesTo(); if (relatesTO == null) { throw new AxisFault("Cannot identify correct Callback object. RelatesTo is null"); } String messageID = relatesTO.getValue(); Object callbackObj = callbackStore.remove(messageID); if (log.isDebugEnabled()) log.debug("CallbackReceiver: receive found callback " + callbackObj + ", " + messageID + ", " + this + ", " + msgContext.getAxisOperation()); if (callbackObj == null) { throw new AxisFault("The Callback for MessageID " + messageID + " was not found"); } if (callbackObj instanceof AxisCallback) { AxisCallback axisCallback = (AxisCallback)callbackObj; if (msgContext.isFault()) { axisCallback.onFault(msgContext); } else { axisCallback.onMessage(msgContext); } // Either way we're done. axisCallback.onComplete(); return; } }
public void receive(MessageContext msgContext) throws AxisFault { RelatesTo relatesTO = msgContext.getOptions().getRelatesTo(); if (relatesTO == null) { throw new AxisFault("Cannot identify correct Callback object. RelatesTo is null"); } String messageID = relatesTO.getValue(); Object callbackObj = callbackStore.remove(messageID); if (log.isDebugEnabled()) log.debug("CallbackReceiver: receive found callback " + callbackObj + ", " + messageID + ", " + this + ", " + msgContext.getAxisOperation()); if (callbackObj == null) { throw new AxisFault("The Callback for MessageID " + messageID + " was not found"); } if (callbackObj instanceof AxisCallback) { AxisCallback axisCallback = (AxisCallback)callbackObj; if (msgContext.isFault()) { axisCallback.onFault(msgContext); } else { axisCallback.onMessage(msgContext); } // Either way we're done. axisCallback.onComplete(); return; } }
private void processRelatesTo() { if (!isAddressingHeaderAlreadyAvailable(WSA_RELATES_TO, true)) { RelatesTo[] relatesTo = messageContextOptions.getRelationships(); if (relatesTo != null) { for (int i = 0, length = relatesTo.length; i < length; i++) { OMElement relatesToHeader = createSOAPHeaderBlock(relatesTo[i].getValue(), WSA_RELATES_TO, relatesTo[i].getExtensibilityAttributes()); String relationshipType = relatesTo[i].getRelationshipType(); if (relatesToHeader != null) { if(!includeOptionalHeaders){ if (Final.WSA_DEFAULT_RELATIONSHIP_TYPE.equals(relationshipType) || Submission.WSA_DEFAULT_RELATIONSHIP_TYPE .equals(relationshipType)) { relationshipType = null; //Omit the attribute. } } if(relationshipType != null){ relatesToHeader.addAttribute(WSA_RELATES_TO_RELATIONSHIP_TYPE, relationshipType, null); } } } } } }
/** * Returns as existing OperationContext related to this message if one exists. * <p/> * TODO - why both this and findOperationContext()? (GD) * * @param msgContext the MessageContext for which we'd like an OperationContext * @return the OperationContext, or null * @throws AxisFault */ public OperationContext findForExistingOperationContext(MessageContext msgContext) throws AxisFault { OperationContext operationContext; if ((operationContext = msgContext.getOperationContext()) != null) { return operationContext; } // If this message is not related to another one, or it is but not one emitted // from the same operation, don't further look for an operation context or fault. if (null != msgContext.getRelatesTo()) { // So this message may be part of an ongoing MEP ConfigurationContext configContext = msgContext.getConfigurationContext(); operationContext = configContext.getOperationContext(msgContext.getRelatesTo().getValue()); if (null == operationContext && log.isDebugEnabled()) { log.debug(msgContext.getLogIDString() + " Cannot correlate inbound message RelatesTo value [" + msgContext.getRelatesTo() + "] to in-progree MEP"); } } return operationContext; }
/** * Returns as existing OperationContext related to this message if one exists. * <p/> * TODO - why both this and findOperationContext()? (GD) * * @param msgContext the MessageContext for which we'd like an OperationContext * @return the OperationContext, or null * @throws AxisFault */ public OperationContext findForExistingOperationContext(MessageContext msgContext) throws AxisFault { OperationContext operationContext; if ((operationContext = msgContext.getOperationContext()) != null) { return operationContext; } // If this message is not related to another one, or it is but not one emitted // from the same operation, don't further look for an operation context or fault. if (null != msgContext.getRelatesTo()) { // So this message may be part of an ongoing MEP ConfigurationContext configContext = msgContext.getConfigurationContext(); operationContext = configContext.getOperationContext(msgContext.getRelatesTo().getValue()); if (null == operationContext && log.isDebugEnabled()) { log.debug(msgContext.getLogIDString() + " Cannot correlate inbound message RelatesTo value [" + msgContext.getRelatesTo() + "] to in-progree MEP"); } } return operationContext; }
RelatesTo relatesTo = options.getRelatesTo(); if (relatesTo != null) { messageID = relatesTo.getValue();
RelatesTo relatesTo = options.getRelatesTo(); if (relatesTo != null) { messageID = relatesTo.getValue();
String createSeqMsgId = null; if (relatesTo != null) { createSeqMsgId = relatesTo.getValue(); } else {
if (mercuryMessageContext.getMessageContext().getRelatesTo() != null){ sequenceReceivedNumberDto.setRelatesToMessageID( mercuryMessageContext.getMessageContext().getRelatesTo().getValue());
correlationId = msgContext.getRelatesTo().getValue();
String relatesTo = msgctx.getRelatesTo().getValue();
String relatesTo = msgctx.getRelatesTo().getValue();