Compare commits
38 Commits
release/7.
...
release/7.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0b6d09fe19 | ||
|
|
95e7b2cec2 | ||
|
|
01749151dc | ||
|
|
6c71d8eef7 | ||
|
|
82048e1057 | ||
|
|
4337618568 | ||
|
|
8d25035ce2 | ||
|
|
cca649e285 | ||
|
|
b70d78cfc4 | ||
|
|
0640bbdec0 | ||
|
|
eee74c58e1 | ||
|
|
33116d41ea | ||
|
|
c81eefda4c | ||
|
|
56a48fa889 | ||
|
|
ab6aa521e7 | ||
|
|
36102a662f | ||
|
|
574312bf7e | ||
|
|
a96a2d3ffa | ||
|
|
e476f16b1d | ||
|
|
107a5cc42d | ||
|
|
773e9b85ec | ||
|
|
8adce7711f | ||
|
|
3f62e44068 | ||
|
|
f5e10343fe | ||
|
|
a2daae515c | ||
|
|
b5240d1762 | ||
|
|
d95d058e75 | ||
|
|
e623b1d136 | ||
|
|
c4dadb8ee9 | ||
|
|
2791c1e35b | ||
|
|
1137336db3 | ||
|
|
29d7c17bbf | ||
|
|
7dde7cf4d0 | ||
|
|
1818864a43 | ||
|
|
4c67a9780a | ||
|
|
9e9f1b3478 | ||
|
|
e6c2ea8bab | ||
|
|
98bbe0416e |
@@ -51,16 +51,17 @@
|
||||
fragment="true"/>
|
||||
|
||||
<plugin
|
||||
id="org.talend.libraries.apache.lucene6"
|
||||
id="org.talend.libraries.apache.lucene8"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"/>
|
||||
version="0.0.0"
|
||||
unpack="true"/>
|
||||
|
||||
<plugin
|
||||
id="org.talend.libraries.apache.lucene4"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
unpack="true"/>
|
||||
|
||||
</feature>
|
||||
|
||||
@@ -114,6 +114,9 @@ public class CommonsPlugin implements BundleActivator {
|
||||
return Boolean.getBoolean("junit_test"); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public static boolean isTUJTest() {
|
||||
return "org.talend.rcp.branding.tuj.product".equals(Platform.getProduct().getId()); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/**
|
||||
* Answer the file associated with name. This handles the case of running as a plugin and running standalone which
|
||||
|
||||
@@ -58,5 +58,6 @@ AS400ResultSet.unknowCloumn=Invalid argument\: unknown column name
|
||||
AS400ResultSet.parameterIndex=Invalid argument\: parameter index
|
||||
AS400ResultSet.outofRange=\ is out of range.
|
||||
ITaCoKitService.exception.multipleInstance=More than one instance found: {0}
|
||||
TalendProxySelector.exception.badProtocolMap=Bad protocol map: {0}
|
||||
TalendProxySelector.exception.badUriMap=Bad uri map: {0}
|
||||
TalendProxySelector.exception.proxySelectionError=Error occurs when selecting proxy for {0}
|
||||
|
||||
|
||||
@@ -30,16 +30,14 @@ public class PasswordEncryptUtil {
|
||||
|
||||
public static final String ENCRYPT_KEY = "Encrypt"; //$NON-NLS-1$
|
||||
|
||||
private static final String RAWKEY = "Talend-Key"; //$NON-NLS-1$
|
||||
|
||||
private static SecretKey key = null;
|
||||
|
||||
private static final SecureRandom SECURERANDOM = new SecureRandom();
|
||||
|
||||
private static SecretKey getSecretKey() throws Exception {
|
||||
if (key == null) {
|
||||
|
||||
byte rawKeyData[] = RAWKEY.getBytes();
|
||||
byte rawKeyData[] = StudioEncryption.getKeySource(StudioEncryption.EncryptionKeyName.MIGRATION.toString(), false)
|
||||
.getKey();
|
||||
DESKeySpec dks = new DESKeySpec(rawKeyData);
|
||||
SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES"); //$NON-NLS-1$
|
||||
key = keyFactory.generateSecret(dks);
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2019 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.commons.utils.network;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.SocketAddress;
|
||||
import java.net.URI;
|
||||
|
||||
import org.talend.commons.CommonsPlugin;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
|
||||
/**
|
||||
* DOC cmeng class global comment. Detailled comment
|
||||
*/
|
||||
public abstract class AbstractProxySelectorProvider implements IProxySelectorProvider {
|
||||
|
||||
private boolean isDebugMode = CommonsPlugin.isDebugMode();
|
||||
|
||||
@Override
|
||||
public Object getKey() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void connectFailed(final URI uri, final SocketAddress sa, final IOException ioe) {
|
||||
if (isDebugMode) {
|
||||
ExceptionHandler.process(ioe);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,13 +10,25 @@
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.updates.runtime.model.interfaces;
|
||||
package org.talend.commons.utils.network;
|
||||
|
||||
import org.talend.updates.runtime.model.ExtraFeature;
|
||||
import java.io.IOException;
|
||||
import java.net.Proxy;
|
||||
import java.net.SocketAddress;
|
||||
import java.net.URI;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* DOC cmeng class global comment. Detailled comment
|
||||
*/
|
||||
public interface IComponentFeature extends ExtraFeature {
|
||||
public interface IProxySelectorProvider {
|
||||
|
||||
Object getKey();
|
||||
|
||||
boolean canHandle(final URI uri);
|
||||
|
||||
List<Proxy> select(final URI uri);
|
||||
|
||||
void connectFailed(final URI uri, final SocketAddress sa, final IOException ioe);
|
||||
|
||||
}
|
||||
@@ -13,6 +13,8 @@
|
||||
package org.talend.commons.utils.network;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.PasswordAuthentication;
|
||||
import java.net.Proxy;
|
||||
import java.net.ProxySelector;
|
||||
import java.net.SocketAddress;
|
||||
@@ -21,15 +23,18 @@ import java.net.URISyntaxException;
|
||||
import java.security.AccessController;
|
||||
import java.security.PrivilegedAction;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Priority;
|
||||
import org.talend.commons.CommonsPlugin;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.i18n.internal.Messages;
|
||||
|
||||
@@ -38,13 +43,37 @@ import org.talend.commons.i18n.internal.Messages;
|
||||
*/
|
||||
public class TalendProxySelector extends ProxySelector {
|
||||
|
||||
public static final String PROP_PRINT_LOGS = "talend.studio.proxy.printLogs";
|
||||
|
||||
private static final String ECLIPSE_PROXY_SELECTOR = ".EclipseProxySelector"; //$NON-NLS-1$
|
||||
|
||||
public static final String PROP_PRINT_LOGS = "talend.studio.proxy.printLogs";
|
||||
private static final String PROP_ALLOW_PROXY_REDIRECT = "talend.studio.proxy.allowProxyRedirect";
|
||||
|
||||
private static final String PROP_ALLOW_PROXY_REDIRECT_EXCLUDE = "talend.studio.proxy.redirect.whiteList";
|
||||
|
||||
private static final String PROP_PROXY_HOST_MAP = "talend.studio.proxy.hostMap";
|
||||
|
||||
private static final String PROP_DISABLE_DEFAULT_SELECTOR = "talend.studio.proxy.disableDefaultSelector";
|
||||
|
||||
/**
|
||||
* Example: update.talend.com,socket:http,https:http;nexus.talend.com,socket,http;,socket:http
|
||||
*/
|
||||
private static final String PROP_PROXY_MAP_HOST_DEFAULT = "";
|
||||
|
||||
/**
|
||||
* Example: svn.company.com;nexus.company.com
|
||||
*/
|
||||
private static final String PROP_ALLOW_PROXY_REDIRECT_EXCLUDE_DEFAULT = "";
|
||||
|
||||
private static final String KEY_DEFAULT = ":default:";
|
||||
|
||||
private ProxySelector defaultSelector;
|
||||
|
||||
final private List<IProxySelectorProvider> selectorProviders;
|
||||
final private Map<Object, Collection<IProxySelectorProvider>> selectorProviders;
|
||||
|
||||
private Map<String, Map<String, String>> hostMap;
|
||||
|
||||
private Set<String> redirectWhiteList;
|
||||
|
||||
private volatile static TalendProxySelector instance;
|
||||
|
||||
@@ -52,11 +81,87 @@ public class TalendProxySelector extends ProxySelector {
|
||||
|
||||
private boolean printProxyLog = false;
|
||||
|
||||
private boolean allowProxyRedirect = false;
|
||||
|
||||
private boolean disableDefaultSelector = false;
|
||||
|
||||
private TalendProxySelector(final ProxySelector defaultSelector) {
|
||||
this.defaultSelector = defaultSelector;
|
||||
selectorProviders = new ArrayList<>();
|
||||
selectorProviders.add(createDefaultProxySelectorProvider());
|
||||
printProxyLog = Boolean.valueOf(System.getProperty(PROP_PRINT_LOGS, "false"));
|
||||
|
||||
selectorProviders = Collections.synchronizedMap(new HashMap<>());
|
||||
allowProxyRedirect = Boolean.valueOf(System.getProperty(PROP_ALLOW_PROXY_REDIRECT, Boolean.FALSE.toString()));
|
||||
disableDefaultSelector = Boolean.valueOf(System.getProperty(PROP_DISABLE_DEFAULT_SELECTOR, Boolean.FALSE.toString()));
|
||||
printProxyLog = Boolean.valueOf(System.getProperty(PROP_PRINT_LOGS, Boolean.FALSE.toString()));
|
||||
|
||||
initHostMap();
|
||||
initRedirectList();
|
||||
}
|
||||
|
||||
private void initHostMap() {
|
||||
try {
|
||||
hostMap = new HashMap<>();
|
||||
String property = System.getProperty(PROP_PROXY_HOST_MAP, PROP_PROXY_MAP_HOST_DEFAULT);
|
||||
if (StringUtils.isEmpty(property)) {
|
||||
return;
|
||||
}
|
||||
String[] splits = property.split(";");
|
||||
for (String split : splits) {
|
||||
try {
|
||||
int index = split.indexOf(',');
|
||||
String uri = split.substring(0, index);
|
||||
String key = StringUtils.strip(uri);
|
||||
if (StringUtils.isBlank(key)) {
|
||||
key = KEY_DEFAULT;
|
||||
}
|
||||
key = key.toLowerCase();
|
||||
Map<String, String> protocolMap = hostMap.get(key);
|
||||
if (protocolMap == null) {
|
||||
protocolMap = new HashMap<>();
|
||||
hostMap.put(key, protocolMap);
|
||||
}
|
||||
int protocolMapIndex = index + 1;
|
||||
String protocolMapStr = split.substring(protocolMapIndex);
|
||||
String[] entry = protocolMapStr.split(",");
|
||||
for (String pMap : entry) {
|
||||
try {
|
||||
String[] mapEntry = pMap.split(":");
|
||||
if (mapEntry.length != 2) {
|
||||
ExceptionHandler.process(
|
||||
new Exception(Messages.getString("TalendProxySelector.exception.badUriMap", pMap)));
|
||||
continue;
|
||||
}
|
||||
protocolMap.put(mapEntry[0].toLowerCase(), mapEntry[1].toLowerCase());
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
private void initRedirectList() {
|
||||
try {
|
||||
redirectWhiteList = new HashSet<>();
|
||||
String property = System.getProperty(PROP_ALLOW_PROXY_REDIRECT_EXCLUDE, PROP_ALLOW_PROXY_REDIRECT_EXCLUDE_DEFAULT);
|
||||
if (StringUtils.isEmpty(property)) {
|
||||
return;
|
||||
}
|
||||
String[] split = property.split(";");
|
||||
for (String host : split) {
|
||||
host = StringUtils.strip(host);
|
||||
if (StringUtils.isBlank(host)) {
|
||||
host = KEY_DEFAULT;
|
||||
}
|
||||
redirectWhiteList.add(host);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static TalendProxySelector getInstance() {
|
||||
@@ -94,8 +199,109 @@ public class TalendProxySelector extends ProxySelector {
|
||||
|
||||
@Override
|
||||
public List<Proxy> select(final URI uri) {
|
||||
final Set<Proxy> resultFromProviders = new HashSet<>();
|
||||
List<IProxySelectorProvider> providers = getProxySelectorProviders();
|
||||
Set<Proxy> results = new LinkedHashSet<>();
|
||||
|
||||
try {
|
||||
final Set<Proxy> resultFromProviders = getProxysFromProviders(uri);
|
||||
if (resultFromProviders != null && !resultFromProviders.isEmpty()) {
|
||||
results.addAll(resultFromProviders);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
|
||||
ProxySelector defaultProxySelector = getDefaultProxySelector();
|
||||
if (defaultProxySelector != null) {
|
||||
URI newUri = getNewUri(uri);
|
||||
List<Proxy> defaultProxys = defaultProxySelector.select(newUri);
|
||||
try {
|
||||
results.addAll(filterProxys(uri, defaultProxys));
|
||||
} catch (Exception e) {
|
||||
results.addAll(defaultProxys);
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
if (printProxyLog) {
|
||||
String proxys = results.toString();
|
||||
ExceptionHandler.log("Selected proxys for " + uri + ", " + proxys);
|
||||
ExceptionHandler.process(new Exception("Proxy call stacks"), Priority.INFO);
|
||||
}
|
||||
return new LinkedList<Proxy>(results);
|
||||
}
|
||||
|
||||
private List<Proxy> filterProxys(final URI uri, List<Proxy> defaultProxys) {
|
||||
List<Proxy> result = new ArrayList<>();
|
||||
if (defaultProxys != null && !defaultProxys.isEmpty()) {
|
||||
for (Proxy proxy : defaultProxys) {
|
||||
SocketAddress addr = null;
|
||||
Proxy.Type proxyType = null;
|
||||
if (proxy != null) {
|
||||
proxyType = proxy.type();
|
||||
addr = proxy.address();
|
||||
}
|
||||
|
||||
boolean redirect = true;
|
||||
if (!allowProxyRedirect) {
|
||||
String host = uri.getHost();
|
||||
if (host == null) {
|
||||
host = "";
|
||||
}
|
||||
host = StringUtils.strip(host).toLowerCase();
|
||||
if (this.redirectWhiteList.contains(host) || this.redirectWhiteList.contains(KEY_DEFAULT)) {
|
||||
redirect = true;
|
||||
} else if (Proxy.Type.DIRECT == proxyType
|
||||
|| (addr != null && StringUtils.equals(uri.getHost(), ((InetSocketAddress) addr).getHostString()))) {
|
||||
redirect = false;
|
||||
}
|
||||
}
|
||||
if (redirect) {
|
||||
result.add(proxy);
|
||||
} else {
|
||||
result.add(Proxy.NO_PROXY);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private URI getNewUri(URI uri) {
|
||||
URI newUri = uri;
|
||||
if (newUri != null) {
|
||||
String host = newUri.getHost();
|
||||
Map<String, String> protocolMap = null;
|
||||
if (StringUtils.isNotBlank(host)) {
|
||||
protocolMap = hostMap.get(host.toLowerCase());
|
||||
}
|
||||
if (protocolMap == null) {
|
||||
protocolMap = hostMap.get(KEY_DEFAULT);
|
||||
}
|
||||
|
||||
if (protocolMap != null) {
|
||||
String schema = newUri.getScheme();
|
||||
if (schema != null) {
|
||||
String lowercasedProtocol = schema.toLowerCase();
|
||||
String preferedProtocol = protocolMap.get(lowercasedProtocol);
|
||||
if (StringUtils.isNotBlank(preferedProtocol)) {
|
||||
try {
|
||||
newUri = new URI(preferedProtocol, newUri.getUserInfo(), newUri.getHost(), newUri.getPort(),
|
||||
newUri.getPath(), newUri.getQuery(), newUri.getFragment());
|
||||
} catch (URISyntaxException e) {
|
||||
if (printProxyLog) {
|
||||
ExceptionHandler.process(new Exception(
|
||||
Messages.getString("TalendProxySelector.exception.proxySelectionError", newUri), e),
|
||||
Priority.WARN);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return newUri;
|
||||
}
|
||||
|
||||
private Set<Proxy> getProxysFromProviders(final URI uri) {
|
||||
final Set<Proxy> resultFromProviders = new LinkedHashSet<>();
|
||||
Collection<IProxySelectorProvider> providers = getCustomProviders(uri);
|
||||
if (providers != null) {
|
||||
providers.stream().forEach(p -> {
|
||||
if (instance == p) {
|
||||
@@ -113,41 +319,79 @@ public class TalendProxySelector extends ProxySelector {
|
||||
}
|
||||
});
|
||||
}
|
||||
List<Proxy> result = new ArrayList<>();
|
||||
return resultFromProviders;
|
||||
}
|
||||
|
||||
if (resultFromProviders != null && !resultFromProviders.isEmpty()) {
|
||||
result.addAll(resultFromProviders);
|
||||
}
|
||||
|
||||
ProxySelector defaultProxySelector = getDefaultProxySelector();
|
||||
if (defaultProxySelector != null) {
|
||||
List<Proxy> defaultProxys = defaultProxySelector.select(uri);
|
||||
if (defaultProxys != null && !defaultProxys.isEmpty()) {
|
||||
result.addAll(defaultProxys);
|
||||
private Collection<IProxySelectorProvider> getCustomProviders(final URI uri) {
|
||||
Collection<IProxySelectorProvider> providers = Collections.EMPTY_LIST;
|
||||
Collection<Object> possibleKeys = getPossibleKeys(uri);
|
||||
for (Object key : possibleKeys) {
|
||||
providers = this.selectorProviders.get(key);
|
||||
if (providers != null) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (printProxyLog) {
|
||||
String proxys = result.toString();
|
||||
ExceptionHandler.log("Selected proxys for " + uri + ", " + proxys);
|
||||
ExceptionHandler.process(new Exception("Proxy call stacks"), Priority.INFO);
|
||||
return providers;
|
||||
}
|
||||
|
||||
public PasswordAuthentication getHttpPasswordAuthentication() {
|
||||
String[] schemas = new String[] { "http", "https" };
|
||||
for (String schema : schemas) {
|
||||
String proxyUser = System.getProperty(schema + ".proxyUser");
|
||||
String proxyPassword = System.getProperty(schema + ".proxyPassword");
|
||||
|
||||
if (StringUtils.isNotBlank(proxyUser)) {
|
||||
char[] pwdChars = new char[0];
|
||||
if (proxyPassword != null && !proxyPassword.isEmpty()) {
|
||||
pwdChars = proxyPassword.toCharArray();
|
||||
}
|
||||
return new PasswordAuthentication(proxyUser, pwdChars);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean addProxySelectorProvider(IProxySelectorProvider provider) {
|
||||
List<IProxySelectorProvider> proxySelectorProviders = getProxySelectorProviders();
|
||||
if (!proxySelectorProviders.contains(provider)) {
|
||||
return proxySelectorProviders.add(provider);
|
||||
try {
|
||||
Object key = provider.getKey();
|
||||
Collection<IProxySelectorProvider> collection = this.selectorProviders.get(key);
|
||||
if (collection == null) {
|
||||
synchronized (this.selectorProviders) {
|
||||
collection = this.selectorProviders.get(key);
|
||||
if (collection == null) {
|
||||
collection = Collections.synchronizedList(new LinkedList<>());
|
||||
this.selectorProviders.put(key, collection);
|
||||
}
|
||||
}
|
||||
}
|
||||
collection.add(provider);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean removeProxySelectorProvider(IProxySelectorProvider provider) {
|
||||
return getProxySelectorProviders().remove(provider);
|
||||
}
|
||||
|
||||
private List<IProxySelectorProvider> getProxySelectorProviders() {
|
||||
return selectorProviders;
|
||||
try {
|
||||
Object key = provider.getKey();
|
||||
Collection<IProxySelectorProvider> collection = this.selectorProviders.get(key);
|
||||
if (collection != null) {
|
||||
synchronized (this.selectorProviders) {
|
||||
collection = this.selectorProviders.get(key);
|
||||
if (collection != null) {
|
||||
collection.remove(provider);
|
||||
if (collection.isEmpty()) {
|
||||
this.selectorProviders.remove(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public ProxySelector getDefaultProxySelector() {
|
||||
@@ -160,7 +404,7 @@ public class TalendProxySelector extends ProxySelector {
|
||||
|
||||
@Override
|
||||
public void connectFailed(final URI uri, final SocketAddress sa, final IOException ioe) {
|
||||
List<IProxySelectorProvider> providers = getProxySelectorProviders();
|
||||
Collection<IProxySelectorProvider> providers = getCustomProviders(uri);
|
||||
if (providers != null) {
|
||||
providers.stream().forEach(p -> {
|
||||
if (p.canHandle(uri)) {
|
||||
@@ -175,101 +419,111 @@ public class TalendProxySelector extends ProxySelector {
|
||||
}
|
||||
}
|
||||
|
||||
public static abstract class AbstractProxySelectorProvider implements IProxySelectorProvider {
|
||||
public IProxySelectorProvider createDefaultProxySelectorProvider() {
|
||||
if (disableDefaultSelector) {
|
||||
return null;
|
||||
}
|
||||
return new DefaultProxySelectorProvider(Thread.currentThread());
|
||||
}
|
||||
|
||||
private boolean isDebugMode = CommonsPlugin.isDebugMode();
|
||||
public IProxySelectorProvider createDefaultProxySelectorProvider(String host) {
|
||||
if (disableDefaultSelector) {
|
||||
return null;
|
||||
}
|
||||
return new DefaultProxySelectorProvider(host);
|
||||
}
|
||||
|
||||
public static Collection<Object> getPossibleKeys(URI uri) {
|
||||
Collection<Object> possibleKeys = new ArrayList<>();
|
||||
possibleKeys.add(Thread.currentThread());
|
||||
if (uri != null) {
|
||||
String uriHost = uri.getHost();
|
||||
if (StringUtils.isNotBlank(uriHost)) {
|
||||
possibleKeys.add(uriHost);
|
||||
}
|
||||
}
|
||||
return possibleKeys;
|
||||
}
|
||||
|
||||
private class DefaultProxySelectorProvider extends AbstractProxySelectorProvider {
|
||||
|
||||
private Thread currentThread = null;
|
||||
|
||||
private String host = null;
|
||||
|
||||
public DefaultProxySelectorProvider(Thread thread) {
|
||||
this.currentThread = thread;
|
||||
}
|
||||
|
||||
public DefaultProxySelectorProvider(String host) {
|
||||
this.host = host;
|
||||
if (StringUtils.isNotBlank(this.host)) {
|
||||
this.host = this.host.toLowerCase();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void connectFailed(final URI uri, final SocketAddress sa, final IOException ioe) {
|
||||
if (isDebugMode) {
|
||||
ExceptionHandler.process(ioe);
|
||||
public Object getKey() {
|
||||
if (this.currentThread != null) {
|
||||
return currentThread;
|
||||
}
|
||||
if (this.host != null) {
|
||||
return this.host;
|
||||
}
|
||||
return super.getKey();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHandle(URI uri) {
|
||||
if (disableDefaultSelector) {
|
||||
return false;
|
||||
}
|
||||
if (currentThread != null && Thread.currentThread() == currentThread) {
|
||||
return true;
|
||||
}
|
||||
if (host != null) {
|
||||
if (uri == null) {
|
||||
return false;
|
||||
}
|
||||
String uriHost = uri.getHost();
|
||||
if (StringUtils.isNotBlank(uriHost)) {
|
||||
return this.host.equals(uriHost.toLowerCase());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Proxy> select(URI uri) {
|
||||
List<Proxy> result = new ArrayList<>();
|
||||
try {
|
||||
ProxySelector defaultProxySelector = getDefaultProxySelector();
|
||||
if (defaultProxySelector != null) {
|
||||
List<Proxy> defaultProxys = defaultProxySelector.select(uri);
|
||||
if (defaultProxys != null && !defaultProxys.isEmpty()) {
|
||||
for (Proxy proxy : defaultProxys) {
|
||||
SocketAddress addr = null;
|
||||
Proxy.Type proxyType = null;
|
||||
if (proxy != null) {
|
||||
proxyType = proxy.type();
|
||||
addr = proxy.address();
|
||||
}
|
||||
if (Proxy.Type.DIRECT == proxyType || (addr != null
|
||||
&& StringUtils.equals(uri.getHost(), ((InetSocketAddress) addr).getHostString()))) {
|
||||
result.add(Proxy.NO_PROXY);
|
||||
} else {
|
||||
result.add(proxy);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static interface IProxySelectorProvider {
|
||||
|
||||
boolean canHandle(final URI uri);
|
||||
|
||||
List<Proxy> select(final URI uri);
|
||||
|
||||
void connectFailed(final URI uri, final SocketAddress sa, final IOException ioe);
|
||||
|
||||
}
|
||||
|
||||
private IProxySelectorProvider createDefaultProxySelectorProvider() {
|
||||
IProxySelectorProvider proxySelectorProvider = new TalendProxySelector.AbstractProxySelectorProvider() {
|
||||
|
||||
private static final String PROP_PROXY_MAP = "talend.studio.proxy.protocol.map";
|
||||
|
||||
private static final String PROP_PROXY_MAP_DEFAULT = "socket:https,";
|
||||
|
||||
private Map<String, String> protocolMap;
|
||||
|
||||
{
|
||||
|
||||
try {
|
||||
protocolMap = new HashMap<>();
|
||||
String property = System.getProperty(PROP_PROXY_MAP, PROP_PROXY_MAP_DEFAULT);
|
||||
String[] splits = property.split(",");
|
||||
for (String split : splits) {
|
||||
String[] entry = split.split(":");
|
||||
if (entry.length != 2) {
|
||||
ExceptionHandler.process(
|
||||
new Exception(Messages.getString("TalendProxySelector.exception.badProtocolMap", split)));
|
||||
continue;
|
||||
}
|
||||
protocolMap.put(entry[0], entry[1]);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Proxy> select(URI uri) {
|
||||
// return Collections.EMPTY_LIST;
|
||||
|
||||
List<Proxy> newProxys = new ArrayList<>();
|
||||
if (uri == null) {
|
||||
return newProxys;
|
||||
}
|
||||
|
||||
String schema = uri.getScheme();
|
||||
if (schema != null) {
|
||||
String lowercasedProtocol = schema.toLowerCase();
|
||||
String preferedProtocol = protocolMap.get(lowercasedProtocol);
|
||||
if (StringUtils.isNotBlank(preferedProtocol)) {
|
||||
try {
|
||||
URI newUri = new URI(preferedProtocol, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(),
|
||||
uri.getQuery(), uri.getFragment());
|
||||
List<Proxy> proxys = getDefaultProxySelector().select(newUri);
|
||||
if (proxys != null && !proxys.isEmpty()) {
|
||||
newProxys.addAll(proxys);
|
||||
}
|
||||
} catch (URISyntaxException e) {
|
||||
if (printProxyLog) {
|
||||
ExceptionHandler.process(
|
||||
new Exception(
|
||||
Messages.getString("TalendProxySelector.exception.proxySelectionError", uri), e),
|
||||
Priority.WARN);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return newProxys;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHandle(URI uri) {
|
||||
return true;
|
||||
}
|
||||
|
||||
};
|
||||
return proxySelectorProvider;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -215,8 +215,18 @@ public interface IRepositoryFactory {
|
||||
public void deleteObjectPhysical(Project project, IRepositoryViewObject objToDelete, String version,
|
||||
boolean fromEmptyRecycleBin, boolean isDeleteOnRemote) throws PersistenceException;
|
||||
|
||||
public void batchDeleteObjectPhysical(Project project, List<IRepositoryViewObject> objToDeleteList, boolean isDeleteOnRemote)
|
||||
throws PersistenceException;
|
||||
/**
|
||||
*
|
||||
* Batch delete the object of the given object list.
|
||||
*
|
||||
* @param project - The object's project.
|
||||
* @param objToDeleteList - The objects list.
|
||||
* @param isDeleteAllVersion - True: delete all version by object id; False: delete object by id and version.
|
||||
* @param isDeleteOnRemote
|
||||
* @throws PersistenceException
|
||||
*/
|
||||
public void batchDeleteObjectPhysical(Project project, List<IRepositoryViewObject> objToDeleteList,
|
||||
boolean isDeleteAllVersion, boolean isDeleteOnRemote) throws PersistenceException;
|
||||
|
||||
/**
|
||||
* Restore a logically deleted object. <code>isDeleted</code> on this object will now returned <code>false</code>.
|
||||
|
||||
@@ -774,6 +774,20 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
log.info(Messages.getString("ProxyRepositoryFactory.log.physicalDeletion", str)); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.talend.repository.model.IProxyRepositoryFactory#forceBatchDeleteObjectPhysical(org.talend.core.model.general.
|
||||
* Project, java.util.List, boolean, boolean)
|
||||
*/
|
||||
@Override
|
||||
public void forceBatchDeleteObjectPhysical(Project project, List<IRepositoryViewObject> objToDeleteList,
|
||||
boolean isDeleteAllVersion, boolean isDeleteOnRemote) throws PersistenceException {
|
||||
this.repositoryFactoryFromProvider.batchDeleteObjectPhysical(project, objToDeleteList, isDeleteAllVersion,
|
||||
isDeleteOnRemote);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
@@ -932,7 +946,7 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
.getService(IRunProcessService.class);
|
||||
service.batchDeleteAllVersionTalendJobProject(idList);
|
||||
}
|
||||
this.repositoryFactoryFromProvider.batchDeleteObjectPhysical(project, repositoryObjectList, false);
|
||||
this.repositoryFactoryFromProvider.batchDeleteObjectPhysical(project, repositoryObjectList, true, false);
|
||||
|
||||
// save project will handle git/svn update
|
||||
this.repositoryFactoryFromProvider.saveProject(project);
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
<dbType type="CHAR"/>
|
||||
<dbType type="NCHAR"/>
|
||||
<dbType type="LONG"/>
|
||||
<dbtype type="CLOB"/>
|
||||
<dbType type="CLOB"/>
|
||||
</talendType>
|
||||
</talendToDbTypes>
|
||||
<dbToTalendTypes><!-- Adviced mappings -->
|
||||
|
||||
@@ -208,8 +208,12 @@ public interface ILibraryManagerService extends IService {
|
||||
*/
|
||||
public boolean isJarNeedToBeDeployed(File jarFile);
|
||||
|
||||
public boolean isSameFile(File f1, File f2);
|
||||
|
||||
public void checkModuleStatus(ModuleNeeded module);
|
||||
|
||||
public String getJarNameFromMavenuri(String mavenURI);
|
||||
|
||||
public void guessMavenRUIFromIndex(File jarFile, Map<String, String> sourceAndMavenUri);
|
||||
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ public enum EParameterFieldType {
|
||||
TEXT,
|
||||
TEXT_AREA,
|
||||
PASSWORD,
|
||||
LICENSEKEY, // xqliu TDQ-17742
|
||||
MEMO_SQL,
|
||||
MEMO_PERL,
|
||||
MEMO_JAVA,
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
package org.talend.core.model.routines;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
@@ -31,9 +32,12 @@ import org.osgi.framework.Bundle;
|
||||
import org.talend.commons.utils.resource.FileExtensions;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.ILibraryManagerService;
|
||||
import org.talend.core.ISVNProviderServiceInCoreRuntime;
|
||||
import org.talend.core.PluginChecker;
|
||||
import org.talend.core.model.general.LibraryInfo;
|
||||
import org.talend.core.nexus.ArtifactRepositoryBean;
|
||||
import org.talend.core.nexus.TalendLibsServerManager;
|
||||
import org.talend.core.runtime.maven.MavenArtifact;
|
||||
import org.talend.core.runtime.maven.MavenConstants;
|
||||
import org.talend.core.runtime.maven.MavenUrlHelper;
|
||||
|
||||
/**
|
||||
* wchen class global comment. Detailled comment
|
||||
@@ -96,9 +100,12 @@ public class RoutineLibraryMananger {
|
||||
try {
|
||||
URL fileUrl = FileLocator.toFileURL(entry);
|
||||
if(fileUrl != null){
|
||||
if (!"file".equals(fileUrl.getProtocol())) throw new IllegalArgumentException();
|
||||
URI fileUri = new File(fileUrl.getFile()).toURI();
|
||||
libManagerService.deploy(fileUri);
|
||||
if (!"file".equals(fileUrl.getProtocol())) throw new IllegalArgumentException();
|
||||
File file = new File(fileUrl.getFile());
|
||||
if (needDeploy(fileUrl)) {
|
||||
URI fileUri = file.toURI();
|
||||
libManagerService.deploy(fileUri);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("Cannot deploy: " + bundleName + path);
|
||||
@@ -114,6 +121,56 @@ public class RoutineLibraryMananger {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean needDeploy(URL fileUrl) throws IOException, Exception {
|
||||
File file = new File(fileUrl.getFile());
|
||||
ILibraryManagerService libManagerService = null;
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(ILibraryManagerService.class)) {
|
||||
libManagerService = (ILibraryManagerService) GlobalServiceRegister.getDefault()
|
||||
.getService(ILibraryManagerService.class);
|
||||
}
|
||||
if (libManagerService != null) {
|
||||
Map<String, String> sourceAndMavenUri = new HashMap<>();
|
||||
libManagerService.guessMavenRUIFromIndex(file, sourceAndMavenUri);
|
||||
String mavUri = null;
|
||||
boolean isSnapshot = false;
|
||||
for (String key : sourceAndMavenUri.keySet()) {
|
||||
if (sourceAndMavenUri.get(key).equals(file.getPath())) {
|
||||
mavUri = key;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (mavUri == null) {
|
||||
return true;
|
||||
}
|
||||
final MavenArtifact parseMvnUrl = MavenUrlHelper.parseMvnUrl(mavUri);
|
||||
if (parseMvnUrl != null) {
|
||||
if (parseMvnUrl.getVersion() != null && parseMvnUrl.getVersion().endsWith(MavenConstants.SNAPSHOT)) {
|
||||
isSnapshot = true;
|
||||
}
|
||||
}
|
||||
TalendLibsServerManager manager = TalendLibsServerManager.getInstance();
|
||||
ArtifactRepositoryBean customNexusServer = manager.getCustomNexusServer();
|
||||
File jarFile = null;
|
||||
try {
|
||||
jarFile = libManagerService.resolveJar(customNexusServer, mavUri);
|
||||
} catch (Exception ex) {
|
||||
// Ignore here
|
||||
}
|
||||
boolean exist = (jarFile != null && jarFile.exists());
|
||||
if (exist) {
|
||||
if (isSnapshot) {
|
||||
boolean isSame = libManagerService.isSameFile(jarFile, file);
|
||||
if (!isSame) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public Map<String, List<LibraryInfo>> getRoutineAndJars() {
|
||||
if (routineAndJars == null) {
|
||||
routineAndJars = new HashMap<String, List<LibraryInfo>>();
|
||||
|
||||
@@ -866,132 +866,6 @@ public class NodeUtil {
|
||||
}
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
|
||||
public static String getRuntimeParameterValue(INode node, IElementParameter ep) {
|
||||
if (EParameterFieldType.TABLE.equals(ep.getFieldType())) {
|
||||
Map<String, IElementParameter> types = new HashMap<String, IElementParameter>();
|
||||
Object[] itemsValue = ep.getListItemsValue();
|
||||
if (itemsValue != null) {
|
||||
for (Object o : itemsValue) {
|
||||
IElementParameter cep = (IElementParameter) o;
|
||||
if (cep.isShow(node.getElementParameters())) {
|
||||
types.put(cep.getName(), cep);
|
||||
}
|
||||
}
|
||||
}
|
||||
List<Map<String, String>> lines = (List<Map<String, String>>) ElementParameterParser.getObjectValue(node,
|
||||
"__" + ep.getName() + "__");
|
||||
StringBuilder value = new StringBuilder();
|
||||
// implement List & Map toString(), different is the value of Map
|
||||
Iterator<Map<String, String>> linesIter = lines.iterator();
|
||||
if (!linesIter.hasNext()) {
|
||||
return "\"[]\"";
|
||||
}
|
||||
value.append("new StringBuilder().append(\"[");
|
||||
for (;;) {
|
||||
Map<String, String> columns = linesIter.next();
|
||||
Iterator<Entry<String, String>> columnsIter = columns.entrySet().iterator();
|
||||
|
||||
value.append("{");
|
||||
Entry<String, String> column = null;
|
||||
boolean printedColumnExist = false;
|
||||
while (columnsIter.hasNext()) {
|
||||
column = columnsIter.next();
|
||||
if (types.get(column.getKey()) == null) {
|
||||
continue;
|
||||
}
|
||||
printedColumnExist = true;
|
||||
|
||||
value.append(column.getKey());
|
||||
value.append("=\").append(");
|
||||
value.append(getRuntimeParameterValue(column.getValue(), types.get(column.getKey()), true));
|
||||
value.append(").append(\"");
|
||||
|
||||
if (columnsIter.hasNext()) {
|
||||
value.append(", ");
|
||||
}
|
||||
}
|
||||
if (printedColumnExist && column != null && (types.get(column.getKey()) == null)) {
|
||||
value.setLength(value.length() - 2);
|
||||
}
|
||||
value.append("}");
|
||||
|
||||
if (!linesIter.hasNext()) {
|
||||
return value.append("]\").toString()").toString();
|
||||
}
|
||||
value.append(",").append(" ");
|
||||
}
|
||||
} else {
|
||||
String value = ElementParameterParser.getValue(node, "__" + ep.getName() + "__");
|
||||
if (EParameterFieldType.TABLE_BY_ROW.equals(ep.getFieldType())) {
|
||||
value = ep.getValue().toString();
|
||||
}
|
||||
return getRuntimeParameterValue(value, ep, false);
|
||||
}
|
||||
}
|
||||
|
||||
private static String getRuntimeParameterValue(String value, IElementParameter ep, boolean itemFromTable) {
|
||||
if (value == null) {
|
||||
value = "";
|
||||
}
|
||||
|
||||
List<EParameterFieldType> needRemoveCRLFList = Arrays.asList(EParameterFieldType.MEMO, EParameterFieldType.MEMO_JAVA,
|
||||
EParameterFieldType.MEMO_SQL, EParameterFieldType.MEMO_IMPORT, EParameterFieldType.MEMO_MESSAGE);
|
||||
if (needRemoveCRLFList.contains(ep.getFieldType())) {
|
||||
value = value.replaceAll("[\r\n]", " ");
|
||||
}
|
||||
List<EParameterFieldType> needQuoteList = Arrays.asList(EParameterFieldType.CLOSED_LIST,
|
||||
EParameterFieldType.COMPONENT_LIST, EParameterFieldType.COLUMN_LIST, EParameterFieldType.PREV_COLUMN_LIST,
|
||||
EParameterFieldType.CONNECTION_LIST, EParameterFieldType.LOOKUP_COLUMN_LIST,
|
||||
EParameterFieldType.CONTEXT_PARAM_NAME_LIST, EParameterFieldType.PROCESS_TYPE, EParameterFieldType.COLOR,
|
||||
EParameterFieldType.TABLE_BY_ROW, EParameterFieldType.HADOOP_JARS_DIALOG, EParameterFieldType.UNIFIED_COMPONENTS);
|
||||
List<EParameterFieldType> needQuoteListForItem = itemFromTable ? Arrays.asList(EParameterFieldType.SCHEMA_TYPE,
|
||||
EParameterFieldType.SAP_SCHEMA_TYPE, EParameterFieldType.MODULE_LIST) : new ArrayList<EParameterFieldType>();
|
||||
// TODO: add RAW attribute when SCHEMA_COLUMN generated by BASED_ON_SCHEMA
|
||||
List<String> needQuoteListByName = Arrays.asList("SCHEMA_COLUMN");// SCHEMA_COLUMN for BASED_ON_SCHEMA="true"
|
||||
|
||||
if (needQuoteList.contains(ep.getFieldType()) || needQuoteListForItem.contains(ep.getFieldType())
|
||||
|| needQuoteListByName.contains(ep.getName()) || ep.isRaw()) {
|
||||
value = value.replaceAll("\\\\", "\\\\\\\\");
|
||||
value = value.replaceAll("\\\"", "\\\\\\\"");
|
||||
value = "\"" + value + "\"";
|
||||
}
|
||||
|
||||
if (itemFromTable) {
|
||||
if ("*".equals(value)) {
|
||||
value = "\"" + value + "\"";
|
||||
}
|
||||
if (value != null && value.endsWith(";")) {
|
||||
value = value.substring(0, value.length() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
// copied it from Log4jFileUtil.javajet but need more comment for this script
|
||||
if (value == null || "".equals(value.trim())) {// for the value which empty
|
||||
value = "\"\"";
|
||||
} else if ("\"\\n\"".equals(value) || "\"\\r\"".equals(value) || "\"\\r\\n\"".equals(value)) {
|
||||
// for the value is "\n" "\r" "\r\n"
|
||||
value = value.replaceAll("\\\\", "\\\\\\\\");
|
||||
} else if ("\"\"\"".equals(value)) {
|
||||
value = "\"" + "\\" + "\"" + "\"";
|
||||
} else if ("\"\"\\r\\n\"\"".equals(value)) {
|
||||
value = "\"\\\\r\\\\n\"";
|
||||
} else if ("\"\"\\r\"\"".equals(value)) {
|
||||
value = "\"\\\\r\"";
|
||||
} else if ("\"\"\\n\"\"".equals(value)) {
|
||||
value = "\"\\\\n\"";
|
||||
}
|
||||
// ftom 20141008 - patch to fix javajet compilation errors due to hard-coded studio TableEditor mechanism
|
||||
// linked to BUILDIN properties checks, this item is a boolean set to TRUE or FALSE
|
||||
// fix is just transforming into true or false to make logging OK
|
||||
else if ("BUILDIN".equals(ep.getName())) {
|
||||
value = value.toLowerCase();
|
||||
} else if (value.endsWith("*")) {
|
||||
value = value.substring(0, value.length() - 1) + "\"*\"";
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
public static String getNormalizeParameterValue(INode node, IElementParameter ep) {
|
||||
if (EParameterFieldType.TABLE.equals(ep.getFieldType())) {
|
||||
|
||||
@@ -12,14 +12,12 @@
|
||||
// ============================================================================
|
||||
package org.talend.core.nexus;
|
||||
|
||||
import java.net.Authenticator;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.PasswordAuthentication;
|
||||
import java.net.Proxy;
|
||||
import java.net.Proxy.Type;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
@@ -37,9 +35,8 @@ import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
import org.eclipse.core.runtime.OperationCanceledException;
|
||||
import org.talend.commons.exception.BusinessException;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.utils.network.IProxySelectorProvider;
|
||||
import org.talend.commons.utils.network.TalendProxySelector;
|
||||
import org.talend.commons.utils.network.TalendProxySelector.IProxySelectorProvider;
|
||||
import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
import org.talend.core.runtime.maven.MavenArtifact;
|
||||
import org.talend.core.runtime.maven.MavenUrlHelper;
|
||||
@@ -167,7 +164,7 @@ public abstract class HttpClientTransport {
|
||||
}
|
||||
}
|
||||
|
||||
private IProxySelectorProvider addProxy(final DefaultHttpClient httpClient, URI requestURI) {
|
||||
public static IProxySelectorProvider addProxy(final DefaultHttpClient httpClient, URI requestURI) {
|
||||
IProxySelectorProvider proxySelectorProvider = null;
|
||||
try {
|
||||
if (Boolean.valueOf(System.getProperty(PROP_PROXY_HTTP_CLIENT_USE_DEFAULT_SETTINGS, Boolean.FALSE.toString()))) {
|
||||
@@ -185,10 +182,10 @@ public abstract class HttpClientTransport {
|
||||
}
|
||||
final Proxy finalProxy = usedProxy;
|
||||
InetSocketAddress address = (InetSocketAddress) finalProxy.address();
|
||||
String proxyServer = address.getHostName();
|
||||
String proxyServer = address.getHostString();
|
||||
int proxyPort = address.getPort();
|
||||
PasswordAuthentication proxyAuthentication = Authenticator.requestPasswordAuthentication(proxyServer,
|
||||
address.getAddress(), proxyPort, "Http Proxy", "Http proxy authentication", null);
|
||||
TalendProxySelector proxySelector = TalendProxySelector.getInstance();
|
||||
PasswordAuthentication proxyAuthentication = proxySelector.getHttpPasswordAuthentication();
|
||||
if (proxyAuthentication != null) {
|
||||
String proxyUser = proxyAuthentication.getUserName();
|
||||
if(StringUtils.isNotBlank(proxyUser)){
|
||||
@@ -203,7 +200,7 @@ public abstract class HttpClientTransport {
|
||||
}
|
||||
HttpHost proxyHost = new HttpHost(proxyServer, proxyPort);
|
||||
httpClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxyHost);
|
||||
proxySelectorProvider = createProxySelectorProvider();
|
||||
proxySelectorProvider = proxySelector.createDefaultProxySelectorProvider();
|
||||
}
|
||||
return proxySelectorProvider;
|
||||
} finally {
|
||||
@@ -213,61 +210,12 @@ public abstract class HttpClientTransport {
|
||||
}
|
||||
}
|
||||
|
||||
private void removeProxy(IProxySelectorProvider proxySelectorProvider) {
|
||||
public static void removeProxy(IProxySelectorProvider proxySelectorProvider) {
|
||||
if (proxySelectorProvider != null) {
|
||||
TalendProxySelector.getInstance().removeProxySelectorProvider(proxySelectorProvider);
|
||||
}
|
||||
}
|
||||
|
||||
private IProxySelectorProvider createProxySelectorProvider() {
|
||||
IProxySelectorProvider proxySelectorProvider = new TalendProxySelector.AbstractProxySelectorProvider() {
|
||||
|
||||
private Thread currentThread = Thread.currentThread();
|
||||
|
||||
@Override
|
||||
public List<Proxy> select(URI uri) {
|
||||
// return Collections.EMPTY_LIST;
|
||||
|
||||
List<Proxy> newProxys = new ArrayList<>();
|
||||
if (uri == null) {
|
||||
return newProxys;
|
||||
}
|
||||
String schema = uri.getScheme();
|
||||
if (schema != null && schema.toLowerCase().startsWith("socket")) { //$NON-NLS-1$
|
||||
try {
|
||||
URI newUri = new URI("https", uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(),
|
||||
uri.getQuery(), uri.getFragment());
|
||||
List<Proxy> proxys = TalendProxySelector.getInstance().getDefaultProxySelector().select(newUri);
|
||||
if (proxys != null && !proxys.isEmpty()) {
|
||||
newProxys.addAll(proxys);
|
||||
} else {
|
||||
newUri = new URI("http", uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(),
|
||||
uri.getQuery(), uri.getFragment());
|
||||
proxys = TalendProxySelector.getInstance().getDefaultProxySelector().select(newUri);
|
||||
if (proxys != null && !proxys.isEmpty()) {
|
||||
newProxys.addAll(proxys);
|
||||
}
|
||||
}
|
||||
} catch (URISyntaxException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
return newProxys;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHandle(URI uri) {
|
||||
if (Thread.currentThread() == currentThread) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
};
|
||||
return proxySelectorProvider;
|
||||
}
|
||||
|
||||
public void processResponseCode(HttpResponse response) throws BusinessException {
|
||||
StatusLine statusLine = response.getStatusLine();
|
||||
int responseCode = statusLine.getStatusCode();
|
||||
|
||||
@@ -24,6 +24,9 @@ import org.osgi.framework.ServiceReference;
|
||||
import org.osgi.service.cm.ManagedService;
|
||||
import org.osgi.util.tracker.ServiceTracker;
|
||||
import org.osgi.util.tracker.ServiceTrackerCustomizer;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.utils.network.IProxySelectorProvider;
|
||||
import org.talend.commons.utils.network.TalendProxySelector;
|
||||
import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
|
||||
/**
|
||||
@@ -102,10 +105,25 @@ public class TalendMavenResolver {
|
||||
}
|
||||
|
||||
public static File resolve(String mvnUri) throws IOException {
|
||||
TalendProxySelector selectorInstance = null;
|
||||
IProxySelectorProvider proxySelector = null;
|
||||
try {
|
||||
try {
|
||||
selectorInstance = TalendProxySelector.getInstance();
|
||||
proxySelector = selectorInstance.createDefaultProxySelectorProvider();
|
||||
if (proxySelector != null) {
|
||||
selectorInstance.addProxySelectorProvider(proxySelector);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
return getMavenResolver().resolve(mvnUri);
|
||||
} catch (IOException e) {
|
||||
throw ResolverExceptionHandler.hideCredential(e);
|
||||
} finally {
|
||||
if (proxySelector != null && selectorInstance != null) {
|
||||
selectorInstance.removeProxySelectorProvider(proxySelector);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -101,6 +101,8 @@ public interface ITalendCorePrefConstants {
|
||||
|
||||
public static final String FORBIDDEN_MAPPING_LENGTH_PREC_LOGIC = "forbidden_mapping_length_prec_logic"; //$NON-NLS-1$
|
||||
|
||||
public static final String METADATA_PREFERENCE_PAGE_ENABLE_BASIC = "metadata_preference_page_enable_basic"; //$NON-NLS-1$
|
||||
|
||||
public static final String DATA_COLLECTOR_ENABLED = "active_data_collector"; //$NON-NLS-1$
|
||||
|
||||
public static final String DATA_COLLECTOR_UPLOAD_PERIOD = "active_data_collector_times"; //$NON-NLS-1$
|
||||
|
||||
@@ -24,7 +24,7 @@ public class MavenArtifact implements Cloneable {
|
||||
private static final char ARTIFACT_SEPARATOR = '-';
|
||||
|
||||
private String repositoryUrl, groupId, artifactId, version, type, classifier, description, url, license, licenseUrl,
|
||||
distribution, username, password, lastUpdated;
|
||||
distribution, username, password, lastUpdated, sha1, md5;
|
||||
|
||||
public String getLastUpdated() {
|
||||
return this.lastUpdated;
|
||||
@@ -138,6 +138,22 @@ public class MavenArtifact implements Cloneable {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getSha1() {
|
||||
return sha1;
|
||||
}
|
||||
|
||||
public void setSha1(String sha1) {
|
||||
this.sha1 = sha1;
|
||||
}
|
||||
|
||||
public String getMd5() {
|
||||
return md5;
|
||||
}
|
||||
|
||||
public void setMd5(String md5) {
|
||||
this.md5 = md5;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* DOC ggu Comment method "getFileName".
|
||||
|
||||
@@ -370,6 +370,15 @@ public class LastGenerationInfo {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear modules per job cache, not thread safe
|
||||
*/
|
||||
public void clearModulesNeededPerJob() {
|
||||
if (!modulesNeededPerJob.isEmpty()) {
|
||||
modulesNeededPerJob.clear();
|
||||
}
|
||||
}
|
||||
|
||||
public void clean() {
|
||||
modulesNeededPerJob.clear();
|
||||
routinesNeededPerJob.clear();
|
||||
|
||||
@@ -239,4 +239,6 @@ public interface IRunProcessService extends IService {
|
||||
public void handleJobDependencyLoop(JobInfo mainJobInfo, List<JobInfo> listJobs, IProgressMonitor progressMonitor)
|
||||
throws Exception;
|
||||
|
||||
public boolean isSelectLog4j2();
|
||||
|
||||
}
|
||||
|
||||
@@ -461,6 +461,9 @@ public interface IProxyRepositoryFactory {
|
||||
|
||||
public void forceDeleteObjectPhysical(IRepositoryViewObject objToDelete, String version, boolean isDeleteOnRemote) throws PersistenceException;
|
||||
|
||||
public void forceBatchDeleteObjectPhysical(Project project, List<IRepositoryViewObject> objToDeleteList,
|
||||
boolean isDeleteAllVersion, boolean isDeleteOnRemote) throws PersistenceException;
|
||||
|
||||
public Property getUptodateProperty(Project project, Property property) throws PersistenceException;
|
||||
|
||||
public Property getUptodateProperty(Property property) throws PersistenceException;
|
||||
|
||||
@@ -619,4 +619,6 @@ I18nPreferencePage.importBabili=Import Translation from Babili
|
||||
I18nPreferencePage.restart=Restart
|
||||
I18nPreferencePage.restartButton=Need to restart to take effect.
|
||||
I18nPreferencePage.restoreDefault=Restore default
|
||||
I18nPreferencePage.wait_process=Process will hold on several minutes, please wait...
|
||||
I18nPreferencePage.wait_process=Process will hold on several minutes, please wait...
|
||||
MetadataPreferencePage.EnableBasic.name=Enable Basic Authentication Header
|
||||
MetadataPreferencePage.MessageDialog.Restart=Will restart the studio to apply this setting. \nAre you sure?
|
||||
@@ -1,5 +1,9 @@
|
||||
package org.talend.core.ui.preference.metadata;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
import org.eclipse.jface.preference.BooleanFieldEditor;
|
||||
import org.eclipse.jface.preference.FieldEditorPreferencePage;
|
||||
import org.eclipse.jface.preference.IntegerFieldEditor;
|
||||
@@ -7,13 +11,20 @@ import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
import org.eclipse.ui.IWorkbench;
|
||||
import org.eclipse.ui.IWorkbenchPreferencePage;
|
||||
import org.eclipse.ui.IWorkbenchWindow;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.core.prefs.ITalendCorePrefConstants;
|
||||
import org.talend.core.ui.CoreUIPlugin;
|
||||
import org.talend.core.ui.i18n.Messages;
|
||||
import org.talend.core.ui.utils.PluginUtil;
|
||||
|
||||
public class MetadataPrecisionPage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
|
||||
|
||||
IntegerFieldEditor xmlColumnsLimit;
|
||||
|
||||
private static final String DISABLED_SCHEMES_KEY = "jdk.http.auth.tunneling.disabledSchemes";
|
||||
|
||||
public MetadataPrecisionPage() {
|
||||
setPreferenceStore(CoreUIPlugin.getDefault().getPreferenceStore());
|
||||
}
|
||||
@@ -30,6 +41,9 @@ public class MetadataPrecisionPage extends FieldEditorPreferencePage implements
|
||||
textControl.setToolTipText("Set the maximum number of schema table columns the xml metadata support. ");
|
||||
xmlColumnsLimit.setValidRange(1, Short.MAX_VALUE);
|
||||
addField(xmlColumnsLimit);
|
||||
|
||||
addField(new BooleanFieldEditor(ITalendCorePrefConstants.METADATA_PREFERENCE_PAGE_ENABLE_BASIC,
|
||||
Messages.getString("MetadataPreferencePage.EnableBasic.name"), getFieldEditorParent()));
|
||||
}
|
||||
|
||||
public void init(IWorkbench workbench) {
|
||||
@@ -39,7 +53,29 @@ public class MetadataPrecisionPage extends FieldEditorPreferencePage implements
|
||||
|
||||
public boolean performOk() {
|
||||
getPreferenceStore().setValue(ITalendCorePrefConstants.MAXIMUM_AMOUNT_OF_COLUMNS_FOR_XML, xmlColumnsLimit.getIntValue());
|
||||
return super.performOk();
|
||||
boolean stored = getPreferenceStore().getBoolean(ITalendCorePrefConstants.METADATA_PREFERENCE_PAGE_ENABLE_BASIC);
|
||||
boolean ok = super.performOk();
|
||||
boolean checked = getPreferenceStore().getBoolean(ITalendCorePrefConstants.METADATA_PREFERENCE_PAGE_ENABLE_BASIC);
|
||||
if (stored != checked) {
|
||||
try {
|
||||
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
|
||||
boolean confirm = MessageDialog.openConfirm(window.getShell(), "Confirm", //$NON-NLS-1$
|
||||
Messages.getString("MetadataPreferencePage.MessageDialog.Restart")); //$NON-NLS-1$
|
||||
File configFile = PluginUtil.getStudioConfigFile();
|
||||
Properties configProperties = PluginUtil.readProperties(configFile);
|
||||
if (checked) {
|
||||
configProperties.setProperty(DISABLED_SCHEMES_KEY, "");
|
||||
} else {
|
||||
configProperties.remove(DISABLED_SCHEMES_KEY);
|
||||
}
|
||||
PluginUtil.saveProperties(configFile, configProperties, null);
|
||||
if (confirm) {
|
||||
PlatformUI.getWorkbench().restart();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,11 +12,18 @@
|
||||
// ============================================================================
|
||||
package org.talend.core.ui.utils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URI;
|
||||
import java.net.URL;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.eclipse.core.runtime.FileLocator;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.core.runtime.URIUtil;
|
||||
import org.eclipse.ui.IEditorPart;
|
||||
import org.eclipse.ui.IWorkbenchPage;
|
||||
import org.eclipse.ui.IWorkbenchWindow;
|
||||
@@ -104,4 +111,28 @@ public class PluginUtil {
|
||||
}
|
||||
return part.getEditorSite().getId();
|
||||
}
|
||||
|
||||
public static File getStudioConfigFile() throws Exception {
|
||||
URL configLocation = new URL("platform:/config/config.ini"); //$NON-NLS-1$
|
||||
URL fileUrl = FileLocator.toFileURL(configLocation);
|
||||
return URIUtil.toFile(new URI(fileUrl.getProtocol(), fileUrl.getPath(), fileUrl.getQuery()));
|
||||
}
|
||||
|
||||
public static Properties readProperties(final File config) {
|
||||
final Properties configuration = new Properties();
|
||||
try (final InputStream stream = new FileInputStream(config)) {
|
||||
configuration.load(stream);
|
||||
} catch (final IOException e) {
|
||||
throw new IllegalArgumentException(e);
|
||||
}
|
||||
return configuration;
|
||||
}
|
||||
|
||||
public static void saveProperties(final File config, Properties prop, String comment) {
|
||||
try (FileOutputStream oFile = new FileOutputStream(config)) {
|
||||
prop.store(oFile, comment);
|
||||
}catch(final IOException e) {
|
||||
throw new IllegalArgumentException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,10 @@ package org.talend.core.services;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.emf.common.util.URI;
|
||||
import org.osgi.service.prefs.BackingStoreException;
|
||||
import org.talend.commons.exception.PersistenceException;
|
||||
@@ -54,6 +57,9 @@ public interface ICoreTisService extends IService {
|
||||
|
||||
public void downLoadAndInstallUpdates(String userName, String password, String adminUrl) throws Exception;
|
||||
|
||||
public void downLoadAndInstallUpdates(IProgressMonitor monitor, String userName, String password, String adminUrl)
|
||||
throws Exception;
|
||||
|
||||
public boolean isLicenseExpired();
|
||||
|
||||
public boolean isTheSameType(String userName, String password, String adminUrl);
|
||||
@@ -66,4 +72,10 @@ public interface ICoreTisService extends IService {
|
||||
|
||||
public void updateConfiguratorBundles(File configFile, File tempConfigFile) throws IOException;
|
||||
|
||||
Map<String, String> getExtraBundleInfo4Patch(File featureIndexFile) throws IOException;
|
||||
|
||||
Map<String, String> getDropBundleInfo() throws IOException;
|
||||
|
||||
Set<String> getComponentBlackList();
|
||||
|
||||
}
|
||||
|
||||
@@ -44,7 +44,8 @@ public class TalendAetherProxySelector implements ProxySelector {
|
||||
if (repository != null) {
|
||||
String proxyStr = "";
|
||||
if (proxy != null) {
|
||||
proxyStr = proxy.toString() + ", proxy user: " + (proxy.getAuthentication() != null ? "..." : "<empty>");
|
||||
proxyStr = proxy.getType() + " " + proxy.toString() + ", proxy user: "
|
||||
+ (proxy.getAuthentication() != null ? "..." : "<empty>");
|
||||
}
|
||||
ExceptionHandler.log("Aether proxy> host: " + repository.getHost() + ", proxy: " + proxyStr);
|
||||
}
|
||||
@@ -62,23 +63,28 @@ public class TalendAetherProxySelector implements ProxySelector {
|
||||
}
|
||||
|
||||
private void javaDefaultProxy(DefaultProxySelector proxySelector) {
|
||||
String proxyHost = System.getProperty("https.proxyHost");
|
||||
String schema = proxyHost != null ? "https" : "http";
|
||||
if (proxyHost == null) {
|
||||
proxyHost = System.getProperty(schema + "." + "proxyHost");
|
||||
String[] schemas = new String[] { "http", "https" };
|
||||
for (String schema : schemas) {
|
||||
Proxy proxy = createProxy(schema);
|
||||
if (proxy != null) {
|
||||
proxySelector.add(proxy, System.getProperty(schema + ".nonProxyHosts"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private org.eclipse.aether.repository.Proxy createProxy(String schema) {
|
||||
String proxyHost = System.getProperty(schema + ".proxyHost");
|
||||
if (proxyHost == null) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
String proxyUser = System.getProperty(schema + "." + "proxyUser");
|
||||
String proxyPassword = System.getProperty(schema + "." + "proxyPassword");
|
||||
int proxyPort = Integer.parseInt(System.getProperty(schema + "." + "proxyPort", "8080"));
|
||||
String nonProxyHosts = System.getProperty(schema + "." + "nonProxyHosts");
|
||||
String proxyUser = System.getProperty(schema + ".proxyUser");
|
||||
String proxyPassword = System.getProperty(schema + ".proxyPassword");
|
||||
int proxyPort = Integer.parseInt(System.getProperty(schema + ".proxyPort", "8080"));
|
||||
|
||||
Authentication authentication = createAuthentication(proxyUser, proxyPassword);
|
||||
org.eclipse.aether.repository.Proxy proxyObj = new org.eclipse.aether.repository.Proxy(schema, proxyHost, proxyPort,
|
||||
authentication);
|
||||
proxySelector.add(proxyObj, nonProxyHosts);
|
||||
return proxyObj;
|
||||
}
|
||||
|
||||
private Authentication createAuthentication(String proxyUser, String proxyPassword) {
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.dataformat</groupId>
|
||||
<artifactId>jackson-dataformat-cbor</artifactId>
|
||||
<version>2.9.9</version>
|
||||
<version>${m2.fasterxml.jackson.version}</version>
|
||||
</dependency>
|
||||
<!-- Required by commons-lang-2.6.pom -->
|
||||
<dependency>
|
||||
|
||||
@@ -18,4 +18,7 @@
|
||||
<module>surefire/pom.xml</module>
|
||||
<module>zip/pom.xml</module>
|
||||
</modules>
|
||||
<properties>
|
||||
<m2.fasterxml.jackson.version>2.10.1</m2.fasterxml.jackson.version>
|
||||
</properties>
|
||||
</project>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<artifactId>studio-tacokit-dependencies</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<properties>
|
||||
<tacokit.components.version>1.3.0-SNAPSHOT</tacokit.components.version>
|
||||
<tacokit.components.version>1.3.2-SNAPSHOT</tacokit.components.version>
|
||||
</properties>
|
||||
<repositories>
|
||||
<repository>
|
||||
|
||||
@@ -523,8 +523,8 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
|
||||
}
|
||||
}
|
||||
final Map<String, Object> templateParameters = PomUtil.getTemplateParameters(property);
|
||||
String batContent = MavenTemplateManager
|
||||
.getProjectSettingValue(IProjectSettingPreferenceConstants.TEMPLATE_BAT, templateParameters);
|
||||
String batContent = MavenTemplateManager.getProjectSettingValue(IProjectSettingPreferenceConstants.TEMPLATE_BAT,
|
||||
templateParameters);
|
||||
batContent = StringUtils
|
||||
.replaceEach(batContent,
|
||||
new String[] { "${talend.job.jvmargs}", "${talend.job.bat.classpath}", "${talend.job.class}",
|
||||
@@ -532,8 +532,8 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
|
||||
new String[] { jvmArgsStr.toString().trim(), getWindowsClasspath(), jobClass,
|
||||
windowsScriptAdditionValue.toString() });
|
||||
|
||||
String shContent = MavenTemplateManager
|
||||
.getProjectSettingValue(IProjectSettingPreferenceConstants.TEMPLATE_SH, templateParameters);
|
||||
String shContent = MavenTemplateManager.getProjectSettingValue(IProjectSettingPreferenceConstants.TEMPLATE_SH,
|
||||
templateParameters);
|
||||
shContent = StringUtils
|
||||
.replaceEach(shContent,
|
||||
new String[] { "${talend.job.jvmargs}", "${talend.job.sh.classpath}", "${talend.job.class}",
|
||||
@@ -541,8 +541,8 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
|
||||
new String[] { jvmArgsStr.toString().trim(), getUnixClasspath(), jobClass,
|
||||
unixScriptAdditionValue.toString() });
|
||||
|
||||
String psContent = MavenTemplateManager
|
||||
.getProjectSettingValue(IProjectSettingPreferenceConstants.TEMPLATE_PS, templateParameters);
|
||||
String psContent = MavenTemplateManager.getProjectSettingValue(IProjectSettingPreferenceConstants.TEMPLATE_PS,
|
||||
templateParameters);
|
||||
psContent = StringUtils
|
||||
.replaceEach(psContent,
|
||||
new String[] { "${talend.job.jvmargs.ps1}", "${talend.job.ps1.classpath}",
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
lib/,\
|
||||
plugin.xml
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -9,63 +9,4 @@
|
||||
</parent>
|
||||
<artifactId>org.talend.libraries.apache.cassandra</artifactId>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
<properties>
|
||||
<talend.groupid>org.talend.libraries</talend.groupid>
|
||||
<talend.version.630>6.3.0</talend.version.630>
|
||||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>2.8</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-maven-repository</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>copy</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<stripVersion>true</stripVersion>
|
||||
<outputDirectory>${project.basedir}/lib</outputDirectory>
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>${talend.groupid}</groupId>
|
||||
<artifactId>spark-cassandra-connector-java-assembly-1.3.1-patched-20161017</artifactId>
|
||||
<version>${talend.version.630}</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>${talend.groupid}</groupId>
|
||||
<artifactId>spark-cassandra-connector-java-assembly-1.4.3-patched-20161017</artifactId>
|
||||
<version>${talend.version.630}</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>${talend.groupid}</groupId>
|
||||
<artifactId>spark-cassandra-connector-java-assembly-1.5.0-patched-20161017</artifactId>
|
||||
<version>${talend.version.630}</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>${talend.groupid}</groupId>
|
||||
<artifactId>spark-cassandra-connector-assembly-1.6.2-patched-20161017</artifactId>
|
||||
<version>${talend.version.630}</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>${talend.groupid}</groupId>
|
||||
<artifactId>spark-cassandra-connector-assembly-2.0.0-M3-patched-20161017</artifactId>
|
||||
<version>${talend.version.630}</version>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>talend_nexus</id>
|
||||
<url>https://artifacts-oss.talend.com/nexus/content/repositories/talend-update/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
</project>
|
||||
|
||||
@@ -1,15 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry exported="true" kind="lib" path="lib/javax.ws.rs-api-2.0-m10.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/neethi-3.0.1.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-api-2.7.7.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-bindings-xml-2.7.7.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-core-2.7.7.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-frontend-jaxrs-2.7.7.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-transports-http-2.7.7.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/stax2-api-3.1.1.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/woodstox-core-asl-4.2.0.jar"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-wsdl-3.3.4.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/jakarta.activation-api-1.2.1.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/jakarta.xml.bind-api-2.3.2.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/jaxb-runtime-2.3.2.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/woodstox-core-asl-4.4.1.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/javax.annotation-api-1.3.2.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/stax2-api-3.1.4.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/neethi-3.1.1.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/jakarta.ws.rs-api-2.1.5.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-core-3.3.4.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-bindings-xml-3.3.4.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-frontend-jaxrs-3.3.4.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-rs-client-3.3.4.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-transports-http-3.3.4.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/jaxws-api-2.3.1.jar"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
||||
@@ -4,21 +4,23 @@ Bundle-Name: Cxf
|
||||
Bundle-SymbolicName: org.talend.libraries.apache.cxf;singleton:=true
|
||||
Bundle-Version: 7.3.1.qualifier
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Bundle-ClassPath: lib/javax.ws.rs-api-2.0-m10.jar,
|
||||
lib/neethi-3.0.1.jar,
|
||||
lib/cxf-api-2.7.7.jar,
|
||||
lib/cxf-rt-bindings-xml-2.7.7.jar,
|
||||
lib/cxf-rt-core-2.7.7.jar,
|
||||
lib/cxf-rt-frontend-jaxrs-2.7.7.jar,
|
||||
lib/cxf-rt-transports-http-2.7.7.jar,
|
||||
lib/stax2-api-3.1.1.jar,
|
||||
lib/woodstox-core-asl-4.2.0.jar,
|
||||
Bundle-ClassPath: .,
|
||||
lib/neethi-3.1.1.jar,
|
||||
lib/stax2-api-3.1.4.jar,
|
||||
lib/javax.activation-1.2.0.jar,
|
||||
lib/javax.annotation-api-1.3.jar,
|
||||
lib/jaxb-api-2.2.11.jar,
|
||||
lib/jaxb-impl-2.1.13.jar,
|
||||
lib/jaxws-api-2.3.1.jar,
|
||||
lib/cxf-core-3.3.4.jar,
|
||||
lib/cxf-rt-bindings-xml-3.3.4.jar,
|
||||
lib/cxf-rt-frontend-jaxrs-3.3.4.jar,
|
||||
lib/cxf-rt-rs-client-3.3.4.jar,
|
||||
lib/cxf-rt-transports-http-3.3.4.jar,
|
||||
lib/cxf-rt-wsdl-3.3.4.jar,
|
||||
lib/jakarta.ws.rs-api-2.1.5.jar,
|
||||
lib/javax.annotation-api-1.3.2.jar,
|
||||
lib/woodstox-core-asl-4.4.1.jar,
|
||||
lib/jakarta.xml.bind-api-2.3.2.jar,
|
||||
lib/jaxb-runtime-2.3.2.jar,
|
||||
.
|
||||
lib/jakarta.activation-api-1.2.1.jar
|
||||
Export-Package: javax.ws.rs,
|
||||
javax.ws.rs.client,
|
||||
javax.ws.rs.container,
|
||||
@@ -44,7 +46,6 @@ Export-Package: javax.ws.rs,
|
||||
org.apache.cxf.common,
|
||||
org.apache.cxf.common.annotation,
|
||||
org.apache.cxf.common.classloader,
|
||||
org.apache.cxf.common.commands,
|
||||
org.apache.cxf.common.i18n,
|
||||
org.apache.cxf.common.injection,
|
||||
org.apache.cxf.common.jaxb,
|
||||
@@ -79,7 +80,6 @@ Export-Package: javax.ws.rs,
|
||||
org.apache.cxf.jaxrs.client,
|
||||
org.apache.cxf.jaxrs.client.spec,
|
||||
org.apache.cxf.jaxrs.ext,
|
||||
org.apache.cxf.jaxrs.ext.form,
|
||||
org.apache.cxf.jaxrs.ext.multipart,
|
||||
org.apache.cxf.jaxrs.ext.xml,
|
||||
org.apache.cxf.jaxrs.impl,
|
||||
@@ -87,7 +87,6 @@ Export-Package: javax.ws.rs,
|
||||
org.apache.cxf.jaxrs.interceptor,
|
||||
org.apache.cxf.jaxrs.lifecycle,
|
||||
org.apache.cxf.jaxrs.model,
|
||||
org.apache.cxf.jaxrs.model.wadl,
|
||||
org.apache.cxf.jaxrs.provider,
|
||||
org.apache.cxf.jaxrs.security,
|
||||
org.apache.cxf.jaxrs.servlet,
|
||||
@@ -111,7 +110,6 @@ Export-Package: javax.ws.rs,
|
||||
org.apache.cxf.service.model,
|
||||
org.apache.cxf.staxutils,
|
||||
org.apache.cxf.staxutils.transform,
|
||||
org.apache.cxf.test,
|
||||
org.apache.cxf.transport,
|
||||
org.apache.cxf.transport.common.gzip,
|
||||
org.apache.cxf.transport.http,
|
||||
@@ -124,9 +122,7 @@ Export-Package: javax.ws.rs,
|
||||
org.apache.cxf.transport.https,
|
||||
org.apache.cxf.transport.servlet,
|
||||
org.apache.cxf.transport.servlet.servicelist,
|
||||
org.apache.cxf.transports.http,
|
||||
org.apache.cxf.transports.http.configuration,
|
||||
org.apache.cxf.transports.http.internal,
|
||||
org.apache.cxf.version,
|
||||
org.apache.cxf.workqueue,
|
||||
org.apache.cxf.ws.addressing,
|
||||
|
||||
@@ -1,40 +1,11 @@
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
lib/neethi-3.0.1.jar,\
|
||||
lib/cxf-api-2.7.7.jar,\
|
||||
lib/cxf-rt-bindings-xml-2.7.7.jar,\
|
||||
lib/cxf-rt-core-2.7.7.jar,\
|
||||
lib/cxf-rt-frontend-jaxrs-2.7.7.jar,\
|
||||
lib/cxf-rt-transports-http-2.7.7.jar,\
|
||||
lib/stax2-api-3.1.1.jar,\
|
||||
lib/woodstox-core-asl-4.2.0.jar,\
|
||||
lib/javax.ws.rs-api-2.0-m10.jar,\
|
||||
plugin.xml,\
|
||||
lib/stax2-api-3.1.4.jar,\
|
||||
lib/woodstox-core-asl-4.4.1.jar,\
|
||||
lib/xmlschema-core-2.2.1.jar,\
|
||||
lib/commons-codec-1.10.jar,\
|
||||
lib/cxf-core-3.1.4.jar,\
|
||||
lib/cxf-rt-bindings-soap-3.1.4.jar,\
|
||||
lib/cxf-rt-bindings-xml-3.1.4.jar,\
|
||||
lib/cxf-rt-databinding-jaxb-3.1.4.jar,\
|
||||
lib/cxf-rt-databinding-xmlbeans-3.1.4.jar,\
|
||||
lib/cxf-rt-frontend-jaxrs-3.1.4.jar,\
|
||||
lib/cxf-rt-frontend-jaxws-3.1.4.jar,\
|
||||
lib/cxf-rt-frontend-simple-3.1.4.jar,\
|
||||
lib/cxf-rt-rs-client-3.1.4.jar,\
|
||||
lib/cxf-rt-security-3.1.4.jar,\
|
||||
lib/cxf-rt-transports-http-3.1.4.jar,\
|
||||
lib/cxf-rt-transports-http-jetty-3.1.4.jar,\
|
||||
lib/cxf-rt-ws-addr-3.1.4.jar,\
|
||||
lib/cxf-rt-ws-mex-3.1.4.jar,\
|
||||
lib/cxf-rt-ws-policy-3.1.4.jar,\
|
||||
lib/cxf-rt-ws-rm-3.1.4.jar,\
|
||||
lib/cxf-rt-ws-security-3.1.4.jar,\
|
||||
lib/cxf-rt-wsdl-3.1.4.jar,\
|
||||
lib/cxf-services-sts-core-3.1.4.jar,\
|
||||
lib/cxf-tools-common-3.1.4.jar,\
|
||||
lib/wss4j-bindings-2.1.4.jar,\
|
||||
lib/wss4j-policy-2.1.4.jar,\
|
||||
lib/wss4j-ws-security-common-2.1.4.jar,\
|
||||
@@ -42,7 +13,16 @@ bin.includes = META-INF/,\
|
||||
lib/wss4j-ws-security-policy-stax-2.1.4.jar,\
|
||||
lib/wss4j-ws-security-stax-2.1.4.jar,\
|
||||
lib/javax.activation-1.2.0.jar,\
|
||||
lib/javax.annotation-api-1.3.jar,\
|
||||
lib/jaxb-api-2.2.11.jar,\
|
||||
lib/jaxb-impl-2.1.13.jar,\
|
||||
lib/jaxb-runtime-2.3.2.jar
|
||||
lib/jaxws-api-2.3.1.jar,\
|
||||
lib/cxf-core-3.3.4.jar,\
|
||||
lib/cxf-rt-bindings-xml-3.3.4.jar,\
|
||||
lib/cxf-rt-frontend-jaxrs-3.3.4.jar,\
|
||||
lib/cxf-rt-rs-client-3.3.4.jar,\
|
||||
lib/cxf-rt-transports-http-3.3.4.jar,\
|
||||
lib/jakarta.ws.rs-api-2.1.5.jar,\
|
||||
lib/neethi-3.1.1.jar,\
|
||||
lib/javax.annotation-api-1.3.2.jar,\
|
||||
lib/jaxb-runtime-2.3.2.jar,\
|
||||
lib/jakarta.xml.bind-api-2.3.2.jar,\
|
||||
lib/jakarta.activation-api-1.2.1.jar,\
|
||||
lib/cxf-rt-wsdl-3.3.4.jar
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user