sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject [48/52] [abbrv] git commit: SQOOP-1498: Sqoop2: Repository Object refactoring (objects prefixed with M)
Date Fri, 10 Oct 2014 02:52:17 GMT
SQOOP-1498: Sqoop2: Repository Object refactoring (objects prefixed with M)

(Veena Basavaraj via Abraham Elmahrek)


Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/8362c73c
Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/8362c73c
Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/8362c73c

Branch: refs/heads/SQOOP-1367
Commit: 8362c73cc01313d2510a659bf296efd727bb1d4e
Parents: e540668
Author: Abraham Elmahrek <abraham@elmahrek.com>
Authored: Thu Oct 2 23:29:50 2014 -0700
Committer: Abraham Elmahrek <abraham@elmahrek.com>
Committed: Thu Oct 9 18:22:51 2014 -0700

----------------------------------------------------------------------
 .../org/apache/sqoop/client/SqoopClient.java    | 119 +--
 .../request/ConnectorResourceRequest.java       |   4 +-
 .../request/DriverConfigResourceRequest.java    |  15 +-
 .../client/request/JobResourceRequest.java      |  26 +-
 .../client/request/LinkResourceRequest.java     |  10 +-
 .../client/request/SqoopResourceRequests.java   |   4 +-
 .../apache/sqoop/client/TestSqoopClient.java    |  73 +-
 .../org/apache/sqoop/json/ConnectorBean.java    | 129 +--
 .../java/org/apache/sqoop/json/DriverBean.java  |  90 ++
 .../org/apache/sqoop/json/DriverConfigBean.java |  92 --
 .../java/org/apache/sqoop/json/JobBean.java     |  77 +-
 .../apache/sqoop/json/JobValidationBean.java    |  83 +-
 .../java/org/apache/sqoop/json/LinkBean.java    |  96 +-
 .../apache/sqoop/json/LinkValidationBean.java   |  56 +-
 .../org/apache/sqoop/json/ThrowableBean.java    |   2 +-
 .../apache/sqoop/json/ValidationResultBean.java |  18 +-
 .../sqoop/json/util/ConfigSerialization.java    | 226 +++++
 .../sqoop/json/util/FormSerialization.java      | 223 -----
 .../json/util/ResourceBundleSerialization.java  |   2 -
 .../java/org/apache/sqoop/model/Config.java     |  34 +
 .../org/apache/sqoop/model/ConfigClass.java     |  45 +
 .../org/apache/sqoop/model/ConfigUtils.java     | 637 +++++++++++++
 .../apache/sqoop/model/ConfigurationClass.java  |   7 +-
 .../main/java/org/apache/sqoop/model/Form.java  |  35 -
 .../java/org/apache/sqoop/model/FormClass.java  |  45 -
 .../java/org/apache/sqoop/model/FormUtils.java  | 634 -------------
 .../java/org/apache/sqoop/model/MConfig.java    | 117 +++
 .../org/apache/sqoop/model/MConfigList.java     | 124 +++
 .../org/apache/sqoop/model/MConfigType.java     |  34 +
 .../apache/sqoop/model/MConnectionForms.java    |  54 --
 .../java/org/apache/sqoop/model/MConnector.java | 124 ++-
 .../java/org/apache/sqoop/model/MDriver.java    |  82 ++
 .../org/apache/sqoop/model/MDriverConfig.java   |  65 +-
 .../main/java/org/apache/sqoop/model/MForm.java | 117 ---
 .../java/org/apache/sqoop/model/MFormList.java  | 124 ---
 .../java/org/apache/sqoop/model/MFormType.java  |  34 -
 .../org/apache/sqoop/model/MFromConfig.java     |  64 ++
 .../main/java/org/apache/sqoop/model/MJob.java  | 102 +-
 .../java/org/apache/sqoop/model/MJobForms.java  |  55 --
 .../main/java/org/apache/sqoop/model/MLink.java |  72 +-
 .../org/apache/sqoop/model/MLinkConfig.java     |  54 ++
 .../java/org/apache/sqoop/model/MToConfig.java  |  64 ++
 .../java/org/apache/sqoop/model/ModelError.java |   6 +-
 .../java/org/apache/sqoop/utils/ClassUtils.java |   6 +-
 .../sqoop/validation/ConfigValidationError.java |  52 +
 .../validation/ConfigValidationResult.java      |  98 ++
 .../validation/ConfigValidationRunner.java      | 177 ++++
 .../sqoop/validation/ConfigValidator.java       | 228 +++++
 .../org/apache/sqoop/validation/Message.java    |   2 +-
 .../org/apache/sqoop/validation/Validation.java | 228 -----
 .../sqoop/validation/ValidationError.java       |  52 -
 .../sqoop/validation/ValidationResult.java      |  98 --
 .../sqoop/validation/ValidationRunner.java      | 176 ----
 .../org/apache/sqoop/json/ConfigTestUtil.java   | 217 +++++
 .../apache/sqoop/json/TestConnectorBean.java    |  37 +-
 .../org/apache/sqoop/json/TestDriverBean.java   |  62 ++
 .../apache/sqoop/json/TestDriverConfigBean.java |  62 --
 .../java/org/apache/sqoop/json/TestJobBean.java |  40 +-
 .../org/apache/sqoop/json/TestLinkBean.java     |  56 +-
 .../java/org/apache/sqoop/json/TestUtil.java    | 153 ---
 .../apache/sqoop/json/TestValidationBean.java   |  83 +-
 .../sqoop/json/TestValidationResultBean.java    |  24 +-
 .../json/util/TestConfigSerialization.java      | 157 ++++
 .../sqoop/json/util/TestFormSerialization.java  | 157 ----
 .../org/apache/sqoop/model/TestConfigUtils.java | 290 ++++++
 .../org/apache/sqoop/model/TestFormUtils.java   | 295 ------
 .../sqoop/model/TestMAccountableEntity.java     |   9 +-
 .../org/apache/sqoop/model/TestMConfig.java     |  86 ++
 .../org/apache/sqoop/model/TestMConfigList.java |  55 ++
 .../sqoop/model/TestMConnectionForms.java       |  48 -
 .../org/apache/sqoop/model/TestMConnector.java  | 144 +--
 .../org/apache/sqoop/model/TestMDriver.java     |  40 +
 .../apache/sqoop/model/TestMDriverConfig.java   |  47 -
 .../java/org/apache/sqoop/model/TestMForm.java  |  89 --
 .../org/apache/sqoop/model/TestMFormList.java   |  58 --
 .../java/org/apache/sqoop/model/TestMJob.java   | 110 ++-
 .../org/apache/sqoop/model/TestMJobConfig.java  |  42 +
 .../org/apache/sqoop/model/TestMJobForms.java   |  46 -
 .../java/org/apache/sqoop/model/TestMLink.java  |  74 +-
 .../org/apache/sqoop/model/TestMLinkConfig.java |  45 +
 .../apache/sqoop/validation/TestValidation.java |  70 +-
 .../sqoop/validation/TestValidationRunner.java  |  98 +-
 .../validators/TestClassAvailable.java          |  12 +-
 .../connector/jdbc/GenericJdbcConnector.java    |   2 +-
 .../jdbc/GenericJdbcConnectorUpgrader.java      |  54 +-
 .../connector/jdbc/GenericJdbcExtractor.java    |  12 +-
 .../jdbc/GenericJdbcFromDestroyer.java          |   2 +-
 .../jdbc/GenericJdbcFromInitializer.java        |  36 +-
 .../sqoop/connector/jdbc/GenericJdbcLoader.java |  10 +-
 .../connector/jdbc/GenericJdbcPartitioner.java  |   5 +-
 .../connector/jdbc/GenericJdbcToDestroyer.java  |  18 +-
 .../jdbc/GenericJdbcToInitializer.java          |  32 +-
 .../connector/jdbc/GenericJdbcValidator.java    |  30 +-
 .../jdbc/configuration/FromJobConfig.java       |  14 +-
 .../configuration/FromJobConfiguration.java     |   4 +-
 .../jdbc/configuration/LinkConfig.java          |   6 +-
 .../jdbc/configuration/LinkConfiguration.java   |   6 +-
 .../jdbc/configuration/ToJobConfig.java         |  16 +-
 .../jdbc/configuration/ToJobConfiguration.java  |   4 +-
 .../generic-jdbc-connector-config.properties    |  24 +-
 .../connector/jdbc/GenericJdbcExecutorTest.java |   3 -
 .../sqoop/connector/jdbc/TestExtractor.java     |  24 +-
 .../connector/jdbc/TestFromInitializer.java     | 158 ++--
 .../apache/sqoop/connector/jdbc/TestLoader.java |   8 +-
 .../sqoop/connector/jdbc/TestPartitioner.java   |  98 +-
 .../sqoop/connector/jdbc/TestToInitializer.java | 188 ++--
 .../connector/hdfs/HdfsConfigUpgrader.java      |  50 +-
 .../sqoop/connector/hdfs/HdfsConnector.java     |   2 +-
 .../sqoop/connector/hdfs/HdfsExtractor.java     |   4 +-
 .../sqoop/connector/hdfs/HdfsInitializer.java   |   6 +-
 .../apache/sqoop/connector/hdfs/HdfsLoader.java |  14 +-
 .../sqoop/connector/hdfs/HdfsPartitioner.java   |   6 +-
 .../sqoop/connector/hdfs/HdfsValidator.java     |  49 +-
 .../hdfs/configuration/FromJobConfig.java       |   4 +-
 .../configuration/FromJobConfiguration.java     |   4 +-
 .../hdfs/configuration/LinkConfig.java          |   6 +-
 .../hdfs/configuration/LinkConfiguration.java   |   8 +-
 .../hdfs/configuration/ToJobConfig.java         |   4 +-
 .../hdfs/configuration/ToJobConfiguration.java  |   4 +-
 .../resources/hdfs-connector-config.properties  |   8 +-
 .../idf/TestCSVIntermediateDataFormat.java      |  14 +-
 .../sqoop/connector/ConnectorHandler.java       |  28 +-
 .../sqoop/connector/ConnectorManager.java       |   2 +-
 .../java/org/apache/sqoop/driver/Driver.java    |  47 +-
 .../sqoop/driver/DriverConfigUpgrader.java      |  48 +-
 .../sqoop/driver/DriverConfigValidator.java     |  46 +
 .../apache/sqoop/driver/DriverValidator.java    |  54 --
 .../org/apache/sqoop/driver/JobManager.java     |  72 +-
 .../org/apache/sqoop/driver/JobRequest.java     |  63 +-
 .../configuration/DriverConfiguration.java      |  34 +
 .../driver/configuration/JobConfiguration.java  |  34 -
 .../driver/configuration/LinkConfiguration.java |  28 -
 .../driver/configuration/ThrottlingConfig.java  |  32 +
 .../driver/configuration/ThrottlingForm.java    |  32 -
 .../apache/sqoop/repository/JdbcRepository.java |  46 +-
 .../sqoop/repository/JdbcRepositoryHandler.java |  14 +-
 .../org/apache/sqoop/repository/Repository.java | 254 +++--
 .../sqoop/repository/RepositoryManager.java     |   2 +-
 .../src/main/resources/driver-config.properties |  12 +-
 .../sqoop/driver/TestDriverConfigUpgrader.java  |  88 +-
 .../org/apache/sqoop/driver/TestJobManager.java |  18 +-
 .../sqoop/repository/TestJdbcRepository.java    | 495 +++-------
 .../main/java/org/apache/sqoop/job/io/Data.java |   2 +-
 .../apache/sqoop/job/mr/ConfigurationUtils.java | 124 +--
 .../sqoop/job/mr/SqoopDestroyerExecutor.java    |   2 +-
 .../java/org/apache/sqoop/job/JobUtils.java     |   3 +-
 .../org/apache/sqoop/job/TestMapReduce.java     |   1 -
 .../sqoop/job/mr/TestConfigurationUtils.java    | 118 ++-
 .../sqoop/repository/derby/DerbyRepoError.java  |   2 +-
 .../derby/DerbyRepositoryHandler.java           | 777 +++++++--------
 .../repository/derby/DerbySchemaConstants.java  | 108 +--
 .../repository/derby/DerbySchemaQuery.java      | 640 ++++++-------
 .../sqoop/repository/derby/DerbyTestCase.java   | 287 +++---
 .../repository/derby/TestConnectorHandling.java |   6 +-
 .../derby/TestDriverConfigHandling.java         | 135 ---
 .../repository/derby/TestDriverHandling.java    | 135 +++
 .../sqoop/repository/derby/TestInputTypes.java  |  22 +-
 .../sqoop/repository/derby/TestJobHandling.java | 216 ++---
 .../repository/derby/TestLinkHandling.java      | 118 +--
 .../derby/TestSubmissionHandling.java           |   2 +-
 .../sqoop/handler/ConnectorRequestHandler.java  |   2 +-
 .../handler/DriverConfigRequestHandler.java     |  11 +-
 .../apache/sqoop/handler/JobRequestHandler.java |  95 +-
 .../sqoop/handler/LinkRequestHandler.java       | 158 ++--
 .../apache/sqoop/shell/CloneJobFunction.java    |  18 +-
 .../apache/sqoop/shell/CloneLinkFunction.java   |  17 +-
 .../apache/sqoop/shell/CreateJobFunction.java   |  26 +-
 .../apache/sqoop/shell/CreateLinkFunction.java  |  22 +-
 .../org/apache/sqoop/shell/ShowCommand.java     |   2 +-
 .../sqoop/shell/ShowConnectorFunction.java      |   4 +-
 .../sqoop/shell/ShowDriverConfigFunction.java   |  60 --
 .../apache/sqoop/shell/ShowDriverFunction.java  |  55 ++
 .../org/apache/sqoop/shell/ShowJobFunction.java |  13 +-
 .../apache/sqoop/shell/ShowLinkFunction.java    |  28 +-
 .../org/apache/sqoop/shell/SqoopFunction.java   |   4 +-
 .../apache/sqoop/shell/UpdateJobFunction.java   |  25 +-
 .../apache/sqoop/shell/UpdateLinkFunction.java  |  23 +-
 .../org/apache/sqoop/shell/core/Constants.java  |  64 +-
 .../sqoop/shell/utils/ConfigDisplayer.java      | 258 +++++
 .../apache/sqoop/shell/utils/ConfigFiller.java  | 911 ++++++++++++++++++
 .../apache/sqoop/shell/utils/ConfigOptions.java | 117 +++
 .../sqoop/shell/utils/DynamicConfigOptions.java |  35 +
 .../sqoop/shell/utils/DynamicFormOptions.java   |  35 -
 .../apache/sqoop/shell/utils/FormDisplayer.java | 267 ------
 .../apache/sqoop/shell/utils/FormFiller.java    | 939 -------------------
 .../apache/sqoop/shell/utils/FormOptions.java   | 117 ---
 .../shell/utils/JobDynamicConfigOptions.java    |  48 +
 .../shell/utils/JobDynamicFormOptions.java      |  48 -
 .../shell/utils/LinkDynamicConfigOptions.java   |  39 +
 .../shell/utils/LinkDynamicFormOptions.java     |  43 -
 .../main/resources/shell-resource.properties    |  34 +-
 .../sqoop/connector/spi/RepositoryUpgrader.java |  28 +-
 .../sqoop/connector/spi/SqoopConnector.java     |  10 +-
 .../org/apache/sqoop/job/etl/Destroyer.java     |   2 +-
 .../org/apache/sqoop/job/etl/Extractor.java     |   4 +-
 .../org/apache/sqoop/job/etl/Initializer.java   |  40 +-
 .../java/org/apache/sqoop/job/etl/Loader.java   |  10 +-
 .../org/apache/sqoop/job/etl/Partitioner.java   |  10 +-
 .../org/apache/sqoop/validation/Validator.java  |  12 +-
 .../mapreduce/MapreduceSubmissionEngine.java    |  18 +-
 .../minicluster/TomcatSqoopMiniCluster.java     |  13 +-
 .../sqoop/test/testcases/ConnectorTestCase.java |  53 +-
 .../sqoop/test/testcases/TomcatTestCase.java    |   4 +-
 .../jdbc/generic/FromHDFSToRDBMSTest.java       |  19 +-
 .../jdbc/generic/FromRDBMSToHDFSTest.java       |  39 +-
 .../connector/jdbc/generic/PartitionerTest.java |  25 +-
 .../jdbc/generic/TableStagedRDBMSTest.java      |  26 +-
 .../SubmissionWithDisabledModelObjectsTest.java |  24 +-
 208 files changed, 8198 insertions(+), 8638 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/8362c73c/client/src/main/java/org/apache/sqoop/client/SqoopClient.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/SqoopClient.java b/client/src/main/java/org/apache/sqoop/client/SqoopClient.java
