private static void replaceDict(final Message message, Map<SimpleString, SimpleString> dictionary) { for (SimpleString property : new HashSet<>(message.getPropertyNames())) { SimpleString replaceTo = dictionary.get(property); if (replaceTo != null) { message.putObjectProperty(replaceTo, message.removeProperty(property)); } } }
/** * @return Returns the message properties in Map form, useful when encoding to JSON */ default Map<String, Object> toPropertyMap() { Map map = new HashMap<>(); for (SimpleString name : getPropertyNames()) { Object value = getObjectProperty(name.toString()); //some property is SimpleString, which is not available for management console if (value instanceof SimpleString) { value = value.toString(); } map.put(name.toString(), value); } return map; }
public static Set<String> getPropertyNames(Message message) { HashSet<String> set = new HashSet<>(); for (SimpleString propName : message.getPropertyNames()) { if (propName.equals(Message.HDR_GROUP_ID)) { set.add(MessageUtil.JMSXGROUPID); } else if (propName.equals(Message.HDR_VALIDATED_USER)) { set.add(MessageUtil.JMSXUSERID); } else if ((!propName.startsWith(JMS) || propName.startsWith(JMSX) || propName.startsWith(JMS_)) && !propName.startsWith(CONNECTION_ID_PROPERTY_NAME) && !propName.equals(Message.HDR_ROUTING_TYPE) && !propName.startsWith(Message.HDR_ROUTE_TO_IDS)) { set.add(propName.toString()); } } set.add(JMSXDELIVERYCOUNT); return set; }
public static void clearProperties(Message message) { /** * JavaDoc for this method states: * Clears a message's properties. * The message's header fields and body are not cleared. * * Since the {@code Message.HDR_ROUTING_TYPE} is used for the JMSDestination header it isn't cleared */ List<SimpleString> toRemove = new ArrayList<>(); for (SimpleString propName : message.getPropertyNames()) { if ((!propName.startsWith(JMS) || propName.startsWith(JMSX) || propName.startsWith(JMS_)) && !propName.equals(Message.HDR_ROUTING_TYPE)) { toRemove.add(propName); } } for (SimpleString propName : toRemove) { message.removeProperty(propName); } }
private static void replaceDict(final Message message, Map<SimpleString, SimpleString> dictionary) { for (SimpleString property : new HashSet<>(message.getPropertyNames())) { SimpleString replaceTo = dictionary.get(property); if (replaceTo != null) { message.putObjectProperty(replaceTo, message.removeProperty(property)); } } }
private static void replaceDict(final Message message, Map<SimpleString, SimpleString> dictionary) { for (SimpleString property : new HashSet<>(message.getPropertyNames())) { SimpleString replaceTo = dictionary.get(property); if (replaceTo != null) { message.putObjectProperty(replaceTo, message.removeProperty(property)); } } }
private static void replaceDict(final Message message, Map<SimpleString, SimpleString> dictionary) { for (SimpleString property : new HashSet<>(message.getPropertyNames())) { SimpleString replaceTo = dictionary.get(property); if (replaceTo != null) { message.putObjectProperty(replaceTo, message.removeProperty(property)); } } }
public void printMessageProperties(Message message) throws XMLStreamException { xmlWriter.writeStartElement(XmlDataConstants.PROPERTIES_PARENT); for (SimpleString key : message.getPropertyNames()) { Object value = message.getObjectProperty(key); xmlWriter.writeEmptyElement(XmlDataConstants.PROPERTIES_CHILD); xmlWriter.writeAttribute(XmlDataConstants.PROPERTY_NAME, key.toString()); xmlWriter.writeAttribute(XmlDataConstants.PROPERTY_VALUE, XmlDataExporterUtil.convertProperty(value)); // Write the property type as an attribute String propertyType = XmlDataExporterUtil.getPropertyType(value); if (propertyType != null) { xmlWriter.writeAttribute(XmlDataConstants.PROPERTY_TYPE, propertyType); } } xmlWriter.writeEndElement(); // end PROPERTIES_PARENT }
/** * @return Returns the message properties in Map form, useful when encoding to JSON */ default Map<String, Object> toPropertyMap() { Map map = new HashMap<>(); for (SimpleString name : getPropertyNames()) { Object value = getObjectProperty(name.toString()); //some property is SimpleString, which is not available for management console if (value instanceof SimpleString) { value = value.toString(); } map.put(name.toString(), value); } return map; }
/** * @return Returns the message properties in Map form, useful when encoding to JSON */ default Map<String, Object> toPropertyMap() { Map map = new HashMap<>(); for (SimpleString name : getPropertyNames()) { Object value = getObjectProperty(name.toString()); //some property is SimpleString, which is not available for management console if (value instanceof SimpleString) { value = value.toString(); } map.put(name.toString(), value); } return map; }
/** * @return Returns the message properties in Map form, useful when encoding to JSON */ default Map<String, Object> toPropertyMap() { Map map = new HashMap<>(); for (SimpleString name : getPropertyNames()) { Object value = getObjectProperty(name.toString()); //some property is SimpleString, which is not available for management console if (value instanceof SimpleString) { value = value.toString(); } map.put(name.toString(), value); } return map; }
public void printMessageProperties(Message message) throws XMLStreamException { xmlWriter.writeStartElement(XmlDataConstants.PROPERTIES_PARENT); for (SimpleString key : message.getPropertyNames()) { Object value = message.getObjectProperty(key); xmlWriter.writeEmptyElement(XmlDataConstants.PROPERTIES_CHILD); xmlWriter.writeAttribute(XmlDataConstants.PROPERTY_NAME, key.toString()); xmlWriter.writeAttribute(XmlDataConstants.PROPERTY_VALUE, XmlDataExporterUtil.convertProperty(value)); // Write the property type as an attribute String propertyType = XmlDataExporterUtil.getPropertyType(value); if (propertyType != null) { xmlWriter.writeAttribute(XmlDataConstants.PROPERTY_TYPE, propertyType); } } xmlWriter.writeEndElement(); // end PROPERTIES_PARENT }
/** * @return Returns the message properties in Map form, useful when encoding to JSON */ default Map<String, Object> toPropertyMap() { Map map = new HashMap<>(); for (SimpleString name : getPropertyNames()) { Object value = getObjectProperty(name.toString()); //some property is SimpleString, which is not available for management console if (value instanceof SimpleString) { value = value.toString(); } map.put(name.toString(), value); } return map; }
/** * @return Returns the message properties in Map form, useful when encoding to JSON */ default Map<String, Object> toPropertyMap() { Map map = new HashMap<>(); for (SimpleString name : getPropertyNames()) { Object value = getObjectProperty(name.toString()); //some property is SimpleString, which is not available for management console if (value instanceof SimpleString) { value = value.toString(); } map.put(name.toString(), value); } return map; }
/** * @return Returns the message properties in Map form, useful when encoding to JSON */ default Map<String, Object> toPropertyMap() { Map map = new HashMap<>(); for (SimpleString name : getPropertyNames()) { Object value = getObjectProperty(name.toString()); //some property is SimpleString, which is not available for management console if (value instanceof SimpleString) { value = value.toString(); } map.put(name.toString(), value); } return map; }
public static Set<String> getPropertyNames(Message message) { HashSet<String> set = new HashSet<>(); for (SimpleString propName : message.getPropertyNames()) { if (propName.equals(Message.HDR_GROUP_ID)) { set.add(MessageUtil.JMSXGROUPID); } else if (propName.equals(Message.HDR_VALIDATED_USER)) { set.add(MessageUtil.JMSXUSERID); } else if ((!propName.startsWith(JMS) || propName.startsWith(JMSX) || propName.startsWith(JMS_)) && !propName.startsWith(CONNECTION_ID_PROPERTY_NAME) && !propName.equals(Message.HDR_ROUTING_TYPE) && !propName.startsWith(Message.HDR_ROUTE_TO_IDS)) { set.add(propName.toString()); } } set.add(JMSXDELIVERYCOUNT); return set; }
public static Set<String> getPropertyNames(Message message) { HashSet<String> set = new HashSet<>(); for (SimpleString propName : message.getPropertyNames()) { if (propName.equals(Message.HDR_GROUP_ID)) { set.add(MessageUtil.JMSXGROUPID); } else if (propName.equals(Message.HDR_GROUP_SEQUENCE)) { set.add(MessageUtil.JMSXGROUPSEQ); } else if (propName.equals(Message.HDR_VALIDATED_USER)) { set.add(MessageUtil.JMSXUSERID); } else if ((!propName.startsWith(JMS) || propName.startsWith(JMSX) || propName.startsWith(JMS_)) && !propName.startsWith(CONNECTION_ID_PROPERTY_NAME) && !propName.equals(Message.HDR_ROUTING_TYPE) && !propName.startsWith(Message.HDR_ROUTE_TO_IDS)) { set.add(propName.toString()); } } set.add(JMSXDELIVERYCOUNT); return set; }
public static Set<String> getPropertyNames(Message message) { HashSet<String> set = new HashSet<>(); for (SimpleString propName : message.getPropertyNames()) { if (propName.equals(Message.HDR_GROUP_ID)) { set.add(MessageUtil.JMSXGROUPID); } else if (propName.equals(Message.HDR_VALIDATED_USER)) { set.add(MessageUtil.JMSXUSERID); } else if ((!propName.startsWith(JMS) || propName.startsWith(JMSX) || propName.startsWith(JMS_)) && !propName.startsWith(CONNECTION_ID_PROPERTY_NAME) && !propName.equals(Message.HDR_ROUTING_TYPE) && !propName.startsWith(Message.HDR_ROUTE_TO_IDS)) { set.add(propName.toString()); } } set.add(JMSXDELIVERYCOUNT); return set; }
public static Set<String> getPropertyNames(Message message) { HashSet<String> set = new HashSet<>(); for (SimpleString propName : message.getPropertyNames()) { if (propName.equals(Message.HDR_GROUP_ID)) { set.add(MessageUtil.JMSXGROUPID); } else if (propName.equals(Message.HDR_VALIDATED_USER)) { set.add(MessageUtil.JMSXUSERID); } else if ((!propName.startsWith(JMS) || propName.startsWith(JMSX) || propName.startsWith(JMS_)) && !propName.startsWith(CONNECTION_ID_PROPERTY_NAME) && !propName.equals(Message.HDR_ROUTING_TYPE) && !propName.startsWith(Message.HDR_ROUTE_TO_IDS)) { set.add(propName.toString()); } } set.add(JMSXDELIVERYCOUNT); return set; }
public static Set<String> getPropertyNames(Message message) { HashSet<String> set = new HashSet<>(); for (SimpleString propName : message.getPropertyNames()) { if (propName.equals(Message.HDR_GROUP_ID)) { set.add(MessageUtil.JMSXGROUPID); } else if (propName.equals(Message.HDR_GROUP_SEQUENCE)) { set.add(MessageUtil.JMSXGROUPSEQ); } else if (propName.equals(Message.HDR_VALIDATED_USER)) { set.add(MessageUtil.JMSXUSERID); } else if ((!propName.startsWith(JMS) || propName.startsWith(JMSX) || propName.startsWith(JMS_)) && !propName.startsWith(CONNECTION_ID_PROPERTY_NAME) && !propName.equals(Message.HDR_ROUTING_TYPE) && !propName.startsWith(Message.HDR_ROUTE_TO_IDS)) { set.add(propName.toString()); } } set.add(JMSXDELIVERYCOUNT); return set; }