From cba8037d8c23170d22a22a3da793512fa71440cc Mon Sep 17 00:00:00 2001 From: ashitsalesforce Date: Sun, 12 Jan 2025 13:03:29 -0800 Subject: [PATCH] move transport layer classes to a different package for readability move the following transport layer classes to a different package for readability - HttpClientTransportv1 - HttpClientTransportInterfacev1 - HttpTransportImpl - HttpTransportInterface - SimplePostFactory - SimplePostImpl - SimplePostInterface - TransportFactoryImpl --- .../dataloader/action/visitor/AbstractQueryVisitor.java | 2 +- .../dataloader/action/visitor/bulk/BulkV1Connection.java | 4 ++-- .../dataloader/action/visitor/bulk/BulkV2Connection.java | 4 ++-- .../dataloader/action/visitor/rest/RESTConnection.java | 4 ++-- .../java/com/salesforce/dataloader/client/ClientBase.java | 1 + .../client/{ => transport}/HttpClientTransportv1.java | 2 +- .../dataloader/client/{ => transport}/HttpTransportImpl.java | 3 ++- .../client/{ => transport}/HttpTransportInterface.java | 2 +- .../client/{ => transport}/HttpTransportInterfacev1.java | 2 +- .../dataloader/client/{ => transport}/SimplePostFactory.java | 2 +- .../dataloader/client/{ => transport}/SimplePostImpl.java | 2 +- .../client/{ => transport}/SimplePostInterface.java | 2 +- .../client/{ => transport}/TransportFactoryImpl.java | 2 +- .../java/com/salesforce/dataloader/controller/Controller.java | 2 +- .../com/salesforce/dataloader/oauth/OAuthSecretFlowUtil.java | 4 ++-- .../com/salesforce/dataloader/process/DataLoaderRunner.java | 2 +- .../com/salesforce/dataloader/ui/AuthenticationRunner.java | 2 +- .../java/com/salesforce/dataloader/ui/OAuthSecretFlow.java | 2 +- .../salesforce/dataloader/util/OAuthBrowserLoginRunner.java | 4 ++-- .../salesforce/dataloader/oauth/OAuthSecretFlowUtilTests.java | 4 ++-- .../com/salesforce/dataloader/process/ProcessTestBase.java | 2 +- 21 files changed, 28 insertions(+), 26 deletions(-) rename src/main/java/com/salesforce/dataloader/client/{ => transport}/HttpClientTransportv1.java (99%) rename src/main/java/com/salesforce/dataloader/client/{ => transport}/HttpTransportImpl.java (99%) rename src/main/java/com/salesforce/dataloader/client/{ => transport}/HttpTransportInterface.java (98%) rename src/main/java/com/salesforce/dataloader/client/{ => transport}/HttpTransportInterfacev1.java (98%) rename src/main/java/com/salesforce/dataloader/client/{ => transport}/SimplePostFactory.java (98%) rename src/main/java/com/salesforce/dataloader/client/{ => transport}/SimplePostImpl.java (98%) rename src/main/java/com/salesforce/dataloader/client/{ => transport}/SimplePostInterface.java (97%) rename src/main/java/com/salesforce/dataloader/client/{ => transport}/TransportFactoryImpl.java (97%) diff --git a/src/main/java/com/salesforce/dataloader/action/visitor/AbstractQueryVisitor.java b/src/main/java/com/salesforce/dataloader/action/visitor/AbstractQueryVisitor.java index cb495c98..1d0d7e1b 100644 --- a/src/main/java/com/salesforce/dataloader/action/visitor/AbstractQueryVisitor.java +++ b/src/main/java/com/salesforce/dataloader/action/visitor/AbstractQueryVisitor.java @@ -28,7 +28,7 @@ import com.salesforce.dataloader.action.AbstractExtractAction; import com.salesforce.dataloader.action.progress.ILoaderProgress; -import com.salesforce.dataloader.client.HttpTransportImpl; +import com.salesforce.dataloader.client.transport.HttpTransportImpl; import com.salesforce.dataloader.config.AppConfig; import com.salesforce.dataloader.config.Messages; import com.salesforce.dataloader.controller.Controller; diff --git a/src/main/java/com/salesforce/dataloader/action/visitor/bulk/BulkV1Connection.java b/src/main/java/com/salesforce/dataloader/action/visitor/bulk/BulkV1Connection.java index 261d160e..c59d745c 100644 --- a/src/main/java/com/salesforce/dataloader/action/visitor/bulk/BulkV1Connection.java +++ b/src/main/java/com/salesforce/dataloader/action/visitor/bulk/BulkV1Connection.java @@ -35,8 +35,8 @@ import org.apache.logging.log4j.Logger; import com.salesforce.dataloader.client.ClientBase; -import com.salesforce.dataloader.client.HttpTransportImpl; -import com.salesforce.dataloader.client.HttpTransportInterface; +import com.salesforce.dataloader.client.transport.HttpTransportImpl; +import com.salesforce.dataloader.client.transport.HttpTransportInterface; import com.salesforce.dataloader.config.AppConfig; import com.salesforce.dataloader.exception.HttpClientTransportException; import com.salesforce.dataloader.util.AppUtil; diff --git a/src/main/java/com/salesforce/dataloader/action/visitor/bulk/BulkV2Connection.java b/src/main/java/com/salesforce/dataloader/action/visitor/bulk/BulkV2Connection.java index ac5a311a..5ad5dacc 100644 --- a/src/main/java/com/salesforce/dataloader/action/visitor/bulk/BulkV2Connection.java +++ b/src/main/java/com/salesforce/dataloader/action/visitor/bulk/BulkV2Connection.java @@ -151,8 +151,8 @@ private static void writeTo(BufferedInputStream bis, BufferedOutputStream bos) t import org.apache.logging.log4j.Logger; import com.salesforce.dataloader.client.ClientBase; -import com.salesforce.dataloader.client.HttpTransportImpl; -import com.salesforce.dataloader.client.HttpTransportInterface; +import com.salesforce.dataloader.client.transport.HttpTransportImpl; +import com.salesforce.dataloader.client.transport.HttpTransportInterface; import com.salesforce.dataloader.controller.Controller; import com.salesforce.dataloader.exception.HttpClientTransportException; import com.salesforce.dataloader.util.AppUtil; diff --git a/src/main/java/com/salesforce/dataloader/action/visitor/rest/RESTConnection.java b/src/main/java/com/salesforce/dataloader/action/visitor/rest/RESTConnection.java index c6a96a32..f0f00db2 100644 --- a/src/main/java/com/salesforce/dataloader/action/visitor/rest/RESTConnection.java +++ b/src/main/java/com/salesforce/dataloader/action/visitor/rest/RESTConnection.java @@ -41,10 +41,10 @@ import org.apache.logging.log4j.Logger; import com.fasterxml.jackson.core.JsonProcessingException; -import com.salesforce.dataloader.client.HttpTransportImpl; -import com.salesforce.dataloader.client.HttpTransportInterface; import com.salesforce.dataloader.client.SessionInfo; import com.salesforce.dataloader.client.CompositeRESTClient.ACTION_ENUM; +import com.salesforce.dataloader.client.transport.HttpTransportImpl; +import com.salesforce.dataloader.client.transport.HttpTransportInterface; import com.salesforce.dataloader.config.AppConfig; import com.salesforce.dataloader.config.Messages; import com.salesforce.dataloader.controller.Controller; diff --git a/src/main/java/com/salesforce/dataloader/client/ClientBase.java b/src/main/java/com/salesforce/dataloader/client/ClientBase.java index ee2c6427..c30cac78 100644 --- a/src/main/java/com/salesforce/dataloader/client/ClientBase.java +++ b/src/main/java/com/salesforce/dataloader/client/ClientBase.java @@ -30,6 +30,7 @@ import org.apache.logging.log4j.Logger; import com.salesforce.dataloader.client.SessionInfo.NotLoggedInException; +import com.salesforce.dataloader.client.transport.TransportFactoryImpl; import com.salesforce.dataloader.config.AppConfig; import com.salesforce.dataloader.config.Messages; import com.salesforce.dataloader.controller.Controller; diff --git a/src/main/java/com/salesforce/dataloader/client/HttpClientTransportv1.java b/src/main/java/com/salesforce/dataloader/client/transport/HttpClientTransportv1.java similarity index 99% rename from src/main/java/com/salesforce/dataloader/client/HttpClientTransportv1.java rename to src/main/java/com/salesforce/dataloader/client/transport/HttpClientTransportv1.java index 8aa16382..fe7851ee 100644 --- a/src/main/java/com/salesforce/dataloader/client/HttpClientTransportv1.java +++ b/src/main/java/com/salesforce/dataloader/client/transport/HttpClientTransportv1.java @@ -23,7 +23,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -package com.salesforce.dataloader.client; +package com.salesforce.dataloader.client.transport; import java.io.*; import java.net.*; diff --git a/src/main/java/com/salesforce/dataloader/client/HttpTransportImpl.java b/src/main/java/com/salesforce/dataloader/client/transport/HttpTransportImpl.java similarity index 99% rename from src/main/java/com/salesforce/dataloader/client/HttpTransportImpl.java rename to src/main/java/com/salesforce/dataloader/client/transport/HttpTransportImpl.java index 7f73a6d0..4be55bd9 100644 --- a/src/main/java/com/salesforce/dataloader/client/HttpTransportImpl.java +++ b/src/main/java/com/salesforce/dataloader/client/transport/HttpTransportImpl.java @@ -23,7 +23,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -package com.salesforce.dataloader.client; +package com.salesforce.dataloader.client.transport; import java.io.*; import java.net.*; @@ -55,6 +55,7 @@ import org.apache.http.entity.ContentType; import org.apache.http.entity.InputStreamEntity; +import com.salesforce.dataloader.client.ClientBase; import com.salesforce.dataloader.config.AppConfig; import com.salesforce.dataloader.exception.HttpClientTransportException; import com.salesforce.dataloader.util.AppUtil; diff --git a/src/main/java/com/salesforce/dataloader/client/HttpTransportInterface.java b/src/main/java/com/salesforce/dataloader/client/transport/HttpTransportInterface.java similarity index 98% rename from src/main/java/com/salesforce/dataloader/client/HttpTransportInterface.java rename to src/main/java/com/salesforce/dataloader/client/transport/HttpTransportInterface.java index a5460148..dfc054ad 100644 --- a/src/main/java/com/salesforce/dataloader/client/HttpTransportInterface.java +++ b/src/main/java/com/salesforce/dataloader/client/transport/HttpTransportInterface.java @@ -24,7 +24,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -package com.salesforce.dataloader.client; +package com.salesforce.dataloader.client.transport; import java.io.OutputStream; import java.io.InputStream; diff --git a/src/main/java/com/salesforce/dataloader/client/HttpTransportInterfacev1.java b/src/main/java/com/salesforce/dataloader/client/transport/HttpTransportInterfacev1.java similarity index 98% rename from src/main/java/com/salesforce/dataloader/client/HttpTransportInterfacev1.java rename to src/main/java/com/salesforce/dataloader/client/transport/HttpTransportInterfacev1.java index ce2c20ee..7e3cb297 100644 --- a/src/main/java/com/salesforce/dataloader/client/HttpTransportInterfacev1.java +++ b/src/main/java/com/salesforce/dataloader/client/transport/HttpTransportInterfacev1.java @@ -24,7 +24,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -package com.salesforce.dataloader.client; +package com.salesforce.dataloader.client.transport; import java.io.OutputStream; import java.net.HttpURLConnection; diff --git a/src/main/java/com/salesforce/dataloader/client/SimplePostFactory.java b/src/main/java/com/salesforce/dataloader/client/transport/SimplePostFactory.java similarity index 98% rename from src/main/java/com/salesforce/dataloader/client/SimplePostFactory.java rename to src/main/java/com/salesforce/dataloader/client/transport/SimplePostFactory.java index 55224c58..e00c7912 100644 --- a/src/main/java/com/salesforce/dataloader/client/SimplePostFactory.java +++ b/src/main/java/com/salesforce/dataloader/client/transport/SimplePostFactory.java @@ -23,7 +23,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -package com.salesforce.dataloader.client; +package com.salesforce.dataloader.client.transport; import com.salesforce.dataloader.config.AppConfig; import org.apache.http.message.BasicNameValuePair; diff --git a/src/main/java/com/salesforce/dataloader/client/SimplePostImpl.java b/src/main/java/com/salesforce/dataloader/client/transport/SimplePostImpl.java similarity index 98% rename from src/main/java/com/salesforce/dataloader/client/SimplePostImpl.java rename to src/main/java/com/salesforce/dataloader/client/transport/SimplePostImpl.java index 7c2f214c..3747c58f 100644 --- a/src/main/java/com/salesforce/dataloader/client/SimplePostImpl.java +++ b/src/main/java/com/salesforce/dataloader/client/transport/SimplePostImpl.java @@ -24,7 +24,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -package com.salesforce.dataloader.client; +package com.salesforce.dataloader.client.transport; import com.salesforce.dataloader.config.AppConfig; import com.salesforce.dataloader.exception.ParameterLoadException; diff --git a/src/main/java/com/salesforce/dataloader/client/SimplePostInterface.java b/src/main/java/com/salesforce/dataloader/client/transport/SimplePostInterface.java similarity index 97% rename from src/main/java/com/salesforce/dataloader/client/SimplePostInterface.java rename to src/main/java/com/salesforce/dataloader/client/transport/SimplePostInterface.java index f27dcca0..69dcd991 100644 --- a/src/main/java/com/salesforce/dataloader/client/SimplePostInterface.java +++ b/src/main/java/com/salesforce/dataloader/client/transport/SimplePostInterface.java @@ -23,7 +23,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -package com.salesforce.dataloader.client; +package com.salesforce.dataloader.client.transport; import com.salesforce.dataloader.exception.ParameterLoadException; diff --git a/src/main/java/com/salesforce/dataloader/client/TransportFactoryImpl.java b/src/main/java/com/salesforce/dataloader/client/transport/TransportFactoryImpl.java similarity index 97% rename from src/main/java/com/salesforce/dataloader/client/TransportFactoryImpl.java rename to src/main/java/com/salesforce/dataloader/client/transport/TransportFactoryImpl.java index 8ae1692b..0f168c84 100644 --- a/src/main/java/com/salesforce/dataloader/client/TransportFactoryImpl.java +++ b/src/main/java/com/salesforce/dataloader/client/transport/TransportFactoryImpl.java @@ -23,7 +23,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -package com.salesforce.dataloader.client; +package com.salesforce.dataloader.client.transport; import com.sforce.ws.transport.Transport; import com.sforce.ws.transport.TransportFactory; diff --git a/src/main/java/com/salesforce/dataloader/controller/Controller.java b/src/main/java/com/salesforce/dataloader/controller/Controller.java index 7c1b1724..6ad63dbd 100644 --- a/src/main/java/com/salesforce/dataloader/controller/Controller.java +++ b/src/main/java/com/salesforce/dataloader/controller/Controller.java @@ -31,10 +31,10 @@ import com.salesforce.dataloader.client.BulkV1Client; import com.salesforce.dataloader.client.BulkV2Client; import com.salesforce.dataloader.client.ClientBase; -import com.salesforce.dataloader.client.HttpTransportImpl; import com.salesforce.dataloader.client.PartnerClient; import com.salesforce.dataloader.client.CompositeRESTClient; import com.salesforce.dataloader.client.ReferenceEntitiesDescribeMap; +import com.salesforce.dataloader.client.transport.HttpTransportImpl; import com.salesforce.dataloader.config.AppConfig; import com.salesforce.dataloader.config.Messages; import com.salesforce.dataloader.dao.DataAccessObject; diff --git a/src/main/java/com/salesforce/dataloader/oauth/OAuthSecretFlowUtil.java b/src/main/java/com/salesforce/dataloader/oauth/OAuthSecretFlowUtil.java index 4af68fd2..e5698b2f 100644 --- a/src/main/java/com/salesforce/dataloader/oauth/OAuthSecretFlowUtil.java +++ b/src/main/java/com/salesforce/dataloader/oauth/OAuthSecretFlowUtil.java @@ -35,8 +35,8 @@ import org.apache.http.message.BasicNameValuePair; -import com.salesforce.dataloader.client.SimplePostInterface; -import com.salesforce.dataloader.client.SimplePostFactory; +import com.salesforce.dataloader.client.transport.SimplePostFactory; +import com.salesforce.dataloader.client.transport.SimplePostInterface; import com.salesforce.dataloader.config.AppConfig; import com.salesforce.dataloader.exception.ParameterLoadException; import com.salesforce.dataloader.util.OAuthBrowserLoginRunner; diff --git a/src/main/java/com/salesforce/dataloader/process/DataLoaderRunner.java b/src/main/java/com/salesforce/dataloader/process/DataLoaderRunner.java index c0827a9a..b62800cd 100644 --- a/src/main/java/com/salesforce/dataloader/process/DataLoaderRunner.java +++ b/src/main/java/com/salesforce/dataloader/process/DataLoaderRunner.java @@ -54,7 +54,7 @@ import org.eclipse.swt.widgets.Shell; import com.salesforce.dataloader.action.progress.ILoaderProgress; -import com.salesforce.dataloader.client.HttpTransportImpl; +import com.salesforce.dataloader.client.transport.HttpTransportImpl; import com.salesforce.dataloader.config.AppConfig; import com.salesforce.dataloader.controller.Controller; diff --git a/src/main/java/com/salesforce/dataloader/ui/AuthenticationRunner.java b/src/main/java/com/salesforce/dataloader/ui/AuthenticationRunner.java index 4d198c73..6be203a2 100644 --- a/src/main/java/com/salesforce/dataloader/ui/AuthenticationRunner.java +++ b/src/main/java/com/salesforce/dataloader/ui/AuthenticationRunner.java @@ -26,7 +26,7 @@ package com.salesforce.dataloader.ui; -import com.salesforce.dataloader.client.HttpTransportInterface; +import com.salesforce.dataloader.client.transport.HttpTransportInterface; import com.salesforce.dataloader.config.AppConfig; import com.salesforce.dataloader.controller.Controller; import com.salesforce.dataloader.model.LoginCriteria; diff --git a/src/main/java/com/salesforce/dataloader/ui/OAuthSecretFlow.java b/src/main/java/com/salesforce/dataloader/ui/OAuthSecretFlow.java index b6d18e26..3251364f 100644 --- a/src/main/java/com/salesforce/dataloader/ui/OAuthSecretFlow.java +++ b/src/main/java/com/salesforce/dataloader/ui/OAuthSecretFlow.java @@ -25,7 +25,7 @@ */ package com.salesforce.dataloader.ui; -import com.salesforce.dataloader.client.SimplePostInterface; +import com.salesforce.dataloader.client.transport.SimplePostInterface; import com.salesforce.dataloader.config.AppConfig; import com.salesforce.dataloader.exception.ParameterLoadException; import com.salesforce.dataloader.oauth.OAuthSecretFlowUtil; diff --git a/src/main/java/com/salesforce/dataloader/util/OAuthBrowserLoginRunner.java b/src/main/java/com/salesforce/dataloader/util/OAuthBrowserLoginRunner.java index e3c23aaf..fa3af555 100644 --- a/src/main/java/com/salesforce/dataloader/util/OAuthBrowserLoginRunner.java +++ b/src/main/java/com/salesforce/dataloader/util/OAuthBrowserLoginRunner.java @@ -48,8 +48,8 @@ import com.google.gson.FieldNamingPolicy; import com.google.gson.Gson; import com.google.gson.GsonBuilder; -import com.salesforce.dataloader.client.SimplePostInterface; -import com.salesforce.dataloader.client.SimplePostFactory; +import com.salesforce.dataloader.client.transport.SimplePostFactory; +import com.salesforce.dataloader.client.transport.SimplePostInterface; import com.salesforce.dataloader.config.AppConfig; import com.salesforce.dataloader.config.Messages; import com.salesforce.dataloader.exception.OAuthBrowserLoginRunnerException; diff --git a/src/test/java/com/salesforce/dataloader/oauth/OAuthSecretFlowUtilTests.java b/src/test/java/com/salesforce/dataloader/oauth/OAuthSecretFlowUtilTests.java index 84143b3c..a0d0b652 100644 --- a/src/test/java/com/salesforce/dataloader/oauth/OAuthSecretFlowUtilTests.java +++ b/src/test/java/com/salesforce/dataloader/oauth/OAuthSecretFlowUtilTests.java @@ -29,8 +29,8 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.salesforce.dataloader.ConfigTestBase; -import com.salesforce.dataloader.client.SimplePostInterface; -import com.salesforce.dataloader.client.SimplePostFactory; +import com.salesforce.dataloader.client.transport.SimplePostFactory; +import com.salesforce.dataloader.client.transport.SimplePostInterface; import com.salesforce.dataloader.config.AppConfig; import com.salesforce.dataloader.exception.ParameterLoadException; import com.salesforce.dataloader.model.OAuthToken; diff --git a/src/test/java/com/salesforce/dataloader/process/ProcessTestBase.java b/src/test/java/com/salesforce/dataloader/process/ProcessTestBase.java index 569d7ea7..e920c070 100644 --- a/src/test/java/com/salesforce/dataloader/process/ProcessTestBase.java +++ b/src/test/java/com/salesforce/dataloader/process/ProcessTestBase.java @@ -45,8 +45,8 @@ import com.salesforce.dataloader.*; import com.salesforce.dataloader.action.OperationInfo; import com.salesforce.dataloader.action.progress.ILoaderProgress; -import com.salesforce.dataloader.client.HttpTransportImpl; import com.salesforce.dataloader.client.PartnerClient; +import com.salesforce.dataloader.client.transport.HttpTransportImpl; import com.salesforce.dataloader.config.AppConfig; import com.salesforce.dataloader.controller.Controller; import com.salesforce.dataloader.dao.DataAccessObjectFactory;