index d7e6768..bffb599 100644
--- a/client/src/main/java/org/apache/sqoop/client/SqoopClient.java
+++ b/client/src/main/java/org/apache/sqoop/client/SqoopClient.java
@@ -17,26 +17,27 @@
  */
 package org.apache.sqoop.client;
 
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.ResourceBundle;
+
 import org.apache.sqoop.client.request.SqoopResourceRequests;
 import org.apache.sqoop.common.Direction;
 import org.apache.sqoop.common.SqoopException;
 import org.apache.sqoop.json.ConnectorBean;
-import org.apache.sqoop.json.DriverConfigBean;
+import org.apache.sqoop.json.DriverBean;
 import org.apache.sqoop.json.ValidationResultBean;
-import org.apache.sqoop.model.FormUtils;
-import org.apache.sqoop.model.MLink;
+import org.apache.sqoop.model.ConfigUtils;
 import org.apache.sqoop.model.MConnector;
+import org.apache.sqoop.model.MDriver;
 import org.apache.sqoop.model.MDriverConfig;
 import org.apache.sqoop.model.MJob;
+import org.apache.sqoop.model.MLink;
 import org.apache.sqoop.model.MSubmission;
+import org.apache.sqoop.validation.ConfigValidationResult;
 import org.apache.sqoop.validation.Status;
-import org.apache.sqoop.validation.ValidationResult;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.ResourceBundle;
 
 /**
  * Sqoop client API.
@@ -69,9 +70,9 @@ public class SqoopClient {
   private Map<Long, ResourceBundle> connectorConfigBundles;
 
   /**
-   * Cached driverConfig.
+   * Cached driver.
    */
-  private MDriverConfig driverConfig;
+  private MDriver mDriver;
   /**
    * Cached driverConfig bundle.
    */
@@ -120,7 +121,7 @@ public class SqoopClient {
     connectorConfigBundles = new HashMap<Long, ResourceBundle>();
     driverConfigBundle = null;
     connectors = new HashMap<Long, MConnector>();
-    driverConfig = null;
+    mDriver = null;
     isAllConnectors = false;
   }
 
