use of org.apache.activemq.artemis.core.server.DivertConfigurationRoutingType in project activemq-artemis by apache.
the class FileConfigurationParser method parseDivertConfiguration.
private void parseDivertConfiguration(final Element e, final Configuration mainConfig) {
String name = e.getAttribute("name");
String routingName = getString(e, "routing-name", null, Validators.NO_CHECK);
String address = getString(e, "address", null, Validators.NOT_NULL_OR_EMPTY);
String forwardingAddress = getString(e, "forwarding-address", null, Validators.NOT_NULL_OR_EMPTY);
boolean exclusive = getBoolean(e, "exclusive", ActiveMQDefaultConfiguration.isDefaultDivertExclusive());
String transformerClassName = getString(e, "transformer-class-name", null, Validators.NO_CHECK);
DivertConfigurationRoutingType routingType = DivertConfigurationRoutingType.valueOf(getString(e, "routing-type", ActiveMQDefaultConfiguration.getDefaultDivertRoutingType(), Validators.DIVERT_ROUTING_TYPE));
TransformerConfiguration transformerConfiguration = null;
String filterString = null;
NodeList children = e.getChildNodes();
for (int j = 0; j < children.getLength(); j++) {
Node child = children.item(j);
if (child.getNodeName().equals("filter")) {
filterString = getAttributeValue(child, "string");
} else if (child.getNodeName().equals("transformer")) {
transformerConfiguration = getTransformerConfiguration(child);
}
}
if (transformerConfiguration == null && transformerClassName != null) {
transformerConfiguration = getTransformerConfiguration(transformerClassName);
}
DivertConfiguration config = new DivertConfiguration().setName(name).setRoutingName(routingName).setAddress(address).setForwardingAddress(forwardingAddress).setExclusive(exclusive).setFilterString(filterString).setTransformerConfiguration(transformerConfiguration).setRoutingType(routingType);
mainConfig.getDivertConfigurations().add(config);
}
Aggregations