diff --git a/pentaho-kettle/lib/pdi-pur-plugin-core-8.0.0.0-1.jar b/pentaho-kettle/lib/pdi-pur-plugin-core-8.0.0.0-1.jar
new file mode 100644
index 0000000..4fb9d58
Binary files /dev/null and b/pentaho-kettle/lib/pdi-pur-plugin-core-8.0.0.0-1.jar differ
diff --git a/pentaho-kettle/pom.xml b/pentaho-kettle/pom.xml
index 7664e34..1f285c4 100644
--- a/pentaho-kettle/pom.xml
+++ b/pentaho-kettle/pom.xml
@@ -4,7 +4,7 @@
com.github.zhicwu
pdi-cluster
- 7.1.0.5-SNAPSHOT
+ 8.0.0.0-SNAPSHOT
pentaho-kettle
jar
@@ -55,6 +55,8 @@
pentaho-kettle
pdi-pur-plugin
${pentaho-ce.version}
+ system
+ ${basedir}/lib/pdi-pur-plugin-core-${pentaho-ce.version}.jar
diff --git a/pentaho-kettle/src/main/java/org/pentaho/di/cluster/SlaveConnectionManager.java b/pentaho-kettle/src/main/java/org/pentaho/di/cluster/SlaveConnectionManager.java
index 6adaa63..e1bb453 100644
--- a/pentaho-kettle/src/main/java/org/pentaho/di/cluster/SlaveConnectionManager.java
+++ b/pentaho-kettle/src/main/java/org/pentaho/di/cluster/SlaveConnectionManager.java
@@ -2,7 +2,7 @@
*
* Pentaho Data Integration
*
- * Copyright (C) 2002-2016 by Pentaho : http://www.pentaho.com
+ * Copyright (C) 2002-2017 by Hitachi Vantara : http://www.pentaho.com
*
*******************************************************************************
*
@@ -22,10 +22,17 @@
package org.pentaho.di.cluster;
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
-import org.apache.commons.httpclient.params.HttpClientParams;
-import org.apache.commons.httpclient.params.HttpConnectionManagerParams;
+import org.apache.http.HttpHost;
+import org.apache.http.auth.AuthScope;
+import org.apache.http.auth.UsernamePasswordCredentials;
+import org.apache.http.client.CredentialsProvider;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.config.SocketConfig;
+import org.apache.http.impl.client.BasicCredentialsProvider;
+import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import javax.net.ssl.KeyManager;
import javax.net.ssl.SSLContext;
@@ -62,7 +69,8 @@ public class SlaveConnectionManager {
private static SlaveConnectionManager slaveConnectionManager;
- private MultiThreadedHttpConnectionManager manager;
+ private final PoolingHttpClientConnectionManager manager;
+ private final RequestConfig defaultRequestConfig;
private SlaveConnectionManager() {
if (needToInitializeSSLContext()) {
@@ -74,14 +82,19 @@ private SlaveConnectionManager() {
//log.logError( "Default SSL context hasn't been initialized", e );
}
}
- manager = new MultiThreadedHttpConnectionManager();
- HttpConnectionManagerParams connParams = manager.getParams();
- connParams.setDefaultMaxConnectionsPerHost(KETTLE_HTTPCLIENT_MAX_CONNECTIONS_PER_HOST);
- connParams.setMaxTotalConnections(KETTLE_HTTPCLIENT_MAX_CONNECTIONS);
-
- connParams.setConnectionTimeout(KETTLE_HTTPCLIENT_CONNECTION_TIMEOUT * 1000);
- connParams.setLinger(KETTLE_HTTPCLIENT_SOCKET_LINGER);
- connParams.setStaleCheckingEnabled(KETTLE_HTTPCLIENT_STALE_CHECKING);
+
+ manager = new PoolingHttpClientConnectionManager();
+ manager.setDefaultMaxPerRoute(KETTLE_HTTPCLIENT_MAX_CONNECTIONS_PER_HOST);
+ manager.setMaxTotal(KETTLE_HTTPCLIENT_MAX_CONNECTIONS);
+
+ manager.setDefaultSocketConfig(
+ SocketConfig.custom()
+ .setSoTimeout(KETTLE_HTTPCLIENT_SOCKET_TIMEOUT)
+ .setSoLinger(KETTLE_HTTPCLIENT_SOCKET_LINGER).build());
+
+ defaultRequestConfig = RequestConfig.custom()
+ .setConnectTimeout(KETTLE_HTTPCLIENT_CONNECTION_MANAGER_TIMEOUT * 1000)
+ .build();
}
private static boolean needToInitializeSSLContext() {
@@ -96,15 +109,45 @@ public static SlaveConnectionManager getInstance() {
}
public HttpClient createHttpClient() {
- HttpClient client = new HttpClient(manager);
-
- HttpClientParams clientParams = client.getParams();
+ return HttpClients.custom().setConnectionManager(manager)
+ .setDefaultRequestConfig(defaultRequestConfig)
+ .build();
+ }
- clientParams.setConnectionManagerTimeout(KETTLE_HTTPCLIENT_CONNECTION_MANAGER_TIMEOUT * 1000);
- clientParams.setSoTimeout(KETTLE_HTTPCLIENT_SOCKET_TIMEOUT * 1000);
- client.getHostConfiguration().getParams().setDefaults(clientParams);
+ public HttpClient createHttpClient(String user, String password) {
+ CredentialsProvider provider = new BasicCredentialsProvider();
+ UsernamePasswordCredentials credentials = new UsernamePasswordCredentials(user, password);
+ provider.setCredentials(AuthScope.ANY, credentials);
+
+ return
+ HttpClientBuilder
+ .create()
+ .setDefaultCredentialsProvider(provider)
+ .setConnectionManager(manager)
+ .setDefaultRequestConfig(defaultRequestConfig)
+ .build();
+ }
- return client;
+ public HttpClient createHttpClient(String user, String password,
+ String proxyHost, int proxyPort, AuthScope authScope) {
+ HttpHost httpHost = new HttpHost(proxyHost, proxyPort);
+
+ RequestConfig requestConfig = RequestConfig.custom()
+ .setProxy(httpHost)
+ .setConnectTimeout(defaultRequestConfig.getConnectTimeout())
+ .build();
+
+ CredentialsProvider provider = new BasicCredentialsProvider();
+ UsernamePasswordCredentials credentials = new UsernamePasswordCredentials(user, password);
+ provider.setCredentials(authScope, credentials);
+
+ return
+ HttpClientBuilder
+ .create()
+ .setDefaultCredentialsProvider(provider)
+ .setDefaultRequestConfig(requestConfig)
+ .setConnectionManager(manager)
+ .build();
}
public void shutdown() {
diff --git a/pentaho-kettle/src/main/java/org/pentaho/di/cluster/SlaveServer.java b/pentaho-kettle/src/main/java/org/pentaho/di/cluster/SlaveServer.java
index 21f7b32..fa8b505 100644
--- a/pentaho-kettle/src/main/java/org/pentaho/di/cluster/SlaveServer.java
+++ b/pentaho-kettle/src/main/java/org/pentaho/di/cluster/SlaveServer.java
@@ -2,7 +2,7 @@
*
* Pentaho Data Integration
*
- * Copyright (C) 2002-2017 by Pentaho : http://www.pentaho.com
+ * Copyright (C) 2002-2017 by Hitachi Vantara : http://www.pentaho.com
*
*******************************************************************************
*
@@ -23,13 +23,24 @@
package org.pentaho.di.cluster;
import com.google.common.base.Strings;
-import org.apache.commons.httpclient.Header;
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.HttpState;
-import org.apache.commons.httpclient.UsernamePasswordCredentials;
-import org.apache.commons.httpclient.auth.AuthScope;
-import org.apache.commons.httpclient.methods.*;
import org.apache.commons.lang.StringUtils;
+import org.apache.http.*;
+import org.apache.http.auth.AuthScope;
+import org.apache.http.auth.UsernamePasswordCredentials;
+import org.apache.http.client.AuthCache;
+import org.apache.http.client.ClientProtocolException;
+import org.apache.http.client.CredentialsProvider;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.client.methods.HttpUriRequest;
+import org.apache.http.client.protocol.HttpClientContext;
+import org.apache.http.entity.ByteArrayEntity;
+import org.apache.http.entity.InputStreamEntity;
+import org.apache.http.impl.auth.BasicScheme;
+import org.apache.http.impl.client.BasicAuthCache;
+import org.apache.http.impl.client.BasicCredentialsProvider;
+import org.apache.http.message.BasicHeader;
import org.pentaho.di.core.Const;
import org.pentaho.di.core.changed.ChangedFlag;
import org.pentaho.di.core.encryption.Encr;
@@ -60,8 +71,6 @@
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
-import static org.pentaho.di.cluster.SlaveConnectionManager.KETTLE_HTTPCLIENT_SOCKET_TIMEOUT;
-
public class SlaveServer extends ChangedFlag implements Cloneable, SharedObjectInterface, VariableSpace,
RepositoryElementInterface, XMLInterface {
private static Class> PKG = SlaveServer.class; // for i18n purposes, needed by Translator2!!
@@ -79,8 +88,6 @@ public class SlaveServer extends ChangedFlag implements Cloneable, SharedObjectI
public static final String SSL_MODE_TAG = "sslMode";
- private static final int NOT_FOUND_ERROR = 404;
-
public static final int KETTLE_CARTE_RETRIES = getNumberOfSlaveServerRetries();
public static final int KETTLE_CARTE_RETRY_BACKOFF_INCREMENTS = getBackoffIncrements();
@@ -546,64 +553,32 @@ public String constructUrl(String serviceAndArguments) throws UnsupportedEncodin
}
// Method is defined as package-protected in order to be accessible by unit tests
- PostMethod buildSendXMLMethod(byte[] content, String service) throws Exception {
+ HttpPost buildSendXMLMethod(byte[] content, String service) throws Exception {
// Prepare HTTP put
//
String urlString = constructUrl(service);
if (log.isDebug()) {
log.logDebug(BaseMessages.getString(PKG, "SlaveServer.DEBUG_ConnectingTo", urlString));
}
- PostMethod postMethod = new PostMethod(urlString);
+ HttpPost postMethod = new HttpPost(urlString);
// Request content will be retrieved directly from the input stream
//
- RequestEntity entity = new ByteArrayRequestEntity(content);
+ HttpEntity entity = new ByteArrayEntity(content);
- postMethod.setRequestEntity(entity);
- postMethod.setDoAuthentication(true);
- postMethod.addRequestHeader(new Header("Content-Type", "text/xml;charset=" + Const.XML_ENCODING));
+ postMethod.setEntity(entity);
+ postMethod.addHeader(new BasicHeader("Content-Type", "text/xml;charset=" + Const.XML_ENCODING));
return postMethod;
}
public String sendXML(String xml, String service) throws Exception {
- PostMethod method = buildSendXMLMethod(xml.getBytes(Const.XML_ENCODING), service);
+ HttpPost method = buildSendXMLMethod(xml.getBytes(Const.XML_ENCODING), service);
// Execute request
//
try {
- int result = getHttpClient().executeMethod(method);
-
- // The status code
- if (log.isDebug()) {
- log.logDebug(BaseMessages.getString(PKG, "SlaveServer.DEBUG_ResponseStatus", Integer.toString(result)));
- }
-
- String responseBody = getResponseBodyAsString(method.getResponseBodyAsStream());
-
- if (log.isDebug()) {
- log.logDebug(BaseMessages.getString(PKG, "SlaveServer.DEBUG_ResponseBody", responseBody));
- }
-
- if (result >= 400) {
- String message;
- if (result == NOT_FOUND_ERROR) {
- message = String.format("%s%s%s%s",
- BaseMessages.getString(PKG, "SlaveServer.Error.404.Title"),
- Const.CR, Const.CR,
- BaseMessages.getString(PKG, "SlaveServer.Error.404.Message")
- );
- } else {
- message = String.format("HTTP Status %d - %s - %s",
- method.getStatusCode(),
- method.getPath(),
- method.getStatusText()
- );
- }
- throw new KettleException(message);
- }
-
- return responseBody;
+ return executeAuth(method);
} finally {
// Release current connection to the connection pool once you are done
method.releaseConnection();
@@ -614,13 +589,35 @@ public String sendXML(String xml, String service) throws Exception {
}
}
+ /**
+ * Throws if not ok
+ */
+ private void handleStatus(HttpUriRequest method, StatusLine statusLine, int status) throws KettleException {
+ if (status >= 300) {
+ String message;
+ if (status == HttpStatus.SC_NOT_FOUND) {
+ message = String.format("%s%s%s%s",
+ BaseMessages.getString(PKG, "SlaveServer.Error.404.Title"),
+ Const.CR, Const.CR,
+ BaseMessages.getString(PKG, "SlaveServer.Error.404.Message")
+ );
+ } else {
+ message = String.format("HTTP Status %d - %s - %s",
+ status,
+ method.getURI().toString(),
+ statusLine.getReasonPhrase());
+ }
+ throw new KettleException(message);
+ }
+ }
+
// Method is defined as package-protected in order to be accessible by unit tests
- PostMethod buildSendExportMethod(String type, String load, InputStream is) throws UnsupportedEncodingException {
+ HttpPost buildSendExportMethod(String type, String load, InputStream is) throws UnsupportedEncodingException {
String serviceUrl = RegisterPackageServlet.CONTEXT_PATH;
if (type != null && load != null) {
serviceUrl +=
- "/?" + AddExportServlet.PARAMETER_TYPE + "=" + type + "&" + AddExportServlet.PARAMETER_LOAD + "="
- + URLEncoder.encode(load, "UTF-8");
+ "/?" + RegisterPackageServlet.PARAMETER_TYPE + "=" + type
+ + "&" + RegisterPackageServlet.PARAMETER_LOAD + "=" + URLEncoder.encode(load, "UTF-8");
}
String urlString = constructUrl(serviceUrl);
@@ -628,11 +625,9 @@ PostMethod buildSendExportMethod(String type, String load, InputStream is) throw
log.logDebug(BaseMessages.getString(PKG, "SlaveServer.DEBUG_ConnectingTo", urlString));
}
- PostMethod method = new PostMethod(urlString);
- method.setRequestEntity(new InputStreamRequestEntity(is));
- method.setDoAuthentication(true);
- method.addRequestHeader(new Header("Content-Type", "binary/zip"));
- method.getParams().setSoTimeout(KETTLE_HTTPCLIENT_SOCKET_TIMEOUT * 1000);
+ HttpPost method = new HttpPost(urlString);
+ method.setEntity(new InputStreamEntity(is));
+ method.addHeader(new BasicHeader("Content-Type", "binary/zip"));
return method;
}
@@ -648,35 +643,11 @@ PostMethod buildSendExportMethod(String type, String load, InputStream is) throw
*/
public String sendExport(String filename, String type, String load) throws Exception {
// Request content will be retrieved directly from the input stream
- //
- InputStream is = null;
- try {
- is = KettleVFS.getInputStream(KettleVFS.getFileObject(filename));
-
+ try (InputStream is = KettleVFS.getInputStream(KettleVFS.getFileObject(filename))) {
// Execute request
- //
- PostMethod method = buildSendExportMethod(type, load, is);
+ HttpPost method = buildSendExportMethod(type, load, is);
try {
- int result = getHttpClient().executeMethod(method);
-
- // The status code
- if (log.isDebug()) {
- log.logDebug(BaseMessages.getString(PKG, "SlaveServer.DEBUG_ResponseStatus", Integer.toString(result)));
- }
-
- String responseBody = getResponseBodyAsString(method.getResponseBodyAsStream());
-
- // String body = post.getResponseBodyAsString();
- if (log.isDebug()) {
- log.logDebug(BaseMessages.getString(PKG, "SlaveServer.DEBUG_ResponseBody", responseBody));
- }
-
- if (result >= 400) {
- throw new KettleException(String.format("HTTP Status %d - %s - %s", method.getStatusCode(), method
- .getPath(), method.getStatusText()));
- }
-
- return responseBody;
+ return executeAuth(method);
} finally {
// Release current connection to the connection pool once you are done
method.releaseConnection();
@@ -685,56 +656,76 @@ public String sendExport(String filename, String type, String load) throws Excep
RegisterPackageServlet.CONTEXT_PATH, environmentSubstitute(hostname)));
}
}
- } finally {
- try {
- if (is != null) {
- is.close();
- }
- } catch (IOException ignored) {
- // nothing to do here...
- }
}
}
- public void addProxy(HttpClient client) {
- String hostName;
- String proxyHost;
- String proxyPort;
- String nonProxyHosts;
+ /**
+ * Executes method with authentication.
+ *
+ * @param method
+ * @return
+ * @throws IOException
+ * @throws ClientProtocolException
+ * @throws KettleException if response not ok
+ */
+ private String executeAuth(HttpUriRequest method) throws IOException, ClientProtocolException, KettleException {
+ HttpResponse httpResponse = getHttpClient().execute(method, getAuthContext());
+ return getResponse(method, httpResponse);
+ }
- lock.readLock().lock();
- try {
- hostName = environmentSubstitute(this.hostname);
- proxyHost = environmentSubstitute(this.proxyHostname);
- proxyPort = environmentSubstitute(this.proxyPort);
- nonProxyHosts = environmentSubstitute(this.nonProxyHosts);
- } finally {
- lock.readLock().unlock();
+ private String getResponse(HttpUriRequest method, HttpResponse httpResponse) throws IOException, KettleException {
+ StatusLine statusLine = httpResponse.getStatusLine();
+ int statusCode = statusLine.getStatusCode();
+ // The status code
+ if (log.isDebug()) {
+ log.logDebug(BaseMessages.getString(PKG, "SlaveServer.DEBUG_ResponseStatus", Integer.toString(statusCode)));
}
- if (!Utils.isEmpty(proxyHost) && !Utils.isEmpty(proxyPort)) {
- // skip applying proxy if non-proxy host matches
- if (!Utils.isEmpty(nonProxyHosts) && !Utils.isEmpty(hostName) && hostName.matches(nonProxyHosts)) {
- return;
- }
- client.getHostConfiguration().setProxy(proxyHost, Integer.parseInt(proxyPort));
+ String responseBody = getResponseBodyAsString(httpResponse.getEntity().getContent());
+ if (log.isDebug()) {
+ log.logDebug(BaseMessages.getString(PKG, "SlaveServer.DEBUG_ResponseBody", responseBody));
}
- }
- public void addCredentials(HttpClient client) {
- HttpState state = client.getState();
+ // throw if not ok
+ handleStatus(method, statusLine, statusCode);
+
+ return responseBody;
+ }
+ private void addCredentials(HttpClientContext context) {
+ String userName;
+ String password;
+ String host;
+ int port;
lock.readLock().lock();
try {
- state.setCredentials(
- new AuthScope(environmentSubstitute(hostname), Const.toInt(environmentSubstitute(port), 80)),
- new UsernamePasswordCredentials(environmentSubstitute(username), Encr
- .decryptPasswordOptionallyEncrypted(environmentSubstitute(password))));
+ host = environmentSubstitute(hostname);
+ port = Const.toInt(environmentSubstitute(this.port), 80);
+ userName = environmentSubstitute(username);
+ password = Encr.decryptPasswordOptionallyEncrypted(environmentSubstitute(this.password));
} finally {
lock.readLock().unlock();
}
+ CredentialsProvider provider = new BasicCredentialsProvider();
+ UsernamePasswordCredentials credentials = new UsernamePasswordCredentials(userName, password);
+ provider.setCredentials(new AuthScope(host, port), credentials);
+ context.setCredentialsProvider(provider);
+
+ // Generate BASIC scheme object and add it to the local auth cache
+ HttpHost target = new HttpHost(host, port, "http");
+ AuthCache authCache = new BasicAuthCache();
+ BasicScheme basicAuth = new BasicScheme();
+ authCache.put(target, basicAuth);
+ context.setAuthCache(authCache);
+ }
- client.getParams().setAuthenticationPreemptive(true);
+ /**
+ * @return HttpClientContext with authorization credentials
+ */
+ protected HttpClientContext getAuthContext() {
+ HttpClientContext context = HttpClientContext.create();
+ addCredentials(context);
+ return context;
}
/**
@@ -816,35 +807,32 @@ String getResponseBodyAsString(InputStream is) throws IOException {
}
// Method is defined as package-protected in order to be accessible by unit tests
- GetMethod buildExecuteServiceMethod(String service, Map headerValues)
+ HttpGet buildExecuteServiceMethod(String service, Map headerValues)
throws UnsupportedEncodingException {
- GetMethod method = new GetMethod(constructUrl(service));
+ HttpGet method = new HttpGet(constructUrl(service));
for (String key : headerValues.keySet()) {
- method.setRequestHeader(key, headerValues.get(key));
+ method.setHeader(key, headerValues.get(key));
}
-
- method.getParams().setSoTimeout(KETTLE_HTTPCLIENT_SOCKET_TIMEOUT * 1000);
-
return method;
}
public String execService(String service, Map headerValues) throws Exception {
// Prepare HTTP get
- //
- GetMethod method = buildExecuteServiceMethod(service, headerValues);
-
+ HttpGet method = buildExecuteServiceMethod(service, headerValues);
// Execute request
- //
try {
- int result = getHttpClient().executeMethod(method);
+ HttpResponse httpResponse = getHttpClient().execute(method, getAuthContext());
+ StatusLine statusLine = httpResponse.getStatusLine();
+ int statusCode = statusLine.getStatusCode();
// The status code
if (log.isDebug()) {
- log.logDebug(BaseMessages.getString(PKG, "SlaveServer.DEBUG_ResponseStatus", Integer.toString(result)));
+ log.logDebug(
+ BaseMessages.getString(PKG, "SlaveServer.DEBUG_ResponseStatus", Integer.toString(statusCode)));
}
- String responseBody = method.getResponseBodyAsString();
+ String responseBody = getResponseBodyAsString(httpResponse.getEntity().getContent());
if (log.isDetailed()) {
log.logDetailed(BaseMessages.getString(PKG, "SlaveServer.DETAILED_FinishedReading", Integer
@@ -854,9 +842,9 @@ public String execService(String service, Map headerValues) thro
log.logDebug(BaseMessages.getString(PKG, "SlaveServer.DEBUG_ResponseBody", responseBody));
}
- if (result >= 400) {
- throw new KettleException(String.format("HTTP Status %d - %s - %s", method.getStatusCode(), method.getPath(),
- method.getStatusText()));
+ if (statusCode >= 400) {
+ throw new KettleException(String.format("HTTP Status %d - %s - %s", statusCode, method.getURI().toString(),
+ statusLine.getReasonPhrase()));
}
return responseBody;
@@ -871,10 +859,41 @@ public String execService(String service, Map headerValues) thro
// Method is defined as package-protected in order to be accessible by unit tests
HttpClient getHttpClient() {
- HttpClient client = SlaveConnectionManager.getInstance().createHttpClient();
- addCredentials(client);
- addProxy(client);
- return client;
+ SlaveConnectionManager connectionManager = SlaveConnectionManager.getInstance();
+ String userName;
+ String password;
+
+ String hostName;
+ int httpPort;
+
+ String proxyHost;
+ String proxyPort;
+ String nonProxyHosts;
+
+ lock.readLock().lock();
+ try {
+ hostName = environmentSubstitute(this.hostname);
+ httpPort = Const.toInt(environmentSubstitute(this.port), 80);
+ proxyHost = environmentSubstitute(this.proxyHostname);
+ proxyPort = environmentSubstitute(this.proxyPort);
+ nonProxyHosts = environmentSubstitute(this.nonProxyHosts);
+ userName = environmentSubstitute(username);
+ password = Encr
+ .decryptPasswordOptionallyEncrypted(environmentSubstitute(environmentSubstitute(this.password)));
+ } finally {
+ lock.readLock().unlock();
+ }
+ if (!Utils.isEmpty(proxyHost) && !Utils.isEmpty(proxyPort)) {
+ // skip applying proxy if non-proxy host matches
+ if (!Utils.isEmpty(nonProxyHosts) && !Utils.isEmpty(hostName) && hostName.matches(nonProxyHosts)) {
+ return connectionManager.createHttpClient(userName, password);
+ }
+ AuthScope authScope = new AuthScope(hostName, httpPort);
+ return connectionManager
+ .createHttpClient(userName, password, hostName, Integer.parseInt(proxyPort), authScope);
+ } else {
+ return connectionManager.createHttpClient();
+ }
}
public SlaveServerStatus getStatus() throws Exception {
@@ -905,7 +924,8 @@ public SlaveServerTransStatus getTransStatus(String transName, String carteObjec
return SlaveServerTransStatus.fromXML(xml);
}
- public SlaveServerJobStatus getJobStatus(String jobName, String carteObjectId, int startLogLineNr) throws Exception {
+ public SlaveServerJobStatus getJobStatus(String jobName, String carteObjectId, int startLogLineNr)
+ throws Exception {
String xml =
execService(GetJobStatusServlet.CONTEXT_PATH + "/?name=" + URLEncoder.encode(jobName, "UTF-8") + "&id="
+ Const.NVL(carteObjectId, "") + "&xml=Y&from=" + startLogLineNr, true);
diff --git a/pentaho-kettle/src/main/java/org/pentaho/di/core/database/DatabaseMeta.java b/pentaho-kettle/src/main/java/org/pentaho/di/core/database/DatabaseMeta.java
index 6e257be..0d49610 100644
--- a/pentaho-kettle/src/main/java/org/pentaho/di/core/database/DatabaseMeta.java
+++ b/pentaho-kettle/src/main/java/org/pentaho/di/core/database/DatabaseMeta.java
@@ -3,7 +3,7 @@
*
* Pentaho Data Integration
*
- * Copyright (C) 2002-2017 by Pentaho : http://www.pentaho.com
+ * Copyright (C) 2002-2017 by Hitachi Vantara : http://www.pentaho.com
*
*******************************************************************************
*
@@ -998,7 +998,7 @@ public String getXML() {
retval.append(" ").append(Const.CR);
- List list = new ArrayList();
+ List list = new ArrayList<>();
Set