@Test public void testExtractMessageAttributes() throws JMSException { Message message = mock(Message.class); final Map<String, Object> mockMap = mockAttributes(message); Operation op = new Operation(); extractMessageProperties(op, message, null, Collections.<String>emptyList()); assertAttributes(mockMap, op); }
static OperationMap extractMessageProperties(Operation op, Message message, ObscuredValueMarker marker, Collection<String> nameSet) throws JMSException { OperationMap attributesMap = op.createMap(MESSAGE_PROPERTIES); Enumeration<?> propertyNames = message.getPropertyNames(); if (propertyNames != null) { Object host = message.getObjectProperty("host"); Object port = message.getObjectProperty("port"); if (host != null && port != null) { OperationMap connectionData = op.createMap(CONNECTION_DATA); int _port; try { _port = Integer.parseInt(String.valueOf(port)); } catch (NumberFormatException e) { _port = -1; } connectionData.put("port", _port); connectionData.put("host", String.valueOf(host)); } for (Enumeration<?> propertyNameEnum = propertyNames; propertyNameEnum.hasMoreElements(); ) { String propertyName = (String) propertyNameEnum.nextElement(); Object propertyValue = message.getObjectProperty(propertyName); updateAny(attributesMap, propertyName, propertyValue, marker, nameSet); } } return attributesMap; }
JMSPluginUtils { static OperationMap extractMessageProperties(Operation op, Message message, ObscuredValueMarker marker, Collection<String> nameSet) throws JMSException { OperationMap attributesMap = op.createMap(MESSAGE_PROPERTIES); Enumeration<?> propertyNames = message.getPropertyNames(); if (propertyNames != null) { Object host = message.getObjectProperty("host"); Object port = message.getObjectProperty("port"); if (host != null && port != null) { OperationMap connectionData = op.createMap(CONNECTION_DATA); int _port; try { _port = Integer.parseInt(String.valueOf(port)); } catch (NumberFormatException e) { _port = -1; } connectionData.put("port", _port); connectionData.put("host", String.valueOf(host)); } for (Enumeration<?> propertyNameEnum = propertyNames; propertyNameEnum.hasMoreElements(); ) { String propertyName = (String) propertyNameEnum.nextElement(); Object propertyValue = message.getObjectProperty(propertyName); updateAny(attributesMap, propertyName, propertyValue, marker, nameSet); } } return attributesMap; } }
JMSPluginUtils { static OperationMap extractMessageProperties(Operation op, Message message, ObscuredValueMarker marker, Collection<String> nameSet) throws JMSException { OperationMap attributesMap = op.createMap(MESSAGE_PROPERTIES); Enumeration<?> propertyNames = message.getPropertyNames(); if (propertyNames != null) { Object host = message.getObjectProperty("host"); Object port = message.getObjectProperty("port"); if (host != null && port != null) { OperationMap connectionData = op.createMap(CONNECTION_DATA); int _port; try { _port = Integer.parseInt(String.valueOf(port)); } catch (NumberFormatException e) { _port = -1; } connectionData.put("port", _port); connectionData.put("host", String.valueOf(host)); } for (Enumeration<?> propertyNameEnum = propertyNames; propertyNameEnum.hasMoreElements(); ) { String propertyName = (String) propertyNameEnum.nextElement(); Object propertyValue = message.getObjectProperty(propertyName); updateAny(attributesMap, propertyName, propertyValue, marker, nameSet); } } return attributesMap; } private  JMSPluginUtils(); }
JMSPluginUtils { static OperationMap extractMessageProperties(Operation op, Message message, ObscuredValueMarker marker, Collection<String> nameSet) throws JMSException { OperationMap attributesMap = op.createMap(MESSAGE_PROPERTIES); Enumeration<?> propertyNames = message.getPropertyNames(); if (propertyNames != null) { Object host = message.getObjectProperty("host"); Object port = message.getObjectProperty("port"); if (host != null && port != null) { OperationMap connectionData = op.createMap(CONNECTION_DATA); int _port; try { _port = Integer.parseInt(String.valueOf(port)); } catch (NumberFormatException e) { _port = -1; } connectionData.put("port", _port); connectionData.put("host", String.valueOf(host)); } for (Enumeration<?> propertyNameEnum = propertyNames; propertyNameEnum.hasMoreElements(); ) { String propertyName = (String) propertyNameEnum.nextElement(); Object propertyValue = message.getObjectProperty(propertyName); updateAny(attributesMap, propertyName, propertyValue, marker, nameSet); } } return attributesMap; } private  JMSPluginUtils();  }
JMSPluginUtils { static OperationMap extractMessageProperties(Operation op, Message message, ObscuredValueMarker marker, Collection<String> nameSet) throws JMSException { OperationMap attributesMap = op.createMap(MESSAGE_PROPERTIES); Enumeration<?> propertyNames = message.getPropertyNames(); if (propertyNames != null) { Object host = message.getObjectProperty("host"); Object port = message.getObjectProperty("port"); if (host != null && port != null) { OperationMap connectionData = op.createMap(CONNECTION_DATA); int _port; try { _port = Integer.parseInt(String.valueOf(port)); } catch (NumberFormatException e) { _port = -1; } connectionData.put("port", _port); connectionData.put("host", String.valueOf(host)); } for (Enumeration<?> propertyNameEnum = propertyNames; propertyNameEnum.hasMoreElements(); ) { String propertyName = (String) propertyNameEnum.nextElement(); Object propertyValue = message.getObjectProperty(propertyName); updateAny(attributesMap, propertyName, propertyValue, marker, nameSet); } } return attributesMap; } private  JMSPluginUtils();   }