airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject [42/44] airavata git commit: Mongo Registry WIP
Date Sun, 07 Jun 2015 17:01:23 GMT
Mongo Registry WIP


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/801489bf
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/801489bf
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/801489bf

Branch: refs/heads/mongo-registry
Commit: 801489bf3faf8a064619a1e0acb09b070091324c
Parents: 7e97f09
Author: Supun Nakandala <scnakandala@apache.org>
Authored: Thu May 28 19:44:25 2015 +0530
Committer: Supun Nakandala <scnakandala@apache.org>
Committed: Thu May 28 19:44:27 2015 +0530

----------------------------------------------------------------------
 .../api/server/util/AppCatalogInitUtil.java     |    6 -
 .../gfac/client/GfacClientFactoryTest.java      |   11 -
 .../airavata/gfac/client/util/Initialize.java   |    2 +-
 .../airavata/gfac/core/utils/GFacUtils.java     |    1 -
 .../client/OrchestratorClientFactoryTest.java   |   13 -
 .../orchestrator/client/util/Initialize.java    |    2 +-
 .../core/OrchestratorTestWithGRAM.java          |   15 -
 .../core/OrchestratorTestWithMyProxyAuth.java   |   16 -
 .../orchestrator/core/util/Initialize.java      |    2 +-
 .../registry/jpa/impl/ExperimentRegistry.java   |    1 +
 .../registry/jpa/impl/ProjectRegistry.java      |    1 +
 .../persistance/registry/jpa/impl/UserReg.java  |    1 -
 .../jpa/resources/ConfigurationResource.java    |    4 -
 .../jpa/resources/ExperimentResource.java       |    1 +
 .../registry/jpa/resources/GatewayResource.java |    1 +
 .../jpa/resources/JobDetailResource.java        |    1 +
 .../resources/NotificationEmailResource.java    |    5 +-
 .../registry/jpa/resources/ProjectResource.java |    1 +
 .../jpa/resources/ProjectUserResource.java      |    6 +-
 .../registry/jpa/resources/StatusResource.java  |    1 +
 .../jpa/resources/TaskDetailResource.java       |    1 +
 .../registry/jpa/resources/Utils.java           |    7 +-
 .../registry/jpa/resources/WorkerResource.java  |    1 +
 .../resources/WorkflowNodeDetailResource.java   |    1 +
 .../jpa/utils/ThriftDataModelConversion.java    |   39 +-
 .../jpa/ExperimentInputResourceTest.java        |    4 +-
 .../registry/jpa/ExperimentResourceTest.java    |    1 -
 .../registry/jpa/GatewayResourceTest.java       |    1 +
 .../registry/jpa/util/Initialize.java           |    1 -
 .../persistance/registry/jpa/JPAConstants.java  |   33 -
 .../persistance/registry/jpa/Resource.java      |   71 -
 .../persistance/registry/jpa/ResourceType.java  |   49 -
 .../persistance/registry/jpa/ResourceUtils.java |  525 ------
 .../registry/jpa/impl/ExperimentRegistry.java   | 1643 ------------------
 .../registry/jpa/impl/GatewayRegistry.java      |  115 --
 .../registry/jpa/impl/LoggingRegistryImpl.java  |   97 --
 .../registry/jpa/impl/ProjectRegistry.java      |  211 ---
 .../registry/jpa/impl/RegistryFactory.java      |   80 -
 .../registry/jpa/impl/RegistryImpl.java         |  735 --------
 .../persistance/registry/jpa/impl/UserReg.java  |   41 -
 .../jpa/model/AdvancedInputDataHandling.java    |  129 --
 .../jpa/model/AdvancedOutputDataHandling.java   |  119 --
 .../registry/jpa/model/ApplicationInput.java    |  173 --
 .../registry/jpa/model/ApplicationInput_PK.java |   65 -
 .../registry/jpa/model/ApplicationOutput.java   |  150 --
 .../jpa/model/ApplicationOutput_PK.java         |   64 -
 .../Computational_Resource_Scheduling.java      |  190 --
 .../registry/jpa/model/Configuration.java       |   80 -
 .../registry/jpa/model/Configuration_PK.java    |   74 -
 .../registry/jpa/model/DataTransferDetail.java  |   88 -
 .../registry/jpa/model/ErrorDetail.java         |  196 ---
 .../registry/jpa/model/Experiment.java          |  211 ---
 .../jpa/model/ExperimentConfigData.java         |  106 --
 .../registry/jpa/model/Experiment_Input.java    |  178 --
 .../registry/jpa/model/Experiment_Input_PK.java |   64 -
 .../registry/jpa/model/Experiment_Output.java   |  151 --
 .../jpa/model/Experiment_Output_PK.java         |   64 -
 .../persistance/registry/jpa/model/Gateway.java |   76 -
 .../registry/jpa/model/Gateway_Worker.java      |   82 -
 .../registry/jpa/model/Gateway_Worker_PK.java   |   64 -
 .../registry/jpa/model/JobDetail.java           |  120 --
 .../registry/jpa/model/JobDetails_PK.java       |   64 -
 .../registry/jpa/model/NodeInput.java           |  171 --
 .../registry/jpa/model/NodeInput_PK.java        |   64 -
 .../registry/jpa/model/NodeOutput.java          |  148 --
 .../registry/jpa/model/NodeOutput_PK.java       |   64 -
 .../registry/jpa/model/Notification_Email.java  |   97 --
 .../persistance/registry/jpa/model/Project.java |  125 --
 .../registry/jpa/model/ProjectUser.java         |   81 -
 .../registry/jpa/model/ProjectUser_PK.java      |   64 -
 .../registry/jpa/model/QosParam.java            |  119 --
 .../persistance/registry/jpa/model/Status.java  |  174 --
 .../registry/jpa/model/TaskDetail.java          |  119 --
 .../persistance/registry/jpa/model/Users.java   |   55 -
 .../registry/jpa/model/WorkflowNodeDetail.java  |  107 --
 .../registry/jpa/mongo/ExperimentRegistry.java  |   28 -
 .../persistance/registry/jpa/mongo/Test.java    |   79 -
 .../conversion/AbstractThriftDeserializer.java  |  152 --
 .../conversion/AbstractThriftSerializer.java    |  122 --
 .../mongo/conversion/ModelConversionHelper.java |  218 ---
 .../idot/InputDataObjectTypeDeserializer.java   |   44 -
 .../idot/InputDataObjectTypeSerializer.java     |   41 -
 .../odot/OutputDataObjectTypeDeserializer.java  |   44 -
 .../odot/OutputDataObjectTypeSerializer.java    |   41 -
 .../experiment/ExperimentDeserializer.java      |   44 -
 .../experiment/ExperimentSerializer.java        |   41 -
 .../AdvancedInputDataHandlingDeserializer.java  |   44 -
 .../AdvancedInputDataHandlingSerializer.java    |   41 -
 .../AdvancedOutputDataHandlingDeserializer.java |   44 -
 .../AdvancedOutputDataHandlingSerializer.java   |   41 -
 .../ApplicationStatusDeserializer.java          |   44 -
 .../appstatus/ApplicationStatusSerializer.java  |   42 -
 ...utationalResourceSchedulingDeserializer.java |   44 -
 ...mputationalResourceSchedulingSerializer.java |   41 -
 .../DataTransferDetailsDeserializer.java        |   44 -
 .../DataTransferDetailsSerializer.java          |   41 -
 .../errdetails/ErrorDetailsDeserializer.java    |   44 -
 .../errdetails/ErrorDetailsSerializer.java      |   41 -
 .../expstatus/ExperimentStatusDeserializer.java |   44 -
 .../expstatus/ExperimentStatusSerializer.java   |   41 -
 .../ExperimentSummaryDeserializer.java          |   44 -
 .../expsummary/ExperimentSummarySerializer.java |   41 -
 .../jobdetails/JobDetailsDeserializer.java      |   44 -
 .../jobdetails/JobDetailsSerializer.java        |   41 -
 .../jobstatus/JobStatusDeserializer.java        |   44 -
 .../jobstatus/JobStatusSerializer.java          |   41 -
 .../QualityOfServiceParamsDeserializer.java     |   44 -
 .../qosp/QualityOfServiceParamsSerializer.java  |   41 -
 .../taskdetails/TaskDetailsDeserializer.java    |   44 -
 .../taskdetails/TaskDetailsSerializer.java      |   41 -
 .../taskstatus/TaskStatusDeserializer.java      |   44 -
 .../taskstatus/TaskStatusSerializer.java        |   41 -
 .../trstatus/TransferStatusDeserializer.java    |   44 -
 .../trstatus/TransferStatusSerializer.java      |   41 -
 .../UserConfigurationDataDeserializer.java      |   44 -
 .../ucdata/UserConfigurationDataSerializer.java |   41 -
 .../ValidationResultsDeserializer.java          |   44 -
 .../ValidationResultsSerializer.java            |   41 -
 .../ValidatorResultDeserializer.java            |   44 -
 .../ValidatorResultSerializer.java              |   41 -
 .../wfnd/WorkflowNodeDetailsDeserializer.java   |   44 -
 .../wfnd/WorkflowNodeDetailsSerializer.java     |   41 -
 .../wfns/WorkflowNodeStatusDeserializer.java    |   44 -
 .../wfns/WorkflowNodeStatusSerializer.java      |   41 -
 .../conversion/gateway/GatewayDeserializer.java |   44 -
 .../conversion/gateway/GatewaySerializer.java   |   41 -
 .../conversion/group/GroupDeserializer.java     |   44 -
 .../mongo/conversion/group/GroupSerializer.java |   41 -
 .../conversion/project/ProjectDeserializer.java |   44 -
 .../conversion/project/ProjectSerializer.java   |   40 -
 .../mongo/conversion/user/UserDeserializer.java |   44 -
 .../mongo/conversion/user/UserSerializer.java   |   40 -
 .../registry/jpa/mongo/dao/ExperimentDao.java   |  374 ----
 .../registry/jpa/mongo/dao/ProjectDao.java      |  189 --
 .../registry/jpa/mongo/utils/MongoUtil.java     |   70 -
 .../jpa/resources/AbstractResource.java         |  317 ----
 .../AdvanceInputDataHandlingResource.java       |  168 --
 .../AdvancedOutputDataHandlingResource.java     |  159 --
 .../jpa/resources/ApplicationInputResource.java |  235 ---
 .../resources/ApplicationOutputResource.java    |  213 ---
 .../ComputationSchedulingResource.java          |  229 ---
 .../jpa/resources/ConfigDataResource.java       |  162 --
 .../jpa/resources/ConfigurationResource.java    |  208 ---
 .../resources/DataTransferDetailResource.java   |  272 ---
 .../jpa/resources/ErrorDetailResource.java      |  229 ---
 .../jpa/resources/ExperimentInputResource.java  |  229 ---
 .../jpa/resources/ExperimentOutputResource.java |  209 ---
 .../jpa/resources/ExperimentResource.java       |  777 ---------
 .../registry/jpa/resources/GatewayResource.java |  436 -----
 .../jpa/resources/JobDetailResource.java        |  361 ----
 .../jpa/resources/NodeInputResource.java        |  231 ---
 .../jpa/resources/NodeOutputResource.java       |  211 ---
 .../resources/NotificationEmailResource.java    |  125 --
 .../registry/jpa/resources/ProjectResource.java |  531 ------
 .../jpa/resources/ProjectUserResource.java      |  123 --
 .../jpa/resources/QosParamResource.java         |  152 --
 .../registry/jpa/resources/StatusResource.java  |  195 ---
 .../jpa/resources/TaskDetailResource.java       |  661 -------
 .../registry/jpa/resources/UserResource.java    |  186 --
 .../registry/jpa/resources/Utils.java           |  824 ---------
 .../registry/jpa/resources/WorkerResource.java  |  908 ----------
 .../resources/WorkflowNodeDetailResource.java   |  473 -----
 .../registry/jpa/utils/QueryGenerator.java      |  128 --
 .../jpa/utils/ThriftDataModelConversion.java    |  714 --------
 .../persistance/registry/mongo/Test.java        |   79 +
 .../conversion/AbstractThriftDeserializer.java  |  152 ++
 .../conversion/AbstractThriftSerializer.java    |  122 ++
 .../mongo/conversion/ModelConversionHelper.java |  218 +++
 .../idot/InputDataObjectTypeDeserializer.java   |   44 +
 .../idot/InputDataObjectTypeSerializer.java     |   41 +
 .../odot/OutputDataObjectTypeDeserializer.java  |   44 +
 .../odot/OutputDataObjectTypeSerializer.java    |   41 +
 .../experiment/ExperimentDeserializer.java      |   44 +
 .../experiment/ExperimentSerializer.java        |   41 +
 .../AdvancedInputDataHandlingDeserializer.java  |   44 +
 .../AdvancedInputDataHandlingSerializer.java    |   41 +
 .../AdvancedOutputDataHandlingDeserializer.java |   44 +
 .../AdvancedOutputDataHandlingSerializer.java   |   41 +
 .../ApplicationStatusDeserializer.java          |   44 +
 .../appstatus/ApplicationStatusSerializer.java  |   42 +
 ...utationalResourceSchedulingDeserializer.java |   44 +
 ...mputationalResourceSchedulingSerializer.java |   41 +
 .../DataTransferDetailsDeserializer.java        |   44 +
 .../DataTransferDetailsSerializer.java          |   41 +
 .../errdetails/ErrorDetailsDeserializer.java    |   44 +
 .../errdetails/ErrorDetailsSerializer.java      |   41 +
 .../expstatus/ExperimentStatusDeserializer.java |   44 +
 .../expstatus/ExperimentStatusSerializer.java   |   41 +
 .../ExperimentSummaryDeserializer.java          |   44 +
 .../expsummary/ExperimentSummarySerializer.java |   41 +
 .../jobdetails/JobDetailsDeserializer.java      |   44 +
 .../jobdetails/JobDetailsSerializer.java        |   41 +
 .../jobstatus/JobStatusDeserializer.java        |   44 +
 .../jobstatus/JobStatusSerializer.java          |   41 +
 .../QualityOfServiceParamsDeserializer.java     |   44 +
 .../qosp/QualityOfServiceParamsSerializer.java  |   41 +
 .../taskdetails/TaskDetailsDeserializer.java    |   44 +
 .../taskdetails/TaskDetailsSerializer.java      |   41 +
 .../taskstatus/TaskStatusDeserializer.java      |   44 +
 .../taskstatus/TaskStatusSerializer.java        |   41 +
 .../trstatus/TransferStatusDeserializer.java    |   44 +
 .../trstatus/TransferStatusSerializer.java      |   41 +
 .../UserConfigurationDataDeserializer.java      |   44 +
 .../ucdata/UserConfigurationDataSerializer.java |   41 +
 .../ValidationResultsDeserializer.java          |   44 +
 .../ValidationResultsSerializer.java            |   41 +
 .../ValidatorResultDeserializer.java            |   44 +
 .../ValidatorResultSerializer.java              |   41 +
 .../wfnd/WorkflowNodeDetailsDeserializer.java   |   44 +
 .../wfnd/WorkflowNodeDetailsSerializer.java     |   41 +
 .../wfns/WorkflowNodeStatusDeserializer.java    |   44 +
 .../wfns/WorkflowNodeStatusSerializer.java      |   41 +
 .../conversion/gateway/GatewayDeserializer.java |   44 +
 .../conversion/gateway/GatewaySerializer.java   |   41 +
 .../conversion/group/GroupDeserializer.java     |   44 +
 .../mongo/conversion/group/GroupSerializer.java |   41 +
 .../conversion/project/ProjectDeserializer.java |   44 +
 .../conversion/project/ProjectSerializer.java   |   40 +
 .../mongo/conversion/user/UserDeserializer.java |   44 +
 .../mongo/conversion/user/UserSerializer.java   |   40 +
 .../registry/mongo/dao/ExperimentDao.java       |  378 ++++
 .../registry/mongo/dao/GatewayDao.java          |  179 ++
 .../registry/mongo/dao/ProjectDao.java          |  189 ++
 .../persistance/registry/mongo/dao/UserDao.java |  124 ++
 .../registry/mongo/impl/RegistryFactory.java    |   44 +
 .../registry/mongo/impl/RegistryImpl.java       |  732 ++++++++
 .../mongo/repository/ExperimentRepository.java  | 1566 +++++++++++++++++
 .../mongo/repository/GatewayRepository.java     |  120 ++
 .../mongo/repository/ProjectRepository.java     |  191 ++
 .../mongo/repository/UserRepository.java        |   65 +
 .../registry/mongo/utils/MongoUtil.java         |   70 +
 .../src/main/resources/META-INF/persistence.xml |   50 +-
 .../registry/mongo/AbstractDaoTest.java         |   37 +
 .../registry/mongo/ExperimentDaoTest.java       |  286 +--
 .../registry/RegistryUseCaseTest.java           |  291 ----
 .../engine/interpretor/WorkflowInterpreter.java |    1 -
 236 files changed, 6620 insertions(+), 21233 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/util/AppCatalogInitUtil.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/util/AppCatalogInitUtil.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/util/AppCatalogInitUtil.java
