Compare commits

...

1 Commits

Author SHA1 Message Date
Maksym Sheverda
ea4bee20b4 TESB-28997: Show warning message in case of HTTP/HTTPS port is not 8040 2020-05-13 22:39:17 +03:00
2 changed files with 40 additions and 0 deletions

View File

@@ -3705,6 +3705,9 @@
<ExtraBuildChecker
ExtraBuildChecker="org.talend.repository.ui.wizards.exportjob.extrachecker.LimitESBConsumerJobChecker">
</ExtraBuildChecker>
<ExtraBuildChecker
ExtraBuildChecker="org.talend.repository.ui.wizards.exportjob.extrachecker.EndpointPortJobChecker">
</ExtraBuildChecker>
</extension>
<extension
point="org.talend.core.repository.login.task">

View File

@@ -0,0 +1,37 @@
package org.talend.repository.ui.wizards.exportjob.extrachecker;
import org.eclipse.emf.common.util.EList;
import org.talend.designer.core.model.utils.emf.talendfile.ElementParameterType;
import org.talend.designer.core.model.utils.emf.talendfile.NodeType;
import org.talend.repository.i18n.Messages;
import org.talend.repository.ui.wizards.exportjob.JavaJobScriptsExportWSWizardPage.JobExportType;
public class EndpointPortJobChecker extends AbstractJobNodeChecker {
@Override
String checkNode(JobExportType exportType, NodeType node) {
if("OSGI".equals(exportType)) {
EList elementParameter = node.getElementParameter();
boolean wrongPort = false;
for (Object obj : elementParameter) {
if (!(obj instanceof ElementParameterType)) {
continue;
}
ElementParameterType param = (ElementParameterType) obj;
String name = param.getName();
if ("REST_ENDPOINT".equals(name)) {
String pVal = param.getValue();
if (pVal != null && !pVal.trim().isEmpty() && pVal.contains("://")) {
if (!pVal.contains("8040")) ;
wrongPort = true;
break;
}
}
}
if(wrongPort) {
return Messages.getString("JavaJobScriptsExportWSWizardPage.banServiceJob");
}
}
return null;
}
}