Search in sources :

Example 6 with PersistentQueueBindingEncoding

use of org.apache.activemq.artemis.core.persistence.impl.journal.codec.PersistentQueueBindingEncoding in project activemq-artemis by apache.

the class XmlDataExporter method printBindingsAsXML.

private void printBindingsAsXML() throws XMLStreamException {
    xmlWriter.writeStartElement(XmlDataConstants.BINDINGS_PARENT);
    for (Map.Entry<Long, PersistentAddressBindingEncoding> addressBindingEncodingEntry : addressBindings.entrySet()) {
        PersistentAddressBindingEncoding bindingEncoding = addressBindings.get(addressBindingEncodingEntry.getKey());
        xmlWriter.writeEmptyElement(XmlDataConstants.ADDRESS_BINDINGS_CHILD);
        StringBuilder routingTypes = new StringBuilder();
        for (RoutingType routingType : bindingEncoding.getRoutingTypes()) {
            routingTypes.append(routingType.toString()).append(", ");
        }
        xmlWriter.writeAttribute(XmlDataConstants.ADDRESS_BINDING_ROUTING_TYPE, routingTypes.toString().substring(0, routingTypes.length() - 2));
        xmlWriter.writeAttribute(XmlDataConstants.ADDRESS_BINDING_NAME, bindingEncoding.getName().toString());
        xmlWriter.writeAttribute(XmlDataConstants.ADDRESS_BINDING_ID, Long.toString(bindingEncoding.getId()));
        bindingsPrinted++;
    }
    for (Map.Entry<Long, PersistentQueueBindingEncoding> queueBindingEncodingEntry : queueBindings.entrySet()) {
        PersistentQueueBindingEncoding bindingEncoding = queueBindings.get(queueBindingEncodingEntry.getKey());
        xmlWriter.writeEmptyElement(XmlDataConstants.QUEUE_BINDINGS_CHILD);
        xmlWriter.writeAttribute(XmlDataConstants.QUEUE_BINDING_ADDRESS, bindingEncoding.getAddress().toString());
        String filter = "";
        if (bindingEncoding.getFilterString() != null) {
            filter = bindingEncoding.getFilterString().toString();
        }
        xmlWriter.writeAttribute(XmlDataConstants.QUEUE_BINDING_FILTER_STRING, filter);
        xmlWriter.writeAttribute(XmlDataConstants.QUEUE_BINDING_NAME, bindingEncoding.getQueueName().toString());
        xmlWriter.writeAttribute(XmlDataConstants.QUEUE_BINDING_ID, Long.toString(bindingEncoding.getId()));
        xmlWriter.writeAttribute(XmlDataConstants.QUEUE_BINDING_ROUTING_TYPE, RoutingType.getType(bindingEncoding.getRoutingType()).toString());
        bindingsPrinted++;
    }
    // end BINDINGS_PARENT
    xmlWriter.writeEndElement();
}
Also used : PersistentAddressBindingEncoding(org.apache.activemq.artemis.core.persistence.impl.journal.codec.PersistentAddressBindingEncoding) PersistentQueueBindingEncoding(org.apache.activemq.artemis.core.persistence.impl.journal.codec.PersistentQueueBindingEncoding) SimpleString(org.apache.activemq.artemis.api.core.SimpleString) Map(java.util.Map) HashMap(java.util.HashMap) TreeMap(java.util.TreeMap) RoutingType(org.apache.activemq.artemis.api.core.RoutingType)

Aggregations

PersistentQueueBindingEncoding (org.apache.activemq.artemis.core.persistence.impl.journal.codec.PersistentQueueBindingEncoding)6 SimpleString (org.apache.activemq.artemis.api.core.SimpleString)3 PersistentAddressBindingEncoding (org.apache.activemq.artemis.core.persistence.impl.journal.codec.PersistentAddressBindingEncoding)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 RecordInfo (org.apache.activemq.artemis.core.journal.RecordInfo)2 File (java.io.File)1 InvalidParameterException (java.security.InvalidParameterException)1 LinkedHashMap (java.util.LinkedHashMap)1 LinkedList (java.util.LinkedList)1 Map (java.util.Map)1 TreeMap (java.util.TreeMap)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 XMLStreamException (javax.xml.stream.XMLStreamException)1 ActiveMQBuffer (org.apache.activemq.artemis.api.core.ActiveMQBuffer)1 ActiveMQException (org.apache.activemq.artemis.api.core.ActiveMQException)1 RoutingType (org.apache.activemq.artemis.api.core.RoutingType)1 Filter (org.apache.activemq.artemis.core.filter.Filter)1 Journal (org.apache.activemq.artemis.core.journal.Journal)1 JournalLoadInformation (org.apache.activemq.artemis.core.journal.JournalLoadInformation)1