migrating user-profile service and new registry components to develop branch


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

Branch: refs/heads/develop
Commit: d9a69ae546736ce3265b6b5cedeeb6a2361293d8
Parents: 4d5b61c
Author: Anuj Bhandar <[email protected]>
Authored: Mon Dec 12 15:00:27 2016 -0500
Committer: Anuj Bhandar <[email protected]>
Committed: Mon Dec 12 15:00:27 2016 -0500

----------------------------------------------------------------------
 .../common/utils/ApplicationSettings.java       |    8 +
 .../airavata/common/utils/ServerSettings.java   |    5 +
 .../main/resources/airavata-server.properties   |    7 +
 modules/registry-refactoring/pom.xml            |  127 +
 .../registry/core/RegistryException.java        |   28 +
 .../workspacecatalog/GatewayEntity.java         |  221 +
 .../workspacecatalog/NSFDemographicsEntity.java |   94 +
 .../workspacecatalog/NotificationEntity.java    |  110 +
 .../workspacecatalog/ProjectEntity.java         |   92 +
 .../workspacecatalog/UserProfileEntity.java     |  247 +
 .../core/repositories/AbstractRepository.java   |   98 +
 .../workspacecatalog/GatewayRepository.java     |   36 +
 .../NotificationRepository.java                 |   35 +
 .../workspacecatalog/ProjectRepository.java     |   35 +
 .../workspacecatalog/UserProfileRepository.java |   88 +
 .../airavata/registry/core/utils/Committer.java |   27 +
 .../airavata/registry/core/utils/JPAUtils.java  |   82 +
 .../core/utils/ObjectMapperSingleton.java       |   39 +
 .../registry/core/utils/QueryConstants.java     |   22 +
 .../src/main/resources/META-INF/persistence.xml |   32 +
 .../src/main/resources/workspace_catalog.sql    |  125 +
 .../repositories/WorkspaceRepositoryTest.java   |  197 +
 .../org/apache/airavata/server/ServerMain.java  |    2 +
 modules/user-profile/pom.xml                    |    4 +-
 modules/user-profile/user-profile-core/pom.xml  |   88 -
 .../core/AbstractThriftDeserializer.java        |  151 -
 .../core/AbstractThriftSerializer.java          |  122 -
 .../userprofile/core/ModelConversionHelper.java |   77 -
 .../airavata/userprofile/core/MongoUtil.java    |   59 -
 .../userprofile/core/UserProfileCPIImpl.java    |   79 -
 .../core/UserProfileCPIImplFactory.java         |   43 -
 .../userprofile/core/UserProfileDao.java        |  164 -
 .../core/UserProfileDeserializer.java           |   64 -
 .../userprofile/core/UserProfileSerializer.java |   51 -
 .../core/UserProfileCPIImplTest.java            |   68 -
 modules/user-profile/user-profile-cpi/pom.xml   |   30 -
 .../userprofile/cpi/UserProfileCPI.java         |   42 -
 .../userprofile/cpi/UserProfileException.java   |   32 -
 .../user-profile-service/.classpath             |   26 +
 .../user-profile/user-profile-service/pom.xml   |   27 +
 .../server/UserProfileHandler.java              |   85 +
 .../server/UserProfileServer.java               |  141 +
 modules/user-profile/user-profile-stubs/pom.xml |   35 +
 .../api/exception/RegistryServiceException.java |  407 +
 .../airavata/userprofile/crude/cpi/Test.java    |   14 +
 .../crude/cpi/UserProfileCrudeService.java      | 7488 ++++++++++++++++++
 .../client/UserProfileServiceClientFactory.java |   43 +
 .../cpi/user_profile_crud_cpiConstants.java     |   41 +
 pom.xml                                         |    1 +
 49 files changed, 10067 insertions(+), 1072 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/d9a69ae5/modules/commons/src/main/java/org/apache/airavata/common/utils/ApplicationSettings.java
----------------------------------------------------------------------
diff --git 
a/modules/commons/src/main/java/org/apache/airavata/common/utils/ApplicationSettings.java
 
b/modules/commons/src/main/java/org/apache/airavata/common/utils/ApplicationSettings.java
index 3c3eed7..e44c4ab 100644
--- 
a/modules/commons/src/main/java/org/apache/airavata/common/utils/ApplicationSettings.java
+++ 
b/modules/commons/src/main/java/org/apache/airavata/common/utils/ApplicationSettings.java
@@ -413,6 +413,14 @@ public class ApplicationSettings {
         return getSetting("cluster.status.monitoring.repeat.time");
     }
 
+    public static String getUserProfileServerHost() throws 
ApplicationSettingsException {
+        return getSetting(ServerSettings.USER_PROFILE_SERVER_HOST);
+    }
+
+    public static String getUserProfileServerPort() throws 
ApplicationSettingsException {
+        return getSetting(ServerSettings.USER_PROFILE_SERVER_PORT);
+    }
+
     /**
      * @deprecated use {{@link #getSetting(String)}}
      * @return

http://git-wip-us.apache.org/repos/asf/airavata/blob/d9a69ae5/modules/commons/src/main/java/org/apache/airavata/common/utils/ServerSettings.java
----------------------------------------------------------------------
diff --git 
a/modules/commons/src/main/java/org/apache/airavata/common/utils/ServerSettings.java
 
b/modules/commons/src/main/java/org/apache/airavata/common/utils/ServerSettings.java
index 46b1ebb..cdf49e0 100644
--- 
a/modules/commons/src/main/java/org/apache/airavata/common/utils/ServerSettings.java
+++ 
b/modules/commons/src/main/java/org/apache/airavata/common/utils/ServerSettings.java
@@ -122,6 +122,11 @@ public class ServerSettings extends ApplicationSettings {
     private static final String KAFKA_TOPIC_PREFIX = "kafka.topic.prefix";
     private static final String SERVER_ROLES = "server.roles";
 
+    //User Profile onstants
+
+    public static final String USER_PROFILE_SERVER_HOST = 
"user.profile.server.host";
+    public static final String USER_PROFILE_SERVER_PORT = 
"user.profile.server.port";
+
     // todo until AIRAVATA-2066 is finished, keep server side list 
configurations here.
     private static Map<String, String[]> listConfigurations = new HashMap<>();
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/d9a69ae5/modules/configuration/server/src/main/resources/airavata-server.properties
----------------------------------------------------------------------
diff --git 
a/modules/configuration/server/src/main/resources/airavata-server.properties 
b/modules/configuration/server/src/main/resources/airavata-server.properties
index ab19a12..ffc9ea8 100644
--- a/modules/configuration/server/src/main/resources/airavata-server.properties
+++ b/modules/configuration/server/src/main/resources/airavata-server.properties
@@ -325,3 +325,10 @@ isRunningOnAws=false
 kafka.broker.list=localhost:9092
 kafka.topic.prefix=local
 enable.kafka.logging=false
+
+###########################################################################
+# User Profile module Configuration
+###########################################################################
+user.profile.server.host=localhost
+user.profile.server.port=8961
+user_profile=com.apache.airavata.user.profile.server.UserProfileServer
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/d9a69ae5/modules/registry-refactoring/pom.xml
----------------------------------------------------------------------
diff --git a/modules/registry-refactoring/pom.xml 
b/modules/registry-refactoring/pom.xml
new file mode 100644
index 0000000..b794349
--- /dev/null
+++ b/modules/registry-refactoring/pom.xml
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0";
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.airavata</groupId>
+        <artifactId>airavata</artifactId>
+        <version>0.17-SNAPSHOT</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+
+    <groupId>org.apache.airavata</groupId>
+    <artifactId>registry-refactoring</artifactId>
+
+    <properties>
+        <derby.version>10.11.1.1</derby.version>
+        <surefire.version>2.18.1</surefire.version>
+        <skipTests>false</skipTests>
+        <mysql.connector.version>5.1.34</mysql.connector.version>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-data-models</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>net.sf.dozer</groupId>
+            <artifactId>dozer</artifactId>
+            <version>5.4.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.openjpa</groupId>
+            <artifactId>openjpa-all</artifactId>
+            <version>2.3.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <version>${mysql.connector.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.derby</groupId>
+            <artifactId>derby</artifactId>
+            <version>${derby.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.derby</groupId>
+            <artifactId>derbyclient</artifactId>
+            <version>${derby.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.derby</groupId>
+            <artifactId>derbynet</artifactId>
+            <version>${derby.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.derby</groupId>
+            <artifactId>derbytools</artifactId>
+            <version>${derby.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.12</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.1</version>
+                <configuration>
+                    <source>1.8</source>
+                    <target>1.8</target>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.openjpa</groupId>
+                <artifactId>openjpa-maven-plugin</artifactId>
+                <version>2.2.0</version>
+                <configuration>
+                    <includes>**/entities/*.class</includes>
+                    <excludes>**/entities/XML*.class</excludes>
+                    <addDefaultConstructor>true</addDefaultConstructor>
+                    
<enforcePropertyRestrictions>true</enforcePropertyRestrictions>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>enhancer</id>
+                        <phase>process-classes</phase>
+                        <goals>
+                            <goal>enhance</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <dependencies>
+                    <dependency>
+                        <groupId>org.apache.openjpa</groupId>
+                        <artifactId>openjpa</artifactId>
+                        <version>2.2.0</version>
+                    </dependency>
+                </dependencies>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <version>${surefire.version}</version>
+                <inherited>true</inherited>
+                <configuration>
+                    <failIfNoTests>false</failIfNoTests>
+                    <!--<skipTests>${skipTests}</skipTests>-->
+                    <skipTests>true</skipTests>
+                    
<workingDirectory>${project.build.testOutputDirectory}</workingDirectory>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/d9a69ae5/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/RegistryException.java
----------------------------------------------------------------------
diff --git 
a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/RegistryException.java
 