@@ -214,11 +215,10 @@ public class SqoopClient {
    * @param connectorId Connector id.
    * @return
    */
-  public ResourceBundle getConnectorConfigResourceBundle(long connectorId) {
+  public ResourceBundle getConnectorConfigBundle(long connectorId) {
     if(connectorConfigBundles.containsKey(connectorId)) {
       return connectorConfigBundles.get(connectorId);
     }
-
     retrieveConnector(connectorId);
     return connectorConfigBundles.get(connectorId);
   }
@@ -229,33 +229,46 @@ public class SqoopClient {
    * @return
    */
   public MDriverConfig getDriverConfig() {
-    if(driverConfig != null) {
-      return driverConfig.clone(false);
+    if (mDriver != null) {
+      return mDriver.clone(false).getDriverConfig();
     }
-    retrieveAndCacheDriverConfig();
-    return driverConfig.clone(false);
-
+    retrieveAndCacheDriver();
+    return mDriver.clone(false).getDriverConfig();
+  }
+  
+  /**
+   * Return driver.
+   *
+   * @return
+   */
+  public MDriver getDriver() {
+    if (mDriver != null) {
+      return mDriver.clone(false);
+    }
+    retrieveAndCacheDriver();
+    return mDriver.clone(false);
+ 
   }
 
   /**
    * Retrieve driverConfig and cache it.
    */
-  private void retrieveAndCacheDriverConfig() {
-    DriverConfigBean driverConfigBean =  resourceRequests.readDriverConfig();
-    driverConfig = driverConfigBean.getDriverConfig();
-    driverConfigBundle = driverConfigBean.getResourceBundle();
+  private void retrieveAndCacheDriver() {
+    DriverBean driverBean =  resourceRequests.readDriver();
+    mDriver = driverBean.getDriver();
+    driverConfigBundle = driverBean.getDriverConfigResourceBundle();
   }
 
   /**
    * Return driverConfig bundle.
-   *
+   *xx
    * @return
    */
   public ResourceBundle getDriverConfigBundle() {
     if(driverConfigBundle != null) {
       return driverConfigBundle;
     }
-    retrieveAndCacheDriverConfig();
+    retrieveAndCacheDriver();
     return driverConfigBundle;
   }
 
@@ -266,11 +279,7 @@ public class SqoopClient {
    * @return
    */
   public MLink createLink(long connectorId) {
-    return new MLink(
-      connectorId,
-      getConnector(connectorId).getConnectionForms(),
-      getDriverConfig().getConnectionForms()
-    );
+    return new MLink(connectorId, getConnector(connectorId).getLinkConfig());
   }
 
   /**
@@ -281,10 +290,9 @@ public class SqoopClient {
    */
   public MLink createLink(String connectorName) {
     MConnector connector = getConnector(connectorName);
-    if(connector == null) {
+    if (connector == null) {
       throw new SqoopException(ClientError.CLIENT_0003, connectorName);
     }
-
     return createLink(connector.getPersistenceId());
   }
 
@@ -362,9 +370,9 @@ public class SqoopClient {
       toLink.getConnectorId(),
       fromLink.getPersistenceId(),
       toLink.getPersistenceId(),
-      getConnector(fromLink.getConnectorId()).getJobForms(Direction.FROM),
-      getConnector(toLink.getConnectorId()).getJobForms(Direction.TO),
-      getDriverConfig().getJobForms()
+      getConnector(fromLink.getConnectorId()).getFromConfig(),
+      getConnector(toLink.getConnectorId()).getToConfig(),
+      getDriverConfig()
     );
   }
 
@@ -530,41 +538,36 @@ public class SqoopClient {
   }
 
   private Status applyLinkValidations(ValidationResultBean bean, MLink link) {
-    ValidationResult connector = bean.getValidationResults()[0];
-    ValidationResult driverConfig = bean.getValidationResults()[1];
-
+    ConfigValidationResult linkConfig = bean.getValidationResults()[0];
     // Apply validation results
-    FormUtils.applyValidation(link.getConnectorPart().getForms(), connector);
-    FormUtils.applyValidation(link.getFrameworkPart().getForms(), driverConfig);
-
+    ConfigUtils.applyValidation(link.getConnectorLinkConfig().getConfigs(), linkConfig);
     Long id = bean.getId();
     if(id != null) {
       link.setPersistenceId(id);
     }
-
-    return Status.getWorstStatus(connector.getStatus(), driverConfig.getStatus());
+    return Status.getWorstStatus(linkConfig.getStatus());
   }
 
   private Status applyJobValidations(ValidationResultBean bean, MJob job) {
-    ValidationResult fromConnector = bean.getValidationResults()[0];
-    ValidationResult toConnector = bean.getValidationResults()[1];
-    ValidationResult driverConfig = bean.getValidationResults()[2];
-
-    // Apply validation results
-    // @TODO(Abe): From/To validation.
-    FormUtils.applyValidation(
-        job.getConnectorPart(Direction.FROM).getForms(),
-        fromConnector);
-    FormUtils.applyValidation(job.getFrameworkPart().getForms(), driverConfig);
-    FormUtils.applyValidation(
-        job.getConnectorPart(Direction.TO).getForms(),
-        toConnector);
+    ConfigValidationResult fromConfig = bean.getValidationResults()[0];
+    ConfigValidationResult toConfig = bean.getValidationResults()[1];
+    // TODO(VB): fix this as part of SQOOP 1509
+    //ConfigValidationResult driverConfig = bean.getValidationResults()[2];
+
+    ConfigUtils.applyValidation(
+        job.getJobConfig(Direction.FROM).getConfigs(),
+        fromConfig);
+    ConfigUtils.applyValidation(
+        job.getJobConfig(Direction.TO).getConfigs(),
+        toConfig);
+    //ConfigUtils.applyValidation(job.getDriverConfig().getSelf().getConfigs(), driverConfig);
 
     Long id = bean.getId();
     if(id != null) {
       job.setPersistenceId(id);
     }
 
-    return Status.getWorstStatus(fromConnector.getStatus(), driverConfig.getStatus(), toConnector.getStatus());
+    return Status.getWorstStatus(fromConfig.getStatus(), toConfig.getStatus());
+       // driverConfig.getStatus());
   }
 }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/8362c73c/client/src/main/java/org/apache/sqoop/client/request/ConnectorResourceRequest.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/request/ConnectorResourceRequest.java b/client/src/main/java/org/apache/sqoop/client/request/ConnectorResourceRequest.java
index 2855de6..e2aae98 100644
--- a/client/src/main/java/org/apache/sqoop/client/request/ConnectorResourceRequest.java
+++ b/client/src/main/java/org/apache/sqoop/client/request/ConnectorResourceRequest.java
@@ -22,7 +22,7 @@ import org.json.simple.JSONObject;
 import org.json.simple.JSONValue;
 
 /**
- * Provide cRud semantics over RESTfull HTTP API for connectors. Only read
+ * Provide Read semantics over RESTfull HTTP API for connectors. Only read
  * is supported as creation, update and delete might be done only directly on
  * server side.
  */
@@ -38,10 +38,8 @@ public class ConnectorResourceRequest extends ResourceRequest
       response = super.get(serverUrl + RESOURCE + cid);
     }
     JSONObject jsonObject = (JSONObject)JSONValue.parse(response);
-
     ConnectorBean connectorBean = new ConnectorBean();
     connectorBean.restore(jsonObject);
-
     return connectorBean;
   }
 }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/8362c73c/client/src/main/java/org/apache/sqoop/client/request/DriverConfigResourceRequest.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/request/DriverConfigResourceRequest.java b/client/src/main/java/org/apache/sqoop/client/request/DriverConfigResourceRequest.java
index 7b2ddc2..f6066fc 100644
--- a/client/src/main/java/org/apache/sqoop/client/request/DriverConfigResourceRequest.java
+++ b/client/src/main/java/org/apache/sqoop/client/request/DriverConfigResourceRequest.java
@@ -17,26 +17,23 @@
  */
 package org.apache.sqoop.client.request;
 
-import org.apache.sqoop.json.DriverConfigBean;
+import org.apache.sqoop.json.DriverBean;
 import org.json.simple.JSONObject;
 import org.json.simple.JSONValue;
 
 /**
- * Provide cRud semantics over RESTfull HTTP API for driverConfig. Only read
- * is supported as creation, update and delete is not allowed.
+ * Provide CRUD semantics over RESTfull HTTP API for driverConfig
  */
 public class DriverConfigResourceRequest extends ResourceRequest {
 
   public static final String RESOURCE = "v1/config/driver";
 
-  public DriverConfigBean read(String serverUrl) {
+  public DriverBean read(String serverUrl) {
     String response = null;
     response = super.get(serverUrl + RESOURCE);
     JSONObject jsonObject = (JSONObject) JSONValue.parse(response);
-
-    DriverConfigBean driverConfigBean = new DriverConfigBean();
-    driverConfigBean.restore(jsonObject);
-
-    return driverConfigBean;
+    DriverBean driverBean = new DriverBean();
+    driverBean.restore(jsonObject);
+    return driverBean;
   }
 }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/8362c73c/client/src/main/java/org/apache/sqoop/client/request/JobResourceRequest.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/request/JobResourceRequest.java b/client/src/main/java/org/apache/sqoop/client/request/JobResourceRequest.java
index fd858ec..83c08b3 100644
--- a/client/src/main/java/org/apache/sqoop/client/request/JobResourceRequest.java
+++ b/client/src/main/java/org/apache/sqoop/client/request/JobResourceRequest.java
@@ -34,46 +34,36 @@ public class JobResourceRequest extends ResourceRequest {
   private static final String ENABLE = "/enable";
   private static final String DISABLE = "/disable";
 
-  public JobBean read(String serverUrl, Long xid) {
+  public JobBean read(String serverUrl, Long linkId) {
     String response;
-    if (xid == null) {
+    if (linkId == null) {
       response = super.get(serverUrl + RESOURCE + "all");
     } else {
-      response = super.get(serverUrl + RESOURCE + xid);
+      response = super.get(serverUrl + RESOURCE + linkId);
     }
     JSONObject jsonObject = (JSONObject) JSONValue.parse(response);
-
     JobBean jobBean = new JobBean();
     jobBean.restore(jsonObject);
-
     return jobBean;
   }
 
   public ValidationResultBean create(String serverUrl, MJob job) {
     JobBean jobBean = new JobBean(job);
-
-    // Extract all form inputs including sensitive inputs
+    // Extract all config inputs including sensitive inputs
     JSONObject jobJson = jobBean.extract(false);
-
     String response = super.post(serverUrl + RESOURCE, jobJson.toJSONString());
-
-    ValidationResultBean validationBean = new ValidationResultBean();
-    validationBean.restore((JSONObject) JSONValue.parse(response));
-
-    return validationBean;
+    ValidationResultBean validationResultBean = new ValidationResultBean();
+    validationResultBean.restore((JSONObject) JSONValue.parse(response));
+    return validationResultBean;
   }
 
   public ValidationResultBean update(String serverUrl, MJob job) {
     JobBean jobBean = new JobBean(job);
-
-    // Extract all form inputs including sensitive inputs
+    // Extract all config inputs including sensitive inputs
     JSONObject jobJson = jobBean.extract(false);
-
     String response = super.put(serverUrl + RESOURCE + job.getPersistenceId(), jobJson.toJSONString());
-
     ValidationResultBean validationBean = new ValidationResultBean();
     validationBean.restore((JSONObject) JSONValue.parse(response));
-
     return validationBean;
   }
 

http://git-wip-us.apache.org/repos/asf/sqoop/blob/8362c73c/client/src/main/java/org/apache/sqoop/client/request/LinkResourceRequest.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/request/LinkResourceRequest.java b/client/src/main/java/org/apache/sqoop/client/request/LinkResourceRequest.java
index 2b784c8..64e5cb1 100644
--- a/client/src/main/java/org/apache/sqoop/client/request/LinkResourceRequest.java
+++ b/client/src/main/java/org/apache/sqoop/client/request/LinkResourceRequest.java
@@ -50,28 +50,22 @@ public class LinkResourceRequest extends ResourceRequest {
   public ValidationResultBean create(String serverUrl, MLink link) {
     LinkBean linkBean = new LinkBean(link);
 
-    // Extract all form inputs including sensitive inputs
+    // Extract all config inputs including sensitive inputs
     JSONObject linkJson = linkBean.extract(false);
-
     String response = super.post(serverUrl + RESOURCE, linkJson.toJSONString());
-
     ValidationResultBean validationBean = new ValidationResultBean();
     validationBean.restore((JSONObject) JSONValue.parse(response));
-
     return validationBean;
   }
 
   public ValidationResultBean update(String serverUrl, MLink link) {
     LinkBean linkBean = new LinkBean(link);
 
-    // Extract all form inputs including sensitive inputs
+    // Extract all config inputs including sensitive inputs
     JSONObject linkJson = linkBean.extract(false);
-
     String response = super.put(serverUrl + RESOURCE + link.getPersistenceId(), linkJson.toJSONString());
-
     ValidationResultBean validationBean = new ValidationResultBean();
     validationBean.restore((JSONObject) JSONValue.parse(response));
-
     return validationBean;
   }
 

http://git-wip-us.apache.org/repos/asf/sqoop/blob/8362c73c/client/src/main/java/org/apache/sqoop/client/request/SqoopResourceRequests.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/request/SqoopResourceRequests.java b/client/src/main/java/org/apache/sqoop/client/request/SqoopResourceRequests.java
index 5401eca..a4dee75 100644
--- a/client/src/main/java/org/apache/sqoop/client/request/SqoopResourceRequests.java
+++ b/client/src/main/java/org/apache/sqoop/client/request/SqoopResourceRequests.java
@@ -19,7 +19,7 @@ package org.apache.sqoop.client.request;
 
 import org.apache.sqoop.json.LinkBean;
 import org.apache.sqoop.json.ConnectorBean;
-import org.apache.sqoop.json.DriverConfigBean;
+import org.apache.sqoop.json.DriverBean;
 import org.apache.sqoop.json.JobBean;
 import org.apache.sqoop.json.SubmissionBean;
 import org.apache.sqoop.json.ValidationResultBean;
@@ -83,7 +83,7 @@ public class SqoopResourceRequests {
     return submissionRequest;
   }
 
-  public DriverConfigBean readDriverConfig() {
+  public DriverBean readDriver() {
     return getDriverConfigResourceRequest().read(serverUrl);
   }
 

http://git-wip-us.apache.org/repos/asf/sqoop/blob/8362c73c/client/src/test/java/org/apache/sqoop/client/TestSqoopClient.java
----------------------------------------------------------------------
diff --git a/client/src/test/java/org/apache/sqoop/client/TestSqoopClient.java b/client/src/test/java/org/apache/sqoop/client/TestSqoopClient.java
index 54ea3d2..18b6132 100644
--- a/client/src/test/java/org/apache/sqoop/client/TestSqoopClient.java
+++ b/client/src/test/java/org/apache/sqoop/client/TestSqoopClient.java
@@ -17,28 +17,36 @@
  */
 package org.apache.sqoop.client;
 
-import org.apache.sqoop.client.request.SqoopResourceRequests;
-import org.apache.sqoop.common.SqoopException;
-import org.apache.sqoop.json.ConnectorBean;
-import org.apache.sqoop.json.DriverConfigBean;
-import org.apache.sqoop.model.MConnectionForms;
-import org.apache.sqoop.model.MConnector;
-import org.apache.sqoop.model.MDriverConfig;
-import org.apache.sqoop.model.MJobForms;
-import org.apache.sqoop.utils.MapResourceBundle;
-import org.junit.Before;
-import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyNoMoreInteractions;
+import static org.mockito.Mockito.when;
 
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
+import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.ResourceBundle;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.mockito.Mockito.*;
+import org.apache.sqoop.client.request.SqoopResourceRequests;
+import org.apache.sqoop.common.SqoopException;
+import org.apache.sqoop.json.ConnectorBean;
+import org.apache.sqoop.json.DriverBean;
+import org.apache.sqoop.model.MConfig;
+import org.apache.sqoop.model.MConnector;
+import org.apache.sqoop.model.MDriver;
+import org.apache.sqoop.model.MDriverConfig;
+import org.apache.sqoop.model.MFromConfig;
+import org.apache.sqoop.model.MLinkConfig;
+import org.apache.sqoop.model.MToConfig;
+import org.apache.sqoop.utils.MapResourceBundle;
+import org.junit.Before;
+import org.junit.Test;
 
 public class TestSqoopClient {
 
@@ -62,7 +70,7 @@ public class TestSqoopClient {
     MConnector connector = client.getConnector(1);
     assertEquals(1, connector.getPersistenceId());
 
-    client.getConnectorConfigResourceBundle(1L);
+    client.getConnectorConfigBundle(1L);
 
     verify(resourceRequests, times(1)).readConnector(1L);
   }
@@ -74,7 +82,7 @@ public class TestSqoopClient {
     assertEquals(1, connector.getPersistenceId());
     assertEquals("A1", connector.getUniqueName());
 
-    client.getConnectorConfigResourceBundle(1L);
+    client.getConnectorConfigBundle(1L);
 
     verify(resourceRequests, times(0)).readConnector(1L);
     verify(resourceRequests, times(1)).readConnector(null);
@@ -87,7 +95,7 @@ public class TestSqoopClient {
   @Test
   public void testGetConnectorBundle() {
     when(resourceRequests.readConnector(1L)).thenReturn(connectorBean(connector(1)));
-    client.getConnectorConfigResourceBundle(1L);
+    client.getConnectorConfigBundle(1L);
 
     MConnector connector = client.getConnector(1);
     assertEquals(1, connector.getPersistenceId());
@@ -101,12 +109,12 @@ public class TestSqoopClient {
    */
   @Test
   public void testGetDriverConfig() {
-    when(resourceRequests.readDriverConfig()).thenReturn(driverConfigBean(driverConfig()));
+    when(resourceRequests.readDriver()).thenReturn(driverBean(driver()));
 
     client.getDriverConfig();
     client.getDriverConfigBundle();
 
-    verify(resourceRequests, times(1)).readDriverConfig();
+    verify(resourceRequests, times(1)).readDriver();
   }
 
   /**
@@ -115,12 +123,12 @@ public class TestSqoopClient {
    */
   @Test
   public void testGetDriverConfigBundle() {
-    when(resourceRequests.readDriverConfig()).thenReturn(driverConfigBean(driverConfig()));
+    when(resourceRequests.readDriver()).thenReturn(driverBean(driver()));
 
     client.getDriverConfigBundle();
     client.getDriverConfig();
 
-    verify(resourceRequests, times(1)).readDriverConfig();
+    verify(resourceRequests, times(1)).readDriver();
   }
 
   /**
@@ -135,12 +143,12 @@ public class TestSqoopClient {
     Collection<MConnector> connectors = client.getConnectors();
     assertEquals(2, connectors.size());
 
-    client.getConnectorConfigResourceBundle(1);
+    client.getConnectorConfigBundle(1);
     connector = client.getConnector(1);
     assertEquals(1, connector.getPersistenceId());
 
     connector = client.getConnector(2);
-    client.getConnectorConfigResourceBundle(2);
+    client.getConnectorConfigBundle(2);
     assertEquals(2, connector.getPersistenceId());
 
     connectors = client.getConnectors();
@@ -173,11 +181,11 @@ public class TestSqoopClient {
     when(resourceRequests.readConnector(1L)).thenReturn(bean);
     when(resourceRequests.readConnector(2L)).thenReturn(bean);
 
-    client.getConnectorConfigResourceBundle(1);
+    client.getConnectorConfigBundle(1);
     client.getConnector(1);
 
     client.getConnector(2);
-    client.getConnectorConfigResourceBundle(2);
+    client.getConnectorConfigBundle(2);
 
     Collection<MConnector> connectors = client.getConnectors();
     assertEquals(2, connectors.size());
@@ -207,21 +215,20 @@ public class TestSqoopClient {
     }
     return new ConnectorBean(connectorList, bundles);
   }
-  private DriverConfigBean driverConfigBean(MDriverConfig driverConfig) {
-    return new DriverConfigBean(driverConfig, new MapResourceBundle(null));
+  private DriverBean driverBean(MDriver driver) {
+    return new DriverBean(driver, new MapResourceBundle(null));
   }
 
   private MConnector connector(long id) {
     MConnector connector = new MConnector("A" + id, "A" + id, "1.0" + id,
-        new MConnectionForms(null), new MJobForms(null), new MJobForms(null));
+        new MLinkConfig(null), new MFromConfig(null), new MToConfig(null));
     connector.setPersistenceId(id);
     return connector;
   }
 
-  private MDriverConfig driverConfig() {
-    MDriverConfig driverConfig = new MDriverConfig(new MConnectionForms(null),
-        new MJobForms(null), "1");
-    driverConfig.setPersistenceId(1);
-    return driverConfig;
+  private MDriver driver() {
+    MDriver driver = new MDriver(new MDriverConfig(new LinkedList<MConfig>()), "1");
+    driver.setPersistenceId(1);
+    return driver;
   }
 }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/8362c73c/common/src/main/java/org/apache/sqoop/json/ConnectorBean.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/json/ConnectorBean.java b/common/src/main/java/org/apache/sqoop/json/ConnectorBean.java
index d726a14..d12b6b0 100644
--- a/common/src/main/java/org/apache/sqoop/json/ConnectorBean.java
+++ b/common/src/main/java/org/apache/sqoop/json/ConnectorBean.java
@@ -17,15 +17,15 @@
  */
 package org.apache.sqoop.json;
 
-import static org.apache.sqoop.json.util.FormSerialization.ALL;
-import static org.apache.sqoop.json.util.FormSerialization.CLASS;
-import static org.apache.sqoop.json.util.FormSerialization.CON_FORMS;
-import static org.apache.sqoop.json.util.FormSerialization.ID;
-import static org.apache.sqoop.json.util.FormSerialization.JOB_FORMS;
-import static org.apache.sqoop.json.util.FormSerialization.NAME;
-import static org.apache.sqoop.json.util.FormSerialization.VERSION;
-import static org.apache.sqoop.json.util.FormSerialization.extractForms;
-import static org.apache.sqoop.json.util.FormSerialization.restoreForms;
+import static org.apache.sqoop.json.util.ConfigSerialization.ALL;
+import static org.apache.sqoop.json.util.ConfigSerialization.CLASS;
+import static org.apache.sqoop.json.util.ConfigSerialization.ID;
+import static org.apache.sqoop.json.util.ConfigSerialization.CONNECTOR_JOB_CONFIG;
+import static org.apache.sqoop.json.util.ConfigSerialization.CONNECTOR_LINK_CONFIG;
+import static org.apache.sqoop.json.util.ConfigSerialization.NAME;
+import static org.apache.sqoop.json.util.ConfigSerialization.VERSION;
+import static org.apache.sqoop.json.util.ConfigSerialization.extractConfigList;
+import static org.apache.sqoop.json.util.ConfigSerialization.restoreConfigList;
 import static org.apache.sqoop.json.util.ResourceBundleSerialization.CONNECTOR_CONFIGS;
 import static org.apache.sqoop.json.util.ResourceBundleSerialization.extractResourceBundle;
 import static org.apache.sqoop.json.util.ResourceBundleSerialization.restoreResourceBundle;
@@ -38,24 +38,28 @@ import java.util.ResourceBundle;
 import java.util.Set;
 
 import org.apache.sqoop.common.Direction;
-import org.apache.sqoop.model.MConnectionForms;
+import org.apache.sqoop.model.MConfig;
 import org.apache.sqoop.model.MConnector;
-import org.apache.sqoop.model.MForm;
-import org.apache.sqoop.model.MJobForms;
+import org.apache.sqoop.model.MFromConfig;
+import org.apache.sqoop.model.MLinkConfig;
+import org.apache.sqoop.model.MToConfig;
 import org.json.simple.JSONArray;
 import org.json.simple.JSONObject;
 
+/**
+ * Json representation of the connector object
+ *
+ */
 public class ConnectorBean implements JsonBean {
 
   private List<MConnector> connectors;
 
-  private Map<Long, ResourceBundle> bundles;
+  private Map<Long, ResourceBundle> connectorConfigBundles;
 
   // for "extract"
-  public ConnectorBean(List<MConnector> connectors,
-                       Map<Long, ResourceBundle> bundles) {
+  public ConnectorBean(List<MConnector> connectors, Map<Long, ResourceBundle> bundles) {
     this.connectors = connectors;
-    this.bundles = bundles;
+    this.connectorConfigBundles = bundles;
   }
 
   // for "restore"
@@ -67,46 +71,46 @@ public class ConnectorBean implements JsonBean {
   }
 
   public Map<Long, ResourceBundle> getResourceBundles() {
-    return bundles;
+    return connectorConfigBundles;
   }
 
   @SuppressWarnings("unchecked")
   @Override
   public JSONObject extract(boolean skipSensitive) {
 
-    JSONArray array = new JSONArray();
+    JSONArray connectorArray = new JSONArray();
 
     for (MConnector connector : connectors) {
-      JSONObject object = new JSONObject();
-
-      object.put(ID, connector.getPersistenceId());
-      object.put(NAME, connector.getUniqueName());
-      object.put(CLASS, connector.getClassName());
-      object.put(VERSION, connector.getVersion());
-
-      object.put(CON_FORMS, extractForms(connector.getConnectionForms().getForms(), skipSensitive));
-      object.put(JOB_FORMS, new JSONObject());
-      if (connector.getJobForms(Direction.FROM) != null) {
-        ((JSONObject)object.get(JOB_FORMS)).put(
-            Direction.FROM, extractForms(connector.getJobForms(Direction.FROM).getForms(), skipSensitive));
+      JSONObject connectorJsonObject = new JSONObject();
+
+      connectorJsonObject.put(ID, connector.getPersistenceId());
+      connectorJsonObject.put(NAME, connector.getUniqueName());
+      connectorJsonObject.put(CLASS, connector.getClassName());
+      connectorJsonObject.put(VERSION, connector.getVersion());
+      connectorJsonObject.put(CONNECTOR_LINK_CONFIG,
+          extractConfigList(connector.getLinkConfig().getConfigs(), skipSensitive));
+
+      connectorJsonObject.put(CONNECTOR_JOB_CONFIG, new JSONObject());
+      // add sub fields to the job config for from and to
+      if (connector.getFromConfig() != null) {
+        ((JSONObject) connectorJsonObject.get(CONNECTOR_JOB_CONFIG)).put(Direction.FROM,
+            extractConfigList(connector.getFromConfig().getConfigs(), skipSensitive));
       }
-
-      if (connector.getJobForms(Direction.TO) != null) {
-        ((JSONObject)object.get(JOB_FORMS)).put(
-            Direction.TO, extractForms(connector.getJobForms(Direction.TO).getForms(), skipSensitive));
+      if (connector.getToConfig() != null) {
+        ((JSONObject) connectorJsonObject.get(CONNECTOR_JOB_CONFIG)).put(Direction.TO,
+            extractConfigList(connector.getToConfig().getConfigs(), skipSensitive));
       }
-      array.add(object);
+      connectorArray.add(connectorJsonObject);
     }
 
     JSONObject all = new JSONObject();
-    all.put(ALL, array);
+    all.put(ALL, connectorArray);
 
-    if(bundles != null && !bundles.isEmpty()) {
+    if (connectorConfigBundles != null && !connectorConfigBundles.isEmpty()) {
       JSONObject jsonBundles = new JSONObject();
 
-      for(Map.Entry<Long, ResourceBundle> entry : bundles.entrySet()) {
-        jsonBundles.put(entry.getKey().toString(),
-                         extractResourceBundle(entry.getValue()));
+      for (Map.Entry<Long, ResourceBundle> entry : connectorConfigBundles.entrySet()) {
+        jsonBundles.put(entry.getKey().toString(), extractResourceBundle(entry.getValue()));
       }
       all.put(CONNECTOR_CONFIGS, jsonBundles);
     }
@@ -129,35 +133,42 @@ public class ConnectorBean implements JsonBean {
       String className = (String) object.get(CLASS);
       String version = (String) object.get(VERSION);
 
-      MJobForms fromJob = null;
-      MJobForms toJob = null;
-      List<MForm> connForms = restoreForms((JSONArray) object.get(CON_FORMS));
-      JSONObject jobJson = (JSONObject) object.get(JOB_FORMS);
-      JSONArray fromJobJson = (JSONArray)jobJson.get(Direction.FROM.name());
-      JSONArray toJobJson = (JSONArray)jobJson.get(Direction.TO.name());
-      if (fromJobJson != null) {
-        List<MForm> fromJobForms = restoreForms(fromJobJson);
-        fromJob = new MJobForms(fromJobForms);
+      List<MConfig> linkConfigs = restoreConfigList((JSONArray) object.get(CONNECTOR_LINK_CONFIG));
+
+      // parent that encapsualtes both the from/to configs
+      JSONObject jobConfigJson = (JSONObject) object.get(CONNECTOR_JOB_CONFIG);
+      JSONArray fromJobConfigJson = (JSONArray) jobConfigJson.get(Direction.FROM.name());
+      JSONArray toJobConfigJson = (JSONArray) jobConfigJson.get(Direction.TO.name());
+
+      MFromConfig fromConfig = null;
+      MToConfig toConfig = null;
+      if (fromJobConfigJson != null) {
+
+        List<MConfig> fromJobConfig = restoreConfigList(fromJobConfigJson);
+        fromConfig = new MFromConfig(fromJobConfig);
+
       }
-      if (toJobJson != null) {
-        List<MForm> toJobForms = restoreForms(toJobJson);
-        toJob = new MJobForms(toJobForms);
+      if (toJobConfigJson != null) {
+        List<MConfig> toJobConfig = restoreConfigList(toJobConfigJson);
+        toConfig = new MToConfig(toJobConfig);
       }
-      MConnectionForms connection = new MConnectionForms(connForms);
-      MConnector connector = new MConnector(uniqueName, className, version,
-          connection, fromJob, toJob);
+
+      MLinkConfig linkConfig = new MLinkConfig(linkConfigs);
+      MConnector connector = new MConnector(uniqueName, className, version, linkConfig, fromConfig,
+          toConfig);
+
       connector.setPersistenceId(connectorId);
       connectors.add(connector);
     }
 
-    if(jsonObject.containsKey(CONNECTOR_CONFIGS)) {
-      bundles = new HashMap<Long, ResourceBundle>();
+    if (jsonObject.containsKey(CONNECTOR_CONFIGS)) {
+      connectorConfigBundles = new HashMap<Long, ResourceBundle>();
 
       JSONObject jsonBundles = (JSONObject) jsonObject.get(CONNECTOR_CONFIGS);
       Set<Map.Entry<String, JSONObject>> entrySet = jsonBundles.entrySet();
       for (Map.Entry<String, JSONObject> entry : entrySet) {
-        bundles.put(Long.parseLong(entry.getKey()),
-                             restoreResourceBundle(entry.getValue()));
+        connectorConfigBundles.put(Long.parseLong(entry.getKey()),
+            restoreResourceBundle(entry.getValue()));
       }
     }
   }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/8362c73c/common/src/main/java/org/apache/sqoop/json/DriverBean.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/json/DriverBean.java b/common/src/main/java/org/apache/sqoop/json/DriverBean.java
new file mode 100644
index 0000000..90cdbef
--- /dev/null
+++ b/common/src/main/java/org/apache/sqoop/json/DriverBean.java
@@ -0,0 +1,90 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sqoop.json;
+
+import static org.apache.sqoop.json.util.ConfigSerialization.DRIVER_CONFIG;
+import static org.apache.sqoop.json.util.ConfigSerialization.DRIVER_VERSION;
+import static org.apache.sqoop.json.util.ConfigSerialization.ID;
+import static org.apache.sqoop.json.util.ConfigSerialization.extractConfigList;
+import static org.apache.sqoop.json.util.ConfigSerialization.restoreConfigList;
+import static org.apache.sqoop.json.util.ResourceBundleSerialization.CONFIGS;
+import static org.apache.sqoop.json.util.ResourceBundleSerialization.extractResourceBundle;
+import static org.apache.sqoop.json.util.ResourceBundleSerialization.restoreResourceBundle;
+
+import java.util.List;
+import java.util.ResourceBundle;
+
+import org.apache.sqoop.model.MConfig;
+import org.apache.sqoop.model.MDriver;
+import org.apache.sqoop.model.MDriverConfig;
+import org.json.simple.JSONArray;
+import org.json.simple.JSONObject;
+/**
+ * Json representation of the driver
+ *
+ */
+public class DriverBean implements JsonBean {
+
+  public static final String CURRENT_DRIVER_VERSION = "1";
+
+  private MDriver driver;
+
+  private ResourceBundle bundle;
+
+  // for "extract"
+  public DriverBean(MDriver driver, ResourceBundle bundle) {
+    this.driver = driver;
+    this.bundle = bundle;
+  }
+
+  // for "restore"
+  public DriverBean() {
+  }
+
+  public MDriver getDriver() {
+    return driver;
+  }
+
+  public ResourceBundle getDriverConfigResourceBundle() {
+    return bundle;
+  }
+
+  @SuppressWarnings("unchecked")
+  @Override
+  public JSONObject extract(boolean skipSensitive) {
+    JSONArray configs =
+      extractConfigList(driver.getDriverConfig().getConfigs(), skipSensitive);
+
+    JSONObject result = new JSONObject();
+    result.put(ID, driver.getPersistenceId());
+    result.put(DRIVER_VERSION, driver.getVersion());
+    result.put(DRIVER_CONFIG, configs);
+    result.put(CONFIGS, extractResourceBundle(bundle));
+    return result;
+  }
+
+  @Override
+  public void restore(JSONObject jsonObject) {
+    long id = (Long) jsonObject.get(ID);
+    String driverVersion = (String) jsonObject.get(DRIVER_VERSION);
+    List<MConfig> driverConfig = restoreConfigList((JSONArray) jsonObject.get(DRIVER_CONFIG));
+    driver = new MDriver(new MDriverConfig(driverConfig), driverVersion);
+    driver.setPersistenceId(id);
+    bundle = restoreResourceBundle((JSONObject) jsonObject.get(CONFIGS));
+  }
+}

http://git-wip-us.apache.org/repos/asf/sqoop/blob/8362c73c/common/src/main/java/org/apache/sqoop/json/DriverConfigBean.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/json/DriverConfigBean.java b/common/src/main/java/org/apache/sqoop/json/DriverConfigBean.java
deleted file mode 100644
index a2cc8b8..0000000
--- a/common/src/main/java/org/apache/sqoop/json/DriverConfigBean.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.sqoop.json;
-
-import org.apache.sqoop.model.MConnectionForms;
-import org.apache.sqoop.model.MForm;
-import org.apache.sqoop.model.MDriverConfig;
-import org.apache.sqoop.model.MJobForms;
-import org.json.simple.JSONArray;
-import org.json.simple.JSONObject;
-
-import java.util.List;
-import java.util.ResourceBundle;
-
-import static org.apache.sqoop.json.util.FormSerialization.*;
-import static org.apache.sqoop.json.util.ResourceBundleSerialization.*;
-
-public class DriverConfigBean implements JsonBean {
-
-  private MDriverConfig driverConfig;
-
-  private ResourceBundle bundle;
-
-  // for "extract"
-  public DriverConfigBean(MDriverConfig driverConfig, ResourceBundle bundle) {
-    this.driverConfig = driverConfig;
-    this.bundle = bundle;
-  }
-
-  // for "restore"
-  public DriverConfigBean() {
-  }
-
-  public MDriverConfig getDriverConfig() {
-    return driverConfig;
-  }
-
-  public ResourceBundle getResourceBundle() {
-    return bundle;
-  }
-
-  @SuppressWarnings("unchecked")
-  @Override
-  public JSONObject extract(boolean skipSensitive) {
-    // TODO(Abe): Add From/To connection forms.
-    JSONArray conForms =
-      extractForms(driverConfig.getConnectionForms().getForms(), skipSensitive);
-    JSONArray jobForms = extractForms(driverConfig.getJobForms().getForms(), skipSensitive);
-
-    JSONObject result = new JSONObject();
-    result.put(ID, driverConfig.getPersistenceId());
-    result.put(DRIVER_VERSION, driverConfig.getVersion());
-    result.put(CON_FORMS, conForms);
-    result.put(JOB_FORMS, jobForms);
-    result.put(CONFIGS, extractResourceBundle(bundle));
-    return result;
-  }
-
-  @Override
-  public void restore(JSONObject jsonObject) {
-    long id = (Long) jsonObject.get(ID);
-    String driverVersion = (String) jsonObject.get(DRIVER_VERSION);
-
-    List<MForm> connForms = restoreForms((JSONArray) jsonObject.get(CON_FORMS));
-    List<MForm> jobForms = restoreForms((JSONArray) jsonObject.get(JOB_FORMS));
-
-    // TODO(Abe): Get From/To connection forms.
-    driverConfig = new MDriverConfig(
-        new MConnectionForms(connForms),
-        new MJobForms(jobForms),
-        driverVersion);
-    driverConfig.setPersistenceId(id);
-
-    bundle = restoreResourceBundle((JSONObject) jsonObject.get(CONFIGS));
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/sqoop/blob/8362c73c/common/src/main/java/org/apache/sqoop/json/JobBean.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/json/JobBean.java b/common/src/main/java/org/apache/sqoop/json/JobBean.java
index a3e6071..8f42edb 100644
--- a/common/src/main/java/org/apache/sqoop/json/JobBean.java
+++ b/common/src/main/java/org/apache/sqoop/json/JobBean.java
@@ -17,12 +17,17 @@
  */
 package org.apache.sqoop.json;
 
-import org.apache.sqoop.common.Direction;
-import org.apache.sqoop.model.MForm;
-import org.apache.sqoop.model.MJob;
-import org.apache.sqoop.model.MJobForms;
-import org.json.simple.JSONArray;
-import org.json.simple.JSONObject;
+import static org.apache.sqoop.json.util.ConfigSerialization.CREATION_DATE;
+import static org.apache.sqoop.json.util.ConfigSerialization.CREATION_USER;
+import static org.apache.sqoop.json.util.ConfigSerialization.ENABLED;
+import static org.apache.sqoop.json.util.ConfigSerialization.UPDATE_DATE;
+import static org.apache.sqoop.json.util.ConfigSerialization.UPDATE_USER;
+import static org.apache.sqoop.json.util.ConfigSerialization.extractConfigList;
+import static org.apache.sqoop.json.util.ConfigSerialization.restoreConfigList;
+import static org.apache.sqoop.json.util.ResourceBundleSerialization.CONNECTOR_CONFIGS;
+import static org.apache.sqoop.json.util.ResourceBundleSerialization.DRIVER_CONFIGS;
+import static org.apache.sqoop.json.util.ResourceBundleSerialization.extractResourceBundle;
+import static org.apache.sqoop.json.util.ResourceBundleSerialization.restoreResourceBundle;
 
 import java.util.ArrayList;
 import java.util.Date;
@@ -32,11 +37,18 @@ import java.util.Map;
 import java.util.ResourceBundle;
 import java.util.Set;
 
-import static org.apache.sqoop.json.util.FormSerialization.*;
-import static org.apache.sqoop.json.util.ResourceBundleSerialization.*;
+import org.apache.sqoop.common.Direction;
+import org.apache.sqoop.model.MConfig;
+import org.apache.sqoop.model.MDriver;
+import org.apache.sqoop.model.MDriverConfig;
+import org.apache.sqoop.model.MFromConfig;
+import org.apache.sqoop.model.MJob;
+import org.apache.sqoop.model.MToConfig;
+import org.json.simple.JSONArray;
+import org.json.simple.JSONObject;
 
 /**
- *
+ * Json representation of the job config
  */
 public class JobBean implements JsonBean {
 
@@ -47,9 +59,9 @@ public class JobBean implements JsonBean {
   private static final String TO_LINK_ID = "to-link-id";
   private static final String FROM_CONNECTOR_ID = "from-connector-id";
   private static final String TO_CONNECTOR_ID = "to-connector-id";
-  private static final String FROM_CONNECTOR_PART = "from-connector";
-  private static final String TO_CONNECTOR_PART = "to-connector";
-  private static final String FRAMEWORK_PART = "framework";
+  private static final String FROM_CONFIG = "from-config";
+  private static final String TO_CONFIG = "to-config";
+  private static final String DRIVER_CONFIG = "driver-config";
 
   // Required
   private List<MJob> jobs;
@@ -114,18 +126,21 @@ public class JobBean implements JsonBean {
       object.put(CREATION_DATE, job.getCreationDate().getTime());
       object.put(UPDATE_USER, job.getLastUpdateUser());
       object.put(UPDATE_DATE, job.getLastUpdateDate().getTime());
-      object.put(FROM_LINK_ID, job.getLinkId(Direction.FROM));
-      object.put(TO_LINK_ID, job.getLinkId(Direction.TO));
+      // job link associated connectors
       object.put(FROM_CONNECTOR_ID, job.getConnectorId(Direction.FROM));
       object.put(TO_CONNECTOR_ID, job.getConnectorId(Direction.TO));
-      object.put(FROM_CONNECTOR_PART,
-        extractForms(job.getConnectorPart(Direction.FROM).getForms(),skipSensitive));
-      object.put(TO_CONNECTOR_PART,
-          extractForms(job.getConnectorPart(Direction.TO).getForms(), skipSensitive));
-      object.put(FRAMEWORK_PART,
-        extractForms(job.getFrameworkPart().getForms(), skipSensitive));
-
-      array.add(object);
+      // job associated links
+      object.put(FROM_LINK_ID, job.getLinkId(Direction.FROM));
+      object.put(TO_LINK_ID, job.getLinkId(Direction.TO));
+      // job configs
+      object.put(FROM_CONFIG, extractConfigList(job
+          .getJobConfig(Direction.FROM).getConfigs(), skipSensitive));
+      object.put(TO_CONFIG,
+          extractConfigList(job.getJobConfig(Direction.TO).getConfigs(), skipSensitive));
+      object.put(DRIVER_CONFIG,
+          extractConfigList(job.getDriverConfig().getConfigs(), skipSensitive));
+
+    array.add(object);
     }
 
     JSONObject all = new JSONObject();
@@ -160,22 +175,22 @@ public class JobBean implements JsonBean {
       long toConnectorId = (Long) object.get(TO_CONNECTOR_ID);
       long fromConnectionId = (Long) object.get(FROM_LINK_ID);
       long toConnectionId = (Long) object.get(TO_LINK_ID);
-      JSONArray fromConnectorPart = (JSONArray) object.get(FROM_CONNECTOR_PART);
-      JSONArray toConnectorPart = (JSONArray) object.get(TO_CONNECTOR_PART);
-      JSONArray frameworkPart = (JSONArray) object.get(FRAMEWORK_PART);
+      JSONArray fromConfigJson = (JSONArray) object.get(FROM_CONFIG);
+      JSONArray toConfigJson = (JSONArray) object.get(TO_CONFIG);
+      JSONArray driverConfigJson = (JSONArray) object.get(DRIVER_CONFIG);
 
-      List<MForm> fromConnectorParts = restoreForms(fromConnectorPart);
-      List<MForm> toConnectorParts = restoreForms(toConnectorPart);
-      List<MForm> frameworkForms = restoreForms(frameworkPart);
+      List<MConfig> fromConfig = restoreConfigList(fromConfigJson);
+      List<MConfig> toConfig = restoreConfigList(toConfigJson);
+      List<MConfig> driverConfig = restoreConfigList(driverConfigJson);
 
       MJob job = new MJob(
         fromConnectorId,
         toConnectorId,
         fromConnectionId,
         toConnectionId,
-        new MJobForms(fromConnectorParts),
-        new MJobForms(toConnectorParts),
-        new MJobForms(frameworkForms)
+        new MFromConfig(fromConfig),
+        new MToConfig(toConfig),
+        new MDriverConfig(driverConfig)
       );
 
       job.setPersistenceId((Long) object.get(ID));

http://git-wip-us.apache.org/repos/asf/sqoop/blob/8362c73c/common/src/main/java/org/apache/sqoop/json/JobValidationBean.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/json/JobValidationBean.java b/common/src/main/java/org/apache/sqoop/json/JobValidationBean.java
index 34c0a4b..9e78fe9 100644
--- a/common/src/main/java/org/apache/sqoop/json/JobValidationBean.java
+++ b/common/src/main/java/org/apache/sqoop/json/JobValidationBean.java
@@ -21,41 +21,41 @@ import org.apache.sqoop.common.Direction;
 import org.apache.sqoop.common.DirectionError;
 import org.apache.sqoop.common.SqoopException;
 import org.apache.sqoop.validation.Status;
-import org.apache.sqoop.validation.Validation;
+import org.apache.sqoop.validation.ConfigValidator;
 import org.json.simple.JSONObject;
 
 import java.util.HashMap;
 import java.util.Map;
 
 /**
- * Bean for sending validations across network. This bean will move two
- * validation objects at one time - one for connector and second for framework
- * part of validated entity. Optionally validation bean can also transfer
+ * Bean for sending validations across network. This bean will send job validation results
+ * Optionally validation bean can also transfer
  * created persistent id in case that new entity was created.
  */
 public class JobValidationBean implements JsonBean {
 
   private static final String ID = "id";
-  private static final String FRAMEWORK = "framework";
-  private static final String CONNECTOR = "connector";
+  private static final String JOB = "job";
   private static final String FROM = "from";
   private static final String TO = "to";
+  private static final String DRIVER = "driver";
+
   private static final String STATUS = "status";
   private static final String MESSAGE = "message";
   private static final String MESSAGES = "messages";
 
   private Long id;
-  private Validation fromConnectorValidation;
-  private Validation toConnectorValidation;
-  private Validation frameworkValidation;
+  private ConfigValidator fromConfigValidation;
+  private ConfigValidator toConfigValidation;
+  private ConfigValidator driverConfigValidation;
 
   // For "extract"
-  public JobValidationBean(Validation fromConnector, Validation framework, Validation toConnector) {
+  public JobValidationBean(ConfigValidator fromConnector, ConfigValidator framework, ConfigValidator toConnector) {
     this();
 
-    this.fromConnectorValidation = fromConnector;
-    this.toConnectorValidation = toConnector;
-    this.frameworkValidation = framework;
+    this.fromConfigValidation = fromConnector;
+    this.toConfigValidation = toConnector;
+    this.driverConfigValidation = framework;
   }
 
   // For "restore"
@@ -63,21 +63,21 @@ public class JobValidationBean implements JsonBean {
     id = null;
   }
 
-  public Validation getConnectorValidation(Direction type) {
+  public ConfigValidator getConnectorValidation(Direction type) {
     switch(type) {
       case FROM:
-        return fromConnectorValidation;
+        return fromConfigValidation;
 
       case TO:
-        return toConnectorValidation;
+        return toConfigValidation;
 
       default:
         throw new SqoopException(DirectionError.DIRECTION_0000, "Direction: " + type);
     }
   }
 
-  public Validation getFrameworkValidation() {
-    return frameworkValidation;
+  public ConfigValidator getFrameworkValidation() {
+    return driverConfigValidation;
   }
 
   public void setId(Long id) {
@@ -91,32 +91,30 @@ public class JobValidationBean implements JsonBean {
   @SuppressWarnings("unchecked")
   public JSONObject extract(boolean skipSensitive) {
     JSONObject object = new JSONObject();
-    JSONObject connectorObject = new JSONObject();
+    JSONObject jobObject = new JSONObject();
 
     // Optionally transfer id
     if(id != null) {
       object.put(ID, id);
     }
 
-    connectorObject.put(FROM, extractValidation(getConnectorValidation(Direction.FROM)));
-    connectorObject.put(TO, extractValidation(getConnectorValidation(Direction.TO)));
-
-    object.put(FRAMEWORK, extractValidation(frameworkValidation));
-    object.put(CONNECTOR, connectorObject);
-
+    jobObject.put(FROM, extractValidation(getConnectorValidation(Direction.FROM)));
+    jobObject.put(TO, extractValidation(getConnectorValidation(Direction.TO)));
+    jobObject.put(DRIVER, extractValidation(driverConfigValidation));
+    object.put(JOB, jobObject);
     return object;
   }
 
   @SuppressWarnings("unchecked")
-  private JSONObject extractValidation(Validation validation) {
+  private JSONObject extractValidation(ConfigValidator validation) {
     JSONObject object = new JSONObject();
 
     object.put(STATUS, validation.getStatus().name());
 
     JSONObject jsonMessages = new JSONObject();
-    Map<Validation.FormInput, Validation.Message> messages = validation.getMessages();
+    Map<ConfigValidator.ConfigInput, ConfigValidator.Message> messages = validation.getMessages();
 
-    for(Map.Entry<Validation.FormInput, Validation.Message> entry : messages.entrySet()) {
+    for(Map.Entry<ConfigValidator.ConfigInput, ConfigValidator.Message> entry : messages.entrySet()) {
       JSONObject jsonEntry = new JSONObject();
       jsonEntry.put(STATUS, entry.getValue().getStatus().name());
       jsonEntry.put(MESSAGE, entry.getValue().getMessage());
@@ -133,20 +131,21 @@ public class JobValidationBean implements JsonBean {
     // Optional and accepting NULLs
     id = (Long) jsonObject.get(ID);
 
-    JSONObject jsonConnectorObject = (JSONObject)jsonObject.get(CONNECTOR);
+    JSONObject jobJsonObject = (JSONObject)jsonObject.get(JOB);
 
-    fromConnectorValidation = restoreValidation(
-        (JSONObject)jsonConnectorObject.get(FROM));
-    toConnectorValidation = restoreValidation(
-        (JSONObject)jsonConnectorObject.get(TO));
-    frameworkValidation = restoreValidation(
-        (JSONObject)jsonObject.get(FRAMEWORK));
+    fromConfigValidation = restoreValidation(
+        (JSONObject)jobJsonObject.get(FROM));
+    toConfigValidation = restoreValidation(
+        (JSONObject)jobJsonObject.get(TO));
+    driverConfigValidation = restoreValidation(
+        (JSONObject)jobJsonObject.get(DRIVER));
   }
 
-  public Validation restoreValidation(JSONObject jsonObject) {
+  public ConfigValidator restoreValidation(JSONObject jsonObject) {
+
     JSONObject jsonMessages = (JSONObject) jsonObject.get(MESSAGES);
-    Map<Validation.FormInput, Validation.Message> messages
-        = new HashMap<Validation.FormInput, Validation.Message>();
+    Map<ConfigValidator.ConfigInput, ConfigValidator.Message> messages
+        = new HashMap<ConfigValidator.ConfigInput, ConfigValidator.Message>();
 
     for(Object key : jsonMessages.keySet()) {
       JSONObject jsonMessage = (JSONObject) jsonMessages.get(key);
@@ -154,14 +153,14 @@ public class JobValidationBean implements JsonBean {
       Status status = Status.valueOf((String) jsonMessage.get(STATUS));
       String stringMessage = (String) jsonMessage.get(MESSAGE);
 
-      Validation.Message message
-          = new Validation.Message(status, stringMessage);
+      ConfigValidator.Message message
+          = new ConfigValidator.Message(status, stringMessage);
 
-      messages.put(new Validation.FormInput((String)key), message);
+      messages.put(new ConfigValidator.ConfigInput((String)key), message);
     }
 
     Status status = Status.valueOf((String) jsonObject.get(STATUS));
 
-    return new Validation(status, messages);
+    return new ConfigValidator(status, messages);
   }
 }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/8362c73c/common/src/main/java/org/apache/sqoop/json/LinkBean.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/json/LinkBean.java b/common/src/main/java/org/apache/sqoop/json/LinkBean.java
index 8981ea7..af0fc9d 100644
--- a/common/src/main/java/org/apache/sqoop/json/LinkBean.java
+++ b/common/src/main/java/org/apache/sqoop/json/LinkBean.java
@@ -18,8 +18,8 @@
 package org.apache.sqoop.json;
 
 import org.apache.sqoop.model.MLink;
-import org.apache.sqoop.model.MConnectionForms;
-import org.apache.sqoop.model.MForm;
+import org.apache.sqoop.model.MLinkConfig;
+import org.apache.sqoop.model.MConfig;
 import org.json.simple.JSONArray;
 import org.json.simple.JSONObject;
 
@@ -31,7 +31,7 @@ import java.util.Map;
 import java.util.ResourceBundle;
 import java.util.Set;
 
-import static org.apache.sqoop.json.util.FormSerialization.*;
+import static org.apache.sqoop.json.util.ConfigSerialization.*;
 import static org.apache.sqoop.json.util.ResourceBundleSerialization.*;
 
 /**
@@ -42,16 +42,14 @@ import static org.apache.sqoop.json.util.ResourceBundleSerialization.*;
  */
 public class LinkBean implements JsonBean {
 
-  private static final String CONNECTOR_ID = "connector-id";
-  private static final String CONNECTOR_PART = "connector";
-  private static final String FRAMEWORK_PART = "framework";
+  static final String CONNECTOR_ID = "connector-id";
+  static final String LINK_CONFIG = "link-config";
 
   // Required
   private List<MLink> links;
 
   // Optional
-  private Map<Long, ResourceBundle> connectorConfigBundles;
-  private ResourceBundle driverConfigBundle;
+  private Map<Long, ResourceBundle> linkConfigBundles;
 
   // For "extract"
   public LinkBean(MLink link) {
@@ -67,72 +65,56 @@ public class LinkBean implements JsonBean {
 
   // For "restore"
   public LinkBean() {
-    connectorConfigBundles = new HashMap<Long, ResourceBundle>();
-  }
-
-  public void setDriverConfigBundle(ResourceBundle driverConfigBundle) {
-    this.driverConfigBundle = driverConfigBundle;
+    linkConfigBundles = new HashMap<Long, ResourceBundle>();
   }
 
   public void addConnectorConfigBundle(Long id, ResourceBundle connectorConfigBundle) {
-    connectorConfigBundles.put(id, connectorConfigBundle);
+    linkConfigBundles.put(id, connectorConfigBundle);
   }
 
-  public boolean hasConnectorBundle(Long id) {
-    return connectorConfigBundles.containsKey(id);
+  public boolean hasConnectorConfigBundle(Long id) {
+    return linkConfigBundles.containsKey(id);
   }
 
   public List<MLink> getLinks() {
     return links;
   }
 
-  public ResourceBundle getConnectorBundle(Long id) {
-    return connectorConfigBundles.get(id);
-  }
-
-  public ResourceBundle getFrameworkBundle() {
-    return driverConfigBundle;
+  public ResourceBundle getConnectorConfigBundle(Long id) {
+    return linkConfigBundles.get(id);
   }
 
   @Override
   @SuppressWarnings("unchecked")
   public JSONObject extract(boolean skipSensitive) {
-    JSONArray array = new JSONArray();
+    JSONArray linkArray = new JSONArray();
 
     for(MLink link : links) {
-      JSONObject object = new JSONObject();
-
-      object.put(ID, link.getPersistenceId());
-      object.put(NAME, link.getName());
-      object.put(ENABLED, link.getEnabled());
-      object.put(CREATION_USER, link.getCreationUser());
-      object.put(CREATION_DATE, link.getCreationDate().getTime());
-      object.put(UPDATE_USER, link.getLastUpdateUser());
-      object.put(UPDATE_DATE, link.getLastUpdateDate().getTime());
-      object.put(CONNECTOR_ID, link.getConnectorId());
-      object.put(CONNECTOR_PART,
-        extractForms(link.getConnectorPart().getForms(), skipSensitive));
-      object.put(FRAMEWORK_PART,
-        extractForms(link.getFrameworkPart().getForms(), skipSensitive));
-
-      array.add(object);
+      JSONObject linkJsonObject = new JSONObject();
+
+      linkJsonObject.put(ID, link.getPersistenceId());
+      linkJsonObject.put(NAME, link.getName());
+      linkJsonObject.put(ENABLED, link.getEnabled());
+      linkJsonObject.put(CREATION_USER, link.getCreationUser());
+      linkJsonObject.put(CREATION_DATE, link.getCreationDate().getTime());
+      linkJsonObject.put(UPDATE_USER, link.getLastUpdateUser());
+      linkJsonObject.put(UPDATE_DATE, link.getLastUpdateDate().getTime());
+      linkJsonObject.put(CONNECTOR_ID, link.getConnectorId());
+      linkJsonObject.put(LINK_CONFIG,
+        extractConfigList(link.getConnectorLinkConfig().getConfigs(), skipSensitive));
+
+      linkArray.add(linkJsonObject);
     }
 
     JSONObject all = new JSONObject();
-    all.put(ALL, array);
-
-    if(!connectorConfigBundles.isEmpty()) {
+    all.put(ALL, linkArray);
+    if (!linkConfigBundles.isEmpty()) {
       JSONObject bundles = new JSONObject();
-
-      for(Map.Entry<Long, ResourceBundle> entry : connectorConfigBundles.entrySet()) {
-        bundles.put(entry.getKey().toString(),
-                    extractResourceBundle(entry.getValue()));
+      for (Map.Entry<Long, ResourceBundle> entry : linkConfigBundles.entrySet()) {
+        bundles.put(entry.getKey().toString(), extractResourceBundle(entry.getValue()));
       }
       all.put(CONNECTOR_CONFIGS, bundles);
     }
-    if(driverConfigBundle != null) {
-      all.put(DRIVER_CONFIGS,extractResourceBundle(driverConfigBundle));
-    }
     return all;
   }
 
@@ -147,15 +129,11 @@ public class LinkBean implements JsonBean {
       JSONObject object = (JSONObject) obj;
 
       long connectorId = (Long) object.get(CONNECTOR_ID);
-      JSONArray connectorPart = (JSONArray) object.get(CONNECTOR_PART);
-      JSONArray frameworkPart = (JSONArray) object.get(FRAMEWORK_PART);
+      JSONArray connectorLinkConfig = (JSONArray) object.get(LINK_CONFIG);
 
-      List<MForm> connectorForms = restoreForms(connectorPart);
-      List<MForm> frameworkForms = restoreForms(frameworkPart);
+      List<MConfig> linkConfig = restoreConfigList(connectorLinkConfig);
 
-      MLink link = new MLink(connectorId,
-        new MConnectionForms(connectorForms),
-        new MConnectionForms(frameworkForms));
+      MLink link = new MLink(connectorId, new MLinkConfig(linkConfig));
 
       link.setPersistenceId((Long) object.get(ID));
       link.setName((String) object.get(NAME));
@@ -172,13 +150,9 @@ public class LinkBean implements JsonBean {
       JSONObject bundles = (JSONObject) jsonObject.get(CONNECTOR_CONFIGS);
       Set<Map.Entry<String, JSONObject>> entrySet = bundles.entrySet();
       for (Map.Entry<String, JSONObject> entry : entrySet) {
-        connectorConfigBundles.put(Long.parseLong(entry.getKey()),
+        linkConfigBundles.put(Long.parseLong(entry.getKey()),
                              restoreResourceBundle(entry.getValue()));
       }
     }
-    if(jsonObject.containsKey(DRIVER_CONFIGS)) {
-      driverConfigBundle = restoreResourceBundle(
-        (JSONObject) jsonObject.get(DRIVER_CONFIGS));
-    }
   }
 }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/8362c73c/common/src/main/java/org/apache/sqoop/json/LinkValidationBean.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/json/LinkValidationBean.java b/common/src/main/java/org/apache/sqoop/json/LinkValidationBean.java
index a6a6b65..682f63b 100644
--- a/common/src/main/java/org/apache/sqoop/json/LinkValidationBean.java
+++ b/common/src/main/java/org/apache/sqoop/json/LinkValidationBean.java
@@ -18,37 +18,32 @@
 package org.apache.sqoop.json;
 
 import org.apache.sqoop.validation.Status;
-import org.apache.sqoop.validation.Validation;
+import org.apache.sqoop.validation.ConfigValidator;
 import org.json.simple.JSONObject;
 
 import java.util.HashMap;
 import java.util.Map;
 
 /**
- * Bean for sending validations across network. This bean will move two
- * validation objects at one time - one for connector and second for framework
- * part of validated entity. Optionally validation bean can also transfer
+ * Bean for sending validations across network.This bean will transfer link config
+ * validation results. Optionally validation bean can also transfer
  * created persistent id in case that new entity was created.
  */
 public class LinkValidationBean implements JsonBean {
 
   private static final String ID = "id";
-  private static final String FRAMEWORK = "framework";
-  private static final String CONNECTOR = "connector";
   private static final String STATUS = "status";
   private static final String MESSAGE = "message";
   private static final String MESSAGES = "messages";
 
   private Long id;
-  private Validation connectorValidation;
-  private Validation frameworkValidation;
+  private ConfigValidator linkConfigValidation;
 
   // For "extract"
-  public LinkValidationBean(Validation connector, Validation framework) {
+  public LinkValidationBean(ConfigValidator linkConfigValidator) {
     this();
 
-    this.connectorValidation = connector;
-    this.frameworkValidation = framework;
+    this.linkConfigValidation = linkConfigValidator;
   }
 
   // For "restore"
@@ -56,12 +51,8 @@ public class LinkValidationBean implements JsonBean {
     id = null;
   }
 
-  public Validation getConnectorValidation() {
-    return connectorValidation;
-  }
-
-  public Validation getFrameworkValidation() {
-    return frameworkValidation;
+  public ConfigValidator getLinkConfigValidator() {
+    return linkConfigValidation;
   }
 
   public void setId(Long id) {
@@ -80,23 +71,20 @@ public class LinkValidationBean implements JsonBean {
     if(id != null) {
       object.put(ID, id);
     }
-
-    object.put(CONNECTOR, extractValidation(connectorValidation));
-    object.put(FRAMEWORK, extractValidation(frameworkValidation));
-
+    object.put(LinkBean.LINK_CONFIG, extractValidation(linkConfigValidation));
     return object;
   }
 
   @SuppressWarnings("unchecked")
-  private JSONObject extractValidation(Validation validation) {
+  private JSONObject extractValidation(ConfigValidator validation) {
     JSONObject object = new JSONObject();
 
     object.put(STATUS, validation.getStatus().name());
 
     JSONObject jsonMessages = new JSONObject();
-    Map<Validation.FormInput, Validation.Message> messages = validation.getMessages();
+    Map<ConfigValidator.ConfigInput, ConfigValidator.Message> messages = validation.getMessages();
 
-    for(Map.Entry<Validation.FormInput, Validation.Message> entry : messages.entrySet()) {
+    for(Map.Entry<ConfigValidator.ConfigInput, ConfigValidator.Message> entry : messages.entrySet()) {
       JSONObject jsonEntry = new JSONObject();
       jsonEntry.put(STATUS, entry.getValue().getStatus().name());
       jsonEntry.put(MESSAGE, entry.getValue().getMessage());
@@ -113,16 +101,14 @@ public class LinkValidationBean implements JsonBean {
     // Optional and accepting NULLs
     id = (Long) jsonObject.get(ID);
 
-    connectorValidation = restoreValidation(
-      (JSONObject)jsonObject.get(CONNECTOR));
-    frameworkValidation = restoreValidation(
-      (JSONObject)jsonObject.get(FRAMEWORK));
+    linkConfigValidation = restoreValidation(
+      (JSONObject)jsonObject.get(LinkBean.LINK_CONFIG));
   }
 
-  public Validation restoreValidation(JSONObject jsonObject) {
+  public ConfigValidator restoreValidation(JSONObject jsonObject) {
     JSONObject jsonMessages = (JSONObject) jsonObject.get(MESSAGES);
-    Map<Validation.FormInput, Validation.Message> messages
-      = new HashMap<Validation.FormInput, Validation.Message>();
+    Map<ConfigValidator.ConfigInput, ConfigValidator.Message> messages
+      = new HashMap<ConfigValidator.ConfigInput, ConfigValidator.Message>();
 
     for(Object key : jsonMessages.keySet()) {
       JSONObject jsonMessage = (JSONObject) jsonMessages.get(key);
@@ -130,14 +116,14 @@ public class LinkValidationBean implements JsonBean {
       Status status = Status.valueOf((String) jsonMessage.get(STATUS));
       String stringMessage = (String) jsonMessage.get(MESSAGE);
 
-      Validation.Message message
-        = new Validation.Message(status, stringMessage);
+      ConfigValidator.Message message
+        = new ConfigValidator.Message(status, stringMessage);
 
-      messages.put(new Validation.FormInput((String)key), message);
+      messages.put(new ConfigValidator.ConfigInput((String)key), message);
     }
 
     Status status = Status.valueOf((String) jsonObject.get(STATUS));
 
-    return new Validation(status, messages);
+    return new ConfigValidator(status, messages);
   }
 }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/8362c73c/common/src/main/java/org/apache/sqoop/json/ThrowableBean.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/json/ThrowableBean.java b/common/src/main/java/org/apache/sqoop/json/ThrowableBean.java
index fc63ed4..cd26020 100644
--- a/common/src/main/java/org/apache/sqoop/json/ThrowableBean.java
+++ b/common/src/main/java/org/apache/sqoop/json/ThrowableBean.java
@@ -26,7 +26,7 @@ import java.util.LinkedList;
 import java.util.List;
 
 /**
- * Transfer throwable instance.
+ * Transfer throwable instance as a throwable bean.
  */
 public class ThrowableBean implements JsonBean {
 

http://git-wip-us.apache.org/repos/asf/sqoop/blob/8362c73c/common/src/main/java/org/apache/sqoop/json/ValidationResultBean.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/json/ValidationResultBean.java b/common/src/main/java/org/apache/sqoop/json/ValidationResultBean.java
index 89bc8db..4b3fc37 100644
--- a/common/src/main/java/org/apache/sqoop/json/ValidationResultBean.java
+++ b/common/src/main/java/org/apache/sqoop/json/ValidationResultBean.java
@@ -19,7 +19,7 @@ package org.apache.sqoop.json;
 
 import org.apache.sqoop.validation.Message;
 import org.apache.sqoop.validation.Status;
-import org.apache.sqoop.validation.ValidationResult;
+import org.apache.sqoop.validation.ConfigValidationResult;
 import org.json.simple.JSONArray;
 import org.json.simple.JSONObject;
 
@@ -38,18 +38,18 @@ public class ValidationResultBean implements JsonBean {
   private static final String STATUS = "STATUS";
   private static final String TEXT = "TEXT";
 
-  private ValidationResult[] results;
+  private ConfigValidationResult[] results;
   private Long id;
 
   public ValidationResultBean() {
     // Empty, for restore
   }
 
-  public ValidationResultBean(ValidationResult ... results) {
+  public ValidationResultBean(ConfigValidationResult ... results) {
     this.results = results;
   }
 
-  public ValidationResult[] getValidationResults() {
+  public ConfigValidationResult[] getValidationResults() {
     return results;
   }
 
@@ -65,7 +65,7 @@ public class ValidationResultBean implements JsonBean {
   public JSONObject extract(boolean skipSensitive) {
     JSONArray array = new JSONArray();
 
-    for(ValidationResult result : results) {
+    for(ConfigValidationResult result : results) {
       JSONObject output = extractValidationResult(result);
       array.add(output);
     }
@@ -78,7 +78,7 @@ public class ValidationResultBean implements JsonBean {
     return object;
   }
 
-  private JSONObject extractValidationResult(ValidationResult result) {
+  private JSONObject extractValidationResult(ConfigValidationResult result) {
     JSONObject ret = new JSONObject();
 
     for(Map.Entry<String, List<Message>> entry : result.getMessages().entrySet()) {
@@ -110,7 +110,7 @@ public class ValidationResultBean implements JsonBean {
   @Override
   public void restore(JSONObject jsonObject) {
     JSONArray array = (JSONArray) jsonObject.get(ROOT);
-    results = new ValidationResult[array.size()];
+    results = new ConfigValidationResult[array.size()];
 
     int i = 0;
     for(Object item : array) {
@@ -122,8 +122,8 @@ public class ValidationResultBean implements JsonBean {
     }
   }
 
-  private ValidationResult restoreValidationResult(JSONObject item) {
-    ValidationResult result  = new ValidationResult();
+  private ConfigValidationResult restoreValidationResult(JSONObject item) {
+    ConfigValidationResult result  = new ConfigValidationResult();
     Set<Map.Entry<String, JSONArray>> entrySet = item.entrySet();
 
     for(Map.Entry<String, JSONArray> entry : entrySet) {


Mime
View raw message