Search in sources :

Example 1 with MULE_4_CORE_NAMESPACE_NO_PREFIX

use of com.mulesoft.tools.migration.library.gateway.steps.GatewayNamespaces.MULE_4_CORE_NAMESPACE_NO_PREFIX in project mule-migration-assistant by mulesoft.

the class AbstractThrottlingMigrationStep method addOnErrorPropagateElement.

protected void addOnErrorPropagateElement(Element errorHandlerElement) {
    List<Element> onErrorPropagateElements = errorHandlerElement.getChildren(ON_ERROR_PROPAGATE_TAG_NAME, MULE_4_CORE_NAMESPACE_NO_PREFIX);
    Element onErrorPropagateElement = getOnErrorPropagateElement();
    if (onErrorPropagateElements.stream().filter(e -> {
        Element addHeadersChildElement = e.getChild(ADD_HEADERS_TAG_NAME, HTTP_TRANSFORM_NAMESPACE);
        return e.getContentSize() == onErrorPropagateElement.getContentSize() && addHeadersChildElement != null && matchesAddHeadersElement(addHeadersChildElement, onErrorPropagateElement.getChild(ADD_HEADERS_TAG_NAME, HTTP_TRANSFORM_NAMESPACE));
    }).findAny().orElse(null) == null) {
        errorHandlerElement.addContent(onErrorPropagateElement);
    }
}
Also used : THROTTLING_MULE_4_NAMESPACE(com.mulesoft.tools.migration.library.gateway.steps.GatewayNamespaces.THROTTLING_MULE_4_NAMESPACE) List(java.util.List) MULE_4_CORE_NAMESPACE_NO_PREFIX(com.mulesoft.tools.migration.library.gateway.steps.GatewayNamespaces.MULE_4_CORE_NAMESPACE_NO_PREFIX) PolicyMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.PolicyMigrationStep) Namespace(org.jdom2.Namespace) HTTP_TRANSFORM_NAMESPACE(com.mulesoft.tools.migration.library.gateway.steps.GatewayNamespaces.HTTP_TRANSFORM_NAMESPACE) Element(org.jdom2.Element) Element(org.jdom2.Element)

Aggregations

HTTP_TRANSFORM_NAMESPACE (com.mulesoft.tools.migration.library.gateway.steps.GatewayNamespaces.HTTP_TRANSFORM_NAMESPACE)1 MULE_4_CORE_NAMESPACE_NO_PREFIX (com.mulesoft.tools.migration.library.gateway.steps.GatewayNamespaces.MULE_4_CORE_NAMESPACE_NO_PREFIX)1 THROTTLING_MULE_4_NAMESPACE (com.mulesoft.tools.migration.library.gateway.steps.GatewayNamespaces.THROTTLING_MULE_4_NAMESPACE)1 PolicyMigrationStep (com.mulesoft.tools.migration.library.gateway.steps.policy.PolicyMigrationStep)1 List (java.util.List)1 Element (org.jdom2.Element)1 Namespace (org.jdom2.Namespace)1