index 870898b..d0fb5cd 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/util/AppCatalogInitUtil.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/util/AppCatalogInitUtil.java
@@ -23,12 +23,6 @@ package org.apache.airavata.api.server.util;
 
 import org.apache.airavata.common.exception.ApplicationSettingsException;
 import org.apache.airavata.common.utils.ServerSettings;
-import org.apache.airavata.persistance.registry.jpa.ResourceType;
-import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
-import org.apache.airavata.persistance.registry.jpa.resources.GatewayResource;
-import org.apache.airavata.persistance.registry.jpa.resources.ProjectResource;
-import org.apache.airavata.persistance.registry.jpa.resources.UserResource;
-import org.apache.airavata.persistance.registry.jpa.resources.WorkerResource;
 import org.apache.derby.drda.NetworkServerControl;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/gfac/airavata-gfac-service/src/test/java/org/apache/airavata/gfac/client/GfacClientFactoryTest.java
----------------------------------------------------------------------
diff --git a/modules/gfac/airavata-gfac-service/src/test/java/org/apache/airavata/gfac/client/GfacClientFactoryTest.java b/modules/gfac/airavata-gfac-service/src/test/java/org/apache/airavata/gfac/client/GfacClientFactoryTest.java
index 21c137f..2cf5aad 100644
--- a/modules/gfac/airavata-gfac-service/src/test/java/org/apache/airavata/gfac/client/GfacClientFactoryTest.java
+++ b/modules/gfac/airavata-gfac-service/src/test/java/org/apache/airavata/gfac/client/GfacClientFactoryTest.java
@@ -25,25 +25,14 @@ package org.apache.airavata.gfac.client;
 //import org.apache.airavata.client.api.AiravataAPI;
 //import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
 //import org.apache.airavata.client.tools.DocumentCreator;
