Search in sources :

Example 6 with Attribute

use of com.mindbright.security.x509.Attribute in project mule-migration-assistant by mulesoft.

the class IpTagMigrationStep method execute.

@Override
public void execute(Element element, MigrationReport migrationReport) throws RuntimeException {
    element.setNamespace(IP_FILTER_NAMESPACE);
    final List<Content> content = detachContent(element.getContent());
    if (content.size() > 0) {
        element.setAttribute(new Attribute(PolicyMigrationStep.VALUE_ATTR_NAME, (content.get(0)).getValue()));
    }
}
Also used : Attribute(org.jdom2.Attribute) Content(org.jdom2.Content)

Example 7 with Attribute

use of com.mindbright.security.x509.Attribute in project mule-migration-assistant by mulesoft.

the class ProxyRequestHeadersProcessorMigrationStep method execute.

@Override
public void execute(Element element, MigrationReport migrationReport) throws RuntimeException {
    new ProxyPomContributionMigrationStep(true).execute(getApplicationModel().getPomModel().get(), migrationReport);
    addConfigElement(element, migrationReport);
    element.setName(REQUEST_HEADERS);
    element.setNamespace(PROXY_NAMESPACE);
    element.removeAttribute(CLASS);
    element.setAttribute(new Attribute(CONFIG_REF, PROXY_CONFIG));
    element.setAttribute(new Attribute(TARGET, PROXY_REQUEST_HEADERS));
}
Also used : Attribute(org.jdom2.Attribute)

Example 8 with Attribute

use of com.mindbright.security.x509.Attribute in project mule-migration-assistant by mulesoft.

the class ProxyResponseHeadersProcessorMigrationStep method execute.

@Override
public void execute(Element element, MigrationReport migrationReport) throws RuntimeException {
    new ProxyPomContributionMigrationStep(true).execute(getApplicationModel().getPomModel().get(), migrationReport);
    addConfigElement(element, migrationReport);
    element.setName(RESPONSE_HEADERS);
    element.setNamespace(PROXY_NAMESPACE);
    element.removeAttribute(CLASS);
    element.setAttribute(new Attribute(CONFIG_REF, PROXY_CONFIG));
    element.setAttribute(new Attribute(TARGET, PROXY_RESPONSE_HEADERS));
}
Also used : Attribute(org.jdom2.Attribute)

Example 9 with Attribute

use of com.mindbright.security.x509.Attribute in project mule-migration-assistant by mulesoft.

the class AbstractIpFilterMigrationStep method migrateBlacklistWhitelistElement.

protected void migrateBlacklistWhitelistElement(Element element, final String configRefAttrValue) {
    element.setNamespace(IP_FILTER_NAMESPACE);
    element.setAttribute(new Attribute(CONFIG_REF_ATTR_NAME, configRefAttrValue));
    setIpAddressAttribute(element);
    setConfigNameAttribute(element, configRefAttrValue);
    moveBlacklistWhitelistContent(element);
}
Also used : Attribute(org.jdom2.Attribute)

Example 10 with Attribute

use of com.mindbright.security.x509.Attribute in project mule-migration-assistant by mulesoft.

the class OAuth2ProviderCreateClient method execute.

@Override
public void execute(Element element, MigrationReport report) throws RuntimeException {
    final Element cfg = getApplicationModel().getNode("/*/*[namespace-uri() = '" + OAUTH2_PROVIDER_NAMESPACE_URI + "' and local-name() = 'config']");
    element.setAttribute("config-ref", cfg.getAttributeValue("name"));
    migrateExpression(element.getAttribute("clientId"), getExpressionMigrator());
    migrateExpression(element.getAttribute("secret"), getExpressionMigrator());
    migrateExpression(element.getAttribute("type"), getExpressionMigrator());
    migrateExpression(element.getAttribute("principal"), getExpressionMigrator());
    final Element redirectUris = element.getChild("redirect-uris", OAUTH2_PROVIDER_NAMESPACE);
    if (redirectUris != null) {
        final Attribute redirectUrisRef = redirectUris.getAttribute("ref");
        migrateExpression(redirectUrisRef, getExpressionMigrator());
        redirectUrisRef.detach();
        element.setAttribute(redirectUrisRef.setName("redirectUris"));
        redirectUris.detach();
    }
    final Element authorizedGrantTypes = element.getChild("authorized-grant-types", OAUTH2_PROVIDER_NAMESPACE);
    if (authorizedGrantTypes != null) {
        final Attribute authorizedGrantTypesRef = authorizedGrantTypes.getAttribute("ref");
        migrateExpression(authorizedGrantTypesRef, getExpressionMigrator());
        authorizedGrantTypesRef.detach();
        element.setAttribute(authorizedGrantTypesRef.setName("authorizedGrantTypes"));
        authorizedGrantTypes.detach();
    }
    final Element scopes = element.getChild("scopes", OAUTH2_PROVIDER_NAMESPACE);
    if (scopes != null) {
        final Attribute scopesRef = scopes.getAttribute("ref");
        migrateExpression(scopesRef, getExpressionMigrator());
        scopesRef.detach();
        element.setAttribute(scopesRef.setName("scopes"));
        scopes.detach();
    }
}
Also used : Attribute(org.jdom2.Attribute) Element(org.jdom2.Element)

Aggregations

Attribute (org.jdom2.Attribute)316 Element (org.jdom2.Element)210 Attribute (ucar.nc2.Attribute)65 IOException (java.io.IOException)55 ArrayList (java.util.ArrayList)51 Document (org.jdom2.Document)43 Variable (ucar.nc2.Variable)39 List (java.util.List)31 HashMap (java.util.HashMap)25 Namespace (org.jdom2.Namespace)24 File (java.io.File)21 Array (ucar.ma2.Array)21 DataConversionException (org.jdom2.DataConversionException)19 Test (org.junit.Test)19 Dimension (ucar.nc2.Dimension)19 Map (java.util.Map)17 JDOMException (org.jdom2.JDOMException)16 XmlDslUtils.addMigrationAttributeToElement (com.mulesoft.tools.migration.step.util.XmlDslUtils.addMigrationAttributeToElement)15 Editor (jmri.jmrit.display.Editor)15 NamedIcon (jmri.jmrit.catalog.NamedIcon)13