@Test public void testExtractMessageHeaders() throws JMSException { Message message = mock(Message.class); mockHeaders(message); Operation op = new Operation(); extractMessageHeaders(op, message, null, Collections.<String>emptyList()); assertHeaders(message, op); }
static OperationMap extractMessageHeaders(Operation op, Message message, ObscuredValueMarker marker, Collection<String> nameSet) throws JMSException { OperationMap headersMap = op.createMap(MESSAGE_HEADERS); addDestinationDetailsToMapIfNeeded(message.getJMSDestination(), headersMap, marker, nameSet, MESSAGE_DESTINATION); addDestinationDetailsToMapIfNeeded(message.getJMSReplyTo(), headersMap, marker, nameSet, REPLY_TO); updateAny(headersMap, CORRELATION_ID, message.getJMSCorrelationID(), marker, nameSet); updateAny(headersMap, DELIVERY_MODE, getDeliveryMode(message.getJMSDeliveryMode()).getLabel(), marker, nameSet); updateAny(headersMap, EXPIRATION, Long.valueOf(message.getJMSExpiration()), marker, nameSet); updateAny(headersMap, MESSAGE_ID, message.getJMSMessageID(), marker, nameSet); updateAny(headersMap, PRIORITY, Integer.valueOf(message.getJMSPriority()), marker, nameSet); updateAny(headersMap, REDELIVERED, Boolean.valueOf(message.getJMSRedelivered()), marker, nameSet); long timestamp = message.getJMSTimestamp(); if (timestamp > 0L) { updateAny(headersMap, TIMESTAMP, Long.valueOf(timestamp), marker, nameSet); } updateAny(headersMap, JMS_TYPE, message.getJMSType(), marker, nameSet); return headersMap; }
JMSPluginUtils { static OperationMap extractMessageHeaders(Operation op, Message message, ObscuredValueMarker marker, Collection<String> nameSet) throws JMSException { OperationMap headersMap = op.createMap(MESSAGE_HEADERS); addDestinationDetailsToMapIfNeeded(message.getJMSDestination(), headersMap, marker, nameSet, MESSAGE_DESTINATION); addDestinationDetailsToMapIfNeeded(message.getJMSReplyTo(), headersMap, marker, nameSet, REPLY_TO); updateAny(headersMap, CORRELATION_ID, message.getJMSCorrelationID(), marker, nameSet); updateAny(headersMap, DELIVERY_MODE, getDeliveryMode(message.getJMSDeliveryMode()).getLabel(), marker, nameSet); updateAny(headersMap, EXPIRATION, Long.valueOf(message.getJMSExpiration()), marker, nameSet); updateAny(headersMap, MESSAGE_ID, message.getJMSMessageID(), marker, nameSet); updateAny(headersMap, PRIORITY, Integer.valueOf(message.getJMSPriority()), marker, nameSet); updateAny(headersMap, REDELIVERED, Boolean.valueOf(message.getJMSRedelivered()), marker, nameSet); long timestamp = message.getJMSTimestamp(); if (timestamp > 0L) { updateAny(headersMap, TIMESTAMP, Long.valueOf(timestamp), marker, nameSet); } updateAny(headersMap, JMS_TYPE, message.getJMSType(), marker, nameSet); return headersMap; } }
JMSPluginUtils { static OperationMap extractMessageHeaders(Operation op, Message message, ObscuredValueMarker marker, Collection<String> nameSet) throws JMSException { OperationMap headersMap = op.createMap(MESSAGE_HEADERS); addDestinationDetailsToMapIfNeeded(message.getJMSDestination(), headersMap, marker, nameSet, MESSAGE_DESTINATION); addDestinationDetailsToMapIfNeeded(message.getJMSReplyTo(), headersMap, marker, nameSet, REPLY_TO); updateAny(headersMap, CORRELATION_ID, message.getJMSCorrelationID(), marker, nameSet); updateAny(headersMap, DELIVERY_MODE, getDeliveryMode(message.getJMSDeliveryMode()).getLabel(), marker, nameSet); updateAny(headersMap, EXPIRATION, Long.valueOf(message.getJMSExpiration()), marker, nameSet); updateAny(headersMap, MESSAGE_ID, message.getJMSMessageID(), marker, nameSet); updateAny(headersMap, PRIORITY, Integer.valueOf(message.getJMSPriority()), marker, nameSet); updateAny(headersMap, REDELIVERED, Boolean.valueOf(message.getJMSRedelivered()), marker, nameSet); long timestamp = message.getJMSTimestamp(); if (timestamp > 0L) { updateAny(headersMap, TIMESTAMP, Long.valueOf(timestamp), marker, nameSet); } updateAny(headersMap, JMS_TYPE, message.getJMSType(), marker, nameSet); return headersMap; } private  JMSPluginUtils(); }
JMSPluginUtils { static OperationMap extractMessageHeaders(Operation op, Message message, ObscuredValueMarker marker, Collection<String> nameSet) throws JMSException { OperationMap headersMap = op.createMap(MESSAGE_HEADERS); addDestinationDetailsToMapIfNeeded(message.getJMSDestination(), headersMap, marker, nameSet, MESSAGE_DESTINATION); addDestinationDetailsToMapIfNeeded(message.getJMSReplyTo(), headersMap, marker, nameSet, REPLY_TO); updateAny(headersMap, CORRELATION_ID, message.getJMSCorrelationID(), marker, nameSet); updateAny(headersMap, DELIVERY_MODE, getDeliveryMode(message.getJMSDeliveryMode()).getLabel(), marker, nameSet); updateAny(headersMap, EXPIRATION, Long.valueOf(message.getJMSExpiration()), marker, nameSet); updateAny(headersMap, MESSAGE_ID, message.getJMSMessageID(), marker, nameSet); updateAny(headersMap, PRIORITY, Integer.valueOf(message.getJMSPriority()), marker, nameSet); updateAny(headersMap, REDELIVERED, Boolean.valueOf(message.getJMSRedelivered()), marker, nameSet); long timestamp = message.getJMSTimestamp(); if (timestamp > 0L) { updateAny(headersMap, TIMESTAMP, Long.valueOf(timestamp), marker, nameSet); } updateAny(headersMap, JMS_TYPE, message.getJMSType(), marker, nameSet); return headersMap; } private  JMSPluginUtils();  }
JMSPluginUtils { static OperationMap extractMessageHeaders(Operation op, Message message, ObscuredValueMarker marker, Collection<String> nameSet) throws JMSException { OperationMap headersMap = op.createMap(MESSAGE_HEADERS); addDestinationDetailsToMapIfNeeded(message.getJMSDestination(), headersMap, marker, nameSet, MESSAGE_DESTINATION); addDestinationDetailsToMapIfNeeded(message.getJMSReplyTo(), headersMap, marker, nameSet, REPLY_TO); updateAny(headersMap, CORRELATION_ID, message.getJMSCorrelationID(), marker, nameSet); updateAny(headersMap, DELIVERY_MODE, getDeliveryMode(message.getJMSDeliveryMode()).getLabel(), marker, nameSet); updateAny(headersMap, EXPIRATION, Long.valueOf(message.getJMSExpiration()), marker, nameSet); updateAny(headersMap, MESSAGE_ID, message.getJMSMessageID(), marker, nameSet); updateAny(headersMap, PRIORITY, Integer.valueOf(message.getJMSPriority()), marker, nameSet); updateAny(headersMap, REDELIVERED, Boolean.valueOf(message.getJMSRedelivered()), marker, nameSet); long timestamp = message.getJMSTimestamp(); if (timestamp > 0L) { updateAny(headersMap, TIMESTAMP, Long.valueOf(timestamp), marker, nameSet); } updateAny(headersMap, JMS_TYPE, message.getJMSType(), marker, nameSet); return headersMap; } private  JMSPluginUtils();   }