-import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.AiravataUtils;
-import org.apache.airavata.common.utils.AiravataZKUtils;
-import org.apache.airavata.common.utils.ServerSettings;
 import org.apache.airavata.gfac.client.util.Initialize;
 import org.apache.airavata.gfac.cpi.GfacService;
 import org.apache.airavata.gfac.server.GfacServer;
-import org.apache.airavata.persistance.registry.jpa.impl.RegistryFactory;
 import org.apache.airavata.registry.cpi.Registry;
 import org.apache.zookeeper.server.ServerCnxnFactory;
-import org.apache.zookeeper.server.ServerConfig;
-import org.apache.zookeeper.server.quorum.QuorumPeerConfig;
-import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.IOException;
-import java.net.URL;
-
 public class GfacClientFactoryTest {
     private final static Logger logger = LoggerFactory.getLogger(GfacClientFactoryTest.class);
 //    private DocumentCreator documentCreator;

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/gfac/airavata-gfac-service/src/test/java/org/apache/airavata/gfac/client/util/Initialize.java
----------------------------------------------------------------------
diff --git a/modules/gfac/airavata-gfac-service/src/test/java/org/apache/airavata/gfac/client/util/Initialize.java b/modules/gfac/airavata-gfac-service/src/test/java/org/apache/airavata/gfac/client/util/Initialize.java
index 6f3f792..08b2eae 100644
--- a/modules/gfac/airavata-gfac-service/src/test/java/org/apache/airavata/gfac/client/util/Initialize.java
+++ b/modules/gfac/airavata-gfac-service/src/test/java/org/apache/airavata/gfac/client/util/Initialize.java
@@ -22,10 +22,10 @@
 package org.apache.airavata.gfac.client.util;
 
 import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.AiravataUtils;
 import org.apache.airavata.common.utils.ServerSettings;
 import org.apache.airavata.persistance.registry.jpa.ResourceType;
 import org.apache.airavata.persistance.registry.jpa.resources.*;
+import org.apache.airavata.persistance.registry.mongo.resources.*;
 import org.apache.airavata.registry.cpi.RegistryException;
 import org.apache.derby.drda.NetworkServerControl;
 import org.slf4j.Logger;

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/GFacUtils.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/GFacUtils.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/GFacUtils.java
index 2c6cbd4..34490cb 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/GFacUtils.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/GFacUtils.java
@@ -38,7 +38,6 @@ import org.apache.airavata.gfac.core.context.JobExecutionContext;
 import org.apache.airavata.gfac.core.handler.GFacHandlerException;
 import org.apache.airavata.gfac.core.states.GfacExperimentState;
 import org.apache.airavata.gfac.core.states.GfacHandlerState;
-import org.apache.airavata.messaging.core.impl.RabbitMQTaskLaunchConsumer;
 import org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType;
 import org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType;
 import org.apache.airavata.model.appcatalog.computeresource.*;

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactoryTest.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactoryTest.java b/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactoryTest.java
index 18168c7..3902c9d 100644
--- a/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactoryTest.java
+++ b/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactoryTest.java
@@ -25,19 +25,6 @@ package org.apache.airavata.orchestrator.client;
 //import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
 //import org.apache.airavata.client.tools.DocumentCreator;
 //import org.apache.airavata.client.tools.DocumentCreatorNew;
-import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.AiravataUtils;
-import org.apache.airavata.common.utils.AiravataZKUtils;
-import org.apache.airavata.common.utils.Constants;
-import org.apache.airavata.common.utils.ServerSettings;
-import org.apache.airavata.model.error.AiravataClientConnectException;
-import org.apache.airavata.orchestrator.client.util.Initialize;
-import org.apache.airavata.orchestrator.cpi.OrchestratorService;
-import org.apache.airavata.orchestrator.server.OrchestratorServer;
-import org.apache.airavata.persistance.registry.jpa.impl.RegistryFactory;
-import org.apache.airavata.registry.cpi.Registry;
-import org.apache.zookeeper.server.ServerCnxnFactory;
-import org.junit.Test;
 
 public class OrchestratorClientFactoryTest {
 /*    private DocumentCreatorNew documentCreator;

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/util/Initialize.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/util/Initialize.java b/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/util/Initialize.java
index a9eb5a8..be7eb30 100644
--- a/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/util/Initialize.java
+++ b/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/util/Initialize.java
@@ -22,10 +22,10 @@
 package org.apache.airavata.orchestrator.client.util;
 
 import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.AiravataUtils;
 import org.apache.airavata.common.utils.ServerSettings;
 import org.apache.airavata.persistance.registry.jpa.ResourceType;
 import org.apache.airavata.persistance.registry.jpa.resources.*;
+import org.apache.airavata.persistance.registry.mongo.resources.*;
 import org.apache.airavata.registry.cpi.RegistryException;
 import org.apache.derby.drda.NetworkServerControl;
 import org.slf4j.Logger;

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/OrchestratorTestWithGRAM.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/OrchestratorTestWithGRAM.java b/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/OrchestratorTestWithGRAM.java
index c5263ea..97f55e5 100644
--- a/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/OrchestratorTestWithGRAM.java
+++ b/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/OrchestratorTestWithGRAM.java
@@ -20,21 +20,6 @@
 */
 package org.apache.airavata.orchestrator.core;
 
-import org.apache.airavata.common.utils.AiravataUtils;
-import org.apache.airavata.orchestrator.cpi.Orchestrator;
-import org.apache.airavata.orchestrator.cpi.impl.SimpleOrchestratorImpl;
-import org.apache.airavata.persistance.registry.jpa.impl.RegistryImpl;
-import org.apache.airavata.registry.cpi.ChildDataType;
-import org.apache.airavata.registry.cpi.ParentDataType;
-import org.apache.airavata.registry.cpi.Registry;
-import org.junit.Assert;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Test;
-
-import java.util.*;
-
 public class OrchestratorTestWithGRAM extends BaseOrchestratorTest {
 //    private static final Logger log = LoggerFactory.getLogger(OrchestratorTestWithGRAM.class);
 //

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/OrchestratorTestWithMyProxyAuth.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/OrchestratorTestWithMyProxyAuth.java b/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/OrchestratorTestWithMyProxyAuth.java
index c155f9c..9c39b3f 100644
--- a/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/OrchestratorTestWithMyProxyAuth.java
+++ b/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/OrchestratorTestWithMyProxyAuth.java
@@ -20,22 +20,6 @@
 */
 package org.apache.airavata.orchestrator.core;
 
-import org.apache.airavata.common.utils.AiravataUtils;
-import org.apache.airavata.model.util.ExperimentModelUtil;
-import org.apache.airavata.model.workspace.experiment.*;
-import org.apache.airavata.orchestrator.cpi.Orchestrator;
-import org.apache.airavata.orchestrator.cpi.impl.SimpleOrchestratorImpl;
-import org.apache.airavata.persistance.registry.jpa.impl.RegistryFactory;
-import org.apache.airavata.registry.cpi.ParentDataType;
-import org.apache.airavata.registry.cpi.Registry;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Test;
-
-import java.util.ArrayList;
-import java.util.List;
-
 public class OrchestratorTestWithMyProxyAuth extends BaseOrchestratorTest {
 //    private static final Logger log = LoggerFactory.getLogger(NewOrchestratorTest.class);
 //

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/util/Initialize.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/util/Initialize.java b/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/util/Initialize.java
index 29a8f2c..e29efde 100644
--- a/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/util/Initialize.java
+++ b/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/util/Initialize.java
@@ -22,10 +22,10 @@
 package org.apache.airavata.orchestrator.core.util;
 
 import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.AiravataUtils;
 import org.apache.airavata.common.utils.ServerSettings;
 import org.apache.airavata.persistance.registry.jpa.ResourceType;
 import org.apache.airavata.persistance.registry.jpa.resources.*;
+import org.apache.airavata.persistance.registry.mongo.resources.*;
 import org.apache.airavata.registry.cpi.RegistryException;
 import org.apache.derby.drda.NetworkServerControl;
 import org.slf4j.Logger;

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
index a6909f1..494cd63 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
@@ -31,6 +31,7 @@ import org.apache.airavata.persistance.registry.jpa.Resource;
 import org.apache.airavata.persistance.registry.jpa.ResourceType;
 import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
 import org.apache.airavata.persistance.registry.jpa.resources.*;
+import org.apache.airavata.persistance.registry.mongo.resources.*;
 import org.apache.airavata.persistance.registry.jpa.utils.ThriftDataModelConversion;
 import org.apache.airavata.registry.cpi.CompositeIdentifier;
 import org.apache.airavata.registry.cpi.RegistryException;

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ProjectRegistry.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ProjectRegistry.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ProjectRegistry.java
index 928fe64..e506422 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ProjectRegistry.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ProjectRegistry.java
@@ -26,6 +26,7 @@ import org.apache.airavata.model.workspace.Project;
 import org.apache.airavata.persistance.registry.jpa.ResourceType;
 import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
 import org.apache.airavata.persistance.registry.jpa.resources.*;
+import org.apache.airavata.persistance.registry.mongo.resources.*;
 import org.apache.airavata.persistance.registry.jpa.utils.ThriftDataModelConversion;
 import org.apache.airavata.registry.cpi.RegistryException;
 import org.apache.airavata.registry.cpi.ResultOrderType;

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/UserReg.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/UserReg.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/UserReg.java
index ef544b2..7920200 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/UserReg.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/UserReg.java
@@ -24,7 +24,6 @@ package org.apache.airavata.persistance.registry.jpa.impl;
 import org.apache.airavata.common.exception.ApplicationSettingsException;
 import org.apache.airavata.common.utils.ServerSettings;
 import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
-import org.apache.airavata.persistance.registry.jpa.resources.UserResource;
 import org.apache.airavata.persistance.registry.jpa.resources.WorkerResource;
 import org.apache.airavata.registry.cpi.RegistryException;
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ConfigurationResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ConfigurationResource.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ConfigurationResource.java
index ef84988..9e2ebfd 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ConfigurationResource.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ConfigurationResource.java
@@ -21,19 +21,15 @@
 package org.apache.airavata.persistance.registry.jpa.resources;
 
 import java.sql.Timestamp;
-import java.util.ArrayList;
 import java.util.List;
-import java.util.concurrent.locks.Lock;
 
 import javax.persistence.EntityManager;
-import javax.persistence.Query;
 
 import org.apache.airavata.persistance.registry.jpa.Resource;
 import org.apache.airavata.persistance.registry.jpa.ResourceType;
 import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
 import org.apache.airavata.persistance.registry.jpa.model.Configuration;
 import org.apache.airavata.persistance.registry.jpa.model.Configuration_PK;
-import org.apache.airavata.persistance.registry.jpa.utils.QueryGenerator;
 import org.apache.airavata.registry.cpi.RegistryException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentResource.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentResource.java
index 1d7b58c..a64372e 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentResource.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentResource.java
@@ -31,6 +31,7 @@ import org.apache.airavata.persistance.registry.jpa.Resource;
 import org.apache.airavata.persistance.registry.jpa.ResourceType;
 import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
 import org.apache.airavata.persistance.registry.jpa.model.*;
+import org.apache.airavata.persistance.registry.mongo.model.*;
 import org.apache.airavata.persistance.registry.jpa.utils.QueryGenerator;
 import org.apache.airavata.registry.cpi.RegistryException;
 import org.apache.airavata.registry.cpi.utils.StatusType;

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GatewayResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GatewayResource.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GatewayResource.java
index d0cb0c4..4d90ab8 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GatewayResource.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GatewayResource.java
@@ -30,6 +30,7 @@ import org.apache.airavata.persistance.registry.jpa.Resource;
 import org.apache.airavata.persistance.registry.jpa.ResourceType;
 import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
 import org.apache.airavata.persistance.registry.jpa.model.*;
+import org.apache.airavata.persistance.registry.mongo.model.*;
 import org.apache.airavata.persistance.registry.jpa.utils.QueryGenerator;
 import org.apache.airavata.registry.cpi.RegistryException;
 import org.slf4j.Logger;

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/JobDetailResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/JobDetailResource.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/JobDetailResource.java
index 6e6d2ee..e2b7eae 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/JobDetailResource.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/JobDetailResource.java
@@ -25,6 +25,7 @@ import org.apache.airavata.persistance.registry.jpa.Resource;
 import org.apache.airavata.persistance.registry.jpa.ResourceType;
 import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
 import org.apache.airavata.persistance.registry.jpa.model.*;
+import org.apache.airavata.persistance.registry.mongo.model.*;
 import org.apache.airavata.persistance.registry.jpa.utils.QueryGenerator;
 import org.apache.airavata.registry.cpi.RegistryException;
 import org.apache.airavata.registry.cpi.utils.StatusType;

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/NotificationEmailResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/NotificationEmailResource.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/NotificationEmailResource.java
index 5ac864f..e8f353d 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/NotificationEmailResource.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/NotificationEmailResource.java
@@ -24,7 +24,10 @@ package org.apache.airavata.persistance.registry.jpa.resources;
 import org.apache.airavata.persistance.registry.jpa.Resource;
 import org.apache.airavata.persistance.registry.jpa.ResourceType;
 import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
-import org.apache.airavata.persistance.registry.jpa.model.*;
+import org.apache.airavata.persistance.registry.jpa.model.Experiment;
+import org.apache.airavata.persistance.registry.jpa.model.Notification_Email;
+import org.apache.airavata.persistance.registry.jpa.model.TaskDetail;
+import org.apache.airavata.persistance.registry.mongo.model.*;
 import org.apache.airavata.registry.cpi.RegistryException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ProjectResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ProjectResource.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ProjectResource.java
index 4dc4160..d10a624 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ProjectResource.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ProjectResource.java
@@ -24,6 +24,7 @@ import org.apache.airavata.persistance.registry.jpa.Resource;
 import org.apache.airavata.persistance.registry.jpa.ResourceType;
 import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
 import org.apache.airavata.persistance.registry.jpa.model.*;
+import org.apache.airavata.persistance.registry.mongo.model.*;
 import org.apache.airavata.persistance.registry.jpa.utils.QueryGenerator;
 import org.apache.airavata.registry.cpi.RegistryException;
 import org.apache.airavata.registry.cpi.ResultOrderType;

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ProjectUserResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ProjectUserResource.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ProjectUserResource.java
index 336a9ee..e4115a9 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ProjectUserResource.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ProjectUserResource.java
@@ -24,7 +24,11 @@ package org.apache.airavata.persistance.registry.jpa.resources;
 import org.apache.airavata.persistance.registry.jpa.Resource;
 import org.apache.airavata.persistance.registry.jpa.ResourceType;
 import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
-import org.apache.airavata.persistance.registry.jpa.model.*;
+import org.apache.airavata.persistance.registry.jpa.model.Project;
+import org.apache.airavata.persistance.registry.jpa.model.ProjectUser;
+import org.apache.airavata.persistance.registry.jpa.model.ProjectUser_PK;
+import org.apache.airavata.persistance.registry.jpa.model.Users;
+import org.apache.airavata.persistance.registry.mongo.model.*;
 import org.apache.airavata.registry.cpi.RegistryException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/StatusResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/StatusResource.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/StatusResource.java
index 169e1c7..bd2d9f0 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/StatusResource.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/StatusResource.java
@@ -25,6 +25,7 @@ import org.apache.airavata.persistance.registry.jpa.Resource;
 import org.apache.airavata.persistance.registry.jpa.ResourceType;
 import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
 import org.apache.airavata.persistance.registry.jpa.model.*;
+import org.apache.airavata.persistance.registry.mongo.model.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.airavata.registry.cpi.RegistryException;

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/TaskDetailResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/TaskDetailResource.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/TaskDetailResource.java
index 791c9f9..66de51e 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/TaskDetailResource.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/TaskDetailResource.java
@@ -25,6 +25,7 @@ import org.apache.airavata.persistance.registry.jpa.Resource;
 import org.apache.airavata.persistance.registry.jpa.ResourceType;
 import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
 import org.apache.airavata.persistance.registry.jpa.model.*;
+import org.apache.airavata.persistance.registry.mongo.model.*;
 import org.apache.airavata.persistance.registry.jpa.utils.QueryGenerator;
 import org.apache.airavata.registry.cpi.RegistryException;
 import org.apache.airavata.registry.cpi.utils.StatusType;

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java
index 69ada6d..86e252f 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java
@@ -26,6 +26,7 @@ import org.apache.airavata.persistance.registry.jpa.JPAConstants;
 import org.apache.airavata.persistance.registry.jpa.Resource;
 import org.apache.airavata.persistance.registry.jpa.ResourceType;
 import org.apache.airavata.persistance.registry.jpa.model.*;
+import org.apache.airavata.persistance.registry.mongo.model.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -215,7 +216,7 @@ public class Utils {
                     throw new IllegalArgumentException("Object should be a Experiment.");
                 }
             case NOTIFICATION_EMAIL:
-                if (o instanceof  Notification_Email){
+                if (o instanceof Notification_Email){
                     return createNotificationEmail((Notification_Email)o);
                 }else {
                     logger.error("Object should be a Experiment.", new IllegalArgumentException());
@@ -229,7 +230,7 @@ public class Utils {
                     throw new IllegalArgumentException("Object should be a Experiment input data.");
                 }
             case EXPERIMENT_OUTPUT:
-                if (o instanceof  Experiment_Output){
+                if (o instanceof Experiment_Output){
                     return createExperimentOutput((Experiment_Output)o);
                 }else {
                     logger.error("Object should be a Experiment output data.", new IllegalArgumentException());
@@ -243,7 +244,7 @@ public class Utils {
                      throw new IllegalArgumentException("Object should be a Workflow node data.");
                  }
             case TASK_DETAIL:
-                if (o instanceof  TaskDetail){
+                if (o instanceof TaskDetail){
                     return createTaskDetail((TaskDetail)o);
                 }else {
                     logger.error("Object should be a task detail data.", new IllegalArgumentException());

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkerResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkerResource.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkerResource.java
index 8be98c3..cdd3dff 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkerResource.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkerResource.java
@@ -26,6 +26,7 @@ import org.apache.airavata.persistance.registry.jpa.Resource;
 import org.apache.airavata.persistance.registry.jpa.ResourceType;
 import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
 import org.apache.airavata.persistance.registry.jpa.model.*;
+import org.apache.airavata.persistance.registry.mongo.model.*;
 import org.apache.airavata.persistance.registry.jpa.utils.QueryGenerator;
 import org.apache.airavata.registry.cpi.ResultOrderType;
 import org.apache.airavata.registry.cpi.utils.Constants;

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkflowNodeDetailResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkflowNodeDetailResource.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkflowNodeDetailResource.java
index 9d2869d..8100b31 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkflowNodeDetailResource.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkflowNodeDetailResource.java
@@ -25,6 +25,7 @@ import org.apache.airavata.persistance.registry.jpa.Resource;
 import org.apache.airavata.persistance.registry.jpa.ResourceType;
 import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
 import org.apache.airavata.persistance.registry.jpa.model.*;
+import org.apache.airavata.persistance.registry.mongo.model.*;
 import org.apache.airavata.persistance.registry.jpa.utils.QueryGenerator;
 import org.apache.airavata.registry.cpi.utils.StatusType;
 import org.slf4j.Logger;

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/ThriftDataModelConversion.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/ThriftDataModelConversion.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/ThriftDataModelConversion.java
index ef3152f..0dbb860 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/ThriftDataModelConversion.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/ThriftDataModelConversion.java
@@ -21,40 +21,12 @@
 
 package org.apache.airavata.persistance.registry.jpa.utils;
 
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.airavata.common.utils.StringUtil;
-import org.apache.airavata.model.appcatalog.appinterface.*;
+import org.apache.airavata.model.appcatalog.appinterface.DataType;
+import org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType;
+import org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType;
 import org.apache.airavata.model.workspace.Gateway;
 import org.apache.airavata.model.workspace.Project;
-import org.apache.airavata.model.workspace.experiment.ActionableGroup;
-import org.apache.airavata.model.workspace.experiment.AdvancedInputDataHandling;
-import org.apache.airavata.model.workspace.experiment.AdvancedOutputDataHandling;
-import org.apache.airavata.model.workspace.experiment.ApplicationStatus;
-import org.apache.airavata.model.workspace.experiment.ComputationalResourceScheduling;
-import org.apache.airavata.model.workspace.experiment.CorrectiveAction;
-import org.apache.airavata.model.workspace.experiment.DataTransferDetails;
-import org.apache.airavata.model.workspace.experiment.ErrorCategory;
-import org.apache.airavata.model.workspace.experiment.ErrorDetails;
-import org.apache.airavata.model.workspace.experiment.ExecutionUnit;
-import org.apache.airavata.model.workspace.experiment.Experiment;
-import org.apache.airavata.model.workspace.experiment.ExperimentState;
-import org.apache.airavata.model.workspace.experiment.ExperimentStatus;
-import org.apache.airavata.model.workspace.experiment.ExperimentSummary;
-import org.apache.airavata.model.workspace.experiment.JobDetails;
-import org.apache.airavata.model.workspace.experiment.JobState;
-import org.apache.airavata.model.workspace.experiment.JobStatus;
-import org.apache.airavata.model.workspace.experiment.QualityOfServiceParams;
-import org.apache.airavata.model.workspace.experiment.TaskDetails;
-import org.apache.airavata.model.workspace.experiment.TaskState;
-import org.apache.airavata.model.workspace.experiment.TaskStatus;
-import org.apache.airavata.model.workspace.experiment.TransferState;
-import org.apache.airavata.model.workspace.experiment.TransferStatus;
-import org.apache.airavata.model.workspace.experiment.UserConfigurationData;
-import org.apache.airavata.model.workspace.experiment.WorkflowNodeDetails;
-import org.apache.airavata.model.workspace.experiment.WorkflowNodeState;
-import org.apache.airavata.model.workspace.experiment.WorkflowNodeStatus;
+import org.apache.airavata.model.workspace.experiment.*;
 import org.apache.airavata.persistance.registry.jpa.Resource;
 import org.apache.airavata.persistance.registry.jpa.ResourceType;
 import org.apache.airavata.persistance.registry.jpa.resources.*;
@@ -62,6 +34,9 @@ import org.apache.airavata.registry.cpi.RegistryException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.ArrayList;
+import java.util.List;
+
 public class ThriftDataModelConversion {
     private final static Logger logger = LoggerFactory.getLogger(ThriftDataModelConversion.class);
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ExperimentInputResourceTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ExperimentInputResourceTest.java b/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ExperimentInputResourceTest.java
index a46e196..3c8fec6 100644
--- a/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ExperimentInputResourceTest.java
+++ b/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ExperimentInputResourceTest.java
@@ -21,7 +21,9 @@
 
 package org.apache.airavata.persistance.registry.jpa;
 
-import org.apache.airavata.persistance.registry.jpa.resources.*;
+import org.apache.airavata.persistance.registry.jpa.resources.ExperimentInputResource;
+import org.apache.airavata.persistance.registry.jpa.resources.ExperimentResource;
+import org.apache.airavata.persistance.registry.mongo.resources.*;
 import org.junit.After;
 import org.junit.Test;
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ExperimentResourceTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ExperimentResourceTest.java b/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ExperimentResourceTest.java
index eb620e9..45f4817 100644
--- a/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ExperimentResourceTest.java
+++ b/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ExperimentResourceTest.java
@@ -24,7 +24,6 @@ package org.apache.airavata.persistance.registry.jpa;
 import static org.junit.Assert.*;
 
 import java.sql.Timestamp;
-import java.util.Calendar;
 import java.util.Date;
 
 import org.apache.airavata.persistance.registry.jpa.resources.ExperimentResource;

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/GatewayResourceTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/GatewayResourceTest.java b/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/GatewayResourceTest.java
index 022b197..1330cee 100644
--- a/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/GatewayResourceTest.java
+++ b/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/GatewayResourceTest.java
@@ -25,6 +25,7 @@ import static org.junit.Assert.*;
 
 import org.apache.airavata.common.utils.ServerSettings;
 import org.apache.airavata.persistance.registry.jpa.resources.*;
+import org.apache.airavata.persistance.registry.mongo.resources.*;
 import org.junit.After;
 import org.junit.Test;
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/util/Initialize.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/util/Initialize.java b/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/util/Initialize.java
index 6bb5a5e..c721737 100644
--- a/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/util/Initialize.java
+++ b/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/util/Initialize.java
@@ -22,7 +22,6 @@
 package org.apache.airavata.persistance.registry.jpa.util;
 
 import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.AiravataUtils;
 import org.apache.airavata.common.utils.ServerSettings;
 import org.apache.airavata.persistance.registry.jpa.ResourceType;
 import org.apache.airavata.persistance.registry.jpa.resources.GatewayResource;

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/JPAConstants.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/JPAConstants.java b/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/JPAConstants.java
deleted file mode 100644
index deb3ba2..0000000
--- a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/JPAConstants.java
+++ /dev/null
@@ -1,33 +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.airavata.persistance.registry.jpa;
-
-public class JPAConstants {
-	public static final String KEY_JDBC_URL = "registry.jdbc.url";
-	public static final String KEY_JDBC_USER = "registry.jdbc.user";
-	public static final String KEY_JDBC_PASSWORD = "registry.jdbc.password";
-	public static final String KEY_JDBC_DRIVER = "registry.jdbc.driver";
-	public static final String KEY_DERBY_START_ENABLE = "start.derby.server.mode";
-    public static final String VALIDATION_QUERY = "validationQuery";
-    public static final String JPA_CACHE_SIZE = "jpa.cache.size";
-    public static final String ENABLE_CACHING = "cache.enable";
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/Resource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/Resource.java b/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/Resource.java
deleted file mode 100644
index 640f771..0000000
--- a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/Resource.java
+++ /dev/null
@@ -1,71 +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.airavata.persistance.registry.jpa;
-
-import org.apache.airavata.registry.cpi.RegistryException;
-
-import java.util.List;
-
-public interface Resource {
-    /**
-     * This method will create associate resource objects for the given resource type.
-     * @param type child resource type
-     * @return associate child resource
-     */
-    Resource create(ResourceType type) throws RegistryException, RegistryException;
-
-    /**
-     * This method will remove the given child resource from the database
-     * @param type child resource type
-     * @param name child resource name
-     */
-    void remove(ResourceType type, Object name) throws RegistryException;
-
-    /**
-     *  This method will return the given child resource from the database
-     * @param type child resource type
-     * @param name child resource name
-     * @return associate child resource
-     */
-    Resource get(ResourceType type, Object name) throws RegistryException;
-
-    /**
-     * This method will list all the child resources for the given resource type
-     * @param type child resource type
-     * @return list of child resources of the given child resource type
-     */
-    List<Resource> get(ResourceType type) throws RegistryException;
-
-    /**
-     * This method will saveExperiment the resource to the database.
-     */
-    void save() throws RegistryException;
-
-    /**
-     * This method will check whether an entry from the given resource type and resource name
-     * exists in the database
-     * @param type child resource type
-     * @param name child resource name
-     * @return whether the entry exists in the database or not
-     */
-    boolean isExists(ResourceType type, Object name) throws RegistryException;
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceType.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceType.java b/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceType.java
deleted file mode 100644
index 0a38664..0000000
--- a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceType.java
+++ /dev/null
@@ -1,49 +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.airavata.persistance.registry.jpa;
-
-public enum ResourceType {
-    GATEWAY,
-    PROJECT,
-    USER,
-    PROJECT_USER,
-    CONFIGURATION,
-    GATEWAY_WORKER,
-    EXPERIMENT,
-    NOTIFICATION_EMAIL,
-    EXPERIMENT_INPUT,
-    EXPERIMENT_OUTPUT,
-    WORKFLOW_NODE_DETAIL,
-    TASK_DETAIL,
-    ERROR_DETAIL,
-    APPLICATION_INPUT,
-    APPLICATION_OUTPUT,
-    NODE_INPUT,
-    NODE_OUTPUT,
-    JOB_DETAIL,
-    DATA_TRANSFER_DETAIL,
-    STATUS,
-    CONFIG_DATA,
-    COMPUTATIONAL_RESOURCE_SCHEDULING,
-    ADVANCE_INPUT_DATA_HANDLING,
-    ADVANCE_OUTPUT_DATA_HANDLING,
-    QOS_PARAM
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java b/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java
deleted file mode 100644
index 4b6fc80..0000000
--- a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java
+++ /dev/null
@@ -1,525 +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.airavata.persistance.registry.jpa;
-
-import org.apache.airavata.persistance.registry.jpa.model.*;
-import org.apache.airavata.persistance.registry.jpa.resources.*;
-import org.apache.airavata.persistance.registry.jpa.utils.QueryGenerator;
-import org.apache.airavata.registry.cpi.RegistryException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Persistence;
-import javax.persistence.Query;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class ResourceUtils {
-    private final static Logger logger = LoggerFactory.getLogger(ResourceUtils.class);
-    private static final String PERSISTENCE_UNIT_NAME = "airavata_data";
-    protected static EntityManagerFactory factory;
-
-    public static void reset(){
-    	factory=null;
-    }
-    
-    public static EntityManager getEntityManager(){
-        if (factory == null) {
-            String connectionProperties = "DriverClassName=" + Utils.getJDBCDriver() + "," + "Url=" + Utils.getJDBCURL() + "?autoReconnect=true,," +
-                    "Username=" + Utils.getJDBCUser() + "," + "Password=" + Utils.getJDBCPassword() + ",validationQuery=" +
-            Utils.getValidationQuery();
-            System.out.println(connectionProperties);
-            Map<String, String> properties = new HashMap<String, String>();
-            properties.put("openjpa.ConnectionDriverName", "org.apache.commons.dbcp.BasicDataSource");
-            properties.put("openjpa.ConnectionProperties", connectionProperties);
-            properties.put("openjpa.DynamicEnhancementAgent", "true");
-            properties.put("openjpa.RuntimeUnenhancedClasses", "unsupported");
-            properties.put("openjpa.DataCache","" + Utils.isCachingEnabled() + "(CacheSize=" + Utils.getJPACacheSize() + ", SoftReferenceSize=0)");
-            properties.put("openjpa.QueryCache","" + Utils.isCachingEnabled() + "(CacheSize=" + Utils.getJPACacheSize() + ", SoftReferenceSize=0)");
-            properties.put("openjpa.RemoteCommitProvider","sjvm");
-            properties.put("openjpa.Log","DefaultLevel=INFO, Runtime=INFO, Tool=INFO, SQL=INFO");
-            properties.put("openjpa.jdbc.DBDictionary","SupportsMultipleNontransactionalResultSets=false");
-//            properties.put("openjpa.ReadLockLevel", "none");
-//            properties.put("openjpa.WriteLockLevel", "none");
-//            properties.put("openjpa.LockTimeout", "30000");
-//            properties.put("openjpa.LockManager", "none");
-            properties.put("openjpa.jdbc.SynchronizeMappings", "buildSchema(ForeignKeys=true)");
-            properties.put("openjpa.ConnectionFactoryProperties", "PrettyPrint=true, PrettyPrintLineLength=72, PrintParameters=true, MaxActive=10, MaxIdle=5, MinIdle=2, MaxWait=31536000,  autoReconnect=true");
-			properties.put("openjpa.jdbc.QuerySQLCache", "false");
-            factory = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME, properties);
-        }
-		return factory.createEntityManager();
-    }
-
-    /**
-     * @param gatewayId
-     * @return
-     */
-    public static Resource createGateway(String gatewayId) throws RegistryException {
-        if (!isGatewayExist(gatewayId)) {
-            GatewayResource gatewayResource = new GatewayResource();
-            gatewayResource.setGatewayId(gatewayId);
-            return gatewayResource;
-        }else {
-            return getGateway(gatewayId);
-        }
-    }
-
-    public static UserResource createUser(String username, String password) throws RegistryException {
-        if (!isUserExist(username)) {
-            UserResource userResource = new UserResource();
-            userResource.setUserName(username);
-            userResource.setPassword(password);
-            return userResource;
-        }else {
-            return (UserResource)getUser(username);
-        }
-
-    }
-
-    public static Resource getGateway(String gatewayId) throws RegistryException{
-        EntityManager em = null;
-        try {
-            if (isGatewayExist(gatewayId)) {
-                em = getEntityManager();
-                Gateway gateway = em.find(Gateway.class, gatewayId);
-                GatewayResource gatewayResource = (GatewayResource)Utils.getResource(ResourceType.GATEWAY, gateway);
-                em.close();
-                return gatewayResource;
-            }
-        }catch (Exception e){
-            logger.error(e.getMessage(), e);
-            throw new RegistryException(e);
-        }finally {
-            if (em != null && em.isOpen()){
-                if (em.getTransaction().isActive()){
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-        return null;
-    }
-
-    public static void addUser (String userName, String password) throws RegistryException{
-        UserResource resource = new UserResource();
-        resource.setUserName(userName);
-        resource.setPassword(password);
-        resource.save();
-    }
-
-    public static boolean isUserExist (String username) throws RegistryException{
-        EntityManager em = null;
-        try {
-            em = getEntityManager();
-            em.getTransaction().begin();
-            QueryGenerator generator = new QueryGenerator(AbstractResource.USERS);
-            generator.setParameter(AbstractResource.UserConstants.USERNAME, username);
-            Query q = generator.selectQuery(em);
-            int size = q.getResultList().size();
-            em.getTransaction().commit();
-            em.close();
-            return size>0;
-        } catch (Exception e){
-            logger.error(e.getMessage(), e);
-            throw new RegistryException(e);
-        }finally {
-            if (em != null && em.isOpen()){
-                if (em.getTransaction().isActive()){
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-    }
-
-
-    public static Resource getUser(String userName) throws RegistryException{
-        EntityManager em = null;
-        try {
-            if (isUserExist(userName)) {
-                em = getEntityManager();
-                Users user =  em.find(Users.class, userName);
-                UserResource userResource = (UserResource)Utils.getResource(ResourceType.USER, user);
-                em.close();
-                return userResource;
-            }
-        }catch (Exception e){
-            logger.error(e.getMessage(), e);
-            throw new RegistryException(e);
-        }finally {
-            if (em != null && em.isOpen()){
-                if (em.getTransaction().isActive()){
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-        return null;
-
-    }
-
-    public static Resource getWorker(String gatewayId, String userName) throws RegistryException{
-        EntityManager em = null;
-        try {
-            em = getEntityManager();
-            Gateway_Worker gatewayWorker = em.find(Gateway_Worker.class, new Gateway_Worker_PK(gatewayId, userName));
-            WorkerResource workerResource = (WorkerResource) Utils.getResource(ResourceType.GATEWAY_WORKER, gatewayWorker);
-            em.close();
-            return workerResource;
-        }catch (Exception e){
-            logger.error(e.getMessage(), e);
-            throw new RegistryException(e);
-        }finally {
-            if (em != null && em.isOpen()){
-                if (em.getTransaction().isActive()){
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-
-
-    }
-
-
-    /**
-     * @param gatewayId
-     * @return
-     */
-    public static boolean isGatewayExist(String gatewayId) throws RegistryException{
-        EntityManager em = null;
-        try {
-            em = getEntityManager();
-            em.getTransaction().begin();
-            QueryGenerator generator = new QueryGenerator(AbstractResource.GATEWAY);
-            generator.setParameter(AbstractResource.GatewayConstants.GATEWAY_ID, gatewayId);
-            Query q = generator.selectQuery(em);
-            int size = q.getResultList().size();
-            em.getTransaction().commit();
-            em.close();
-            return size>0;
-        }catch (Exception e){
-            logger.error(e.getMessage(), e);
-            throw new RegistryException(e);
-        }finally {
-            if (em != null && em.isOpen()){
-                if (em.getTransaction().isActive()){
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-
-    }
-
-    public static List<Resource> getAllGateways() throws RegistryException{
-        List<Resource> resourceList = new ArrayList<Resource>();
-        EntityManager em = null;
-        try {
-            em = getEntityManager();
-            em.getTransaction().begin();
-            QueryGenerator generator = new QueryGenerator(AbstractResource.GATEWAY);
-            Query q = generator.selectQuery(em);
-            List results = q.getResultList();
-            if (results.size() != 0) {
-                for (Object result : results) {
-                    Gateway gateway = (Gateway) result;
-                    GatewayResource gatewayResource =
-                            (GatewayResource) Utils.getResource(ResourceType.GATEWAY, gateway);
-                    resourceList.add(gatewayResource);
-                }
-            }
-            em.getTransaction().commit();
-            em.close();
-        }catch (Exception e){
-            logger.error(e.getMessage(), e);
-            throw new RegistryException(e);
-        }finally {
-            if (em != null && em.isOpen()){
-                if (em.getTransaction().isActive()){
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-        return resourceList;
-    }
-
-    /**
-     * @param gatewayId
-     * @return
-     */
-    public static boolean removeGateway(String gatewayId) {
-        EntityManager em = null;
-        try {
-            em = getEntityManager();
-            em.getTransaction().begin();
-            QueryGenerator generator = new QueryGenerator(AbstractResource.GATEWAY);
-            generator.setParameter(AbstractResource.GatewayConstants.GATEWAY_ID, gatewayId);
-            Query q = generator.deleteQuery(em);
-            q.executeUpdate();
-            em.getTransaction().commit();
-            em.close();
-            return true;
-        } catch (Exception e) {
-            logger.error(e.getMessage(), e);
-            return false;
-        }finally {
-            if (em != null && em.isOpen()){
-                if (em.getTransaction().isActive()){
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-    }
-
-    /**
-     * @param gatewayResource
-     * @param userResource
-     */
-    public static WorkerResource addGatewayWorker(GatewayResource gatewayResource, UserResource userResource) throws RegistryException{
-        EntityManager em = null;
-        try {
-            em = getEntityManager();
-            em.getTransaction().begin();
-            if (!isGatewayExist(gatewayResource.getGatewayName())){
-                gatewayResource.save();
-            }
-            if (!isUserExist(userResource.getUserName())){
-                userResource.save();
-            }
-            Gateway gateway = em.find(Gateway.class, gatewayResource.getGatewayId());
-            Users user = em.find(Users.class, userResource.getUserName());
-            Gateway_Worker gatewayWorker = new Gateway_Worker();
-            gatewayWorker.setGateway(gateway);
-            gatewayWorker.setUser(user);
-            em.persist(gatewayWorker);
-            em.getTransaction().commit();
-            em.close();
-            return (WorkerResource)Utils.getResource(ResourceType.GATEWAY_WORKER, gatewayWorker);
-        } catch (Exception e){
-            logger.error(e.getMessage(), e);
-            throw new RegistryException(e);
-        }finally {
-            if (em != null && em.isOpen()){
-                if (em.getTransaction().isActive()){
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-    }
-
-    /**
-     * @param gatewayResource
-     * @param userResource
-     * @return
-     */
-    public static boolean removeGatewayWorker(GatewayResource gatewayResource, UserResource userResource) {
-        EntityManager em = null;
-        try {
-            em = getEntityManager();
-            em.getTransaction().begin();
-            QueryGenerator generator = new QueryGenerator(AbstractResource.GATEWAY_WORKER);
-            generator.setParameter(AbstractResource.GatewayWorkerConstants.GATEWAY_ID,
-                    gatewayResource.getGatewayName());
-            generator.setParameter(AbstractResource.UserConstants.USERNAME, userResource.getUserName());
-            Query q = generator.deleteQuery(em);
-            q.executeUpdate();
-            em.getTransaction().commit();
-            em.close();
-            return true;
-        } catch (Exception e) {
-            logger.error(e.getMessage(), e);
-            return false;
-        }finally {
-            if (em != null && em.isOpen()){
-                if (em.getTransaction().isActive()){
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-
-    }
-
-    /**
-     * @param configKey
-     * @return
-     */
-    public static List<ConfigurationResource> getConfigurations(String configKey){
-        List<ConfigurationResource> list = new ArrayList<ConfigurationResource>();
-        EntityManager em = null;
-        try {
-            em = getEntityManager();
-            em.getTransaction().begin();
-            QueryGenerator generator = new QueryGenerator(AbstractResource.CONFIGURATION);
-            generator.setParameter(AbstractResource.ConfigurationConstants.CONFIG_KEY, configKey);
-            Query q = generator.selectQuery(em);
-            List<?> resultList = q.getResultList();
-            if (resultList.size() != 0) {
-                for (Object result : resultList) {
-                    ConfigurationResource configurationResource = createConfigurationResourceObject(result);
-                    list.add(configurationResource);
-                }
-            }
-            em.getTransaction().commit();
-            em.close();
-        }catch (Exception e) {
-            logger.error(e.getMessage(), e);
-        }finally {
-            if (em != null && em.isOpen()){
-                if (em.getTransaction().isActive()){
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-        return list;
-    }
-
-    /**
-     * @param configKey
-     * @return
-     */
-    public static ConfigurationResource getConfiguration(String configKey){
-        List<ConfigurationResource> configurations = getConfigurations(configKey);
-        return (configurations != null && configurations.size() > 0) ? configurations.get(0) : null;
-    }
-
-    /**
-     * @param configKey
-     * @return
-     */
-    public static boolean isConfigurationExist(String configKey){
-        List<ConfigurationResource> configurations = getConfigurations(configKey);
-        return (configurations != null && configurations.size() > 0);
-    }
-
-    /**
-     * @param configKey
-     * @return
-     */
-    public static ConfigurationResource createConfiguration(String configKey) {
-        ConfigurationResource config = new ConfigurationResource();
-        config.setConfigKey(configKey);
-        return config;
-    }
-
-    /**
-     * @param result
-     * @return
-     */
-    private static ConfigurationResource createConfigurationResourceObject(
-            Object result) {
-        Configuration configuration = (Configuration) result;
-        ConfigurationResource configurationResource = new ConfigurationResource(configuration.getConfig_key(), configuration.getConfig_val());
-        configurationResource.setExpireDate(configuration.getExpire_date());
-        return configurationResource;
-    }
-
-    /**
-     * @param configkey
-     * @param configValue
-     */
-    public static void removeConfiguration(String configkey, String configValue) throws RegistryException{
-        QueryGenerator queryGenerator = new QueryGenerator(AbstractResource.CONFIGURATION);
-        queryGenerator.setParameter(AbstractResource.ConfigurationConstants.CONFIG_KEY, configkey);
-        queryGenerator.setParameter(AbstractResource.ConfigurationConstants.CONFIG_VAL, configValue);
-        EntityManager em = null;
-        try {
-            if(isConfigurationExists(configkey, configValue)){
-                em = getEntityManager();
-                em.getTransaction().begin();
-                Query q = queryGenerator.deleteQuery(em);
-                q.executeUpdate();
-                em.getTransaction().commit();
-                em.close();
-            }
-        }catch (Exception e){
-            logger.error(e.getMessage(), e);
-            throw new RegistryException(e);
-        }finally {
-            if (em != null && em.isOpen()){
-                if (em.getTransaction().isActive()){
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-    }
-
-    /**
-     * @param configkey
-     */
-    public static void removeConfiguration(String configkey) throws RegistryException{
-        QueryGenerator queryGenerator = new QueryGenerator(AbstractResource.CONFIGURATION);
-        queryGenerator.setParameter(AbstractResource.ConfigurationConstants.CONFIG_KEY, configkey);
-        EntityManager em = null;
-        try {
-            if(isConfigurationExist(configkey)){
-                em = getEntityManager();
-                em.getTransaction().begin();
-                Query q = queryGenerator.deleteQuery(em);
-                q.executeUpdate();
-                em.getTransaction().commit();
-                em.close();
-            }
-        }catch (Exception e){
-            logger.error(e.getMessage(), e);
-            throw new RegistryException(e);
-        }finally {
-            if (em != null && em.isOpen()){
-                if (em.getTransaction().isActive()){
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-    }
-
-    public static boolean isConfigurationExists(String configKey, String configVal) throws RegistryException{
-        EntityManager em = null;
-        try{
-            //Currently categoryID is hardcoded value
-            em = ResourceUtils.getEntityManager();
-            Configuration existing = em.find(Configuration.class, new Configuration_PK(configKey, configVal, AbstractResource.ConfigurationConstants.CATEGORY_ID_DEFAULT_VALUE));
-            em.close();
-            return existing!= null;
-        } catch (Exception e){
-            logger.error(e.getMessage(), e);
-            throw new RegistryException(e);
-        }finally {
-            if (em != null && em.isOpen()){
-                if (em.getTransaction().isActive()){
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-    }
-}


Mime
View raw message