Search in sources :

Example 1 with HTTP_TRANSFORM_NAMESPACE

use of com.mulesoft.tools.migration.library.gateway.steps.GatewayNamespaces.HTTP_TRANSFORM_NAMESPACE 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)

Example 2 with HTTP_TRANSFORM_NAMESPACE

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

the class ValidateClientProcessorChainTagMigrationStep method migrateContent.

@Override
protected void migrateContent(Element errorHandlerElement, List<Content> cloneContentList) {
    Element onErrorContinueElement = new ClientIdEnforcementOnErrorContinueElementWriter().create(errorHandlerElement, false);
    onErrorContinueElement.addContent(0, cloneContentList);
    replaceSetPayloadElement(onErrorContinueElement.getChildren(SET_PAYLOAD_TAG_NAME, MULE_4_POLICY_NAMESPACE).stream().filter(e -> {
        String attrValue = e.getAttributeValue(VALUE_ATTR_NAME);
        return attrValue.equals(VALUE_FLOW_VARS) || attrValue.equals(VALUE_VARS);
    }).findFirst().orElse(null));
    com.mulesoft.tools.migration.library.mule.steps.http.HttpConnectorListener.httpListenerLib(getApplicationModel());
    addNamespaceDeclaration(getRootElement(onErrorContinueElement), HTTP_TRANSFORM_NAMESPACE, HTTP_TRANSFORM_XSI_SCHEMA_LOCATION_URI_MULE4);
}
Also used : MULE_4_POLICY_NAMESPACE(com.mulesoft.tools.migration.library.gateway.steps.GatewayNamespaces.MULE_4_POLICY_NAMESPACE) List(java.util.List) ProcessorChainTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.ProcessorChainTagMigrationStep) ClientIdEnforcementOnErrorContinueElementWriter(com.mulesoft.tools.migration.library.gateway.steps.policy.utils.ClientIdEnforcementOnErrorContinueElementWriter) HTTP_TRANSFORM_NAMESPACE(com.mulesoft.tools.migration.library.gateway.steps.GatewayNamespaces.HTTP_TRANSFORM_NAMESPACE) Content(org.jdom2.Content) Element(org.jdom2.Element) Element(org.jdom2.Element) ClientIdEnforcementOnErrorContinueElementWriter(com.mulesoft.tools.migration.library.gateway.steps.policy.utils.ClientIdEnforcementOnErrorContinueElementWriter)

Aggregations

HTTP_TRANSFORM_NAMESPACE (com.mulesoft.tools.migration.library.gateway.steps.GatewayNamespaces.HTTP_TRANSFORM_NAMESPACE)2 List (java.util.List)2 Element (org.jdom2.Element)2 MULE_4_CORE_NAMESPACE_NO_PREFIX (com.mulesoft.tools.migration.library.gateway.steps.GatewayNamespaces.MULE_4_CORE_NAMESPACE_NO_PREFIX)1 MULE_4_POLICY_NAMESPACE (com.mulesoft.tools.migration.library.gateway.steps.GatewayNamespaces.MULE_4_POLICY_NAMESPACE)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 ProcessorChainTagMigrationStep (com.mulesoft.tools.migration.library.gateway.steps.policy.ProcessorChainTagMigrationStep)1 ClientIdEnforcementOnErrorContinueElementWriter (com.mulesoft.tools.migration.library.gateway.steps.policy.utils.ClientIdEnforcementOnErrorContinueElementWriter)1 Content (org.jdom2.Content)1 Namespace (org.jdom2.Namespace)1