b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/RegistryException.java
new file mode 100644
index 0000000..8893b34
--- /dev/null
+++ 
b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/RegistryException.java
@@ -0,0 +1,28 @@
+/*
+ *
+ * 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.registry.core;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class RegistryException extends Exception {
+    private final static Logger logger = 
LoggerFactory.getLogger(RegistryException.class);
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/d9a69ae5/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/GatewayEntity.java
----------------------------------------------------------------------
diff --git 
a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/GatewayEntity.java
 
b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/GatewayEntity.java
new file mode 100644
index 0000000..c4f1f59
--- /dev/null
+++ 
b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/GatewayEntity.java
@@ -0,0 +1,221 @@
+/*
+ *
+ * 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.registry.core.entities.workspacecatalog;
+
+import javax.persistence.*;
+
+@Entity
+@Table(name="WORKSPACE_GATEWAY")
+public class GatewayEntity {
+    private String gatewayId;
+    private String gatewayName;
+    private String domain;
+    private String emailAddress;
+    private String gatewayApprovalStatus;
+    private String gatewayAcronym;
+    private String gatewayUrl;
+    private String gatewayPublicAbstract;
+    private String reviewProposalDescription;
+    private String gatewayAdminFirstName;
+    private String getGatewayAdminLastName;
+    private String gatewayAdminEmail;
+    private String identityServerUserName;
+    private String identityServerPasswordToken;
+    private String declinedReason;
+    private String oauthClientId;
+    private String getOauthClientSecret;
+    private long requestCreationTime;
+    private String requesterUsername;
+
+    @Id
+    @Column(name = "GATEWAY_ID")
+    public String getGatewayId() {
+        return gatewayId;
+    }
+
+    public void setGatewayId(String id) {
+        this.gatewayId = id;
+    }
+
+    @Column(name = "GATEWAY_NAME")
+    public String getGatewayName() {
+        return gatewayName;
+    }
+
+    public void setGatewayName(String gatewayName) {
+        this.gatewayName = gatewayName;
+    }
+
+    @Column(name = "GATEWAY_DOMAIN")
+    public String getDomain() {
+        return domain;
+    }
+
+    public void setDomain(String domain) {
+        this.domain = domain;
+    }
+
+    @Column(name = "EMAIL_ADDRESS")
+    public String getEmailAddress() {
+        return emailAddress;
+    }
+
+    public void setEmailAddress(String emailAddress) {
+        this.emailAddress = emailAddress;
+    }
+
+    @Column(name = "GATEWAY_APPROVAL_STATUS")
+    public String getGatewayApprovalStatus() {
+        return gatewayApprovalStatus;
+    }
+
+    public void setGatewayApprovalStatus(String gatewayApprovalStatus) {
+        this.gatewayApprovalStatus = gatewayApprovalStatus;
+    }
+
+    @Column(name = "GATEWAY_ACRONYM")
+    public String getGatewayAcronym() {
+        return gatewayAcronym;
+    }
+
+    public void setGatewayAcronym(String gatewayAcronym) {
+        this.gatewayAcronym = gatewayAcronym;
+    }
+
+    @Column(name = "GATEWAY_URL")
+    public String getGatewayUrl() {
+        return gatewayUrl;
+    }
+
+    public void setGatewayUrl(String gatewayUrl) {
+        this.gatewayUrl = gatewayUrl;
+    }
+
+    @Lob
+    @Column(name = "GATEWAY_PUBLIC_ABSTRACT")
+    public String getGatewayPublicAbstract() {
+        return gatewayPublicAbstract;
+    }
+
+    public void setGatewayPublicAbstract(String gatewayPublicAbstract) {
+        this.gatewayPublicAbstract = gatewayPublicAbstract;
+    }
+
+    @Lob
+    @Column(name = "REVIEW_PROPOSAL_DESCRIPTION")
+    public String getReviewProposalDescription() {
+        return reviewProposalDescription;
+    }
+
+    public void setReviewProposalDescription(String reviewProposalDescription) 
{
+        this.reviewProposalDescription = reviewProposalDescription;
+    }
+
+    @Column(name = "GATEWAY_ADMIN_FIRST_NAME")
+    public String getGatewayAdminFirstName() {
+        return gatewayAdminFirstName;
+    }
+
+    public void setGatewayAdminFirstName(String gatewayAdminFirstName) {
+        this.gatewayAdminFirstName = gatewayAdminFirstName;
+    }
+
+    @Column(name = "GATEWAY_ADMIN_LAST_NAME")
+    public String getGetGatewayAdminLastName() {
+        return getGatewayAdminLastName;
+    }
+
+    public void setGetGatewayAdminLastName(String getGatewayAdminLastName) {
+        this.getGatewayAdminLastName = getGatewayAdminLastName;
+    }
+
+    @Column(name = "GATEWAY_ADMIN_EMAIL")
+    public String getGatewayAdminEmail() {
+        return gatewayAdminEmail;
+    }
+
+    public void setGatewayAdminEmail(String gatewayAdminEmail) {
+        this.gatewayAdminEmail = gatewayAdminEmail;
+    }
+
+    @Column(name = "IDENTITY_SERVER_USERNAME")
+    public String getIdentityServerUserName() {
+        return identityServerUserName;
+    }
+
+    public void setIdentityServerUserName(String identityServerUserName) {
+        this.identityServerUserName = identityServerUserName;
+    }
+
+    @Column(name = "IDENTITY_SERVER_PASSWORD_TOKEN")
+    public String getIdentityServerPasswordToken() {
+        return identityServerPasswordToken;
+    }
+
+    public void setIdentityServerPasswordToken(String 
identityServerPasswordToken) {
+        this.identityServerPasswordToken = identityServerPasswordToken;
+    }
+
+    @Column(name = "REQUESTER_USERNAME")
+    public String getRequesterUsername() {
+        return requesterUsername;
+    }
+
+    public void setRequesterUsername(String requesterUsername) {
+        this.requesterUsername = requesterUsername;
+    }
+
+    @Column(name = "DECLINED_REASON")
+    public String getDeclinedReason() {
+        return declinedReason;
+    }
+
+    public void setDeclinedReason(String declinedReason) {
+        this.declinedReason = declinedReason;
+    }
+
+    @Column(name = "OAUTH_CLIENT_ID")
+    public String getOauthClientId() {
+        return oauthClientId;
+    }
+
+    public void setOauthClientId(String oauthClientId) {
+        this.oauthClientId = oauthClientId;
+    }
+
+    @Column(name = "REQUEST_CREATION_TIME")
+    public long getRequestCreationTime() {
+        return requestCreationTime;
+    }
+
+    public void setRequestCreationTime(long requestCreationTime) {
+        this.requestCreationTime = requestCreationTime;
+    }
+
+    @Column(name = "OAUTH_CLIENT_SECRET")
+    public String getGetOauthClientSecret() {
+        return getOauthClientSecret;
+    }
+
+    public void setGetOauthClientSecret(String oauthClientSecret) {
+        this.getOauthClientSecret = oauthClientSecret;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/d9a69ae5/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/NSFDemographicsEntity.java
----------------------------------------------------------------------
diff --git 
a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/NSFDemographicsEntity.java
 
b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/NSFDemographicsEntity.java
new file mode 100644
index 0000000..0bcbafa
--- /dev/null
+++ 
b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/NSFDemographicsEntity.java
@@ -0,0 +1,94 @@
+/*
+ *
+ * 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.registry.core.entities.workspacecatalog;
+
+import javax.persistence.*;
+import java.util.List;
+
+@Entity
+@Table(name = "WORKSPACE_NSF_DEMOGRAPHIC")
+public class NSFDemographicsEntity {
+    private String airavataInternalUserId;
+    private String gender;
+    private List<String> ethnicities;
+    private List<String> races;
+    private List<String> disabilities;
+    private UserProfileEntity userProfile;
+
+    @Id
+    @Column(name = "AIRAVATA_INTERNAL_USER_ID")
+    public String getAiravataInternalUserId() {
+        return airavataInternalUserId;
+    }
+
+    public void setAiravataInternalUserId(String userId) {
+        this.airavataInternalUserId = userId;
+    }
+
+    @Column(name = "GENDER")
+    public String getGender() {
+        return gender;
+    }
+
+    public void setGender(String gender) {
+        this.gender = gender;
+    }
+
+    @ElementCollection
+    @CollectionTable(name="NSF_DEMOGRAPHIC_ETHNICITY", joinColumns = 
@JoinColumn(name="AIRAVATA_INTERNAL_USER_ID"))
+    public List<String> getEthnicities() {
+        return ethnicities;
+    }
+
+    public void setEthnicities(List<String> ethnicities) {
+        this.ethnicities = ethnicities;
+    }
+
+    @ElementCollection
+    @CollectionTable(name="NSF_DEMOGRAPHIC_RACE", joinColumns = 
@JoinColumn(name="AIRAVATA_INTERNAL_USER_ID"))
+    public List<String> getRaces() {
+        return races;
+    }
+
+    public void setRaces(List<String> races) {
+        this.races = races;
+    }
+
+    @ElementCollection
+    @CollectionTable(name="NSF_DEMOGRAPHIC_DISABILITY", joinColumns = 
@JoinColumn(name="AIRAVATA_INTERNAL_USER_ID"))
+    public List<String> getDisabilities() {
+        return disabilities;
+    }
+
+    public void setDisabilities(List<String> disabilities) {
+        this.disabilities = disabilities;
+    }
+
+    @OneToOne(targetEntity = UserProfileEntity.class, cascade = 
CascadeType.ALL)
+    @PrimaryKeyJoinColumn(name = "AIRAVATA_INTERNAL_USER_ID", 
referencedColumnName = "AIRAVATA_INTERNAL_USER_ID")
+    public UserProfileEntity getUserProfile() {
+        return userProfile;
+    }
+
+    public void setUserProfile(UserProfileEntity userProfile) {
+        this.userProfile = userProfile;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/d9a69ae5/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/NotificationEntity.java
----------------------------------------------------------------------
diff --git 
a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/NotificationEntity.java
 
b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/NotificationEntity.java
new file mode 100644
index 0000000..67f8af2
--- /dev/null
+++ 
b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/NotificationEntity.java
@@ -0,0 +1,110 @@
+/*
+ *
+ * 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.registry.core.entities.workspacecatalog;
+
+import javax.persistence.*;
+
+@Entity
+@Table(name = "WORKSPACE_NOTIFICATION")
+public class NotificationEntity {
+    private String notificationId;
+    private String gatewayId;
+    private String title;
+    private String notificationMessage;
+    private long creationTime;
+    private long publishedTime;
+    private long expirationTime;
+    private String priority;
+
+    @Id
+    @Column(name = "NOTIFICATION_ID")
+    public String getNotificationId() {
+        return notificationId;
+    }
+
+    public void setNotificationId(String notificationId) {
+        this.notificationId = notificationId;
+    }
+
+    @Column(name = "GATEWAY_ID")
+    public String getGatewayId() {
+        return gatewayId;
+    }
+
+    public void setGatewayId(String gatewayId) {
+        this.gatewayId = gatewayId;
+    }
+
+    @Column(name = "TITLE")
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    @Lob
+    @Column(name = "NOTIFICATION_MESSAGE")
+    public String getNotificationMessage() {
+        return notificationMessage;
+    }
+
+    public void setNotificationMessage(String notificationMessage) {
+        this.notificationMessage = notificationMessage;
+    }
+
+    @Column(name = "CREATION_TIME")
+    public long getCreationTime() {
+        return creationTime;
+    }
+
+    public void setCreationTime(long creationTime) {
+        this.creationTime = creationTime;
+    }
+
+    @Column(name = "PUBLISHED_TIME")
+    public long getPublishedTime() {
+        return publishedTime;
+    }
+
+    public void setPublishedTime(long publishedTime) {
+        this.publishedTime = publishedTime;
+    }
+
+    @Column(name = "EXPIRATION_TIME")
+    public long getExpirationTime() {
+        return expirationTime;
+    }
+
+    public void setExpirationTime(long expirationTime) {
+        this.expirationTime = expirationTime;
+    }
+
+    @Column(name = "PRIORITY")
+    public String getPriority() {
+        return priority;
+    }
+
+    public void setPriority(String priority) {
+        this.priority = priority;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/d9a69ae5/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/ProjectEntity.java
----------------------------------------------------------------------
diff --git 
a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/ProjectEntity.java
 
b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/ProjectEntity.java
new file mode 100644
index 0000000..31e0868
--- /dev/null
+++ 
b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/ProjectEntity.java
@@ -0,0 +1,92 @@
+/*
+ *
+ * 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.registry.core.entities.workspacecatalog;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+@Entity
+@Table(name = "WORKSPACE_PROJECT")
+public class ProjectEntity {
+    private String projectID;
+    private String owner;
+    private String gatewayId;
+    private String name;
+    private String description;
+    private long creationTime;
+
+    @Id
+    @Column(name = "PROJECT_ID")
+    public String getProjectID() {
+        return projectID;
+    }
+
+    public void setProjectID(String projectID) {
+        this.projectID = projectID;
+    }
+
+    @Column(name = "OWNER")
+    public String getOwner() {
+        return owner;
+    }
+
+    public void setOwner(String owner) {
+        this.owner = owner;
+    }
+
+    @Column(name = "GATEWAY_ID")
+    public String getGatewayId() {
+        return gatewayId;
+    }
+
+    public void setGatewayId(String gatewayId) {
+        this.gatewayId = gatewayId;
+    }
+
+    @Column(name = "PROJECT_NAME")
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    @Column(name = "DESCRIPTION")
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    @Column(name = "CREATION_TIME")
+    public long getCreationTime() {
+        return creationTime;
+    }
+
+    public void setCreationTime(long creationTime) {
+        this.creationTime = creationTime;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/d9a69ae5/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/UserProfileEntity.java
----------------------------------------------------------------------
diff --git 
a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/UserProfileEntity.java
 
b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/UserProfileEntity.java
new file mode 100644
index 0000000..7dd51ed
--- /dev/null
+++ 
b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/UserProfileEntity.java
@@ -0,0 +1,247 @@
+/*
+ *
+ * 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.registry.core.entities.workspacecatalog;
+
+import javax.persistence.*;
+import java.util.List;
+
+@Entity
+@Table(name="WORKSPACE_USER_PROFILE")
+public class UserProfileEntity {
+    private String airavataInternalUserId;
+    private String userId;
+    private String gatewayId;
+    private String userModelVersion;
+    private String userName;
+    private String orcidId;
+    private String country;
+    private String homeOrganization;
+    private String orginationAffiliation;
+    private long creationTime;
+    private long lastAccessTime;
+    private long validUntil;
+    private String state;
+    private String comments;
+    private List<String> labeledURI;
+    private String gpgKey;
+    private String timeZone;
+
+    private List<String> nationality;
+    private List<String> emails;
+    private List<String> phones;
+    private NSFDemographicsEntity nsfDemographics;
+
+    @Id
+    @Column(name = "AIRAVATA_INTERNAL_USER_ID")
+    public String getAiravataInternalUserId() {
+        return airavataInternalUserId;
+    }
+
+    public void setAiravataInternalUserId(String id) {
+        this.airavataInternalUserId = id;
+    }
+
+    @Column(name = "USER_ID")
+    public String getUserId() {
+        return userId;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
+
+    @Column(name = "GATEWAY_ID")
+    public String getGatewayId() {
+        return gatewayId;
+    }
+
+    public void setGatewayId(String gatewayId) {
+        this.gatewayId = gatewayId;
+    }
+
+    @Column(name = "USER_MODEL_VERSION")
+    public String getUserModelVersion() {
+        return userModelVersion;
+    }
+
+    public void setUserModelVersion(String userModelVersion) {
+        this.userModelVersion = userModelVersion;
+    }
+
+    @ElementCollection
+    @CollectionTable(name="USER_PROFILE_EMAIL", joinColumns = 
@JoinColumn(name="AIRAVATA_INTERNAL_USER_ID"))
+    public List<String> getEmails() {
+        return emails;
+    }
+
+    public void setEmails(List<String> emails) {
+        this.emails = emails;
+    }
+
+    @Column(name = "USER_NAME")
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    @Column(name = "ORCID_ID")
+    public String getOrcidId() {
+        return orcidId;
+    }
+
+    public void setOrcidId(String orcidId) {
+        this.orcidId = orcidId;
+    }
+
+    @ElementCollection
+    @CollectionTable(name="USER_PROFILE_PHONE", joinColumns = 
@JoinColumn(name="AIRAVATA_INTERNAL_USER_ID"))
+    public List<String> getPhones() {
+        return phones;
+    }
+
+    public void setPhones(List<String> phones) {
+        this.phones = phones;
+    }
+
+    @Column(name = "COUNTRY")
+    public String getCountry() {
+        return country;
+    }
+
+    public void setCountry(String country) {
+        this.country = country;
+    }
+
+    @ElementCollection
+    @CollectionTable(name="USER_PROFILE_NATIONALITY", joinColumns = 
@JoinColumn(name="AIRAVATA_INTERNAL_USER_ID"))
+    public List<String> getNationality() {
+        return nationality;
+    }
+
+    public void setNationality(List<String> nationality) {
+        this.nationality = nationality;
+    }
+
+    @Column(name = "HOME_ORGANIZATION")
+    public String getHomeOrganization() {
+        return homeOrganization;
+    }
+
+    public void setHomeOrganization(String homeOrganization) {
+        this.homeOrganization = homeOrganization;
+    }
+
+    @Column(name = "ORIGINATION_AFFILIATION")
+    public String getOrginationAffiliation() {
+        return orginationAffiliation;
+    }
+
+    public void setOrginationAffiliation(String orginationAffiliation) {
+        this.orginationAffiliation = orginationAffiliation;
+    }
+
+    @Column(name="CREATION_TIME")
+    public long getCreationTime() {
+        return creationTime;
+    }
+
+    public void setCreationTime(long creationTime) {
+        this.creationTime = creationTime;
+    }
+
+    @Column(name = "LAST_ACCESS_TIME")
+    public long getLastAccessTime() {
+        return lastAccessTime;
+    }
+
+    public void setLastAccessTime(long lastAccessTime) {
+        this.lastAccessTime = lastAccessTime;
+    }
+
+    @Column(name = "VALID_UNTIL")
+    public long getValidUntil() {
+        return validUntil;
+    }
+
+    public void setValidUntil(long validUntil) {
+        this.validUntil = validUntil;
+    }
+
+    @Column(name = "STATE")
+    public String getState() {
+        return state;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
+
+    @Lob
+    @Column(name = "COMMENTS")
+    public String getComments() {
+        return comments;
+    }
+
+    public void setComments(String comments) {
+        this.comments = comments;
+    }
+
+    @ElementCollection
+    @CollectionTable(name="USER_PROFILE_LABELED_URI", joinColumns = 
@JoinColumn(name="AIRAVATA_INTERNAL_USER_ID"))
+    public List<String> getLabeledURI() {
+        return labeledURI;
+    }
+
+    public void setLabeledURI(List<String> labeledURI) {
+        this.labeledURI = labeledURI;
+    }
+
+    @Lob
+    @Column(name = "GPG_KEY")
+    public String getGpgKey() {
+        return gpgKey;
+    }
+
+    public void setGpgKey(String gpgKey) {
+        this.gpgKey = gpgKey;
+    }
+
+    @Column(name = "TIME_ZONE")
+    public String getTimeZone() {
+        return timeZone;
+    }
+
+    public void setTimeZone(String timeZone) {
+        this.timeZone = timeZone;
+    }
+
+    @OneToOne(targetEntity = NSFDemographicsEntity.class, cascade = 
CascadeType.ALL, mappedBy = "userProfile")
+    public NSFDemographicsEntity getNsfDemographics() {
+        return nsfDemographics;
+    }
+
+    public void setNsfDemographics(NSFDemographicsEntity nsfDemographics) {
+        this.nsfDemographics = nsfDemographics;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/d9a69ae5/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/AbstractRepository.java
----------------------------------------------------------------------
diff --git 
a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/AbstractRepository.java
 
b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/AbstractRepository.java
new file mode 100644
index 0000000..a83928d
--- /dev/null
+++ 
b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/AbstractRepository.java
@@ -0,0 +1,98 @@
+/*
+ *
+ * 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.registry.core.repositories;
+
+import org.apache.airavata.registry.core.utils.JPAUtils;
+import org.apache.airavata.registry.core.utils.ObjectMapperSingleton;
+import org.dozer.Mapper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.Query;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+public abstract class AbstractRepository<T, E, Id> {
+    private final static Logger logger = 
LoggerFactory.getLogger(AbstractRepository.class);
+
+    private Class<T> thriftGenericClass;
+    private Class<E> dbEntityGenericClass;
+
+    public AbstractRepository(Class<T> thriftGenericClass, Class<E> 
dbEntityGenericClass) {
+        this.thriftGenericClass = thriftGenericClass;
+        this.dbEntityGenericClass = dbEntityGenericClass;
+    }
+
+    public T create(T t) {
+        return update(t);
+    }
+
+    public T update(T t) {
+        Mapper mapper = ObjectMapperSingleton.getInstance();
+        E entity = mapper.map(t, dbEntityGenericClass);
+        E persistedCopy = JPAUtils.execute(entityManager -> 
entityManager.merge(entity));
+        return mapper.map(persistedCopy, thriftGenericClass);
+    }
+
+    public boolean delete(Id id) {
+        JPAUtils.execute(entityManager -> {
+            E entity = entityManager.find(dbEntityGenericClass, id);
+            entityManager.remove(entity);
+            return entity;
+        });
+        return true;
+    }
+
+    public T get(Id id) {
+        E entity = JPAUtils.execute(entityManager -> entityManager
+                .find(dbEntityGenericClass, id));
+        Mapper mapper = ObjectMapperSingleton.getInstance();
+        return mapper.map(entity, thriftGenericClass);
+    }
+
+    public List<T> select(String query, int limit, int offset) {
+        List resultSet = (List) JPAUtils.execute(entityManager -> 
entityManager.createQuery(query).setFirstResult(offset)
+                .setMaxResults(offset).getResultList());
+        Mapper mapper = ObjectMapperSingleton.getInstance();
+        List<T> gatewayList = new ArrayList<>();
+        resultSet.stream().forEach(rs -> gatewayList.add(mapper.map(rs, 
thriftGenericClass)));
+        return gatewayList;
+    }
+
+    public List<T> select(String query, int limit, int offset, Map<String, 
Object> queryParams) {
+        List resultSet = (List) JPAUtils.execute(entityManager -> {
+            Query jpaQuery = entityManager.createQuery(query);
+
+            for (Map.Entry<String, Object> entry : queryParams.entrySet()) {
+
+                jpaQuery.setParameter(entry.getKey(), entry.getValue());
+            }
+
+            return 
jpaQuery.setFirstResult(offset).setMaxResults(limit).getResultList();
+
+        });
+        Mapper mapper = ObjectMapperSingleton.getInstance();
+        List<T> gatewayList = new ArrayList<>();
+        resultSet.stream().forEach(rs -> gatewayList.add(mapper.map(rs, 
thriftGenericClass)));
+        return gatewayList;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/d9a69ae5/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workspacecatalog/GatewayRepository.java
----------------------------------------------------------------------
diff --git 
a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workspacecatalog/GatewayRepository.java
 
b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workspacecatalog/GatewayRepository.java
new file mode 100644
index 0000000..9a1c6d6
--- /dev/null
+++ 
b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workspacecatalog/GatewayRepository.java
@@ -0,0 +1,36 @@
+/*
+ *
+ * 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.registry.core.repositories.workspacecatalog;
+
+import org.apache.airavata.model.workspace.Gateway;
+import 
org.apache.airavata.registry.core.entities.workspacecatalog.GatewayEntity;
+import org.apache.airavata.registry.core.repositories.AbstractRepository;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class GatewayRepository extends AbstractRepository<Gateway, 
GatewayEntity, String> {
+    private final static Logger logger = 
LoggerFactory.getLogger(GatewayRepository.class);
+
+    public GatewayRepository(Class<Gateway> thriftGenericClass, 
Class<GatewayEntity> dbEntityGenericClass) {
+        super(thriftGenericClass, dbEntityGenericClass);
+
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/d9a69ae5/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workspacecatalog/NotificationRepository.java
----------------------------------------------------------------------
diff --git 
a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workspacecatalog/NotificationRepository.java
 
b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workspacecatalog/NotificationRepository.java
new file mode 100644
index 0000000..8332024
--- /dev/null
+++ 
b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workspacecatalog/NotificationRepository.java
@@ -0,0 +1,35 @@
+/*
+ *
+ * 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.registry.core.repositories.workspacecatalog;
+
+import org.apache.airavata.model.workspace.Notification;
+import 
org.apache.airavata.registry.core.entities.workspacecatalog.NotificationEntity;
+import org.apache.airavata.registry.core.repositories.AbstractRepository;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class NotificationRepository extends AbstractRepository<Notification, 
NotificationEntity, String> {
+    private final static Logger logger = 
LoggerFactory.getLogger(NotificationRepository.class);
+
+    public NotificationRepository(Class thriftGenericClass, Class 
dbEntityGenericClass) {
+        super(thriftGenericClass, dbEntityGenericClass);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/d9a69ae5/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workspacecatalog/ProjectRepository.java
----------------------------------------------------------------------
diff --git 
a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workspacecatalog/ProjectRepository.java
 
b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workspacecatalog/ProjectRepository.java
new file mode 100644
index 0000000..eebf5fb
--- /dev/null
+++ 
b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workspacecatalog/ProjectRepository.java
@@ -0,0 +1,35 @@
+/*
+ *
+ * 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.registry.core.repositories.workspacecatalog;
+
+import org.apache.airavata.model.workspace.Project;
+import 
org.apache.airavata.registry.core.entities.workspacecatalog.ProjectEntity;
+import org.apache.airavata.registry.core.repositories.AbstractRepository;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ProjectRepository extends AbstractRepository<Project, 
ProjectEntity, String> {
+    private final static Logger logger = 
LoggerFactory.getLogger(ProjectRepository.class);
+
+    public ProjectRepository(Class<Project> thriftGenericClass, 
Class<ProjectEntity> dbEntityGenericClass) {
+        super(thriftGenericClass, dbEntityGenericClass);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/d9a69ae5/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workspacecatalog/UserProfileRepository.java
----------------------------------------------------------------------
diff --git 
a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workspacecatalog/UserProfileRepository.java
 
b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workspacecatalog/UserProfileRepository.java
new file mode 100644
index 0000000..de0f99e
--- /dev/null
+++ 
b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workspacecatalog/UserProfileRepository.java
@@ -0,0 +1,88 @@
+/*
+ *
+ * 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.registry.core.repositories.workspacecatalog;
+
+import org.apache.airavata.model.user.UserProfile;
+import 
org.apache.airavata.registry.core.entities.workspacecatalog.UserProfileEntity;
+import org.apache.airavata.registry.core.repositories.AbstractRepository;
+import org.apache.airavata.registry.core.utils.QueryConstants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class UserProfileRepository extends AbstractRepository<UserProfile, 
UserProfileEntity, String> {
+    private final static Logger logger = 
LoggerFactory.getLogger(UserProfileRepository.class);
+
+    public UserProfileRepository(Class<UserProfile> thriftGenericClass, 
Class<UserProfileEntity> dbEntityGenericClass) {
+        super(thriftGenericClass, dbEntityGenericClass);
+    }
+
+    @Override
+    public List<UserProfile> select(String query, int offset, int limit) {
+        throw new UnsupportedOperationException("Due to performance overheads 
this method is not supported. Instead use" +
+                " UserProfileSummaryRepository");
+    }
+
+    public UserProfile getUserProfileByIdAndGateWay(String userId, String 
gatewayId)   {
+
+        UserProfile userProfile = null;
+
+        Map<String, Object> queryParam = new HashMap<String, Object>();
+        queryParam.put(UserProfile._Fields.USER_ID.getFieldName(), userId);
+        queryParam.put(UserProfile._Fields.GATEWAY_ID.getFieldName(), 
gatewayId);
+        List<UserProfile> resultList = 
select(QueryConstants.FIND_USER_PROFILE_BY_USER_ID, 0, 1, queryParam);
+
+        if (resultList != null && resultList.size() > 0)
+            userProfile =  resultList.get(0);
+
+
+        return userProfile;
+    }
+
+    public List<UserProfile> getAllUserProfilesInGateway(String gatewayId, int 
offset, int limit)  {
+
+        Map<String, Object> queryParam = new HashMap<String, Object>();
+        queryParam.put(UserProfile._Fields.GATEWAY_ID.getFieldName(), 
gatewayId);
+
+        List<UserProfile> resultList = 
select(QueryConstants.FIND_ALL_USER_PROFILES_BY_GATEWAY_ID, limit, offset, 
queryParam);
+
+        return  resultList;
+    }
+
+    public UserProfile getUserProfileByNameAndGateWay(String name, String 
gatewayId)   {
+
+        UserProfile userProfile = null;
+
+        Map<String, Object> queryParam = new HashMap<String, Object>();
+        queryParam.put(UserProfile._Fields.USER_NAME.getFieldName(), name);
+        queryParam.put(UserProfile._Fields.GATEWAY_ID.getFieldName(), 
gatewayId);
+        List<UserProfile> resultList = 
select(QueryConstants.FIND_USER_PROFILE_BY_USER_NAME, 0, 1, queryParam);
+
+        if (resultList != null && resultList.size() > 0)
+            userProfile =  resultList.get(0);
+
+
+        return userProfile;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/d9a69ae5/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/Committer.java
----------------------------------------------------------------------
diff --git 
a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/Committer.java
 
b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/Committer.java
new file mode 100644
index 0000000..07f8244
--- /dev/null
+++ 
b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/Committer.java
@@ -0,0 +1,27 @@
+/*
+ *
+ * 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.registry.core.utils;
+
+@FunctionalInterface
+public interface Committer<T, R>  {
+
+    R commit(T t);
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/d9a69ae5/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/JPAUtils.java
----------------------------------------------------------------------
diff --git 
a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/JPAUtils.java
 
b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/JPAUtils.java
new file mode 100644
index 0000000..05098c4
--- /dev/null
+++ 
b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/JPAUtils.java
@@ -0,0 +1,82 @@
+/*
+ *
+ * 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.registry.core.utils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.*;
+import java.util.HashMap;
+import java.util.Map;
+
+public class JPAUtils {
+    private final static Logger logger = 
LoggerFactory.getLogger(JPAUtils.class);
+    private static final String PERSISTENCE_UNIT_NAME = "airavata_catalog";
+    @PersistenceUnit(unitName = "airavata_catalog")
+    protected static EntityManagerFactory factory;
+    @PersistenceContext(unitName = "airavata_catalog")
+    private static EntityManager entityManager;
+
+    public static EntityManager getEntityManager(){
+        if (factory == null) {
+            //FIXME
+            String connectionProperties = 
"DriverClassName=com.mysql.jdbc.Driver," +
+                    "Url=jdbc:mysql://localhost:3306/airavata_catalog," +
+                    "Username=root," +
+                    "Password=root";
+            logger.info(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", "warn");
+            properties.put("openjpa.RemoteCommitProvider", "sjvm");
+            properties.put("openjpa.Log", "DefaultLevel=INFO, Runtime=INFO, 
Tool=INFO, SQL=INFO");
+            properties.put("openjpa.jdbc.SynchronizeMappings", 
"buildSchema(ForeignKeys=true)");
+            properties.put("openjpa.jdbc.QuerySQLCache", "false");
+            properties.put("openjpa.ConnectionFactoryProperties", 
"PrettyPrint=true, PrettyPrintLineLength=72," +
+                    " PrintParameters=true, MaxActive=10, MaxIdle=5, 
MinIdle=2, MaxWait=31536000,  autoReconnect=true");
+            factory = 
Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME, properties);
+        }
+
+        entityManager = factory.createEntityManager();
+        return entityManager;
+    }
+
+    public static <R> R execute(Committer<EntityManager, R> committer){
+        EntityManager entityManager = JPAUtils.getEntityManager();
+        try {
+            entityManager.getTransaction().begin();
+            R r = committer.commit(entityManager);
+            entityManager.getTransaction().commit();
+            return  r;
+        }finally {
+            if (entityManager != null && entityManager.isOpen()) {
+                if (entityManager.getTransaction().isActive()) {
+                    entityManager.getTransaction().rollback();
+                }
+                entityManager.close();
+            }
+        }
+    }
+
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/d9a69ae5/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/ObjectMapperSingleton.java
----------------------------------------------------------------------
diff --git 
a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/ObjectMapperSingleton.java
 
b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/ObjectMapperSingleton.java
new file mode 100644
index 0000000..9189460
--- /dev/null
+++ 
b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/ObjectMapperSingleton.java
@@ -0,0 +1,39 @@
+/*
+ *
+ * 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.registry.core.utils;
+
+import org.dozer.DozerBeanMapper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ObjectMapperSingleton extends DozerBeanMapper{
+    private final static Logger logger = 
LoggerFactory.getLogger(ObjectMapperSingleton.class);
+
+    private static ObjectMapperSingleton instance;
+
+    private ObjectMapperSingleton(){}
+
+    public static ObjectMapperSingleton getInstance(){
+        if(instance == null)
+            instance = new ObjectMapperSingleton();
+        return instance;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/d9a69ae5/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/QueryConstants.java
----------------------------------------------------------------------
diff --git 
a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/QueryConstants.java
 
b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/QueryConstants.java
new file mode 100644
index 0000000..171317e
--- /dev/null
+++ 
b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/QueryConstants.java
@@ -0,0 +1,22 @@
+package org.apache.airavata.registry.core.utils;
+
+import org.apache.airavata.model.user.UserProfile;
+
+/**
+ * Created by abhij on 11/11/2016.
+ */
+public interface QueryConstants {
+
+
+
+    String FIND_USER_PROFILE_BY_USER_ID = "SELECT u FROM UserProfileEntity u " 
+
+            "where u.userId LIKE :" + 
UserProfile._Fields.USER_ID.getFieldName() + " " +
+            "AND u.gatewayId LIKE :"+ 
UserProfile._Fields.GATEWAY_ID.getFieldName() + "";
+
+    String FIND_ALL_USER_PROFILES_BY_GATEWAY_ID = "SELECT u FROM 
UserProfileEntity u " +
+            "where u.gatewayId LIKE :"+ 
UserProfile._Fields.GATEWAY_ID.getFieldName() + "";
+
+    String FIND_USER_PROFILE_BY_USER_NAME = "SELECT u FROM UserProfileEntity u 
" +
+            "where u.userId LIKE :" + 
UserProfile._Fields.USER_NAME.getFieldName() + " " +
+            "AND u.gatewayId LIKE :"+ 
UserProfile._Fields.GATEWAY_ID.getFieldName() + "";
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/d9a69ae5/modules/registry-refactoring/src/main/resources/META-INF/persistence.xml
----------------------------------------------------------------------
diff --git 
a/modules/registry-refactoring/src/main/resources/META-INF/persistence.xml 
b/modules/registry-refactoring/src/main/resources/META-INF/persistence.xml
new file mode 100644
index 0000000..76c965a
--- /dev/null
+++ b/modules/registry-refactoring/src/main/resources/META-INF/persistence.xml
@@ -0,0 +1,32 @@
+<?xml version="1.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.
+ *
+* -->
+<persistence xmlns="http://java.sun.com/xml/ns/persistence"; version="2.0">
+    <persistence-unit name="airavata_catalog">
+        
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
+        
<class>org.apache.airavata.registry.core.entities.workspacecatalog.GatewayEntity</class>
+        
<class>org.apache.airavata.registry.core.entities.workspacecatalog.UserProfileEntity</class>
+        
<class>org.apache.airavata.registry.core.entities.workspacecatalog.NSFDemographicsEntity</class>
+        
<class>org.apache.airavata.registry.core.entities.workspacecatalog.NotificationEntity</class>
+        
<class>org.apache.airavata.registry.core.entities.workspacecatalog.ProjectEntity</class>
+        <exclude-unlisted-classes>true</exclude-unlisted-classes>
+    </persistence-unit>
+</persistence>

http://git-wip-us.apache.org/repos/asf/airavata/blob/d9a69ae5/modules/registry-refactoring/src/main/resources/workspace_catalog.sql
----------------------------------------------------------------------
diff --git 
a/modules/registry-refactoring/src/main/resources/workspace_catalog.sql 
b/modules/registry-refactoring/src/main/resources/workspace_catalog.sql
new file mode 100644
index 0000000..debdba4
--- /dev/null
+++ b/modules/registry-refactoring/src/main/resources/workspace_catalog.sql
@@ -0,0 +1,125 @@
+
+CREATE TABLE IF NOT  EXISTS WORKSPACE_GATEWAY(
+    GATEWAY_ID VARCHAR (255),
+    GATEWAY_NAME VARCHAR (255),
+    GATEWAY_DOMAIN VARCHAR (255),
+    EMAIL_ADDRESS VARCHAR (255),
+    GATEWAY_APPROVAL_STATUS VARCHAR (255),
+    GATEWAY_ACRONYM VARCHAR (255),
+    GATEWAY_URL VARCHAR (255),
+    GATEWAY_PUBLIC_ABSTRACT TEXT,
+    REVIEW_PROPOSAL_DESCRIPTION TEXT,
+    GATEWAY_ADMIN_FIRST_NAME VARCHAR(255),
+    GATEWAY_ADMIN_LAST_NAME VARCHAR(255),
+    GATEWAY_ADMIN_EMAIL VARCHAR(255),
+    IDENTITY_SERVER_USERNAME VARCHAR(255),
+    IDENTITY_SERVER_PASSWORD_TOKEN VARCHAR(255),
+    DECLINED_REASON VARCHAR(255),
+    OAUTH_CLIENT_ID VARCHAR(255),
+    OAUTH_CLIENT_SECRET VARCHAR(255),
+    REQUEST_CREATION_TIME BIGINT,
+    REQUESTER_USERNAME VARCHAR(255),
+    PRIMARY KEY (GATEWAY_ID)
+);
+
+CREATE TABLE IF NOT EXISTS WORKSPACE_NOTIFICATION (
+    NOTIFICATION_ID VARCHAR (255),
+    GATEWAY_ID VARCHAR (255),
+    TITLE VARCHAR (255),
+    NOTIFICATION_MESSAGE TEXT,
+    CREATION_TIME BIGINT,
+    PUBLISHED_TIME BIGINT,
+    EXPIRATION_TIME BIGINT,
+    PRIORITY VARCHAR (255),
+    PRIMARY KEY (NOTIFICATION_ID),
+    FOREIGN KEY (GATEWAY_ID) REFERENCES WORKSPACE_GATEWAY(GATEWAY_ID) ON 
DELETE CASCADE
+);
+
+CREATE TABLE IF NOT EXISTS WORKSPACE_USER_PROFILE (
+    AIRAVATA_INTERNAL_USER_ID VARCHAR (255),
+    USER_ID VARCHAR (255),
+    GATEWAY_ID VARCHAR (255),
+    USER_MODEL_VERSION VARCHAR (255),
+    USER_NAME VARCHAR (255),
+    ORCID_ID VARCHAR (255),
+    COUNTRY VARCHAR (255),
+    HOME_ORGANIZATION VARCHAR (255),
+    ORIGINATION_AFFILIATION VARCHAR (255),
+    CREATION_TIME BIGINT,
+    LAST_ACCESS_TIME BIGINT,
+    VALID_UNTIL BIGINT,
+    STATE VARCHAR (255),
+    COMMENTS TEXT,
+    GPG_KEY VARCHAR (8192),
+    TIME_ZONE VARCHAR (255),
+    PRIMARY KEY (AIRAVATA_INTERNAL_USER_ID),
+    FOREIGN KEY (GATEWAY_ID) REFERENCES WORKSPACE_GATEWAY(GATEWAY_ID) ON 
DELETE CASCADE
+);
+
+CREATE TABLE IF NOT EXISTS WORKSPACE_USER_PROFILE_EMAIL (
+    AIRAVATA_INTERNAL_USER_ID VARCHAR (255),
+    EMAIL VARCHAR (255),
+    PRIMARY KEY (AIRAVATA_INTERNAL_USER_ID, EMAIL),
+    FOREIGN KEY (AIRAVATA_INTERNAL_USER_ID) REFERENCES 
WORKSPACE_USER_PROFILE(AIRAVATA_INTERNAL_USER_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE IF NOT EXISTS WORKSPACE_USER_PROFILE_PHONE (
+    AIRAVATA_INTERNAL_USER_ID VARCHAR (255),
+    PHONE VARCHAR (255),
+    PRIMARY KEY (AIRAVATA_INTERNAL_USER_ID, PHONE ),
+    FOREIGN KEY (AIRAVATA_INTERNAL_USER_ID) REFERENCES 
WORKSPACE_USER_PROFILE(AIRAVATA_INTERNAL_USER_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE IF NOT EXISTS WORKSPACE_USER_PROFILE_NATIONALITY (
+    AIRAVATA_INTERNAL_USER_ID VARCHAR (255),
+    NATIONALITY VARCHAR (255),
+    PRIMARY KEY (AIRAVATA_INTERNAL_USER_ID, NATIONALITY ),
+    FOREIGN KEY (AIRAVATA_INTERNAL_USER_ID) REFERENCES 
WORKSPACE_USER_PROFILE(AIRAVATA_INTERNAL_USER_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE IF NOT EXISTS WORKSPACE_USER_PROFILE_LABELED_URI (
+    AIRAVATA_INTERNAL_USER_ID VARCHAR (255),
+    LABELED_URI VARCHAR (255),
+    PRIMARY KEY (AIRAVATA_INTERNAL_USER_ID, LABELED_URI ),
+    FOREIGN KEY (AIRAVATA_INTERNAL_USER_ID) REFERENCES 
WORKSPACE_USER_PROFILE(AIRAVATA_INTERNAL_USER_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE IF NOT EXISTS WORKSPACE_NSF_DEMOGRAPHIC (
+    AIRAVATA_INTERNAL_USER_ID VARCHAR (255),
+    GENDER VARCHAR (255),
+    PRIMARY KEY (AIRAVATA_INTERNAL_USER_ID),
+    FOREIGN KEY (AIRAVATA_INTERNAL_USER_ID) REFERENCES 
WORKSPACE_USER_PROFILE(AIRAVATA_INTERNAL_USER_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE IF NOT EXISTS WORKSPACE_NSF_DEMOGRAPHIC_ETHNICITY (
+    AIRAVATA_INTERNAL_USER_ID VARCHAR (255),
+    ETHNICITY VARCHAR (255),
+    PRIMARY KEY (AIRAVATA_INTERNAL_USER_ID, ETHNICITY ),
+    FOREIGN KEY (AIRAVATA_INTERNAL_USER_ID) REFERENCES 
WORKSPACE_NSF_DEMOGRAPHIC(AIRAVATA_INTERNAL_USER_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE IF NOT EXISTS WORKSPACE_NSF_DEMOGRAPHIC_RACE (
+    AIRAVATA_INTERNAL_USER_ID VARCHAR (255),
+    RACE VARCHAR (255),
+    PRIMARY KEY (AIRAVATA_INTERNAL_USER_ID, RACE ),
+    FOREIGN KEY (AIRAVATA_INTERNAL_USER_ID) REFERENCES 
WORKSPACE_NSF_DEMOGRAPHIC(AIRAVATA_INTERNAL_USER_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE IF NOT EXISTS WORKSPACE_NSF_DEMOGRAPHIC_DISABILITY (
+    AIRAVATA_INTERNAL_USER_ID VARCHAR (255),
+    DISABILITY VARCHAR (255),
+    PRIMARY KEY (AIRAVATA_INTERNAL_USER_ID, DISABILITY ),
+    FOREIGN KEY (AIRAVATA_INTERNAL_USER_ID) REFERENCES 
WORKSPACE_NSF_DEMOGRAPHIC(AIRAVATA_INTERNAL_USER_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE IF NOT EXISTS WORKSPACE_PROJECT(
+    PROJECT_ID VARCHAR (255),
+    OWNER VARCHAR (255),
+    GATEWAY_ID VARCHAR (255),
+    PROJECT_NAME VARCHAR (255),
+    DESCRIPTION VARCHAR (255),
+    CREATION_TIME BIGINT,
+    PRIMARY KEY (PROJECT_ID),
+    FOREIGN KEY(OWNER) REFERENCES 
WORKSPACE_USER_PROFILE(AIRAVATA_INTERNAL_USER_ID),
+    FOREIGN KEY(GATEWAY_ID) REFERENCES WORKSPACE_GATEWAY(GATEWAY_ID) ON DELETE 
CASCADE
+);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/d9a69ae5/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/WorkspaceRepositoryTest.java
----------------------------------------------------------------------
diff --git 
a/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/WorkspaceRepositoryTest.java
 
b/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/WorkspaceRepositoryTest.java
new file mode 100644
index 0000000..a168f0d
--- /dev/null
+++ 
b/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/WorkspaceRepositoryTest.java
@@ -0,0 +1,197 @@
+/*
+ *
+ * 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.registry.core.repositories;
+
+import org.apache.airavata.model.user.UserProfile;
+import org.apache.airavata.model.workspace.Gateway;
+import org.apache.airavata.model.workspace.GatewayApprovalStatus;
+import org.apache.airavata.model.workspace.Notification;
+import org.apache.airavata.model.workspace.Project;
+import 
org.apache.airavata.registry.core.entities.workspacecatalog.GatewayEntity;
+import 
org.apache.airavata.registry.core.entities.workspacecatalog.NotificationEntity;
+import 
org.apache.airavata.registry.core.entities.workspacecatalog.ProjectEntity;
+import 
org.apache.airavata.registry.core.entities.workspacecatalog.UserProfileEntity;
+import 
org.apache.airavata.registry.core.repositories.workspacecatalog.GatewayRepository;
+import 
org.apache.airavata.registry.core.repositories.workspacecatalog.NotificationRepository;
+import 
org.apache.airavata.registry.core.repositories.workspacecatalog.ProjectRepository;
+import 
org.apache.airavata.registry.core.repositories.workspacecatalog.UserProfileRepository;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.UUID;
+
+public class WorkspaceRepositoryTest {
+    private final static Logger logger = 
LoggerFactory.getLogger(WorkspaceRepositoryTest.class);
+
+    private GatewayRepository gatewayRepository;
+    private NotificationRepository notificationRepository;
+    private UserProfileRepository userProfileRepository;
+    private ProjectRepository projectRepository;
+    private String gatewayId;
+    private String notificationId;
+    private String userId;
+    private String projectId;
+
+    private final String GATEWAY_DOMAIN = "test1.com";
+    private final String NOTIFY_MESSAGE = "NotifyMe";
+    private final String USER_COMMENT = "TestComment";
+    private final String PROJECT_DESCRIPTION = "Test Description";
+
+
+    @Before
+    public void setupRepository() {
+
+        gatewayRepository = new GatewayRepository(Gateway.class, 
GatewayEntity.class);
+        notificationRepository = new NotificationRepository(Notification.class,
+                NotificationEntity.class);
+        userProfileRepository = new UserProfileRepository(UserProfile.class, 
UserProfileEntity.class);
+        projectRepository = new ProjectRepository(Project.class, 
ProjectEntity.class);
+
+        gatewayId = "test.com" + System.currentTimeMillis();
+        notificationId = UUID.randomUUID().toString();
+        userId = "testuser" + System.currentTimeMillis();
+        projectId = "project" + System.currentTimeMillis();
+    }
+
+    @Test
+    public void userProfileRepositoryTest() {
+
+               /*
+         * Creating Gateway required for UserProfile creation
+                */
+        Gateway gateway = new Gateway();
+        gateway.setGatewayApprovalStatus(GatewayApprovalStatus.ACTIVE);
+        gateway.setGatewayId(gatewayId);
+        gateway.setDomain(GATEWAY_DOMAIN);
+        gateway = gatewayRepository.create(gateway);
+        Assert.assertTrue(!gateway.getGatewayId().isEmpty());
+
+
+
+               /*
+         * UserProfile Instance creation
+                */
+        UserProfile userProfile = new UserProfile();
+        userProfile.setAiravataInternalUserId(userId);
+        userProfile.setGatewayId(gateway.getGatewayId());
+
+        /*
+         * Workspace UserProfile Repository Insert Operation Test
+                */
+        userProfile = userProfileRepository.create(userProfile);
+        Assert.assertTrue(!userProfile.getAiravataInternalUserId().isEmpty());
+
+        /*
+         * Workspace UserProfile Repository Update Operation Test
+                */
+        userProfile.setComments(USER_COMMENT);
+        userProfileRepository.update(userProfile);
+        userProfile = userProfileRepository.get(userId);
+        System.out.println(userProfile.getComments());
+        Assert.assertEquals(userProfile.getComments(), USER_COMMENT);
+
+               /*
+         * Workspace UserProfile Repository Select Operation Test
+                */
+        userProfile = userProfileRepository.get(userId);
+        Assert.assertNotNull(userProfile);
+
+               /*
+         * Workspace UserProfile Repository Delete Operation
+                */
+        boolean deleteResult = userProfileRepository.delete(userId);
+        Assert.assertTrue(deleteResult);
+        deleteResult = gatewayRepository.delete(gatewayId);
+        Assert.assertTrue(deleteResult);
+
+
+    }
+
+    @Test
+    public void projectRepositoryTest() {
+
+               /*
+         * Creating Gateway required for UserProfile & Project creation
+                */
+        Gateway gateway = new Gateway();
+        gateway.setGatewayApprovalStatus(GatewayApprovalStatus.ACTIVE);
+        gateway.setGatewayId(gatewayId);
+        gateway.setDomain(GATEWAY_DOMAIN);
+        gateway = gatewayRepository.create(gateway);
+        Assert.assertTrue(!gateway.getGatewayId().isEmpty());
+
+               /*
+         * UserProfile Instance creation required for Project Creation
+                */
+        UserProfile userProfile = new UserProfile();
+        userProfile.setAiravataInternalUserId(userId);
+        userProfile.setGatewayId(gateway.getGatewayId());
+        userProfile = userProfileRepository.create(userProfile);
+        Assert.assertTrue(!userProfile.getAiravataInternalUserId().isEmpty());
+
+        /*
+         * Project Instance creation
+         */
+        Project project = new Project();
+        project.setGatewayId(gatewayId);
+        project.setOwner(userId);
+        project.setProjectID(projectId);
+        project.setGatewayIdIsSet(true);
+
+
+        /*
+         * Workspace Project Repository Insert Operation Test
+                */
+        project = projectRepository.create(project);
+        Assert.assertTrue(!project.getProjectID().isEmpty());
+
+        /*
+         * Workspace Project Repository Update Operation Test
+                */
+        project.setDescription(PROJECT_DESCRIPTION);
+        projectRepository.update(project);
+        project = projectRepository.get(projectId);
+        Assert.assertEquals(project.getDescription(), PROJECT_DESCRIPTION);
+
+               /*
+         * Workspace Project Repository Select Operation Test
+                */
+        project = projectRepository.get(projectId);
+        Assert.assertNotNull(project);
+
+               /*
+         * Workspace Project Repository Delete Operation
+                */
+        boolean deleteResult = projectRepository.delete(projectId);
+        Assert.assertTrue(deleteResult);
+
+        deleteResult = userProfileRepository.delete(userId);
+        Assert.assertTrue(deleteResult);
+
+        deleteResult = gatewayRepository.delete(gatewayId);
+        Assert.assertTrue(deleteResult);
+
+
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/d9a69ae5/modules/server/src/main/java/org/apache/airavata/server/ServerMain.java
----------------------------------------------------------------------
diff --git 
a/modules/server/src/main/java/org/apache/airavata/server/ServerMain.java 
b/modules/server/src/main/java/org/apache/airavata/server/ServerMain.java
index b348ec0..0ff5744 100644
--- a/modules/server/src/main/java/org/apache/airavata/server/ServerMain.java
+++ b/modules/server/src/main/java/org/apache/airavata/server/ServerMain.java
@@ -63,6 +63,7 @@ public class ServerMain {
        private static final String REGISTRY_SERVER = "regserver";
        private static final String GFAC_SERVER = "gfac";
        private static final String ORCHESTRATOR = "orchestrator";
+       private static final String USER_PROFILE = "user_profile";
 
     private static ServerCnxnFactory cnxnFactory;
 //     private static boolean shutdownHookCalledBefore=false;
@@ -117,6 +118,7 @@ public class ServerMain {
                        serverList.add(API_SERVER);
                        serverList.add(ORCHESTRATOR);
                        serverList.add(GFAC_SERVER);
+                       serverList.add(USER_PROFILE);
                } else if (serverList.indexOf(API_ORCH) > -1) {
                        serverList.clear();
                        serverList.add(CREDENTIAL_STORE);

http://git-wip-us.apache.org/repos/asf/airavata/blob/d9a69ae5/modules/user-profile/pom.xml
----------------------------------------------------------------------
diff --git a/modules/user-profile/pom.xml b/modules/user-profile/pom.xml
index 00d9afe..f6349d3 100644
--- a/modules/user-profile/pom.xml
+++ b/modules/user-profile/pom.xml
@@ -21,8 +21,8 @@
     <artifactId>user-profile</artifactId>
     <packaging>pom</packaging>
     <modules>
-        <module>user-profile-core</module>
-        <module>user-profile-cpi</module>
+        <module>user-profile-stubs</module>
+        <module>user-profile-service</module>
     </modules>
 
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/d9a69ae5/modules/user-profile/user-profile-core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/user-profile/user-profile-core/pom.xml 
b/modules/user-profile/user-profile-core/pom.xml
deleted file mode 100644
index 0c4fb24..0000000
--- a/modules/user-profile/user-profile-core/pom.xml
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--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. -->
-<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
-    <parent>
-        <artifactId>user-profile</artifactId>
-        <groupId>org.apache.airavata</groupId>
-        <version>0.17-SNAPSHOT</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>user-profile-core</artifactId>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-commons</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <!-- Test -->
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>jcl-over-slf4j</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-log4j12</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.openjpa</groupId>
-            <artifactId>openjpa-all</artifactId>
-            <version>2.2.0</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-credential-store</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-
-
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-data-models</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>user-profile-cpi</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-server-configuration</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.mongodb</groupId>
-            <artifactId>mongo-java-driver</artifactId>
-            <version>3.0.0</version>
-        </dependency>
-        <dependency>
-            <groupId>com.fasterxml.jackson.core</groupId>
-            <artifactId>jackson-databind</artifactId>
-            <version>2.5.3</version>
-        </dependency>
-    </dependencies>
-</project>
\ No newline at end of file

Reply via email to