use of com.github.zhenwei.core.asn1.x509.Attribute in project mule-migration-assistant by mulesoft.
the class SoapkitFault method migrateFaultType.
private void migrateFaultType(Element element, MigrationReport report) {
final Attribute faultType = element.getAttribute("faultType");
if (faultType != null) {
final String faultTypeValue = faultType.getValue();
final String[] split = faultTypeValue.split("\\|\\|");
if (split.length <= 0)
throw new RuntimeException("Error parsing 'faultType' value");
final String faultValue;
final String operationValue;
if (split.length == 1) {
report.report(WARN, element, element.getParentElement(), "Cannot find value for 'operation'");
operationValue = "";
faultValue = split[0];
} else {
if (split.length > 2)
report.report(WARN, element, element.getParentElement(), "fault type shouldn't have more than two partes '<Operation>||<FaultType>'. Some data could be lost after migration");
operationValue = split[0];
faultValue = split[1];
}
element.setAttribute("operation", operationValue);
element.setAttribute("fault", faultValue);
element.removeAttribute(faultType);
}
}
use of com.github.zhenwei.core.asn1.x509.Attribute in project mule-migration-assistant by mulesoft.
the class GatewayMigrationStep method removeSchemaLocationNamespace.
protected void removeSchemaLocationNamespace(Element root, String mule3Uri, String mule4Uri) {
Attribute attr = getXSIAttribute(root);
String uri = attr.getValue();
if (uri.contains(mule4Uri)) {
attr.setValue(uri.replace(mule3Uri, EMPTY));
} else {
attr.setValue(uri.replace(mule3Uri, mule4Uri));
}
}
use of com.github.zhenwei.core.asn1.x509.Attribute in project mule-migration-assistant by mulesoft.
the class GatewayMigrationStep method getXSIAttribute.
protected Attribute getXSIAttribute(Element element) {
if (element == null) {
return new Attribute(SCHEMA_LOCATION, MULE_4_XSI_SCHEMA_LOCATION_URI, XSI_NAMESPACE);
}
if (element.getAttribute(SCHEMA_LOCATION, XSI_NAMESPACE) == null) {
Attribute attr = new Attribute(SCHEMA_LOCATION, MULE_4_XSI_SCHEMA_LOCATION_URI, XSI_NAMESPACE);
element.setAttribute(attr);
return attr;
}
return element.getAttribute(SCHEMA_LOCATION, XSI_NAMESPACE);
}
use of com.github.zhenwei.core.asn1.x509.Attribute in project mule-migration-assistant by mulesoft.
the class GatewayMigrationStep method replaceSchemaLocationNamespace.
protected void replaceSchemaLocationNamespace(Element root, String mule3UriXsd, String mule4UriXsd, String mule3Uri, String mule4Uri) {
Attribute attr = getXSIAttribute(root);
setUriValue(attr, attr.getValue(), mule3UriXsd, mule4UriXsd);
setUriValue(attr, attr.getValue(), mule3Uri, mule4Uri);
}
use of com.github.zhenwei.core.asn1.x509.Attribute in project mule-migration-assistant by mulesoft.
the class PolicyMigrationStep method completeMule4Element.
private void completeMule4Element(Element element) {
Element root = getRootElement(element);
root.addNamespaceDeclaration(HTTP_POLICY_NAMESPACE);
Attribute attr = getXSIAttribute(root);
final String uri = attr.getValue();
attr.setValue(new StringBuilder(uri).append(SPACE).append(HTTP_POLICY_XSI_URI).toString());
}
Aggregations