You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sc...@apache.org on 2016/10/17 22:41:46 UTC

[1/3] airavata git commit: updating getting started guide and fixing some sharing issues

Repository: airavata
Updated Branches:
  refs/heads/develop b85d3dbc5 -> 273d074ac


http://git-wip-us.apache.org/repos/asf/airavata/blob/273d074a/modules/sharing-registry/sharing-service-docs/api-docs/sharing_models.html
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-service-docs/api-docs/sharing_models.html b/modules/sharing-registry/sharing-service-docs/api-docs/sharing_models.html
index 5065c95..80384c8 100644
--- a/modules/sharing-registry/sharing-service-docs/api-docs/sharing_models.html
+++ b/modules/sharing-registry/sharing-service-docs/api-docs/sharing_models.html
@@ -77,11 +77,13 @@ considered as a group in it's own right for implementation ease</p>
 </td></tr>
 <tr><td><code>FULL_TEXT</code></td><td><code>2</code></td><td>
 </td></tr>
-<tr><td><code>PRRENT_ENTITY_ID</code></td><td><code>3</code></td><td>
+<tr><td><code>PARRENT_ENTITY_ID</code></td><td><code>3</code></td><td>
 </td></tr>
-<tr><td><code>CREATED_TIME</code></td><td><code>4</code></td><td>
+<tr><td><code>PERMISSION_TYPE_ID</code></td><td><code>4</code></td><td>
 </td></tr>
-<tr><td><code>UPDATED_TIME</code></td><td><code>5</code></td><td>
+<tr><td><code>CREATED_TIME</code></td><td><code>5</code></td><td>
+</td></tr>
+<tr><td><code>UPDATED_TIME</code></td><td><code>6</code></td><td>
 </td></tr>
 </table></div>
 <div class="definition"><h3 id="Enum_SearchCondition">Enumeration: SearchCondition</h3>
@@ -224,8 +226,9 @@ regarding the user.</p>
 <tr><td>7</td><td>description</td><td><code>string</code></td><td></td><td>optional</td><td></td></tr>
 <tr><td>8</td><td>binaryData</td><td><code>binary</code></td><td></td><td>optional</td><td></td></tr>
 <tr><td>9</td><td>fullText</td><td><code>string</code></td><td></td><td>optional</td><td></td></tr>
-<tr><td>10</td><td>createdTime</td><td><code>i64</code></td><td></td><td>optional</td><td></td></tr>
-<tr><td>11</td><td>updatedTime</td><td><code>i64</code></td><td></td><td>optional</td><td></td></tr>
+<tr><td>10</td><td>originalEntityCreationTime</td><td><code>i64</code></td><td></td><td>optional</td><td></td></tr>
+<tr><td>11</td><td>createdTime</td><td><code>i64</code></td><td></td><td>optional</td><td></td></tr>
+<tr><td>12</td><td>updatedTime</td><td><code>i64</code></td><td></td><td>optional</td><td></td></tr>
 </table><br/><p>Entity object which is used to register an entity in the system.</p>
 <li><b>entityId</b> : Entity id provided by the client</li>
 <li><b>domainId</b> : Domain id</li>
@@ -236,8 +239,10 @@ regarding the user.</p>
 <li>description : Short description for the entity</li>
 <li>binaryData : Any information stored in binary format</li>
 <li>fullText : A string which will be considered for full text search</li>
-<li>createdTime : If client provides this value then the system will use it if not the current time will be set</li>
-<li>updatedTime : If client provides this value then the system will use it if not the current time will be set</li>
+<li><b>originalEntityCreationTime</b> : When registering old records what is the original entity creation time. If not
+set will be default to current time</li>
+<li>createdTime : Will be set by the system</li>
+<li>updatedTime : Will be set by the system</li>
 
 <br/></div><div class="definition"><h3 id="Struct_PermissionType">Struct: PermissionType</h3>
 <table class="table-bordered table-striped table-condensed"><thead><th>Key</th><th>Field</th><th>Type</th><th>Description</th><th>Requiredness</th><th>Default value</th></thead>

http://git-wip-us.apache.org/repos/asf/airavata/blob/273d074a/modules/sharing-registry/sharing-service-docs/index.html
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-service-docs/index.html b/modules/sharing-registry/sharing-service-docs/index.html
index d7a7868..0364025 100644
--- a/modules/sharing-registry/sharing-service-docs/index.html
+++ b/modules/sharing-registry/sharing-service-docs/index.html
@@ -7,17 +7,40 @@
 <div class="container-fluid">
     <h2>Welcome to Airavata Sharing Registry Service Documentation</h2>
 
-    <p>Airavata Data Sharing Registry Service is a general purpose <em>Collaborative User Space Management Component</em> that can solve
+    <p>Airavata Data Sharing Registry Service is a general purpose <b>Collaborative Workspace Management Component</b>
+        that can solve
         your Scientific Data Management requirements related to sharing and access controlling.</p>
 
+    <p><span style="color: red; ">N.B. This component is under active development and this document will keep on evolving</span>
+    </p>
+
     <div>
         <ul><a href="#getting-started">Getting Started</a></ul>
         <ul><a href="./api-docs/index.html" target="_blank">API Docs</a></ul>
     </div>
     <div id="#getting-started">
-        <h3>Getting started with Java client</h3>
+        <h3>Getting started with the Java client</h3>
+
+        <div>
+            <ol start="0">
+                <li><a href="#requirements">Requirements</a></li>
+                <li><a href="#thrift-client">Create a thrift client</a></li>
+                <li><a href="#create-domain">Create a Domain</a></li>
+                <li><a href="#create-users">Create Users</a></li>
+                <li><a href="#create-groups">Create Groups</a></li>
+                <li><a href="#assign-users-to-group">Assign Users to a Group</a></li>
+                <li><a href="#assign-groups-to-group">Assign Groups to a Group</a></li>
+                <li><a href="#create-permission-types">Create Permission Types for your Domain</a></li>
+                <li><a href="#create-entity-types">Create Entity Types for your Domain</a></li>
+                <li><a href="#create-entities">Create Entities</a></li>
+                <li><a href="#sharing-entities">Share Entities</a></li>
+                <li><a href="#checking-user-has-access">Checking User has Permission</a></li>
+                <li><a href="#search-entities">Searching Entities</a></li>
+            </ol>
+        </div>
+        <br/>
 
-        <div class="definition">
+        <div class="definition" id="requirements">
             <h4>0. Required maven dependencies</h4>
             <pre>
                 &lt;dependency&gt;
@@ -34,11 +57,11 @@
             </pre>
         </div>
 
-        <div class="definition">
+        <div class="definition" id="thrift-client">
             <h4>1. Creating the thrift client</h4>
             <pre>
                 //should use the correct host name and port here
-                String serverHost = "gw56.iu.xsede.org";
+                String serverHost = "localhost";
                 int serverPort = 7878;
 
                 TTransport transport = new TSocket(serverHost, serverPort);
@@ -48,7 +71,7 @@
             </pre>
         </div>
 
-        <div class="definition">
+        <div class="definition" id="create-domain">
             <h4>2. Create a domain</h4>
             <pre>
                 Domain domain = new Domain();
@@ -62,32 +85,237 @@
             </pre>
         </div>
 
-        <div class="definition">
-            <h4>2. Create User</h4>
+        <div class="definition" id="create-users">
+            <h4>2. Create Users</h4>
             <pre>
-                User user = new User();
+                User user1 = new User();
+                String userName = "test-user-1";
+                String userId1 =  "test-user-1";
                 //required
-                user.setUserName("test-user");
+                user1.setUserId(userId1);
                 //required
-                user.setDomainId(domainId);
+                user.setUserName(userName);
                 //required
-                user.setFirstName("John");
+                user1.setDomainId(domainId);
                 //required
-                user.setLastName("Doe");
+                user1.setFirstName("John");
                 //required
-                user.setEmail("john.doe@abc.com");
+                user1.setLastName("Doe");
+                //required
+                user1.setEmail("john.doe@abc.com");
                 //optional - this should be bytes of the users image icon
-                byte[] icon = new byte[10];
-                user.setIcon(icon);
+                //byte[] icon = new byte[10];
+                //user1.setIcon(icon);
+
+                sharingServiceClient.createUser(user1);
+
+                //Similarly create two more users user2 and user3.
+                    .
+                    .
+                    .
+            </pre>
+        </div>
+
+        <div class="definition" id="create-groups">
+            <h4>3. Create User Groups</h4>
+            <pre>
+                UserGroup userGroup1 = new UserGroup();
+                //required
+                userGroup1.setGroupId("test-group-1");
+                //required
+                userGroup1.setDomainId(domainId);
+                //required
+                userGroup1.setName("test-group-1");
+                //optional
+                userGroup1.setDescription("test group description");
+                //required
+                userGroup1.setOwnerId("test-user-1");
+                //required
+                userGroup1.setGroupType(GroupType.USER_LEVEL_GROUP);
 
-                //can be manually set. otherwise will be set to the current time by the system
-                user.setCreatedTime(System.currentTimeMillis());
-                user.setUpdatedTime(System.currentTimeMillis());
+                sharingServiceClient.createGroup(userGroup1);
 
-                //will be of form &lt;domainId&gt;:&lt;userName&gt;
-                String userId = sharingServiceClient.createUser(user);
+                //Similarly create another group "userGroup2" with the owner being "test-user-2".
+                    .
+                    .
+                    .
+            </pre>
+        </div>
+
+        <div class="definition" id="assign-users-to-group">
+            <h4>4. Assign Users to a Group</h4>
+            <pre>
+                sharingServiceClient.addUsersToGroup(domainId, Arrays.asList("test-user-3"), "test-group-2");
             </pre>
         </div>
+
+        <div class="definition" id="assign-groups-to-group">
+            <h4>5. Assign groups to a group</h4>
+            <pre>
+                sharingServiceClient.addChildGroupsToParentGroup(domainId, Arrays.asList("test-group-2"), "test-group-1");
+
+                /********************************************/
+                /*              test-group-1                */
+                /*                 /     \                  */
+                /*                /       \                 */
+                /*        test-user-1   test-group-2        */
+                /*                        /        \        */
+                /*                 test-user-2  test-user-3 */
+                /********************************************/
+            </pre>
+        </div>
+
+        <div class="definition" id="create-permission-types">
+            <h4>6. Create Permission types for your Domain</h4>
+            <pre>
+                PermissionType permissionType1 = new PermissionType();
+                //required
+                permissionType1.setPermissionTypeId("READ");
+                //required
+                permissionType1.setDomainId(domainId);
+                //required
+                permissionType1.setName("READ");
+                //optional
+                permissionType1.setDescription("READ description");
+                sharingServiceClient.createPermissionType(permissionType1);
+
+                PermissionType permissionType2 = new PermissionType();
+                permissionType2.setPermissionTypeId("WRITE");
+                permissionType2.setDomainId(domainId);
+                permissionType2.setName("WRITE");
+                permissionType2.setDescription("WRITE description");
+                sharingServiceClient.createPermissionType(permissionType2);
+            </pre>
+        </div>
+
+        <div class="definition" id="create-entity-types">
+            <h4>7. Create Entity Types for your Domain</h4>
+            <pre>
+                EntityType entityType1 = new EntityType();
+                //required
+                entityType1.setEntityTypeId("PROJECT");
+                //required
+                entityType1.setDomainId(domainId);
+                //required
+                entityType1.setName("PROJECT");
+                //optional
+                entityType1.setDescription("PROJECT entity type description");
+                sharingServiceClient.createEntityType(entityType1);
+
+                EntityType entityType2 = new EntityType();
+                entityType2.setEntityTypeId("EXPERIMENT");
+                entityType2.setDomainId(domainId);
+                entityType2.setName("EXPERIMENT");
+                entityType2.setDescription("EXPERIMENT entity type");
+                sharingServiceClient.createEntityType(entityType2);
+            </pre>
+        </div>
+
+        <div class="definition" id="create-entities">
+            <h4>8. Create Entities</h4>
+            <pre>
+                Entity entity1 = new Entity();
+                //required
+                entity1.setEntityId("test-project-1");
+                //required
+                entity1.setDomainId(domainId);
+                //required
+                entity1.setEntityTypeId("PROJECT");
+                //required
+                entity1.setOwnerId("test-user-1");
+                //required
+                entity1.setName("test-project-1");
+                //optional
+                entity1.setDescription("test project 1 description");
+                //optional
+                entity1.setFullText("test project 1 stampede gaussian seagrid");
+                //optional - If not set this will be default to current system time
+                entity1.setOriginalEntityCreationTime(System.currentTimeMillis());
+
+                Entity entity2 = new Entity();
+                entity2.setEntityId("test-experiment-1");
+                entity2.setDomainId(domainId);
+                entity2.setEntityTypeId("EXPERIMENT");
+                entity2.setOwnerId("test-user-1");
+                entity2.setName("test-experiment-1");
+                entity2.setDescription("test experiment 1 description");
+                entity2.setParentEntityId("test-project-1");
+                entity2.setFullText("test experiment 1 benzene");
+                sharingServiceClient.createEntity(entity2);
+
+                Entity entity3 = new Entity();
+                entity3.setEntityId("test-experiment-2");
+                entity3.setDomainId(domainId);
+                entity3.setEntityTypeId("EXPERIMENT");
+                entity3.setOwnerId("test-user-1");
+                entity3.setName("test-experiment-2");
+                entity3.setDescription("test experiment 2 description");
+                entity3.setParentEntityId("test-project-1");
+                entity3.setFullText("test experiment 1 3-methyl 1-butanol");
+                sharingServiceClient.createEntity(entity3);
+            </pre>
+        </div>
+
+        <div class="definition" id="sharing-entities">
+        <h4>9. Share Entities with Users and Groups</h4>
+            <pre>
+                sharingServiceClient.shareEntityWithUsers(domainId, "test-project-1", Arrays.asList("test-user-2"), "WRITE", true);
+                sharingServiceClient.shareEntityWithGroups(domainId, "test-experiment-2", Arrays.asList("test-group-2"), "READ", true);
+
+                /**********************************************************************/
+                /*          test-project-1 (OWNER:test-user-1, WRITE:test-user-2)     */
+                /*             /                        \                             */
+                /*    test-experiment-1          test-experiment-2                    */
+                /*   (OWNER:test-user-1)     (OWNER:test-user-1, READ:test-group-2)   */
+                /**********************************************************************/
+            </pre>
+        </div>
+
+        <div class="definition" id="checking-user-has-access">
+            <h4>9. Checking whether a User has Permission to access an Entity with specified Permission</h4>
+            <pre>
+                //test-project-1 is explicitly shared with test-user-2 with WRITE permission
+                System.out.println(sharingServiceClient.userHasAccess(domainId, "test-user-2", "test-project-1", "WRITE"));
+
+                //test-user-2 has WRITE permission to test-experiment-1 and test-experiment-2 indirectly
+                System.out.println(sharingServiceClient.userHasAccess(domainId, "test-user-2", "test-experiment-1", "WRITE"));
+                System.out.println(sharingServiceClient.userHasAccess(domainId, "test-user-2", "test-experiment-2", "WRITE"));
+
+                //test-user-2 does not have READ permission to test-experiment-1 and test-experiment-2
+                System.out.println(sharingServiceClient.userHasAccess(domainId, "test-user-2", "test-experiment-1", "READ"));
+                System.out.println(sharingServiceClient.userHasAccess(domainId, "test-user-2", "test-experiment-2", "READ"));
+
+                //test-user-3 does not have READ permission to test-project-1
+                System.out.println(sharingServiceClient.userHasAccess(domainId, "test-user-3", "test-project-1", "READ"));
+
+                //test-experiment-2 is shared with test-group-2 with READ permission. Therefore test-user-3 has READ permission
+                System.out.println(sharingServiceClient.userHasAccess(domainId, "test-user-3", "test-experiment-2", "READ"));
+
+                //test-user-3 does not have WRITE permission to test-experiment-2
+                System.out.println(sharingServiceClient.userHasAccess(domainId, "test-user-3", "test-experiment-2", "WRITE"));
+            </pre>
+        </div>
+
+        <div class="definition" id="search-entities">
+            <h4>10. Searching Entities</h4>
+            <pre>
+                ArrayList<SearchCriteria> filters = new ArrayList<>();
+                SearchCriteria searchCriteria = new SearchCriteria();
+                searchCriteria.setSearchCondition(SearchCondition.LIKE);
+                searchCriteria.setValue("experiment");
+                searchCriteria.setSearchField(EntitySearchField.NAME);
+                filters.add(searchCriteria);
+
+                searchCriteria = new SearchCriteria();
+                searchCriteria.setSearchCondition(SearchCondition.EQUAL);
+                searchCriteria.setValue("READ");
+                searchCriteria.setSearchField(EntitySearchField.PERMISSION_TYPE_ID);
+                filters.add(searchCriteria);
+
+                System.out.println(sharingServiceClient.searchEntities(domainId, "test-user-2", "EXPERIMENT", filters, 0, -1).size());
+            </pre>
+        </div>
+
     </div>
 </div>
 </body>

http://git-wip-us.apache.org/repos/asf/airavata/blob/273d074a/modules/sharing-registry/thrift_models/sharing_cpi.thrift
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/thrift_models/sharing_cpi.thrift b/modules/sharing-registry/thrift_models/sharing_cpi.thrift
index f180738..7dd0775 100644
--- a/modules/sharing-registry/thrift_models/sharing_cpi.thrift
+++ b/modules/sharing-registry/thrift_models/sharing_cpi.thrift
@@ -48,7 +48,7 @@ service SharingRegistryService {
     /**
      <p>API method to register a user in the system</p>
     */
-    string registerUser(1: required sharing_models.User user) throws (1: sharing_models.SharingRegistryException sre)
+    string createUser(1: required sharing_models.User user) throws (1: sharing_models.SharingRegistryException sre)
     /**
      <p>API method to update existing user</p>
     */
@@ -62,7 +62,7 @@ service SharingRegistryService {
     */
     sharing_models.User getUser(1: required string domainId, 2: required string userId) throws (1: sharing_models.SharingRegistryException sre)
     /**
-     <p>API method to get a list of users in a specific domain Users will be reverse sorted based on the created time.</p>
+     <p>API method to get a list of users in a specific domain.</p>
      <li>domainId : Domain id</li>
      <li>offset : Starting result number</li>
      <li>limit : Number of max results to be sent</li>
@@ -86,7 +86,7 @@ service SharingRegistryService {
     */
     sharing_models.UserGroup getGroup(1: required string domainId, 2: required string groupId) throws (1: sharing_models.SharingRegistryException sre)
     /**
-     <p>API method to get groups in a domainId. Results are reverse sorted based on created time.</p>
+     <p>API method to get groups in a domainId.</p>
     */
     list<sharing_models.UserGroup> getGroups(1: required string domainId, 2: required i32 offset, 3: required i32 limit)
 
@@ -99,11 +99,11 @@ service SharingRegistryService {
     */
     bool removeUsersFromGroup(1: required string domainId, 2: required list<string> userIds, 3: required string groupId) throws (1: sharing_models.SharingRegistryException sre);
     /**
-     <p>API method to get list of child users in a group. Only the direct members will be returned. Results are reverse time sorted based on creation time</p>
+     <p>API method to get list of child users in a group. Only the direct members will be returned.</p>
     */
     list<sharing_models.User> getGroupMembersOfTypeUser(1: string domainId, 2: required string groupId, 3: required i32 offset, 4: required i32 limit) throws (1: sharing_models.SharingRegistryException sre);
     /**
-     <p>API method to get list of child groups in a group. Only the direct members will be returned. Results are reverse time sorted based on creation time</p>
+     <p>API method to get list of child groups in a group. Only the direct members will be returned.</p>
     */
     list<sharing_models.UserGroup> getGroupMembersOfTypeGroup(1: required string domainId, 2: required string groupId, 3: required i32 offset, 4: required i32 limit) throws (1: sharing_models.SharingRegistryException sre);
     /**
@@ -132,7 +132,7 @@ service SharingRegistryService {
     */
     sharing_models.EntityType getEntityType(1: required string domainId, 2: required string entityTypeId) throws (1: sharing_models.SharingRegistryException sre)
     /**
-     <p>API method to get entity types in a domainId. Results are reverse time sorted based on creation time</p>
+     <p>API method to get entity types in a domainId.</p>
     */
     list<sharing_models.EntityType> getEntityTypes(1: required string domainId, 2: required i32 offset, 3: required i32 limit) throws (1: sharing_models.SharingRegistryException sre);
 
@@ -140,7 +140,7 @@ service SharingRegistryService {
     /**
      <p>API method to register new entity</p>
     */
-    string registerEntity(1: required sharing_models.Entity entity) throws (1: sharing_models.SharingRegistryException sre)
+    string createEntity(1: required sharing_models.Entity entity) throws (1: sharing_models.SharingRegistryException sre)
     /**
      <p>API method to update entity</p>
     */
@@ -183,7 +183,7 @@ service SharingRegistryService {
     */
     sharing_models.PermissionType getPermissionType(1: required string domainId, 2: required string permissionTypeId) throws (1: sharing_models.SharingRegistryException sre)
     /**
-     <p>API method to get list of permission types in a given domainId. Results are reverse time sorted based on creation time</p>
+     <p>API method to get list of permission types in a given domainId.</p>
     */
     list<sharing_models.PermissionType> getPermissionTypes(1: required string domainId, 2: required i32 offset, 3: required i32 limit) throws (1: sharing_models.SharingRegistryException sre)
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/273d074a/modules/sharing-registry/thrift_models/sharing_models.thrift
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/thrift_models/sharing_models.thrift b/modules/sharing-registry/thrift_models/sharing_models.thrift
index d4d15c4..e34dc93 100644
--- a/modules/sharing-registry/thrift_models/sharing_models.thrift
+++ b/modules/sharing-registry/thrift_models/sharing_models.thrift
@@ -158,7 +158,8 @@ enum EntitySearchField {
     NAME,
     DESCRIPTION,
     FULL_TEXT,
-    PRRENT_ENTITY_ID,
+    PARRENT_ENTITY_ID,
+    PERMISSION_TYPE_ID,
     CREATED_TIME,
     UPDATED_TIME
 }
@@ -202,8 +203,10 @@ struct SearchCriteria {
 * <li>description : Short description for the entity</li>
 * <li>binaryData : Any information stored in binary format</li>
 * <li>fullText : A string which will be considered for full text search</li>
-* <li>createdTime : If client provides this value then the system will use it if not the current time will be set</li>
-* <li>updatedTime : If client provides this value then the system will use it if not the current time will be set</li>
+* <li><b>originalEntityCreationTime</b> : When registering old records what is the original entity creation time. If not
+* set will be default to current time</li>
+* <li>createdTime : Will be set by the system</li>
+* <li>updatedTime : Will be set by the system</li>
 **/
 struct Entity {
     1: optional string entityId,
@@ -215,8 +218,9 @@ struct Entity {
     7: optional string description,
     8: optional binary binaryData,
     9: optional string fullText,
-    10: optional i64 createdTime,
-    11: optional i64 updatedTime
+    10: optional i64 originalEntityCreationTime,
+    11: optional i64 createdTime,
+    12: optional i64 updatedTime
 }
 
 /**


[3/3] airavata git commit: updating getting started guide and fixing some sharing issues

Posted by sc...@apache.org.
updating getting started guide and fixing some sharing issues


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

Branch: refs/heads/develop
Commit: 273d074ace42f554ca727dd044ee342c917cac29
Parents: b85d3db
Author: scnakandala <su...@gmail.com>
Authored: Mon Oct 17 18:41:41 2016 -0400
Committer: scnakandala <su...@gmail.com>
Committed: Mon Oct 17 18:41:41 2016 -0400

----------------------------------------------------------------------
 .../server/handler/AiravataServerHandler.java   | 234 +++++------
 .../migrator/airavata/AiravataDataMigrator.java |   6 +-
 .../registry/db/entities/EntityEntity.java      |  14 +
 .../db/repositories/AbstractRepository.java     |   4 +-
 .../db/repositories/EntityRepository.java       |  21 +-
 .../repositories/GroupMembershipRepository.java |   4 +-
 .../db/repositories/SharingRepository.java      |   2 +-
 .../db/repositories/UserGroupRepository.java    |   2 +-
 .../db/repositories/UserRepository.java         |   2 +-
 .../sharing/registry/db/utils/DBConstants.java  |   1 +
 .../registry/db/utils/DatabaseCreator.java      |   4 +-
 .../sharing/registry/server/ServerMain.java     |  12 +-
 .../server/SharingRegistryServerHandler.java    |  27 +-
 .../main/resources/sharing-registry-derby.sql   |   1 +
 .../main/resources/sharing-registry-mysql.sql   |   1 +
 .../SharingRegistryServerHandlerTest.java       |  14 +-
 .../registry/SharingRegistryServiceTest.java    | 233 ++++++++++-
 .../sharing/registry/models/Entity.java         | 138 ++++++-
 .../registry/models/EntitySearchField.java      |  13 +-
 .../service/cpi/SharingRegistryService.java     | 392 +++++++++----------
 .../sharing-service-docs/api-docs/index.html    |   4 +-
 .../api-docs/sharing_cpi.html                   |  24 +-
 .../api-docs/sharing_models.html                |  19 +-
 .../sharing-service-docs/index.html             | 270 ++++++++++++-
 .../thrift_models/sharing_cpi.thrift            |  16 +-
 .../thrift_models/sharing_models.thrift         |  14 +-
 26 files changed, 1029 insertions(+), 443 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/273d074a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
index 36770ea..5570157 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
@@ -123,7 +123,7 @@ public class AiravataServerHandler implements Airavata.Iface {
             user.setDomainId(domain.domainId);
             user.setUserId(ServerSettings.getDefaultUser()+"@"+ServerSettings.getDefaultUserGateway());
             user.setUserName(ServerSettings.getDefaultUser());
-            sharingRegistryServerHandler.registerUser(user);
+            sharingRegistryServerHandler.createUser(user);
 
             //Creating Entity Types for each domain
             EntityType entityType = new EntityType();
@@ -671,7 +671,7 @@ public class AiravataServerHandler implements Airavata.Iface {
                 entity.setName(project.getName());
                 entity.setDescription(project.getDescription());
 
-                sharingRegistryServerHandler.registerEntity(entity);
+                sharingRegistryServerHandler.createEntity(entity);
             }
 
             logger.debug("Airavata created project with project Id : " + projectId + " for gateway Id : " + gatewayId);
@@ -808,7 +808,7 @@ public class AiravataServerHandler implements Airavata.Iface {
     @Override
     @SecurityCheck
     public List<Project> getUserProjects(AuthzToken authzToken, String gatewayId, String userName,
-                                                          int limit, int offset)
+                                         int limit, int offset)
             throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
         try {
             if (ServerSettings.isEnableSharing()){
@@ -998,7 +998,7 @@ public class AiravataServerHandler implements Airavata.Iface {
     @Override
     @SecurityCheck
     public List<ExperimentModel> getUserExperiments(AuthzToken authzToken, String gatewayId, String userName, int limit,
-                                                                     int offset) throws InvalidRequestException,
+                                                    int offset) throws InvalidRequestException,
             AiravataClientException, AiravataSystemException, AuthorizationException, TException {
         try {
             return getRegistryServiceClient().getUserExperiments(gatewayId, userName, limit, offset);
@@ -1049,7 +1049,7 @@ public class AiravataServerHandler implements Airavata.Iface {
                 entity.setName(experiment.getExperimentName());
                 entity.setDescription(experiment.getDescription());
 
-                sharingRegistryServerHandler.registerEntity(entity);
+                sharingRegistryServerHandler.createEntity(entity);
             }
 
             ExperimentStatusChangeEvent event = new ExperimentStatusChangeEvent(ExperimentState.CREATED,
@@ -1245,7 +1245,7 @@ public class AiravataServerHandler implements Airavata.Iface {
             RegistryService.Client regClient = getRegistryServiceClient();
             ExperimentModel experimentModel = regClient.getExperiment(airavataExperimentId);
             if(ServerSettings.isEnableSharing() && !authzToken.getClaimsMap().get(org.apache.airavata.common.utils.Constants.USER_NAME).equals(experimentModel.getUserName())
-                || !authzToken.getClaimsMap().get(org.apache.airavata.common.utils.Constants.GATEWAY_ID).equals(experimentModel.getGatewayId())){
+                    || !authzToken.getClaimsMap().get(org.apache.airavata.common.utils.Constants.GATEWAY_ID).equals(experimentModel.getGatewayId())){
                 try {
                     String gatewayId = authzToken.getClaimsMap().get(Constants.GATEWAY_ID);
                     String userId = authzToken.getClaimsMap().get(Constants.USER_NAME);
@@ -1567,9 +1567,9 @@ public class AiravataServerHandler implements Airavata.Iface {
                 existingExperiment.getErrors().clear();
             }
             if(existingExperiment.getUserConfigurationData() != null && existingExperiment.getUserConfigurationData()
-                .getComputationalResourceScheduling() != null){
+                    .getComputationalResourceScheduling() != null){
                 String compResourceId = existingExperiment.getUserConfigurationData()
-                    .getComputationalResourceScheduling().getResourceHostId();
+                        .getComputationalResourceScheduling().getResourceHostId();
 
                 ComputeResourceDescription computeResourceDescription = regClient.getComputeResource(compResourceId);
                 if(!computeResourceDescription.isEnabled()){
@@ -1589,7 +1589,7 @@ public class AiravataServerHandler implements Airavata.Iface {
                 entity.setName(existingExperiment.getExperimentName());
                 entity.setDescription(existingExperiment.getDescription());
 
-                sharingRegistryServerHandler.registerEntity(entity);
+                sharingRegistryServerHandler.createEntity(entity);
             }
 
             return expId;
@@ -2127,7 +2127,7 @@ public class AiravataServerHandler implements Airavata.Iface {
     @SecurityCheck
     public String registerComputeResource(AuthzToken authzToken, ComputeResourceDescription computeResourceDescription)
             throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
-    	try {
+        try {
             return getRegistryServiceClient().registerComputeResource(computeResourceDescription);
         } catch (ApplicationSettingsException | RegistryServiceException e) {
             logger.error("Error while saving compute resource...", e);
@@ -2149,7 +2149,7 @@ public class AiravataServerHandler implements Airavata.Iface {
     @SecurityCheck
     public ComputeResourceDescription getComputeResource(AuthzToken authzToken, String computeResourceId)
             throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
-    	try {
+        try {
             return getRegistryServiceClient().getComputeResource(computeResourceId);
         } catch (ApplicationSettingsException | RegistryServiceException e) {
             logger.error(computeResourceId, "Error while retrieving compute resource...", e);
@@ -2193,7 +2193,7 @@ public class AiravataServerHandler implements Airavata.Iface {
     @SecurityCheck
     public boolean updateComputeResource(AuthzToken authzToken, String computeResourceId, ComputeResourceDescription computeResourceDescription)
             throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
-    	try {
+        try {
             return getRegistryServiceClient().updateComputeResource(computeResourceId, computeResourceDescription);
         } catch (ApplicationSettingsException | RegistryServiceException e) {
             logger.error(computeResourceId, "Error while updating compute resource...", e);
@@ -2215,7 +2215,7 @@ public class AiravataServerHandler implements Airavata.Iface {
     @SecurityCheck
     public boolean deleteComputeResource(AuthzToken authzToken, String computeResourceId) throws InvalidRequestException,
             AiravataClientException, AiravataSystemException, AuthorizationException, TException {
-    	try {
+        try {
             return getRegistryServiceClient().deleteComputeResource(computeResourceId);
         } catch (ApplicationSettingsException | RegistryServiceException e) {
             logger.error(computeResourceId, "Error while deleting compute resource...", e);
@@ -2351,7 +2351,7 @@ public class AiravataServerHandler implements Airavata.Iface {
     @SecurityCheck
     public String addLocalSubmissionDetails(AuthzToken authzToken, String computeResourceId, int priorityOrder, LOCALSubmission localSubmission)
             throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
-    	try {
+        try {
             return getRegistryServiceClient().addLocalSubmissionDetails(computeResourceId, priorityOrder, localSubmission);
         } catch (ApplicationSettingsException | RegistryServiceException e) {
             logger.error(computeResourceId, "Error while adding job submission interface to resource compute resource...", e);
@@ -2374,7 +2374,7 @@ public class AiravataServerHandler implements Airavata.Iface {
     @SecurityCheck
     public boolean updateLocalSubmissionDetails(AuthzToken authzToken, String jobSubmissionInterfaceId, LOCALSubmission localSubmission)
             throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
-    	try {
+        try {
             return getRegistryServiceClient().updateLocalSubmissionDetails(jobSubmissionInterfaceId, localSubmission);
         } catch (Exception e) {
             logger.error(jobSubmissionInterfaceId, "Error while adding job submission interface to resource compute resource...", e);
@@ -2415,7 +2415,7 @@ public class AiravataServerHandler implements Airavata.Iface {
     @SecurityCheck
     public String addSSHJobSubmissionDetails(AuthzToken authzToken, String computeResourceId, int priorityOrder, SSHJobSubmission sshJobSubmission)
             throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
-    	try {
+        try {
             return getRegistryServiceClient().addSSHJobSubmissionDetails(computeResourceId, priorityOrder, sshJobSubmission);
         } catch (ApplicationSettingsException | RegistryServiceException e) {
             logger.error(computeResourceId, "Error while adding job submission interface to resource compute resource...", e);
@@ -2511,19 +2511,19 @@ public class AiravataServerHandler implements Airavata.Iface {
 
     @Override
     @SecurityCheck
-	public String addUNICOREJobSubmissionDetails(AuthzToken authzToken, String computeResourceId, int priorityOrder,
+    public String addUNICOREJobSubmissionDetails(AuthzToken authzToken, String computeResourceId, int priorityOrder,
                                                  UnicoreJobSubmission unicoreJobSubmission)
-			throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
-		try {
-	        return getRegistryServiceClient().addUNICOREJobSubmissionDetails(computeResourceId, priorityOrder, unicoreJobSubmission);
-	    } catch (ApplicationSettingsException | RegistryServiceException e) {
-	        logger.error("Error while adding job submission interface to resource compute resource...", e);
-	        AiravataSystemException exception = new AiravataSystemException();
-	        exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
-	        exception.setMessage("Error while adding job submission interface to resource compute resource. More info : " + e.getMessage());
-	        throw exception;
-	    }
-	}
+            throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
+        try {
+            return getRegistryServiceClient().addUNICOREJobSubmissionDetails(computeResourceId, priorityOrder, unicoreJobSubmission);
+        } catch (ApplicationSettingsException | RegistryServiceException e) {
+            logger.error("Error while adding job submission interface to resource compute resource...", e);
+            AiravataSystemException exception = new AiravataSystemException();
+            exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
+            exception.setMessage("Error while adding job submission interface to resource compute resource. More info : " + e.getMessage());
+            throw exception;
+        }
+    }
 
     @Override
     @SecurityCheck
@@ -2553,7 +2553,7 @@ public class AiravataServerHandler implements Airavata.Iface {
     @SecurityCheck
     public boolean updateSSHJobSubmissionDetails(AuthzToken authzToken, String jobSubmissionInterfaceId, SSHJobSubmission sshJobSubmission)
             throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
-    	try {
+        try {
             return getRegistryServiceClient().updateSSHJobSubmissionDetails(jobSubmissionInterfaceId, sshJobSubmission);
         } catch (Exception e) {
             logger.error(jobSubmissionInterfaceId, "Error while adding job submission interface to resource compute resource...", e);
@@ -2617,7 +2617,7 @@ public class AiravataServerHandler implements Airavata.Iface {
     public String addLocalDataMovementDetails(AuthzToken authzToken, String resourceId, DMType dmType, int priorityOrder,
                                               LOCALDataMovement localDataMovement) throws InvalidRequestException,
             AiravataClientException, AiravataSystemException, AuthorizationException, TException {
-    	try {
+        try {
             return getRegistryServiceClient().addLocalDataMovementDetails(resourceId, dmType, priorityOrder, localDataMovement);
         } catch (ApplicationSettingsException | RegistryServiceException e) {
             logger.error(resourceId, "Error while adding data movement interface to resource resource...", e);
@@ -2640,7 +2640,7 @@ public class AiravataServerHandler implements Airavata.Iface {
     @SecurityCheck
     public boolean updateLocalDataMovementDetails(AuthzToken authzToken, String dataMovementInterfaceId, LOCALDataMovement localDataMovement)
             throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
-    	try {
+        try {
             return getRegistryServiceClient().updateLocalDataMovementDetails(dataMovementInterfaceId, localDataMovement);
         } catch (Exception e) {
             logger.error(dataMovementInterfaceId, "Error while updating local data movement interface..", e);
@@ -2682,7 +2682,7 @@ public class AiravataServerHandler implements Airavata.Iface {
     @SecurityCheck
     public String addSCPDataMovementDetails(AuthzToken authzToken, String resourceId, DMType dmType, int priorityOrder, SCPDataMovement scpDataMovement)
             throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
-    	try {
+        try {
             return getRegistryServiceClient().addSCPDataMovementDetails(resourceId, dmType, priorityOrder, scpDataMovement);
         } catch (ApplicationSettingsException | RegistryServiceException e) {
             logger.error(resourceId, "Error while adding data movement interface to resource compute resource...", e);
@@ -2706,7 +2706,7 @@ public class AiravataServerHandler implements Airavata.Iface {
     @SecurityCheck
     public boolean updateSCPDataMovementDetails(AuthzToken authzToken, String dataMovementInterfaceId, SCPDataMovement scpDataMovement)
             throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
-    	try {
+        try {
             return getRegistryServiceClient().updateSCPDataMovementDetails(dataMovementInterfaceId, scpDataMovement);
         } catch (Exception e) {
             logger.error(dataMovementInterfaceId, "Error while adding job submission interface to resource compute resource...", e);
@@ -2794,7 +2794,7 @@ public class AiravataServerHandler implements Airavata.Iface {
     public String addGridFTPDataMovementDetails(AuthzToken authzToken, String computeResourceId, DMType dmType, int priorityOrder,
                                                 GridFTPDataMovement gridFTPDataMovement) throws InvalidRequestException,
             AiravataClientException, AiravataSystemException, AuthorizationException, TException {
-    	try {
+        try {
             return getRegistryServiceClient().addGridFTPDataMovementDetails(computeResourceId, dmType, priorityOrder, gridFTPDataMovement);
         } catch (ApplicationSettingsException | RegistryServiceException e) {
             logger.error(computeResourceId, "Error while adding data movement interface to resource compute resource...", e);
@@ -2818,7 +2818,7 @@ public class AiravataServerHandler implements Airavata.Iface {
     @SecurityCheck
     public boolean updateGridFTPDataMovementDetails(AuthzToken authzToken, String dataMovementInterfaceId, GridFTPDataMovement gridFTPDataMovement)
             throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
-    	try {
+        try {
             return getRegistryServiceClient().updateGridFTPDataMovementDetails(dataMovementInterfaceId, gridFTPDataMovement);
         } catch (Exception e) {
             logger.error(dataMovementInterfaceId, "Error while adding job submission interface to resource compute resource...", e);
@@ -3035,7 +3035,7 @@ public class AiravataServerHandler implements Airavata.Iface {
     @SecurityCheck
     public String registerGatewayResourceProfile(AuthzToken authzToken, GatewayResourceProfile gatewayResourceProfile)
             throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
-    	try {
+        try {
             return getRegistryServiceClient().registerGatewayResourceProfile(gatewayResourceProfile);
         } catch (ApplicationSettingsException | RegistryServiceException e) {
             logger.error("Error while registering gateway resource profile...", e);
@@ -3128,7 +3128,7 @@ public class AiravataServerHandler implements Airavata.Iface {
     public boolean addGatewayComputeResourcePreference(AuthzToken authzToken, String gatewayID, String computeResourceId,
                                                        ComputeResourcePreference computeResourcePreference) throws InvalidRequestException,
             AiravataClientException, AiravataSystemException, AuthorizationException, TException {
-    	try {
+        try {
             return getRegistryServiceClient().addGatewayComputeResourcePreference(gatewayID, computeResourceId, computeResourcePreference);
         } catch (ApplicationSettingsException | RegistryServiceException e) {
             logger.error(gatewayID, "Error while registering gateway resource profile preference...", e);
@@ -3166,7 +3166,7 @@ public class AiravataServerHandler implements Airavata.Iface {
     @SecurityCheck
     public ComputeResourcePreference getGatewayComputeResourcePreference(AuthzToken authzToken, String gatewayID, String computeResourceId)
             throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
-    	try {
+        try {
             return getRegistryServiceClient().getGatewayComputeResourcePreference(gatewayID, computeResourceId);
         } catch (ApplicationSettingsException | RegistryServiceException e) {
             logger.error(gatewayID, "Error while reading gateway compute resource preference...", e);
@@ -3202,7 +3202,7 @@ public class AiravataServerHandler implements Airavata.Iface {
     @SecurityCheck
     public List<ComputeResourcePreference> getAllGatewayComputeResourcePreferences(AuthzToken authzToken, String gatewayID)
             throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
-    	try {
+        try {
             return getRegistryServiceClient().getAllGatewayComputeResourcePreferences(gatewayID);
         } catch (ApplicationSettingsException | RegistryServiceException e) {
             logger.error(gatewayID, "Error while reading gateway compute resource preferences...", e);
@@ -3255,7 +3255,7 @@ public class AiravataServerHandler implements Airavata.Iface {
     public boolean updateGatewayComputeResourcePreference(AuthzToken authzToken, String gatewayID, String computeResourceId,
                                                           ComputeResourcePreference computeResourcePreference)
             throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
-    	try {
+        try {
             return getRegistryServiceClient().updateGatewayComputeResourcePreference(gatewayID, computeResourceId, computeResourcePreference);
         } catch (ApplicationSettingsException | RegistryServiceException e) {
             logger.error(gatewayID, "Error while reading gateway compute resource preference...", e);
@@ -3292,7 +3292,7 @@ public class AiravataServerHandler implements Airavata.Iface {
     @SecurityCheck
     public boolean deleteGatewayComputeResourcePreference(AuthzToken authzToken, String gatewayID, String computeResourceId)
             throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
-    	try {
+        try {
             return getRegistryServiceClient().deleteGatewayComputeResourcePreference(gatewayID, computeResourceId);
         } catch (ApplicationSettingsException | RegistryServiceException e) {
             logger.error(gatewayID, "Error while reading gateway compute resource preference...", e);
@@ -3627,109 +3627,109 @@ public class AiravataServerHandler implements Airavata.Iface {
 
     @Override
     @SecurityCheck
-	public List<String> getAllWorkflows(AuthzToken authzToken, String gatewayId) throws InvalidRequestException,
-			AiravataClientException, AiravataSystemException, AuthorizationException, TException {
+    public List<String> getAllWorkflows(AuthzToken authzToken, String gatewayId) throws InvalidRequestException,
+            AiravataClientException, AiravataSystemException, AuthorizationException, TException {
 
         try {
-			return getRegistryServiceClient().getAllWorkflows(gatewayId);
-		} catch (ApplicationSettingsException | RegistryServiceException e) {
-			String msg = "Error in retrieving all workflow template Ids.";
-			logger.error(msg, e);
-			AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
+            return getRegistryServiceClient().getAllWorkflows(gatewayId);
+        } catch (ApplicationSettingsException | RegistryServiceException e) {
+            String msg = "Error in retrieving all workflow template Ids.";
+            logger.error(msg, e);
+            AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
             exception.setMessage(msg+" More info : " + e.getMessage());
             throw exception;
-		}
-	}
+        }
+    }
 
-	@Override
+    @Override
     @SecurityCheck
-	public WorkflowModel getWorkflow(AuthzToken authzToken, String workflowTemplateId)
-			throws InvalidRequestException, AiravataClientException, AuthorizationException, AiravataSystemException, TException {
-		try {
-			return getRegistryServiceClient().getWorkflow(workflowTemplateId);
-		} catch (ApplicationSettingsException | RegistryServiceException e) {
-			String msg = "Error in retrieving the workflow "+workflowTemplateId+".";
-			logger.error(msg, e);
-			AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
+    public WorkflowModel getWorkflow(AuthzToken authzToken, String workflowTemplateId)
+            throws InvalidRequestException, AiravataClientException, AuthorizationException, AiravataSystemException, TException {
+        try {
+            return getRegistryServiceClient().getWorkflow(workflowTemplateId);
+        } catch (ApplicationSettingsException | RegistryServiceException e) {
+            String msg = "Error in retrieving the workflow "+workflowTemplateId+".";
+            logger.error(msg, e);
+            AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
             exception.setMessage(msg+" More info : " + e.getMessage());
             throw exception;
-		}
-	}
+        }
+    }
 
-	@Override
+    @Override
     @SecurityCheck
-	public void deleteWorkflow(AuthzToken authzToken, String workflowTemplateId)
-			throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
-		try {
-			getRegistryServiceClient().deleteWorkflow(workflowTemplateId);
-		} catch (ApplicationSettingsException | RegistryServiceException e) {
-			String msg = "Error in deleting the workflow "+workflowTemplateId+".";
-			logger.error(msg, e);
-			AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
+    public void deleteWorkflow(AuthzToken authzToken, String workflowTemplateId)
+            throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
+        try {
+            getRegistryServiceClient().deleteWorkflow(workflowTemplateId);
+        } catch (ApplicationSettingsException | RegistryServiceException e) {
+            String msg = "Error in deleting the workflow "+workflowTemplateId+".";
+            logger.error(msg, e);
+            AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
             exception.setMessage(msg+" More info : " + e.getMessage());
             throw exception;
-		}
-	}
+        }
+    }
 
-	@Override
+    @Override
     @SecurityCheck
-	public String registerWorkflow(AuthzToken authzToken, String gatewayId, WorkflowModel workflow)
-			throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
+    public String registerWorkflow(AuthzToken authzToken, String gatewayId, WorkflowModel workflow)
+            throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
         try {
-			return getRegistryServiceClient().registerWorkflow(gatewayId, workflow);
-		} catch (ApplicationSettingsException | RegistryServiceException e) {
-			String msg = "Error in registering the workflow "+workflow.getName()+".";
-			logger.error(msg, e);
-			AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
+            return getRegistryServiceClient().registerWorkflow(gatewayId, workflow);
+        } catch (ApplicationSettingsException | RegistryServiceException e) {
+            String msg = "Error in registering the workflow "+workflow.getName()+".";
+            logger.error(msg, e);
+            AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
             exception.setMessage(msg+" More info : " + e.getMessage());
             throw exception;
-		}
-	}
+        }
+    }
 
-	@Override
+    @Override
     @SecurityCheck
-	public void updateWorkflow(AuthzToken authzToken, String workflowTemplateId, WorkflowModel workflow)
-			throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
-		try {
-			getRegistryServiceClient().updateWorkflow(workflowTemplateId, workflow);
-		} catch (ApplicationSettingsException | RegistryServiceException e) {
-			String msg = "Error in updating the workflow "+workflow.getName()+".";
-			logger.error(msg, e);
-			AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
+    public void updateWorkflow(AuthzToken authzToken, String workflowTemplateId, WorkflowModel workflow)
+            throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
+        try {
+            getRegistryServiceClient().updateWorkflow(workflowTemplateId, workflow);
+        } catch (ApplicationSettingsException | RegistryServiceException e) {
+            String msg = "Error in updating the workflow "+workflow.getName()+".";
+            logger.error(msg, e);
+            AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
             exception.setMessage(msg+" More info : " + e.getMessage());
             throw exception;
-		}
-	}
+        }
+    }
 
-	@Override
+    @Override
     @SecurityCheck
-	public String getWorkflowTemplateId(AuthzToken authzToken, String workflowName)
-			throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
-		try {
-			return getRegistryServiceClient().getWorkflowTemplateId(workflowName);
-		} catch (ApplicationSettingsException | RegistryServiceException e) {
-			String msg = "Error in retrieving the workflow template id for "+workflowName+".";
-			logger.error(msg, e);
-			AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
+    public String getWorkflowTemplateId(AuthzToken authzToken, String workflowName)
+            throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
+        try {
+            return getRegistryServiceClient().getWorkflowTemplateId(workflowName);
+        } catch (ApplicationSettingsException | RegistryServiceException e) {
+            String msg = "Error in retrieving the workflow template id for "+workflowName+".";
+            logger.error(msg, e);
+            AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
             exception.setMessage(msg+" More info : " + e.getMessage());
             throw exception;
-		}
-	}
+        }
+    }
 
-	@Override
+    @Override
     @SecurityCheck
-	public boolean isWorkflowExistWithName(AuthzToken authzToken, String workflowName)
-			throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
-		try {
-			return getRegistryServiceClient().isWorkflowExistWithName(workflowName);
-		} catch (ApplicationSettingsException | RegistryServiceException e) {
-			String msg = "Error in veriying the workflow for workflow name "+workflowName+".";
-			logger.error(msg, e);
-			AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
+    public boolean isWorkflowExistWithName(AuthzToken authzToken, String workflowName)
+            throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
+        try {
+            return getRegistryServiceClient().isWorkflowExistWithName(workflowName);
+        } catch (ApplicationSettingsException | RegistryServiceException e) {
+            String msg = "Error in veriying the workflow for workflow name "+workflowName+".";
+            logger.error(msg, e);
+            AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
             exception.setMessage(msg+" More info : " + e.getMessage());
             throw exception;
-		}
-	}
+        }
+    }
 
 
     /**
@@ -3878,11 +3878,11 @@ public class AiravataServerHandler implements Airavata.Iface {
             if(permissionType.equals(ResourcePermissionType.WRITE))
                 sharingRegistryServerHandler.getListOfSharedUsers(authzToken.getClaimsMap().get(Constants.GATEWAY_ID),
                         resourceId, authzToken.getClaimsMap().get(Constants.GATEWAY_ID)
-                        + ":WRITE").stream().forEach(u->accessibleUsers.add(u.userId));
+                                + ":WRITE").stream().forEach(u->accessibleUsers.add(u.userId));
             else if(permissionType.equals(ResourcePermissionType.READ))
                 sharingRegistryServerHandler.getListOfSharedUsers(authzToken.getClaimsMap().get(Constants.GATEWAY_ID),
                         resourceId, authzToken.getClaimsMap().get(Constants.GATEWAY_ID)
-                        + ":READ").stream().forEach(u->accessibleUsers.add(u.userId));
+                                + ":READ").stream().forEach(u->accessibleUsers.add(u.userId));
             return accessibleUsers;
         } catch (Exception e) {
             String msg = "Error in getting all accessible users for resource. Resource ID : " + resourceId + " Resource Type : " + resourceType.toString() ;

http://git-wip-us.apache.org/repos/asf/airavata/blob/273d074a/modules/sharing-registry/sharing-data-migrator/src/main/java/org/apache/airavata/sharing/registry/migrator/airavata/AiravataDataMigrator.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-data-migrator/src/main/java/org/apache/airavata/sharing/registry/migrator/airavata/AiravataDataMigrator.java b/modules/sharing-registry/sharing-data-migrator/src/main/java/org/apache/airavata/sharing/registry/migrator/airavata/AiravataDataMigrator.java
index e38a760..a8ec19f 100644
--- a/modules/sharing-registry/sharing-data-migrator/src/main/java/org/apache/airavata/sharing/registry/migrator/airavata/AiravataDataMigrator.java
+++ b/modules/sharing-registry/sharing-data-migrator/src/main/java/org/apache/airavata/sharing/registry/migrator/airavata/AiravataDataMigrator.java
@@ -106,7 +106,7 @@ public class AiravataDataMigrator {
             user.setDomainId(rs.getString("GATEWAY_ID"));
             user.setUserName(rs.getString("USER_NAME"));
 
-            govRegistryServerHandler.registerUser(user);
+            govRegistryServerHandler.createUser(user);
         }
 
         //Creating project entries
@@ -128,7 +128,7 @@ public class AiravataDataMigrator {
             Map<String, String> metadata = new HashMap<>();
             metadata.put("CREATION_TIME", rs.getDate("CREATION_TIME").toString());
 
-            govRegistryServerHandler.registerEntity(entity);
+            govRegistryServerHandler.createEntity(entity);
         }
 
         //Creating experiment entries
@@ -158,7 +158,7 @@ public class AiravataDataMigrator {
             metadata.put("GATEWAY_INSTANCE_ID", rs.getString("GATEWAY_INSTANCE_ID"));
             metadata.put("ARCHIVE", rs.getString("ARCHIVE"));
 
-            govRegistryServerHandler.registerEntity(entity);
+            govRegistryServerHandler.createEntity(entity);
         }
 
         expCatConnection.close();

http://git-wip-us.apache.org/repos/asf/airavata/blob/273d074a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/entities/EntityEntity.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/entities/EntityEntity.java b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/entities/EntityEntity.java
index 7ee8225..1fbf4f4 100644
--- a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/entities/EntityEntity.java
+++ b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/entities/EntityEntity.java
@@ -40,6 +40,7 @@ public class EntityEntity {
     private String description;
     private ByteBuffer binaryData;
     private String fullText;
+    private Long originalEntityCreationTime;
     private Long createdTime;
     private Long updatedTime;
 
@@ -134,6 +135,16 @@ public class EntityEntity {
     }
 
     @Basic
+    @Column(name = "ORIGINAL_ENTITY_CREATION_TIME")
+    public Long getOriginalEntityCreationTime() {
+        return originalEntityCreationTime;
+    }
+
+    public void setOriginalEntityCreationTime(Long originalEntityCreationTime) {
+        this.originalEntityCreationTime = originalEntityCreationTime;
+    }
+
+    @Basic
     @Column(name = "CREATED_TIME")
     public Long getCreatedTime() {
         return createdTime;
@@ -167,6 +178,8 @@ public class EntityEntity {
         if (description != null ? !description.equals(that.description) : that.description != null) return false;
         if (binaryData.equals(that.binaryData)) return false;
         if (fullText != null ? !fullText.equals(that.fullText) : that.fullText != null) return false;
+        if (originalEntityCreationTime != null ? !originalEntityCreationTime.equals(that.originalEntityCreationTime)
+                : that.originalEntityCreationTime != null) return false;
         if (createdTime != null ? !createdTime.equals(that.createdTime) : that.createdTime != null) return false;
         if (updatedTime != null ? !updatedTime.equals(that.updatedTime) : that.updatedTime != null) return false;
         if (ownerId != null ? !ownerId.equals(that.ownerId) : that.ownerId != null) return false;
@@ -181,6 +194,7 @@ public class EntityEntity {
         result = 31 * result + (description != null ? description.hashCode() : 0);
         result = 31 * result + (binaryData != null ? binaryData.hashCode() : 0);
         result = 31 * result + (fullText != null ? fullText.hashCode() : 0);
+        result = 31 * result + (originalEntityCreationTime != null ? originalEntityCreationTime.hashCode() : 0);
         result = 31 * result + (createdTime != null ? createdTime.hashCode() : 0);
         result = 31 * result + (updatedTime != null ? updatedTime.hashCode() : 0);
         return result;

http://git-wip-us.apache.org/repos/asf/airavata/blob/273d074a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/AbstractRepository.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/AbstractRepository.java b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/AbstractRepository.java
index a53a6a2..9f5a706 100644
--- a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/AbstractRepository.java
+++ b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/AbstractRepository.java
@@ -121,8 +121,8 @@ public abstract class AbstractRepository<T, E, Id> {
         return gatewayList;
     }
 
-    private String getSelectQuery(Map<String, String> filters){
-        String query = "SELECT p from " + dbEntityGenericClass.getSimpleName() + " as p";
+    public String getSelectQuery(Map<String, String> filters){
+        String query = "SELECT DISTINCT p from " + dbEntityGenericClass.getSimpleName() + " as p";
         if(filters != null && filters.size() != 0){
             query += " WHERE ";
             for(String k : filters.keySet()){

http://git-wip-us.apache.org/repos/asf/airavata/blob/273d074a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/EntityRepository.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/EntityRepository.java b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/EntityRepository.java
index a762f00..6d60aa9 100644
--- a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/EntityRepository.java
+++ b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/EntityRepository.java
@@ -30,6 +30,7 @@ import org.slf4j.LoggerFactory;
 
 import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 public class EntityRepository extends AbstractRepository<Entity, EntityEntity, EntityPK> {
     private final static Logger logger = LoggerFactory.getLogger(EntityRepository.class);
@@ -51,7 +52,7 @@ public class EntityRepository extends AbstractRepository<Entity, EntityEntity, E
             groupIdString += groupId + "','";
         groupIdString = groupIdString.substring(0, groupIdString.length()-2);
 
-        String query = "SELECT E FROM " + EntityEntity.class.getSimpleName() + " E, " + SharingEntity.class.getSimpleName() + " S WHERE " +
+        String query = "SELECT DISTINCT E FROM " + EntityEntity.class.getSimpleName() + " E, " + SharingEntity.class.getSimpleName() + " S WHERE " +
                 "E." + DBConstants.EntityTable.ENTITY_ID + " = S." + DBConstants.SharingTable.ENTITY_ID + " AND " +
                 "E." + DBConstants.EntityTable.DOMAIN_ID + " = S." + DBConstants.SharingTable.DOMAIN_ID + " AND " +
                 "E." + DBConstants.EntityTable.DOMAIN_ID + " = '" + domainId + "' AND " +
@@ -63,9 +64,11 @@ public class EntityRepository extends AbstractRepository<Entity, EntityEntity, E
                 query += "E." + DBConstants.EntityTable.NAME + " LIKE '%" + searchCriteria.getValue() + "%' AND ";
             }else if(searchCriteria.getSearchField().equals(EntitySearchField.DESCRIPTION)){
                 query += "E." + DBConstants.EntityTable.DESCRIPTION + " LIKE '%" + searchCriteria.getValue() + "%' AND ";
+            }else if(searchCriteria.getSearchField().equals(EntitySearchField.PERMISSION_TYPE_ID)){
+                query += "S." + DBConstants.SharingTable.PERMISSION_TYPE_ID + " = '" + searchCriteria.getValue() + "' AND ";
             }else if(searchCriteria.getSearchField().equals(EntitySearchField.FULL_TEXT)){
                 query += "E." + DBConstants.EntityTable.FULL_TEXT + " LIKE '%" + searchCriteria.getValue() + "%' AND ";
-            }else if(searchCriteria.getSearchField().equals(EntitySearchField.PRRENT_ENTITY_ID)){
+            }else if(searchCriteria.getSearchField().equals(EntitySearchField.PARRENT_ENTITY_ID)){
                 query += "E." + DBConstants.EntityTable.PARENT_ENTITY_ID + " = '" + searchCriteria.getValue() + "' AND ";
             }else if(searchCriteria.getSearchField().equals(EntitySearchField.CREATED_TIME)){
                 if(searchCriteria.getSearchCondition().equals(SearchCondition.GTE)){
@@ -84,6 +87,20 @@ public class EntityRepository extends AbstractRepository<Entity, EntityEntity, E
 
         query = query.substring(0, query.length() - 5);
         return select(query, offset, limit);
+    }
+
+    public String getSelectQuery(Map<String, String> filters){
+        String query = "SELECT p from " + EntityEntity.class.getSimpleName() + " as p";
+        if(filters != null && filters.size() != 0){
+            query += " WHERE ";
+            for(String k : filters.keySet()){
+                query += "p." + k + " = '" + filters.get(k) + "' AND ";
+            }
+            query = query.substring(0, query.length()-5);
+        }
+
+        query += " ORDER BY p."+DBConstants.EntityTable.ORIGINAL_ENTITY_CREATION_TIME+" DESC";
 
+        return query;
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/273d074a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/GroupMembershipRepository.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/GroupMembershipRepository.java b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/GroupMembershipRepository.java
index ccf27cb..087cc72 100644
--- a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/GroupMembershipRepository.java
+++ b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/GroupMembershipRepository.java
@@ -36,7 +36,7 @@ public class GroupMembershipRepository extends AbstractRepository<GroupMembershi
     }
 
     public List<User> getAllChildUsers(String domainId, String groupId) throws SharingRegistryException {
-        String queryString = "SELECT U FROM " + UserEntity.class.getSimpleName() + " U, " + GroupMembershipEntity.class.getSimpleName()
+        String queryString = "SELECT DISTINCT U FROM " + UserEntity.class.getSimpleName() + " U, " + GroupMembershipEntity.class.getSimpleName()
                 + " GM WHERE GM." + DBConstants.GroupMembershipTable.CHILD_ID + " = U." + DBConstants.UserTable.USER_ID + " AND " +
                 "GM." + DBConstants.GroupMembershipTable.DOMAIN_ID + " = U." + DBConstants.UserTable.DOMAIN_ID + " AND " +
                 "GM." + DBConstants.GroupMembershipTable.DOMAIN_ID + "='" + domainId + "' AND "+
@@ -48,7 +48,7 @@ public class GroupMembershipRepository extends AbstractRepository<GroupMembershi
     }
 
     public List<UserGroup> getAllChildGroups(String domainId, String groupId) throws SharingRegistryException {
-        String queryString = "SELECT G FROM " + UserGroupEntity.class.getSimpleName() + " G, " + GroupMembershipEntity.class.getSimpleName()
+        String queryString = "SELECT DISTINCT G FROM " + UserGroupEntity.class.getSimpleName() + " G, " + GroupMembershipEntity.class.getSimpleName()
                 + " GM WHERE GM." + DBConstants.GroupMembershipTable.CHILD_ID + " = G." + DBConstants.UserGroupTable.GROUP_ID + " AND " +
                 "GM." + DBConstants.GroupMembershipTable.DOMAIN_ID + " = G." + DBConstants.UserGroupTable.DOMAIN_ID + " AND " +
                 "GM." + DBConstants.GroupMembershipTable.DOMAIN_ID+"='"+domainId + "' AND "+

http://git-wip-us.apache.org/repos/asf/airavata/blob/273d074a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/SharingRepository.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/SharingRepository.java b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/SharingRepository.java
index 1237808..a9a6b5d 100644
--- a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/SharingRepository.java
+++ b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/SharingRepository.java
@@ -50,7 +50,7 @@ public class SharingRepository extends AbstractRepository<Sharing, SharingEntity
     }
 
     public List<Sharing> getCascadingPermissionsForEntity(String domainId, String entityId) throws SharingRegistryException {
-        String query = "SELECT p from " + SharingEntity.class.getSimpleName() + " as p";
+        String query = "SELECT DISTINCT p from " + SharingEntity.class.getSimpleName() + " as p";
         query += " WHERE ";
         query += "p." + DBConstants.SharingTable.DOMAIN_ID + " = '" + domainId + "' AND ";
         query += "p." + DBConstants.SharingTable.ENTITY_ID + " = '" + entityId + "' AND ";

http://git-wip-us.apache.org/repos/asf/airavata/blob/273d074a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/UserGroupRepository.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/UserGroupRepository.java b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/UserGroupRepository.java
index c86bb22..778ecde 100644
--- a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/UserGroupRepository.java
+++ b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/UserGroupRepository.java
@@ -40,7 +40,7 @@ public class UserGroupRepository extends AbstractRepository<UserGroup, UserGroup
     }
 
     public List<UserGroup> getAccessibleGroups(String domainId, String entityId, String permissionTypeId) throws SharingRegistryException {
-        String query = "SELECT g from " + UserGroupEntity.class.getSimpleName() + " g, " + SharingEntity.class.getSimpleName() + " s";
+        String query = "SELECT DISTINCT g from " + UserGroupEntity.class.getSimpleName() + " g, " + SharingEntity.class.getSimpleName() + " s";
         query += " WHERE ";
         query += "g." + DBConstants.UserGroupTable.GROUP_ID + " = s." + DBConstants.SharingTable.GROUP_ID + " AND ";
         query += "g." + DBConstants.UserGroupTable.DOMAIN_ID + " = s." + DBConstants.SharingTable.DOMAIN_ID + " AND ";

http://git-wip-us.apache.org/repos/asf/airavata/blob/273d074a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/UserRepository.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/UserRepository.java b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/UserRepository.java
index 6df5d70..8501d94 100644
--- a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/UserRepository.java
+++ b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/UserRepository.java
@@ -41,7 +41,7 @@ public class UserRepository extends AbstractRepository<User, UserEntity, UserPK>
 
 
     public List<User> getAccessibleUsers(String domainId, String entityId, String permissionTypeId) throws SharingRegistryException {
-        String query = "SELECT u from " + UserEntity.class.getSimpleName() + " u, " + SharingEntity.class.getSimpleName() + " s";
+        String query = "SELECT DISTINCT u from " + UserEntity.class.getSimpleName() + " u, " + SharingEntity.class.getSimpleName() + " s";
         query += " WHERE ";
         query += "u." + DBConstants.UserTable.USER_ID + " = s." + DBConstants.SharingTable.GROUP_ID + " AND ";
         query += "u." + DBConstants.UserTable.DOMAIN_ID + " = s." + DBConstants.SharingTable.DOMAIN_ID + " AND ";

http://git-wip-us.apache.org/repos/asf/airavata/blob/273d074a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/utils/DBConstants.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/utils/DBConstants.java b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/utils/DBConstants.java
index 00dd367..b269ce1 100644
--- a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/utils/DBConstants.java
+++ b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/utils/DBConstants.java
@@ -90,6 +90,7 @@ public class DBConstants {
         public static final String CREATED_TIME = "createdTime";
         public static final String UPDATED_TIME = "updatedTime";
         public static final String DOMAIN_ID = "domainId";
+        public static final String ORIGINAL_ENTITY_CREATION_TIME = "originalEntityCreationTime";
     }
 
     public static class SharingTable {

http://git-wip-us.apache.org/repos/asf/airavata/blob/273d074a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/utils/DatabaseCreator.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/utils/DatabaseCreator.java b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/utils/DatabaseCreator.java
index 5aa423c..5fe5e47 100644
--- a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/utils/DatabaseCreator.java
+++ b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/utils/DatabaseCreator.java
@@ -265,9 +265,9 @@ public class DatabaseCreator {
                 logger.info("Script file not found at " + dbscriptName + ". Uses default database script file");
                 DatabaseType databaseType = DatabaseCreator.getDatabaseType(conn);
                 if(databaseType.equals(DatabaseType.derby)){
-                    is = DatabaseCreator.class.getClassLoader().getResourceAsStream("experiment-derby.sql");
+                    is = DatabaseCreator.class.getClassLoader().getResourceAsStream("sharing-registry-derby.sql");
                 }else if(databaseType.equals(DatabaseType.mysql)){
-                    is = DatabaseCreator.class.getClassLoader().getResourceAsStream("experiment-mysql.sql");
+                    is = DatabaseCreator.class.getClassLoader().getResourceAsStream("sharing-registry-mysql.sql");
                 }
             }
             reader = new BufferedReader(new InputStreamReader(is));

http://git-wip-us.apache.org/repos/asf/airavata/blob/273d074a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/server/ServerMain.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/server/ServerMain.java b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/server/ServerMain.java
index 54e1722..a34f8c8 100644
--- a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/server/ServerMain.java
+++ b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/server/ServerMain.java
@@ -55,15 +55,19 @@ public class ServerMain {
             serverStartedFile.deleteOnExit();
             new RandomAccessFile(serverStartedFile, "rw").getChannel().lock();
         } catch (FileNotFoundException e) {
-            logger.error(e.getMessage(), e);
+            logger.warn(e.getMessage(), e);
         } catch (IOException e) {
-            logger.error(e.getMessage(), e);
+            logger.warn(e.getMessage(), e);
         }
     }
 
     private static String getServerStartedFileName() {
-        return new File(new File(System.getenv("" +
-                "SHARING_REGISTRY_HOME"), "bin"), serverStartedFileNamePrefix + "_" + Integer.toString(serverPID)).toString();
+        String SHARING_REGISTRY_HOME = System.getenv("" +"SHARING_REGISTRY_HOME");
+        if(SHARING_REGISTRY_HOME==null)
+            SHARING_REGISTRY_HOME = "/tmp";
+        else
+            SHARING_REGISTRY_HOME = SHARING_REGISTRY_HOME + "bin";
+        return new File(SHARING_REGISTRY_HOME, serverStartedFileNamePrefix + "_" + Integer.toString(serverPID)).toString();
     }
 
     private static int getPID() {

http://git-wip-us.apache.org/repos/asf/airavata/blob/273d074a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/server/SharingRegistryServerHandler.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/server/SharingRegistryServerHandler.java b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/server/SharingRegistryServerHandler.java
index 5dc3dbc..4f88e16 100644
--- a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/server/SharingRegistryServerHandler.java
+++ b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/server/SharingRegistryServerHandler.java
@@ -67,6 +67,7 @@ public class SharingRegistryServerHandler implements SharingRegistryService.Ifac
      */
     @Override
     public String createDomain(Domain domain) throws SharingRegistryException, TException {
+        domain.setDomainId(domain.name);
         if(domainRepository.get(domain.domainId) != null)
             throw new SharingRegistryException("There exist domain with given domain id");
 
@@ -76,7 +77,7 @@ public class SharingRegistryServerHandler implements SharingRegistryService.Ifac
 
         //create the global permission for the domain
         PermissionType permissionType = new PermissionType();
-        permissionType.setPermissionTypeId(domain.domainId+":"+ OWNER_PERMISSION_NAME);
+        permissionType.setPermissionTypeId(OWNER_PERMISSION_NAME);
         permissionType.setDomainId(domain.domainId);
         permissionType.setName(OWNER_PERMISSION_NAME);
         permissionType.setDescription("GLOBAL permission to " + domain.domainId);
@@ -118,7 +119,7 @@ public class SharingRegistryServerHandler implements SharingRegistryService.Ifac
      * *
      */
     @Override
-    public String registerUser(User user) throws SharingRegistryException, TException {
+    public String createUser(User user) throws SharingRegistryException, TException {
         UserPK userPK = new UserPK();
         userPK.setUserId(user.getUserId());
         userPK.setDomainId(user.domainId);
@@ -137,7 +138,7 @@ public class SharingRegistryServerHandler implements SharingRegistryService.Ifac
         userGroup.setOwnerId(user.userId);
         userGroup.setGroupType(GroupType.USER_LEVEL_GROUP);
         userGroup.setGroupCardinality(GroupCardinality.SINGLE_USER);
-        createGroup(userGroup);
+        userGroupRepository.create(userGroup);
 
         return user.userId;
     }
@@ -203,10 +204,13 @@ public class SharingRegistryServerHandler implements SharingRegistryService.Ifac
         userGroupPK.setDomainId(group.domainId);
         if(userGroupRepository.get(userGroupPK) != null)
             throw new SharingRegistryException("There exist group with given group id");
-
+        //Client created groups are always of type MULTI_USER
+        group.setGroupCardinality(GroupCardinality.MULTI_USER);
         group.setCreatedTime(System.currentTimeMillis());
         group.setUpdatedTime(System.currentTimeMillis());
         userGroupRepository.create(group);
+
+        addUsersToGroup(group.domainId, Arrays.asList(group.ownerId), group.groupId);
         return group.groupId;
     }
 
@@ -217,8 +221,14 @@ public class SharingRegistryServerHandler implements SharingRegistryService.Ifac
         userGroupPK.setGroupId(group.groupId);
         userGroupPK.setDomainId(group.domainId);
         UserGroup oldGroup = userGroupRepository.get(userGroupPK);
+        //Client created groups are always of type MULTI_USER
+        group.setGroupCardinality(GroupCardinality.MULTI_USER);
         group.setCreatedTime(oldGroup.createdTime);
         group = getUpdatedObject(oldGroup, group);
+
+        if(!group.ownerId.equals(oldGroup.ownerId))
+            throw new SharingRegistryException("Group owner cannot be changed");
+
         userGroupRepository.update(group);
         return true;
     }
@@ -427,7 +437,7 @@ public class SharingRegistryServerHandler implements SharingRegistryService.Ifac
      * *
      */
     @Override
-    public String registerEntity(Entity entity) throws SharingRegistryException, TException {
+    public String createEntity(Entity entity) throws SharingRegistryException, TException {
         EntityPK entityPK = new EntityPK();
         entityPK.setDomainId(entity.domainId);
         entityPK.setEntityId(entity.entityId);
@@ -444,11 +454,14 @@ public class SharingRegistryServerHandler implements SharingRegistryService.Ifac
             user.setDomainId(entity.domainId);
             user.setUserName(user.userId.split("@")[0]);
 
-            registerUser(user);
+            createUser(user);
         }
-
         entity.setCreatedTime(System.currentTimeMillis());
         entity.setUpdatedTime(System.currentTimeMillis());
+
+        if(entity.originalEntityCreationTime==0){
+            entity.originalEntityCreationTime = entity.createdTime;
+        }
         entityRepository.create(entity);
 
         //Assigning global permission for the owner

http://git-wip-us.apache.org/repos/asf/airavata/blob/273d074a/modules/sharing-registry/sharing-registry-server/src/main/resources/sharing-registry-derby.sql
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-server/src/main/resources/sharing-registry-derby.sql b/modules/sharing-registry/sharing-registry-server/src/main/resources/sharing-registry-derby.sql
index 0b5167a..923894e 100644
--- a/modules/sharing-registry/sharing-registry-server/src/main/resources/sharing-registry-derby.sql
+++ b/modules/sharing-registry/sharing-registry-server/src/main/resources/sharing-registry-derby.sql
@@ -101,6 +101,7 @@ CREATE TABLE ENTITY (
   DESCRIPTION VARCHAR(255),
   BINARY_DATA BLOB,
   FULL_TEXT CLOB,
+  ORIGINAL_ENTITY_CREATION_TIME BIGINT NOT NULL,
   CREATED_TIME BIGINT NOT NULL,
   UPDATED_TIME BIGINT NOT NULL,
   PRIMARY KEY (ENTITY_ID, DOMAIN_ID),

http://git-wip-us.apache.org/repos/asf/airavata/blob/273d074a/modules/sharing-registry/sharing-registry-server/src/main/resources/sharing-registry-mysql.sql
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-server/src/main/resources/sharing-registry-mysql.sql b/modules/sharing-registry/sharing-registry-server/src/main/resources/sharing-registry-mysql.sql
index ce7a9bf..9bfe64a 100644
--- a/modules/sharing-registry/sharing-registry-server/src/main/resources/sharing-registry-mysql.sql
+++ b/modules/sharing-registry/sharing-registry-server/src/main/resources/sharing-registry-mysql.sql
@@ -101,6 +101,7 @@ CREATE TABLE ENTITY (
   DESCRIPTION VARCHAR(255),
   BINARY_DATA BLOB,
   FULL_TEXT TEXT,
+  ORIGINAL_ENTITY_CREATION_TIME BIGINT NOT NULL,
   CREATED_TIME BIGINT NOT NULL,
   UPDATED_TIME BIGINT NOT NULL,
   PRIMARY KEY (ENTITY_ID, DOMAIN_ID),

http://git-wip-us.apache.org/repos/asf/airavata/blob/273d074a/modules/sharing-registry/sharing-registry-server/src/test/java/org/apache/airavata/sharing/registry/SharingRegistryServerHandlerTest.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-server/src/test/java/org/apache/airavata/sharing/registry/SharingRegistryServerHandlerTest.java b/modules/sharing-registry/sharing-registry-server/src/test/java/org/apache/airavata/sharing/registry/SharingRegistryServerHandlerTest.java
index 499fc88..d11e744 100644
--- a/modules/sharing-registry/sharing-registry-server/src/test/java/org/apache/airavata/sharing/registry/SharingRegistryServerHandlerTest.java
+++ b/modules/sharing-registry/sharing-registry-server/src/test/java/org/apache/airavata/sharing/registry/SharingRegistryServerHandlerTest.java
@@ -71,7 +71,7 @@ public class SharingRegistryServerHandlerTest {
         user1.setCreatedTime(System.currentTimeMillis());
         user1.setUpdatedTime(System.currentTimeMillis());
 
-        Assert.assertNotNull(sharingRegistryServerHandler.registerUser(user1));
+        Assert.assertNotNull(sharingRegistryServerHandler.createUser(user1));
 
         User user2 = new User();
         String userName2 = "test-user-2." + System.currentTimeMillis();
@@ -82,7 +82,7 @@ public class SharingRegistryServerHandlerTest {
         user2.setCreatedTime(System.currentTimeMillis());
         user2.setUpdatedTime(System.currentTimeMillis());
 
-        Assert.assertNotNull(sharingRegistryServerHandler.registerUser(user2));
+        Assert.assertNotNull(sharingRegistryServerHandler.createUser(user2));
 
         User user3 = new User();
         String userName3 = "test-user-3." + System.currentTimeMillis();
@@ -93,7 +93,7 @@ public class SharingRegistryServerHandlerTest {
         user3.setCreatedTime(System.currentTimeMillis());
         user3.setUpdatedTime(System.currentTimeMillis());
 
-        Assert.assertNotNull(sharingRegistryServerHandler.registerUser(user3));
+        Assert.assertNotNull(sharingRegistryServerHandler.createUser(user3));
 
         Assert.assertTrue(sharingRegistryServerHandler.getUsers(domainId, 0, 10).size() > 0);
 
@@ -205,7 +205,7 @@ public class SharingRegistryServerHandlerTest {
         entity1.setCreatedTime(System.currentTimeMillis());
         entity1.setUpdatedTime(System.currentTimeMillis());
 
-        String entityId1 = sharingRegistryServerHandler.registerEntity(entity1);
+        String entityId1 = sharingRegistryServerHandler.createEntity(entity1);
         Assert.assertNotNull(entityId1);
 
         Entity entity2 = new Entity();
@@ -220,7 +220,7 @@ public class SharingRegistryServerHandlerTest {
         entity2.setCreatedTime(System.currentTimeMillis());
         entity2.setUpdatedTime(System.currentTimeMillis());
 
-        String entityId2 = sharingRegistryServerHandler.registerEntity(entity2);
+        String entityId2 = sharingRegistryServerHandler.createEntity(entity2);
         Assert.assertNotNull(entityId2);
 
         Entity entity3 = new Entity();
@@ -235,7 +235,7 @@ public class SharingRegistryServerHandlerTest {
         entity3.setCreatedTime(System.currentTimeMillis());
         entity3.setUpdatedTime(System.currentTimeMillis());
 
-        String entityId3 = sharingRegistryServerHandler.registerEntity(entity3);
+        String entityId3 = sharingRegistryServerHandler.createEntity(entity3);
         Assert.assertNotNull(entityId3);
 
         sharingRegistryServerHandler.shareEntityWithUsers(domainId, entityId1, Arrays.asList(userId2), permissionTypeId1, true);
@@ -253,7 +253,7 @@ public class SharingRegistryServerHandlerTest {
         entity4.setCreatedTime(System.currentTimeMillis());
         entity4.setUpdatedTime(System.currentTimeMillis());
 
-        String entityId4 = sharingRegistryServerHandler.registerEntity(entity4);
+        String entityId4 = sharingRegistryServerHandler.createEntity(entity4);
         Assert.assertNotNull(entityId4);
 
         Assert.assertTrue(sharingRegistryServerHandler.userHasAccess(domainId, userId3, entityId4, permissionTypeId1));

http://git-wip-us.apache.org/repos/asf/airavata/blob/273d074a/modules/sharing-registry/sharing-registry-server/src/test/java/org/apache/airavata/sharing/registry/SharingRegistryServiceTest.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-server/src/test/java/org/apache/airavata/sharing/registry/SharingRegistryServiceTest.java b/modules/sharing-registry/sharing-registry-server/src/test/java/org/apache/airavata/sharing/registry/SharingRegistryServiceTest.java
index 3357eb5..c05924a 100644
--- a/modules/sharing-registry/sharing-registry-server/src/test/java/org/apache/airavata/sharing/registry/SharingRegistryServiceTest.java
+++ b/modules/sharing-registry/sharing-registry-server/src/test/java/org/apache/airavata/sharing/registry/SharingRegistryServiceTest.java
@@ -20,27 +20,36 @@
 */
 package org.apache.airavata.sharing.registry;
 
-import org.apache.airavata.sharing.registry.models.Domain;
-import org.apache.airavata.sharing.registry.models.User;
+import org.apache.airavata.sharing.registry.models.*;
+import org.apache.airavata.sharing.registry.server.ServerMain;
 import org.apache.airavata.sharing.registry.service.cpi.SharingRegistryService;
 import org.apache.thrift.TException;
 import org.apache.thrift.protocol.TBinaryProtocol;
 import org.apache.thrift.protocol.TProtocol;
 import org.apache.thrift.transport.TSocket;
 import org.apache.thrift.transport.TTransport;
-import org.junit.Ignore;
+import org.junit.BeforeClass;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+
 public class SharingRegistryServiceTest {
     private final static Logger logger = LoggerFactory.getLogger(SharingRegistryServiceTest.class);
 
+    @BeforeClass
+    public static void setUp() throws InterruptedException {
+        ServerMain serverMain = new ServerMain();
+        serverMain.main(new String[]{});
+        Thread.sleep(1000*2);
+    }
+
 
     @Test
-    @Ignore("Test is only for demonstration purposes")
     public void test() throws TException {
-        String serverHost = "gw56.iu.xsede.org";
+        String serverHost = "localhost";
         int serverPort = 7878;
 
         TTransport transport = new TSocket(serverHost, serverPort);
@@ -56,29 +65,213 @@ public class SharingRegistryServiceTest {
 
         String domainId = sharingServiceClient.createDomain(domain);
 
-        User user = new User();
-        String userName = "test-user";
-        String userId1 =  userName + "@" + domainId;
+        User user1 = new User();
+        //required
+        user1.setUserId("test-user-1");
+        //required
+        user1.setUserName("test-user-1");
+        //required
+        user1.setDomainId(domainId);
+        //required
+        user1.setFirstName("John");
+        //required
+        user1.setLastName("Doe");
+        //required
+        user1.setEmail("john.doe@abc.com");
+        //optional - this should be bytes of the users image icon
+        //byte[] icon1 = new byte[10];
+        //user1.setIcon(icon1);
+
+        sharingServiceClient.createUser(user1);
+
+        User user2 = new User();
+        //required
+        user2.setUserId("test-user-2");
+        //required
+        user2.setUserName("test-user-2");
+        //required
+        user2.setDomainId(domainId);
+        //required
+        user2.setFirstName("John");
+        //required
+        user2.setLastName("Doe");
+        //required
+        user2.setEmail("john.doe@abc.com");
+        //optional - this should be bytes of the users image icon
+        //byte[] icon2 = new byte[10];
+        //user2.setIcon(icon2);
+
+        sharingServiceClient.createUser(user2);
+
+        User user3 = new User();
         //required
-        user.setUserId(userId1);
+        user3.setUserId("test-user-3");
         //required
-        user.setUserName(userName);
+        user3.setUserName("test-user-3");
         //required
-        user.setDomainId(domainId);
+        user3.setDomainId(domainId);
         //required
-        user.setFirstName("John");
+        user3.setFirstName("John");
         //required
-        user.setLastName("Doe");
+        user3.setLastName("Doe");
         //required
-        user.setEmail("john.doe@abc.com");
+        user3.setEmail("john.doe@abc.com");
         //optional - this should be bytes of the users image icon
-        byte[] icon = new byte[10];
-        user.setIcon(icon);
+        //byte[] icon3 = new byte[10];
+        //user3.setIcon(icon3);
+
+        sharingServiceClient.createUser(user3);
+
+        UserGroup userGroup1 = new UserGroup();
+        //required
+        userGroup1.setGroupId("test-group-1");
+        //required
+        userGroup1.setDomainId(domainId);
+        //required
+        userGroup1.setName("test-group-1");
+        //optional
+        userGroup1.setDescription("test group description");
+        //required
+        userGroup1.setOwnerId("test-user-1");
+        //required
+        userGroup1.setGroupType(GroupType.USER_LEVEL_GROUP);
+
+        sharingServiceClient.createGroup(userGroup1);
+
+        UserGroup userGroup2 = new UserGroup();
+        //required
+        userGroup2.setGroupId("test-group-2");
+        //required
+        userGroup2.setDomainId(domainId);
+        //required
+        userGroup2.setName("test-group-2");
+        //optional
+        userGroup2.setDescription("test group description");
+        //required
+        userGroup2.setOwnerId("test-user-2");
+        //required
+        userGroup2.setGroupType(GroupType.USER_LEVEL_GROUP);
+
+        sharingServiceClient.createGroup(userGroup2);
+
+        sharingServiceClient.addUsersToGroup(domainId, Arrays.asList("test-user-3"), "test-group-2");
+
+        sharingServiceClient.addChildGroupsToParentGroup(domainId, Arrays.asList("test-group-2"), "test-group-1");
+
+        PermissionType permissionType1 = new PermissionType();
+        //required
+        permissionType1.setPermissionTypeId("READ");
+        //required
+        permissionType1.setDomainId(domainId);
+        //required
+        permissionType1.setName("READ");
+        //optional
+        permissionType1.setDescription("READ description");
+        sharingServiceClient.createPermissionType(permissionType1);
+
+        PermissionType permissionType2 = new PermissionType();
+        permissionType2.setPermissionTypeId("WRITE");
+        permissionType2.setDomainId(domainId);
+        permissionType2.setName("WRITE");
+        permissionType2.setDescription("WRITE description");
+        sharingServiceClient.createPermissionType(permissionType2);
+
+        EntityType entityType1 = new EntityType();
+        //required
+        entityType1.setEntityTypeId("PROJECT");
+        //required
+        entityType1.setDomainId(domainId);
+        //required
+        entityType1.setName("PROJECT");
+        //optional
+        entityType1.setDescription("PROJECT entity type description");
+        sharingServiceClient.createEntityType(entityType1);
+
+        EntityType entityType2 = new EntityType();
+        entityType2.setEntityTypeId("EXPERIMENT");
+        entityType2.setDomainId(domainId);
+        entityType2.setName("EXPERIMENT");
+        entityType2.setDescription("EXPERIMENT entity type");
+        sharingServiceClient.createEntityType(entityType2);
+
+
+        //Creating entities
+        Entity entity1 = new Entity();
+        //required
+        entity1.setEntityId("test-project-1");
+        //required
+        entity1.setDomainId(domainId);
+        //required
+        entity1.setEntityTypeId("PROJECT");
+        //required
+        entity1.setOwnerId("test-user-1");
+        //required
+        entity1.setName("test-project-1");
+        //optional
+        entity1.setDescription("test project 1 description");
+        //optional
+        entity1.setFullText("test project 1 stampede gaussian seagrid");
+        //optional - If not set this will be default to current system time
+        entity1.setOriginalEntityCreationTime(System.currentTimeMillis());
+        sharingServiceClient.createEntity(entity1);
+
+        Entity entity2 = new Entity();
+        entity2.setEntityId("test-experiment-1");
+        entity2.setDomainId(domainId);
+        entity2.setEntityTypeId("EXPERIMENT");
+        entity2.setOwnerId("test-user-1");
+        entity2.setName("test-experiment-1");
+        entity2.setDescription("test experiment 1 description");
+        entity2.setParentEntityId("test-project-1");
+        entity2.setFullText("test experiment 1 benzene");
+        sharingServiceClient.createEntity(entity2);
+
+        Entity entity3 = new Entity();
+        entity3.setEntityId("test-experiment-2");
+        entity3.setDomainId(domainId);
+        entity3.setEntityTypeId("EXPERIMENT");
+        entity3.setOwnerId("test-user-1");
+        entity3.setName("test-experiment-2");
+        entity3.setDescription("test experiment 2 description");
+        entity3.setParentEntityId("test-project-1");
+        entity3.setFullText("test experiment 1 3-methyl 1-butanol");
+        sharingServiceClient.createEntity(entity3);
+
+        sharingServiceClient.shareEntityWithUsers(domainId, "test-project-1", Arrays.asList("test-user-2"), "WRITE", true);
+        sharingServiceClient.shareEntityWithGroups(domainId, "test-experiment-2", Arrays.asList("test-group-2"), "READ", true);
+
+        //true
+        System.out.println(sharingServiceClient.userHasAccess(domainId, "test-user-2", "test-project-1", "WRITE"));
+        //true
+        System.out.println(sharingServiceClient.userHasAccess(domainId, "test-user-2", "test-experiment-1", "WRITE"));
+        //true
+        System.out.println(sharingServiceClient.userHasAccess(domainId, "test-user-2", "test-experiment-2", "WRITE"));
+
+        //false
+        System.out.println(sharingServiceClient.userHasAccess(domainId, "test-user-2", "test-experiment-1", "READ"));
+        //true
+        System.out.println(sharingServiceClient.userHasAccess(domainId, "test-user-2", "test-experiment-2", "READ"));
+
+        //false
+        System.out.println(sharingServiceClient.userHasAccess(domainId, "test-user-3", "test-project-1", "READ"));
+        //true
+        System.out.println(sharingServiceClient.userHasAccess(domainId, "test-user-3", "test-experiment-2", "READ"));
+        //false
+        System.out.println(sharingServiceClient.userHasAccess(domainId, "test-user-3", "test-experiment-2", "WRITE"));
+
+        ArrayList<SearchCriteria> filters = new ArrayList<>();
+        SearchCriteria searchCriteria = new SearchCriteria();
+        searchCriteria.setSearchCondition(SearchCondition.LIKE);
+        searchCriteria.setValue("experiment");
+        searchCriteria.setSearchField(EntitySearchField.NAME);
+        filters.add(searchCriteria);
 
-        //can be manually set. otherwise will be set to the current time by the system
-        user.setCreatedTime(System.currentTimeMillis());
-        user.setUpdatedTime(System.currentTimeMillis());
+        searchCriteria = new SearchCriteria();
+        searchCriteria.setSearchCondition(SearchCondition.EQUAL);
+        searchCriteria.setValue("READ");
+        searchCriteria.setSearchField(EntitySearchField.PERMISSION_TYPE_ID);
+        filters.add(searchCriteria);
 
-        sharingServiceClient.registerUser(user);
+        System.out.println(sharingServiceClient.searchEntities(domainId, "test-user-2", "EXPERIMENT", filters, 0, -1).size());
     }
 }
\ No newline at end of file


[2/3] airavata git commit: updating getting started guide and fixing some sharing issues

Posted by sc...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/273d074a/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/Entity.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/Entity.java b/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/Entity.java
index 7fc932e..c7bc3e1 100644
--- a/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/Entity.java
+++ b/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/Entity.java
@@ -45,8 +45,10 @@ import org.slf4j.LoggerFactory;
  * <li>description : Short description for the entity</li>
  * <li>binaryData : Any information stored in binary format</li>
  * <li>fullText : A string which will be considered for full text search</li>
- * <li>createdTime : If client provides this value then the system will use it if not the current time will be set</li>
- * <li>updatedTime : If client provides this value then the system will use it if not the current time will be set</li>
+ * <li><b>originalEntityCreationTime</b> : When registering old records what is the original entity creation time. If not
+ * set will be default to current time</li>
+ * <li>createdTime : Will be set by the system</li>
+ * <li>updatedTime : Will be set by the system</li>
  * 
  */
 @Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
@@ -62,8 +64,9 @@ public class Entity implements org.apache.thrift.TBase<Entity, Entity._Fields>,
   private static final org.apache.thrift.protocol.TField DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("description", org.apache.thrift.protocol.TType.STRING, (short)7);
   private static final org.apache.thrift.protocol.TField BINARY_DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("binaryData", org.apache.thrift.protocol.TType.STRING, (short)8);
   private static final org.apache.thrift.protocol.TField FULL_TEXT_FIELD_DESC = new org.apache.thrift.protocol.TField("fullText", org.apache.thrift.protocol.TType.STRING, (short)9);
-  private static final org.apache.thrift.protocol.TField CREATED_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("createdTime", org.apache.thrift.protocol.TType.I64, (short)10);
-  private static final org.apache.thrift.protocol.TField UPDATED_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("updatedTime", org.apache.thrift.protocol.TType.I64, (short)11);
+  private static final org.apache.thrift.protocol.TField ORIGINAL_ENTITY_CREATION_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("originalEntityCreationTime", org.apache.thrift.protocol.TType.I64, (short)10);
+  private static final org.apache.thrift.protocol.TField CREATED_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("createdTime", org.apache.thrift.protocol.TType.I64, (short)11);
+  private static final org.apache.thrift.protocol.TField UPDATED_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("updatedTime", org.apache.thrift.protocol.TType.I64, (short)12);
 
   private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
   static {
@@ -80,6 +83,7 @@ public class Entity implements org.apache.thrift.TBase<Entity, Entity._Fields>,
   public String description; // optional
   public ByteBuffer binaryData; // optional
   public String fullText; // optional
+  public long originalEntityCreationTime; // optional
   public long createdTime; // optional
   public long updatedTime; // optional
 
@@ -94,8 +98,9 @@ public class Entity implements org.apache.thrift.TBase<Entity, Entity._Fields>,
     DESCRIPTION((short)7, "description"),
     BINARY_DATA((short)8, "binaryData"),
     FULL_TEXT((short)9, "fullText"),
-    CREATED_TIME((short)10, "createdTime"),
-    UPDATED_TIME((short)11, "updatedTime");
+    ORIGINAL_ENTITY_CREATION_TIME((short)10, "originalEntityCreationTime"),
+    CREATED_TIME((short)11, "createdTime"),
+    UPDATED_TIME((short)12, "updatedTime");
 
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -128,9 +133,11 @@ public class Entity implements org.apache.thrift.TBase<Entity, Entity._Fields>,
           return BINARY_DATA;
         case 9: // FULL_TEXT
           return FULL_TEXT;
-        case 10: // CREATED_TIME
+        case 10: // ORIGINAL_ENTITY_CREATION_TIME
+          return ORIGINAL_ENTITY_CREATION_TIME;
+        case 11: // CREATED_TIME
           return CREATED_TIME;
-        case 11: // UPDATED_TIME
+        case 12: // UPDATED_TIME
           return UPDATED_TIME;
         default:
           return null;
@@ -172,10 +179,11 @@ public class Entity implements org.apache.thrift.TBase<Entity, Entity._Fields>,
   }
 
   // isset id assignments
-  private static final int __CREATEDTIME_ISSET_ID = 0;
-  private static final int __UPDATEDTIME_ISSET_ID = 1;
+  private static final int __ORIGINALENTITYCREATIONTIME_ISSET_ID = 0;
+  private static final int __CREATEDTIME_ISSET_ID = 1;
+  private static final int __UPDATEDTIME_ISSET_ID = 2;
   private byte __isset_bitfield = 0;
-  private static final _Fields optionals[] = {_Fields.ENTITY_ID,_Fields.DOMAIN_ID,_Fields.ENTITY_TYPE_ID,_Fields.OWNER_ID,_Fields.PARENT_ENTITY_ID,_Fields.NAME,_Fields.DESCRIPTION,_Fields.BINARY_DATA,_Fields.FULL_TEXT,_Fields.CREATED_TIME,_Fields.UPDATED_TIME};
+  private static final _Fields optionals[] = {_Fields.ENTITY_ID,_Fields.DOMAIN_ID,_Fields.ENTITY_TYPE_ID,_Fields.OWNER_ID,_Fields.PARENT_ENTITY_ID,_Fields.NAME,_Fields.DESCRIPTION,_Fields.BINARY_DATA,_Fields.FULL_TEXT,_Fields.ORIGINAL_ENTITY_CREATION_TIME,_Fields.CREATED_TIME,_Fields.UPDATED_TIME};
   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
@@ -197,6 +205,8 @@ public class Entity implements org.apache.thrift.TBase<Entity, Entity._Fields>,
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , true)));
     tmpMap.put(_Fields.FULL_TEXT, new org.apache.thrift.meta_data.FieldMetaData("fullText", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.ORIGINAL_ENTITY_CREATION_TIME, new org.apache.thrift.meta_data.FieldMetaData("originalEntityCreationTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
     tmpMap.put(_Fields.CREATED_TIME, new org.apache.thrift.meta_data.FieldMetaData("createdTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
     tmpMap.put(_Fields.UPDATED_TIME, new org.apache.thrift.meta_data.FieldMetaData("updatedTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
@@ -240,6 +250,7 @@ public class Entity implements org.apache.thrift.TBase<Entity, Entity._Fields>,
     if (other.isSetFullText()) {
       this.fullText = other.fullText;
     }
+    this.originalEntityCreationTime = other.originalEntityCreationTime;
     this.createdTime = other.createdTime;
     this.updatedTime = other.updatedTime;
   }
@@ -259,6 +270,8 @@ public class Entity implements org.apache.thrift.TBase<Entity, Entity._Fields>,
     this.description = null;
     this.binaryData = null;
     this.fullText = null;
+    setOriginalEntityCreationTimeIsSet(false);
+    this.originalEntityCreationTime = 0;
     setCreatedTimeIsSet(false);
     this.createdTime = 0;
     setUpdatedTimeIsSet(false);
@@ -491,6 +504,29 @@ public class Entity implements org.apache.thrift.TBase<Entity, Entity._Fields>,
     }
   }
 
+  public long getOriginalEntityCreationTime() {
+    return this.originalEntityCreationTime;
+  }
+
+  public Entity setOriginalEntityCreationTime(long originalEntityCreationTime) {
+    this.originalEntityCreationTime = originalEntityCreationTime;
+    setOriginalEntityCreationTimeIsSet(true);
+    return this;
+  }
+
+  public void unsetOriginalEntityCreationTime() {
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ORIGINALENTITYCREATIONTIME_ISSET_ID);
+  }
+
+  /** Returns true if field originalEntityCreationTime is set (has been assigned a value) and false otherwise */
+  public boolean isSetOriginalEntityCreationTime() {
+    return EncodingUtils.testBit(__isset_bitfield, __ORIGINALENTITYCREATIONTIME_ISSET_ID);
+  }
+
+  public void setOriginalEntityCreationTimeIsSet(boolean value) {
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ORIGINALENTITYCREATIONTIME_ISSET_ID, value);
+  }
+
   public long getCreatedTime() {
     return this.createdTime;
   }
@@ -611,6 +647,14 @@ public class Entity implements org.apache.thrift.TBase<Entity, Entity._Fields>,
       }
       break;
 
+    case ORIGINAL_ENTITY_CREATION_TIME:
+      if (value == null) {
+        unsetOriginalEntityCreationTime();
+      } else {
+        setOriginalEntityCreationTime((Long)value);
+      }
+      break;
+
     case CREATED_TIME:
       if (value == null) {
         unsetCreatedTime();
@@ -659,6 +703,9 @@ public class Entity implements org.apache.thrift.TBase<Entity, Entity._Fields>,
     case FULL_TEXT:
       return getFullText();
 
+    case ORIGINAL_ENTITY_CREATION_TIME:
+      return getOriginalEntityCreationTime();
+
     case CREATED_TIME:
       return getCreatedTime();
 
@@ -694,6 +741,8 @@ public class Entity implements org.apache.thrift.TBase<Entity, Entity._Fields>,
       return isSetBinaryData();
     case FULL_TEXT:
       return isSetFullText();
+    case ORIGINAL_ENTITY_CREATION_TIME:
+      return isSetOriginalEntityCreationTime();
     case CREATED_TIME:
       return isSetCreatedTime();
     case UPDATED_TIME:
@@ -796,6 +845,15 @@ public class Entity implements org.apache.thrift.TBase<Entity, Entity._Fields>,
         return false;
     }
 
+    boolean this_present_originalEntityCreationTime = true && this.isSetOriginalEntityCreationTime();
+    boolean that_present_originalEntityCreationTime = true && that.isSetOriginalEntityCreationTime();
+    if (this_present_originalEntityCreationTime || that_present_originalEntityCreationTime) {
+      if (!(this_present_originalEntityCreationTime && that_present_originalEntityCreationTime))
+        return false;
+      if (this.originalEntityCreationTime != that.originalEntityCreationTime)
+        return false;
+    }
+
     boolean this_present_createdTime = true && this.isSetCreatedTime();
     boolean that_present_createdTime = true && that.isSetCreatedTime();
     if (this_present_createdTime || that_present_createdTime) {
@@ -866,6 +924,11 @@ public class Entity implements org.apache.thrift.TBase<Entity, Entity._Fields>,
     if (present_fullText)
       list.add(fullText);
 
+    boolean present_originalEntityCreationTime = true && (isSetOriginalEntityCreationTime());
+    list.add(present_originalEntityCreationTime);
+    if (present_originalEntityCreationTime)
+      list.add(originalEntityCreationTime);
+
     boolean present_createdTime = true && (isSetCreatedTime());
     list.add(present_createdTime);
     if (present_createdTime)
@@ -977,6 +1040,16 @@ public class Entity implements org.apache.thrift.TBase<Entity, Entity._Fields>,
         return lastComparison;
       }
     }
+    lastComparison = Boolean.valueOf(isSetOriginalEntityCreationTime()).compareTo(other.isSetOriginalEntityCreationTime());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetOriginalEntityCreationTime()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.originalEntityCreationTime, other.originalEntityCreationTime);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
     lastComparison = Boolean.valueOf(isSetCreatedTime()).compareTo(other.isSetCreatedTime());
     if (lastComparison != 0) {
       return lastComparison;
@@ -1106,6 +1179,12 @@ public class Entity implements org.apache.thrift.TBase<Entity, Entity._Fields>,
       }
       first = false;
     }
+    if (isSetOriginalEntityCreationTime()) {
+      if (!first) sb.append(", ");
+      sb.append("originalEntityCreationTime:");
+      sb.append(this.originalEntityCreationTime);
+      first = false;
+    }
     if (isSetCreatedTime()) {
       if (!first) sb.append(", ");
       sb.append("createdTime:");
@@ -1235,7 +1314,15 @@ public class Entity implements org.apache.thrift.TBase<Entity, Entity._Fields>,
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
             }
             break;
-          case 10: // CREATED_TIME
+          case 10: // ORIGINAL_ENTITY_CREATION_TIME
+            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+              struct.originalEntityCreationTime = iprot.readI64();
+              struct.setOriginalEntityCreationTimeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 11: // CREATED_TIME
             if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
               struct.createdTime = iprot.readI64();
               struct.setCreatedTimeIsSet(true);
@@ -1243,7 +1330,7 @@ public class Entity implements org.apache.thrift.TBase<Entity, Entity._Fields>,
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
             }
             break;
-          case 11: // UPDATED_TIME
+          case 12: // UPDATED_TIME
             if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
               struct.updatedTime = iprot.readI64();
               struct.setUpdatedTimeIsSet(true);
@@ -1329,6 +1416,11 @@ public class Entity implements org.apache.thrift.TBase<Entity, Entity._Fields>,
           oprot.writeFieldEnd();
         }
       }
+      if (struct.isSetOriginalEntityCreationTime()) {
+        oprot.writeFieldBegin(ORIGINAL_ENTITY_CREATION_TIME_FIELD_DESC);
+        oprot.writeI64(struct.originalEntityCreationTime);
+        oprot.writeFieldEnd();
+      }
       if (struct.isSetCreatedTime()) {
         oprot.writeFieldBegin(CREATED_TIME_FIELD_DESC);
         oprot.writeI64(struct.createdTime);
@@ -1384,13 +1476,16 @@ public class Entity implements org.apache.thrift.TBase<Entity, Entity._Fields>,
       if (struct.isSetFullText()) {
         optionals.set(8);
       }
-      if (struct.isSetCreatedTime()) {
+      if (struct.isSetOriginalEntityCreationTime()) {
         optionals.set(9);
       }
-      if (struct.isSetUpdatedTime()) {
+      if (struct.isSetCreatedTime()) {
         optionals.set(10);
       }
-      oprot.writeBitSet(optionals, 11);
+      if (struct.isSetUpdatedTime()) {
+        optionals.set(11);
+      }
+      oprot.writeBitSet(optionals, 12);
       if (struct.isSetEntityId()) {
         oprot.writeString(struct.entityId);
       }
@@ -1418,6 +1513,9 @@ public class Entity implements org.apache.thrift.TBase<Entity, Entity._Fields>,
       if (struct.isSetFullText()) {
         oprot.writeString(struct.fullText);
       }
+      if (struct.isSetOriginalEntityCreationTime()) {
+        oprot.writeI64(struct.originalEntityCreationTime);
+      }
       if (struct.isSetCreatedTime()) {
         oprot.writeI64(struct.createdTime);
       }
@@ -1429,7 +1527,7 @@ public class Entity implements org.apache.thrift.TBase<Entity, Entity._Fields>,
     @Override
     public void read(org.apache.thrift.protocol.TProtocol prot, Entity struct) throws org.apache.thrift.TException {
       TTupleProtocol iprot = (TTupleProtocol) prot;
-      BitSet incoming = iprot.readBitSet(11);
+      BitSet incoming = iprot.readBitSet(12);
       if (incoming.get(0)) {
         struct.entityId = iprot.readString();
         struct.setEntityIdIsSet(true);
@@ -1467,10 +1565,14 @@ public class Entity implements org.apache.thrift.TBase<Entity, Entity._Fields>,
         struct.setFullTextIsSet(true);
       }
       if (incoming.get(9)) {
+        struct.originalEntityCreationTime = iprot.readI64();
+        struct.setOriginalEntityCreationTimeIsSet(true);
+      }
+      if (incoming.get(10)) {
         struct.createdTime = iprot.readI64();
         struct.setCreatedTimeIsSet(true);
       }
-      if (incoming.get(10)) {
+      if (incoming.get(11)) {
         struct.updatedTime = iprot.readI64();
         struct.setUpdatedTimeIsSet(true);
       }

http://git-wip-us.apache.org/repos/asf/airavata/blob/273d074a/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/EntitySearchField.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/EntitySearchField.java b/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/EntitySearchField.java
index 3ca2012..4d322f2 100644
--- a/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/EntitySearchField.java
+++ b/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/EntitySearchField.java
@@ -25,9 +25,10 @@ public enum EntitySearchField implements org.apache.thrift.TEnum {
   NAME(0),
   DESCRIPTION(1),
   FULL_TEXT(2),
-  PRRENT_ENTITY_ID(3),
-  CREATED_TIME(4),
-  UPDATED_TIME(5);
+  PARRENT_ENTITY_ID(3),
+  PERMISSION_TYPE_ID(4),
+  CREATED_TIME(5),
+  UPDATED_TIME(6);
 
   private final int value;
 
@@ -55,10 +56,12 @@ public enum EntitySearchField implements org.apache.thrift.TEnum {
       case 2:
         return FULL_TEXT;
       case 3:
-        return PRRENT_ENTITY_ID;
+        return PARRENT_ENTITY_ID;
       case 4:
-        return CREATED_TIME;
+        return PERMISSION_TYPE_ID;
       case 5:
+        return CREATED_TIME;
+      case 6:
         return UPDATED_TIME;
       default:
         return null;

http://git-wip-us.apache.org/repos/asf/airavata/blob/273d074a/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/service/cpi/SharingRegistryService.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/service/cpi/SharingRegistryService.java b/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/service/cpi/SharingRegistryService.java
index 803d802..9e69d8a 100644
--- a/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/service/cpi/SharingRegistryService.java
+++ b/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/service/cpi/SharingRegistryService.java
@@ -80,7 +80,7 @@ public class SharingRegistryService {
      * 
      * @param user
      */
-    public String registerUser(org.apache.airavata.sharing.registry.models.User user) throws org.apache.airavata.sharing.registry.models.SharingRegistryException, org.apache.thrift.TException;
+    public String createUser(org.apache.airavata.sharing.registry.models.User user) throws org.apache.airavata.sharing.registry.models.SharingRegistryException, org.apache.thrift.TException;
 
     /**
      * <p>API method to update existing user</p>
@@ -106,7 +106,7 @@ public class SharingRegistryService {
     public org.apache.airavata.sharing.registry.models.User getUser(String domainId, String userId) throws org.apache.airavata.sharing.registry.models.SharingRegistryException, org.apache.thrift.TException;
 
     /**
-     * <p>API method to get a list of users in a specific domain Users will be reverse sorted based on the created time.</p>
+     * <p>API method to get a list of users in a specific domain.</p>
      * <li>domainId : Domain id</li>
      * <li>offset : Starting result number</li>
      * <li>limit : Number of max results to be sent</li>
@@ -148,7 +148,7 @@ public class SharingRegistryService {
     public org.apache.airavata.sharing.registry.models.UserGroup getGroup(String domainId, String groupId) throws org.apache.airavata.sharing.registry.models.SharingRegistryException, org.apache.thrift.TException;
 
     /**
-     * <p>API method to get groups in a domainId. Results are reverse sorted based on created time.</p>
+     * <p>API method to get groups in a domainId.</p>
      * 
      * @param domainId
      * @param offset
@@ -175,7 +175,7 @@ public class SharingRegistryService {
     public boolean removeUsersFromGroup(String domainId, List<String> userIds, String groupId) throws org.apache.airavata.sharing.registry.models.SharingRegistryException, org.apache.thrift.TException;
 
     /**
-     * <p>API method to get list of child users in a group. Only the direct members will be returned. Results are reverse time sorted based on creation time</p>
+     * <p>API method to get list of child users in a group. Only the direct members will be returned.</p>
      * 
      * @param domainId
      * @param groupId
@@ -185,7 +185,7 @@ public class SharingRegistryService {
     public List<org.apache.airavata.sharing.registry.models.User> getGroupMembersOfTypeUser(String domainId, String groupId, int offset, int limit) throws org.apache.airavata.sharing.registry.models.SharingRegistryException, org.apache.thrift.TException;
 
     /**
-     * <p>API method to get list of child groups in a group. Only the direct members will be returned. Results are reverse time sorted based on creation time</p>
+     * <p>API method to get list of child groups in a group. Only the direct members will be returned.</p>
      * 
      * @param domainId
      * @param groupId
@@ -243,7 +243,7 @@ public class SharingRegistryService {
     public org.apache.airavata.sharing.registry.models.EntityType getEntityType(String domainId, String entityTypeId) throws org.apache.airavata.sharing.registry.models.SharingRegistryException, org.apache.thrift.TException;
 
     /**
-     * <p>API method to get entity types in a domainId. Results are reverse time sorted based on creation time</p>
+     * <p>API method to get entity types in a domainId.</p>
      * 
      * @param domainId
      * @param offset
@@ -256,7 +256,7 @@ public class SharingRegistryService {
      * 
      * @param entity
      */
-    public String registerEntity(org.apache.airavata.sharing.registry.models.Entity entity) throws org.apache.airavata.sharing.registry.models.SharingRegistryException, org.apache.thrift.TException;
+    public String createEntity(org.apache.airavata.sharing.registry.models.Entity entity) throws org.apache.airavata.sharing.registry.models.SharingRegistryException, org.apache.thrift.TException;
 
     /**
      * <p>API method to update entity</p>
@@ -342,7 +342,7 @@ public class SharingRegistryService {
     public org.apache.airavata.sharing.registry.models.PermissionType getPermissionType(String domainId, String permissionTypeId) throws org.apache.airavata.sharing.registry.models.SharingRegistryException, org.apache.thrift.TException;
 
     /**
-     * <p>API method to get list of permission types in a given domainId. Results are reverse time sorted based on creation time</p>
+     * <p>API method to get list of permission types in a given domainId.</p>
      * 
      * @param domainId
      * @param offset
@@ -416,7 +416,7 @@ public class SharingRegistryService {
 
     public void getDomains(int offset, int limit, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
-    public void registerUser(org.apache.airavata.sharing.registry.models.User user, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+    public void createUser(org.apache.airavata.sharing.registry.models.User user, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
     public void updatedUser(org.apache.airavata.sharing.registry.models.User user, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
@@ -458,7 +458,7 @@ public class SharingRegistryService {
 
     public void getEntityTypes(String domainId, int offset, int limit, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
-    public void registerEntity(org.apache.airavata.sharing.registry.models.Entity entity, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+    public void createEntity(org.apache.airavata.sharing.registry.models.Entity entity, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
     public void updateEntity(org.apache.airavata.sharing.registry.models.Entity entity, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
@@ -645,30 +645,30 @@ public class SharingRegistryService {
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getDomains failed: unknown result");
     }
 
-    public String registerUser(org.apache.airavata.sharing.registry.models.User user) throws org.apache.airavata.sharing.registry.models.SharingRegistryException, org.apache.thrift.TException
+    public String createUser(org.apache.airavata.sharing.registry.models.User user) throws org.apache.airavata.sharing.registry.models.SharingRegistryException, org.apache.thrift.TException
     {
-      send_registerUser(user);
-      return recv_registerUser();
+      send_createUser(user);
+      return recv_createUser();
     }
 
-    public void send_registerUser(org.apache.airavata.sharing.registry.models.User user) throws org.apache.thrift.TException
+    public void send_createUser(org.apache.airavata.sharing.registry.models.User user) throws org.apache.thrift.TException
     {
-      registerUser_args args = new registerUser_args();
+      createUser_args args = new createUser_args();
       args.setUser(user);
-      sendBase("registerUser", args);
+      sendBase("createUser", args);
     }
 
-    public String recv_registerUser() throws org.apache.airavata.sharing.registry.models.SharingRegistryException, org.apache.thrift.TException
+    public String recv_createUser() throws org.apache.airavata.sharing.registry.models.SharingRegistryException, org.apache.thrift.TException
     {
-      registerUser_result result = new registerUser_result();
-      receiveBase(result, "registerUser");
+      createUser_result result = new createUser_result();
+      receiveBase(result, "createUser");
       if (result.isSetSuccess()) {
         return result.success;
       }
       if (result.sre != null) {
         throw result.sre;
       }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "registerUser failed: unknown result");
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createUser failed: unknown result");
     }
 
     public boolean updatedUser(org.apache.airavata.sharing.registry.models.User user) throws org.apache.airavata.sharing.registry.models.SharingRegistryException, org.apache.thrift.TException
@@ -1214,30 +1214,30 @@ public class SharingRegistryService {
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getEntityTypes failed: unknown result");
     }
 
-    public String registerEntity(org.apache.airavata.sharing.registry.models.Entity entity) throws org.apache.airavata.sharing.registry.models.SharingRegistryException, org.apache.thrift.TException
+    public String createEntity(org.apache.airavata.sharing.registry.models.Entity entity) throws org.apache.airavata.sharing.registry.models.SharingRegistryException, org.apache.thrift.TException
     {
-      send_registerEntity(entity);
-      return recv_registerEntity();
+      send_createEntity(entity);
+      return recv_createEntity();
     }
 
-    public void send_registerEntity(org.apache.airavata.sharing.registry.models.Entity entity) throws org.apache.thrift.TException
+    public void send_createEntity(org.apache.airavata.sharing.registry.models.Entity entity) throws org.apache.thrift.TException
     {
-      registerEntity_args args = new registerEntity_args();
+      createEntity_args args = new createEntity_args();
       args.setEntity(entity);
-      sendBase("registerEntity", args);
+      sendBase("createEntity", args);
     }
 
-    public String recv_registerEntity() throws org.apache.airavata.sharing.registry.models.SharingRegistryException, org.apache.thrift.TException
+    public String recv_createEntity() throws org.apache.airavata.sharing.registry.models.SharingRegistryException, org.apache.thrift.TException
     {
-      registerEntity_result result = new registerEntity_result();
-      receiveBase(result, "registerEntity");
+      createEntity_result result = new createEntity_result();
+      receiveBase(result, "createEntity");
       if (result.isSetSuccess()) {
         return result.success;
       }
       if (result.sre != null) {
         throw result.sre;
       }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "registerEntity failed: unknown result");
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createEntity failed: unknown result");
     }
 
     public boolean updateEntity(org.apache.airavata.sharing.registry.models.Entity entity) throws org.apache.airavata.sharing.registry.models.SharingRegistryException, org.apache.thrift.TException
@@ -1869,23 +1869,23 @@ public class SharingRegistryService {
       }
     }
 
-    public void registerUser(org.apache.airavata.sharing.registry.models.User user, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+    public void createUser(org.apache.airavata.sharing.registry.models.User user, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
       checkReady();
-      registerUser_call method_call = new registerUser_call(user, resultHandler, this, ___protocolFactory, ___transport);
+      createUser_call method_call = new createUser_call(user, resultHandler, this, ___protocolFactory, ___transport);
       this.___currentMethod = method_call;
       ___manager.call(method_call);
     }
 
-    public static class registerUser_call extends org.apache.thrift.async.TAsyncMethodCall {
+    public static class createUser_call extends org.apache.thrift.async.TAsyncMethodCall {
       private org.apache.airavata.sharing.registry.models.User user;
-      public registerUser_call(org.apache.airavata.sharing.registry.models.User user, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+      public createUser_call(org.apache.airavata.sharing.registry.models.User user, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
         super(client, protocolFactory, transport, resultHandler, false);
         this.user = user;
       }
 
       public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
-        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("registerUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
-        registerUser_args args = new registerUser_args();
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        createUser_args args = new createUser_args();
         args.setUser(user);
         args.write(prot);
         prot.writeMessageEnd();
@@ -1897,7 +1897,7 @@ public class SharingRegistryService {
         }
         org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
         org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
-        return (new Client(prot)).recv_registerUser();
+        return (new Client(prot)).recv_createUser();
       }
     }
 
@@ -2619,23 +2619,23 @@ public class SharingRegistryService {
       }
     }
 
-    public void registerEntity(org.apache.airavata.sharing.registry.models.Entity entity, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+    public void createEntity(org.apache.airavata.sharing.registry.models.Entity entity, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
       checkReady();
-      registerEntity_call method_call = new registerEntity_call(entity, resultHandler, this, ___protocolFactory, ___transport);
+      createEntity_call method_call = new createEntity_call(entity, resultHandler, this, ___protocolFactory, ___transport);
       this.___currentMethod = method_call;
       ___manager.call(method_call);
     }
 
-    public static class registerEntity_call extends org.apache.thrift.async.TAsyncMethodCall {
+    public static class createEntity_call extends org.apache.thrift.async.TAsyncMethodCall {
       private org.apache.airavata.sharing.registry.models.Entity entity;
-      public registerEntity_call(org.apache.airavata.sharing.registry.models.Entity entity, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+      public createEntity_call(org.apache.airavata.sharing.registry.models.Entity entity, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
         super(client, protocolFactory, transport, resultHandler, false);
         this.entity = entity;
       }
 
       public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
-        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("registerEntity", org.apache.thrift.protocol.TMessageType.CALL, 0));
-        registerEntity_args args = new registerEntity_args();
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createEntity", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        createEntity_args args = new createEntity_args();
         args.setEntity(entity);
         args.write(prot);
         prot.writeMessageEnd();
@@ -2647,7 +2647,7 @@ public class SharingRegistryService {
         }
         org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
         org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
-        return (new Client(prot)).recv_registerEntity();
+        return (new Client(prot)).recv_createEntity();
       }
     }
 
@@ -3277,7 +3277,7 @@ public class SharingRegistryService {
       processMap.put("deleteDomain", new deleteDomain());
       processMap.put("getDomain", new getDomain());
       processMap.put("getDomains", new getDomains());
-      processMap.put("registerUser", new registerUser());
+      processMap.put("createUser", new createUser());
       processMap.put("updatedUser", new updatedUser());
       processMap.put("deleteUser", new deleteUser());
       processMap.put("getUser", new getUser());
@@ -3298,7 +3298,7 @@ public class SharingRegistryService {
       processMap.put("deleteEntityType", new deleteEntityType());
       processMap.put("getEntityType", new getEntityType());
       processMap.put("getEntityTypes", new getEntityTypes());
-      processMap.put("registerEntity", new registerEntity());
+      processMap.put("createEntity", new createEntity());
       processMap.put("updateEntity", new updateEntity());
       processMap.put("deleteEntity", new deleteEntity());
       processMap.put("getEntity", new getEntity());
@@ -3440,23 +3440,23 @@ public class SharingRegistryService {
       }
     }
 
-    public static class registerUser<I extends Iface> extends org.apache.thrift.ProcessFunction<I, registerUser_args> {
-      public registerUser() {
-        super("registerUser");
+    public static class createUser<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createUser_args> {
+      public createUser() {
+        super("createUser");
       }
 
-      public registerUser_args getEmptyArgsInstance() {
-        return new registerUser_args();
+      public createUser_args getEmptyArgsInstance() {
+        return new createUser_args();
       }
 
       protected boolean isOneway() {
         return false;
       }
 
-      public registerUser_result getResult(I iface, registerUser_args args) throws org.apache.thrift.TException {
-        registerUser_result result = new registerUser_result();
+      public createUser_result getResult(I iface, createUser_args args) throws org.apache.thrift.TException {
+        createUser_result result = new createUser_result();
         try {
-          result.success = iface.registerUser(args.user);
+          result.success = iface.createUser(args.user);
         } catch (org.apache.airavata.sharing.registry.models.SharingRegistryException sre) {
           result.sre = sre;
         }
@@ -3950,23 +3950,23 @@ public class SharingRegistryService {
       }
     }
 
-    public static class registerEntity<I extends Iface> extends org.apache.thrift.ProcessFunction<I, registerEntity_args> {
-      public registerEntity() {
-        super("registerEntity");
+    public static class createEntity<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createEntity_args> {
+      public createEntity() {
+        super("createEntity");
       }
 
-      public registerEntity_args getEmptyArgsInstance() {
-        return new registerEntity_args();
+      public createEntity_args getEmptyArgsInstance() {
+        return new createEntity_args();
       }
 
       protected boolean isOneway() {
         return false;
       }
 
-      public registerEntity_result getResult(I iface, registerEntity_args args) throws org.apache.thrift.TException {
-        registerEntity_result result = new registerEntity_result();
+      public createEntity_result getResult(I iface, createEntity_args args) throws org.apache.thrift.TException {
+        createEntity_result result = new createEntity_result();
         try {
-          result.success = iface.registerEntity(args.entity);
+          result.success = iface.createEntity(args.entity);
         } catch (org.apache.airavata.sharing.registry.models.SharingRegistryException sre) {
           result.sre = sre;
         }
@@ -4385,7 +4385,7 @@ public class SharingRegistryService {
       processMap.put("deleteDomain", new deleteDomain());
       processMap.put("getDomain", new getDomain());
       processMap.put("getDomains", new getDomains());
-      processMap.put("registerUser", new registerUser());
+      processMap.put("createUser", new createUser());
       processMap.put("updatedUser", new updatedUser());
       processMap.put("deleteUser", new deleteUser());
       processMap.put("getUser", new getUser());
@@ -4406,7 +4406,7 @@ public class SharingRegistryService {
       processMap.put("deleteEntityType", new deleteEntityType());
       processMap.put("getEntityType", new getEntityType());
       processMap.put("getEntityTypes", new getEntityTypes());
-      processMap.put("registerEntity", new registerEntity());
+      processMap.put("createEntity", new createEntity());
       processMap.put("updateEntity", new updateEntity());
       processMap.put("deleteEntity", new deleteEntity());
       processMap.put("getEntity", new getEntity());
@@ -4713,20 +4713,20 @@ public class SharingRegistryService {
       }
     }
 
-    public static class registerUser<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, registerUser_args, String> {
-      public registerUser() {
-        super("registerUser");
+    public static class createUser<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, createUser_args, String> {
+      public createUser() {
+        super("createUser");
       }
 
-      public registerUser_args getEmptyArgsInstance() {
-        return new registerUser_args();
+      public createUser_args getEmptyArgsInstance() {
+        return new createUser_args();
       }
 
       public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
         final org.apache.thrift.AsyncProcessFunction fcall = this;
         return new AsyncMethodCallback<String>() { 
           public void onComplete(String o) {
-            registerUser_result result = new registerUser_result();
+            createUser_result result = new createUser_result();
             result.success = o;
             try {
               fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
@@ -4739,7 +4739,7 @@ public class SharingRegistryService {
           public void onError(Exception e) {
             byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
             org.apache.thrift.TBase msg;
-            registerUser_result result = new registerUser_result();
+            createUser_result result = new createUser_result();
             if (e instanceof org.apache.airavata.sharing.registry.models.SharingRegistryException) {
                         result.sre = (org.apache.airavata.sharing.registry.models.SharingRegistryException) e;
                         result.setSreIsSet(true);
@@ -4765,8 +4765,8 @@ public class SharingRegistryService {
         return false;
       }
 
-      public void start(I iface, registerUser_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
-        iface.registerUser(args.user,resultHandler);
+      public void start(I iface, createUser_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
+        iface.createUser(args.user,resultHandler);
       }
     }
 
@@ -5914,20 +5914,20 @@ public class SharingRegistryService {
       }
     }
 
-    public static class registerEntity<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, registerEntity_args, String> {
-      public registerEntity() {
-        super("registerEntity");
+    public static class createEntity<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, createEntity_args, String> {
+      public createEntity() {
+        super("createEntity");
       }
 
-      public registerEntity_args getEmptyArgsInstance() {
-        return new registerEntity_args();
+      public createEntity_args getEmptyArgsInstance() {
+        return new createEntity_args();
       }
 
       public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
         final org.apache.thrift.AsyncProcessFunction fcall = this;
         return new AsyncMethodCallback<String>() { 
           public void onComplete(String o) {
-            registerEntity_result result = new registerEntity_result();
+            createEntity_result result = new createEntity_result();
             result.success = o;
             try {
               fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
@@ -5940,7 +5940,7 @@ public class SharingRegistryService {
           public void onError(Exception e) {
             byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
             org.apache.thrift.TBase msg;
-            registerEntity_result result = new registerEntity_result();
+            createEntity_result result = new createEntity_result();
             if (e instanceof org.apache.airavata.sharing.registry.models.SharingRegistryException) {
                         result.sre = (org.apache.airavata.sharing.registry.models.SharingRegistryException) e;
                         result.setSreIsSet(true);
@@ -5966,8 +5966,8 @@ public class SharingRegistryService {
         return false;
       }
 
-      public void start(I iface, registerEntity_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
-        iface.registerEntity(args.entity,resultHandler);
+      public void start(I iface, createEntity_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
+        iface.createEntity(args.entity,resultHandler);
       }
     }
 
@@ -11168,15 +11168,15 @@ public class SharingRegistryService {
 
   }
 
-  public static class registerUser_args implements org.apache.thrift.TBase<registerUser_args, registerUser_args._Fields>, java.io.Serializable, Cloneable, Comparable<registerUser_args>   {
-    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("registerUser_args");
+  public static class createUser_args implements org.apache.thrift.TBase<createUser_args, createUser_args._Fields>, java.io.Serializable, Cloneable, Comparable<createUser_args>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createUser_args");
 
     private static final org.apache.thrift.protocol.TField USER_FIELD_DESC = new org.apache.thrift.protocol.TField("user", org.apache.thrift.protocol.TType.STRUCT, (short)1);
 
     private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
-      schemes.put(StandardScheme.class, new registerUser_argsStandardSchemeFactory());
-      schemes.put(TupleScheme.class, new registerUser_argsTupleSchemeFactory());
+      schemes.put(StandardScheme.class, new createUser_argsStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new createUser_argsTupleSchemeFactory());
     }
 
     public org.apache.airavata.sharing.registry.models.User user; // required
@@ -11246,13 +11246,13 @@ public class SharingRegistryService {
       tmpMap.put(_Fields.USER, new org.apache.thrift.meta_data.FieldMetaData("user", org.apache.thrift.TFieldRequirementType.REQUIRED, 
           new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.sharing.registry.models.User.class)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
-      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(registerUser_args.class, metaDataMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createUser_args.class, metaDataMap);
     }
 
-    public registerUser_args() {
+    public createUser_args() {
     }
 
-    public registerUser_args(
+    public createUser_args(
       org.apache.airavata.sharing.registry.models.User user)
     {
       this();
@@ -11262,14 +11262,14 @@ public class SharingRegistryService {
     /**
      * Performs a deep copy on <i>other</i>.
      */
-    public registerUser_args(registerUser_args other) {
+    public createUser_args(createUser_args other) {
       if (other.isSetUser()) {
         this.user = new org.apache.airavata.sharing.registry.models.User(other.user);
       }
     }
 
-    public registerUser_args deepCopy() {
-      return new registerUser_args(this);
+    public createUser_args deepCopy() {
+      return new createUser_args(this);
     }
 
     @Override
@@ -11281,7 +11281,7 @@ public class SharingRegistryService {
       return this.user;
     }
 
-    public registerUser_args setUser(org.apache.airavata.sharing.registry.models.User user) {
+    public createUser_args setUser(org.apache.airavata.sharing.registry.models.User user) {
       this.user = user;
       return this;
     }
@@ -11340,12 +11340,12 @@ public class SharingRegistryService {
     public boolean equals(Object that) {
       if (that == null)
         return false;
-      if (that instanceof registerUser_args)
-        return this.equals((registerUser_args)that);
+      if (that instanceof createUser_args)
+        return this.equals((createUser_args)that);
       return false;
     }
 
-    public boolean equals(registerUser_args that) {
+    public boolean equals(createUser_args that) {
       if (that == null)
         return false;
 
@@ -11374,7 +11374,7 @@ public class SharingRegistryService {
     }
 
     @Override
-    public int compareTo(registerUser_args other) {
+    public int compareTo(createUser_args other) {
       if (!getClass().equals(other.getClass())) {
         return getClass().getName().compareTo(other.getClass().getName());
       }
@@ -11408,7 +11408,7 @@ public class SharingRegistryService {
 
     @Override
     public String toString() {
-      StringBuilder sb = new StringBuilder("registerUser_args(");
+      StringBuilder sb = new StringBuilder("createUser_args(");
       boolean first = true;
 
       sb.append("user:");
@@ -11449,15 +11449,15 @@ public class SharingRegistryService {
       }
     }
 
-    private static class registerUser_argsStandardSchemeFactory implements SchemeFactory {
-      public registerUser_argsStandardScheme getScheme() {
-        return new registerUser_argsStandardScheme();
+    private static class createUser_argsStandardSchemeFactory implements SchemeFactory {
+      public createUser_argsStandardScheme getScheme() {
+        return new createUser_argsStandardScheme();
       }
     }
 
-    private static class registerUser_argsStandardScheme extends StandardScheme<registerUser_args> {
+    private static class createUser_argsStandardScheme extends StandardScheme<createUser_args> {
 
-      public void read(org.apache.thrift.protocol.TProtocol iprot, registerUser_args struct) throws org.apache.thrift.TException {
+      public void read(org.apache.thrift.protocol.TProtocol iprot, createUser_args struct) throws org.apache.thrift.TException {
         org.apache.thrift.protocol.TField schemeField;
         iprot.readStructBegin();
         while (true)
@@ -11487,7 +11487,7 @@ public class SharingRegistryService {
         struct.validate();
       }
 
-      public void write(org.apache.thrift.protocol.TProtocol oprot, registerUser_args struct) throws org.apache.thrift.TException {
+      public void write(org.apache.thrift.protocol.TProtocol oprot, createUser_args struct) throws org.apache.thrift.TException {
         struct.validate();
 
         oprot.writeStructBegin(STRUCT_DESC);
@@ -11502,22 +11502,22 @@ public class SharingRegistryService {
 
     }
 
-    private static class registerUser_argsTupleSchemeFactory implements SchemeFactory {
-      public registerUser_argsTupleScheme getScheme() {
-        return new registerUser_argsTupleScheme();
+    private static class createUser_argsTupleSchemeFactory implements SchemeFactory {
+      public createUser_argsTupleScheme getScheme() {
+        return new createUser_argsTupleScheme();
       }
     }
 
-    private static class registerUser_argsTupleScheme extends TupleScheme<registerUser_args> {
+    private static class createUser_argsTupleScheme extends TupleScheme<createUser_args> {
 
       @Override
-      public void write(org.apache.thrift.protocol.TProtocol prot, registerUser_args struct) throws org.apache.thrift.TException {
+      public void write(org.apache.thrift.protocol.TProtocol prot, createUser_args struct) throws org.apache.thrift.TException {
         TTupleProtocol oprot = (TTupleProtocol) prot;
         struct.user.write(oprot);
       }
 
       @Override
-      public void read(org.apache.thrift.protocol.TProtocol prot, registerUser_args struct) throws org.apache.thrift.TException {
+      public void read(org.apache.thrift.protocol.TProtocol prot, createUser_args struct) throws org.apache.thrift.TException {
         TTupleProtocol iprot = (TTupleProtocol) prot;
         struct.user = new org.apache.airavata.sharing.registry.models.User();
         struct.user.read(iprot);
@@ -11527,16 +11527,16 @@ public class SharingRegistryService {
 
   }
 
-  public static class registerUser_result implements org.apache.thrift.TBase<registerUser_result, registerUser_result._Fields>, java.io.Serializable, Cloneable, Comparable<registerUser_result>   {
-    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("registerUser_result");
+  public static class createUser_result implements org.apache.thrift.TBase<createUser_result, createUser_result._Fields>, java.io.Serializable, Cloneable, Comparable<createUser_result>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createUser_result");
 
     private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
     private static final org.apache.thrift.protocol.TField SRE_FIELD_DESC = new org.apache.thrift.protocol.TField("sre", org.apache.thrift.protocol.TType.STRUCT, (short)1);
 
     private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
-      schemes.put(StandardScheme.class, new registerUser_resultStandardSchemeFactory());
-      schemes.put(TupleScheme.class, new registerUser_resultTupleSchemeFactory());
+      schemes.put(StandardScheme.class, new createUser_resultStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new createUser_resultTupleSchemeFactory());
     }
 
     public String success; // required
@@ -11612,13 +11612,13 @@ public class SharingRegistryService {
       tmpMap.put(_Fields.SRE, new org.apache.thrift.meta_data.FieldMetaData("sre", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
-      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(registerUser_result.class, metaDataMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createUser_result.class, metaDataMap);
     }
 
-    public registerUser_result() {
+    public createUser_result() {
     }
 
-    public registerUser_result(
+    public createUser_result(
       String success,
       org.apache.airavata.sharing.registry.models.SharingRegistryException sre)
     {
@@ -11630,7 +11630,7 @@ public class SharingRegistryService {
     /**
      * Performs a deep copy on <i>other</i>.
      */
-    public registerUser_result(registerUser_result other) {
+    public createUser_result(createUser_result other) {
       if (other.isSetSuccess()) {
         this.success = other.success;
       }
@@ -11639,8 +11639,8 @@ public class SharingRegistryService {
       }
     }
 
-    public registerUser_result deepCopy() {
-      return new registerUser_result(this);
+    public createUser_result deepCopy() {
+      return new createUser_result(this);
     }
 
     @Override
@@ -11653,7 +11653,7 @@ public class SharingRegistryService {
       return this.success;
     }
 
-    public registerUser_result setSuccess(String success) {
+    public createUser_result setSuccess(String success) {
       this.success = success;
       return this;
     }
@@ -11677,7 +11677,7 @@ public class SharingRegistryService {
       return this.sre;
     }
 
-    public registerUser_result setSre(org.apache.airavata.sharing.registry.models.SharingRegistryException sre) {
+    public createUser_result setSre(org.apache.airavata.sharing.registry.models.SharingRegistryException sre) {
       this.sre = sre;
       return this;
     }
@@ -11749,12 +11749,12 @@ public class SharingRegistryService {
     public boolean equals(Object that) {
       if (that == null)
         return false;
-      if (that instanceof registerUser_result)
-        return this.equals((registerUser_result)that);
+      if (that instanceof createUser_result)
+        return this.equals((createUser_result)that);
       return false;
     }
 
-    public boolean equals(registerUser_result that) {
+    public boolean equals(createUser_result that) {
       if (that == null)
         return false;
 
@@ -11797,7 +11797,7 @@ public class SharingRegistryService {
     }
 
     @Override
-    public int compareTo(registerUser_result other) {
+    public int compareTo(createUser_result other) {
       if (!getClass().equals(other.getClass())) {
         return getClass().getName().compareTo(other.getClass().getName());
       }
@@ -11841,7 +11841,7 @@ public class SharingRegistryService {
 
     @Override
     public String toString() {
-      StringBuilder sb = new StringBuilder("registerUser_result(");
+      StringBuilder sb = new StringBuilder("createUser_result(");
       boolean first = true;
 
       sb.append("success:");
@@ -11884,15 +11884,15 @@ public class SharingRegistryService {
       }
     }
 
-    private static class registerUser_resultStandardSchemeFactory implements SchemeFactory {
-      public registerUser_resultStandardScheme getScheme() {
-        return new registerUser_resultStandardScheme();
+    private static class createUser_resultStandardSchemeFactory implements SchemeFactory {
+      public createUser_resultStandardScheme getScheme() {
+        return new createUser_resultStandardScheme();
       }
     }
 
-    private static class registerUser_resultStandardScheme extends StandardScheme<registerUser_result> {
+    private static class createUser_resultStandardScheme extends StandardScheme<createUser_result> {
 
-      public void read(org.apache.thrift.protocol.TProtocol iprot, registerUser_result struct) throws org.apache.thrift.TException {
+      public void read(org.apache.thrift.protocol.TProtocol iprot, createUser_result struct) throws org.apache.thrift.TException {
         org.apache.thrift.protocol.TField schemeField;
         iprot.readStructBegin();
         while (true)
@@ -11930,7 +11930,7 @@ public class SharingRegistryService {
         struct.validate();
       }
 
-      public void write(org.apache.thrift.protocol.TProtocol oprot, registerUser_result struct) throws org.apache.thrift.TException {
+      public void write(org.apache.thrift.protocol.TProtocol oprot, createUser_result struct) throws org.apache.thrift.TException {
         struct.validate();
 
         oprot.writeStructBegin(STRUCT_DESC);
@@ -11950,16 +11950,16 @@ public class SharingRegistryService {
 
     }
 
-    private static class registerUser_resultTupleSchemeFactory implements SchemeFactory {
-      public registerUser_resultTupleScheme getScheme() {
-        return new registerUser_resultTupleScheme();
+    private static class createUser_resultTupleSchemeFactory implements SchemeFactory {
+      public createUser_resultTupleScheme getScheme() {
+        return new createUser_resultTupleScheme();
       }
     }
 
-    private static class registerUser_resultTupleScheme extends TupleScheme<registerUser_result> {
+    private static class createUser_resultTupleScheme extends TupleScheme<createUser_result> {
 
       @Override
-      public void write(org.apache.thrift.protocol.TProtocol prot, registerUser_result struct) throws org.apache.thrift.TException {
+      public void write(org.apache.thrift.protocol.TProtocol prot, createUser_result struct) throws org.apache.thrift.TException {
         TTupleProtocol oprot = (TTupleProtocol) prot;
         BitSet optionals = new BitSet();
         if (struct.isSetSuccess()) {
@@ -11978,7 +11978,7 @@ public class SharingRegistryService {
       }
 
       @Override
-      public void read(org.apache.thrift.protocol.TProtocol prot, registerUser_result struct) throws org.apache.thrift.TException {
+      public void read(org.apache.thrift.protocol.TProtocol prot, createUser_result struct) throws org.apache.thrift.TException {
         TTupleProtocol iprot = (TTupleProtocol) prot;
         BitSet incoming = iprot.readBitSet(2);
         if (incoming.get(0)) {
@@ -31388,15 +31388,15 @@ public class SharingRegistryService {
 
   }
 
-  public static class registerEntity_args implements org.apache.thrift.TBase<registerEntity_args, registerEntity_args._Fields>, java.io.Serializable, Cloneable, Comparable<registerEntity_args>   {
-    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("registerEntity_args");
+  public static class createEntity_args implements org.apache.thrift.TBase<createEntity_args, createEntity_args._Fields>, java.io.Serializable, Cloneable, Comparable<createEntity_args>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createEntity_args");
 
     private static final org.apache.thrift.protocol.TField ENTITY_FIELD_DESC = new org.apache.thrift.protocol.TField("entity", org.apache.thrift.protocol.TType.STRUCT, (short)1);
 
     private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
-      schemes.put(StandardScheme.class, new registerEntity_argsStandardSchemeFactory());
-      schemes.put(TupleScheme.class, new registerEntity_argsTupleSchemeFactory());
+      schemes.put(StandardScheme.class, new createEntity_argsStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new createEntity_argsTupleSchemeFactory());
     }
 
     public org.apache.airavata.sharing.registry.models.Entity entity; // required
@@ -31466,13 +31466,13 @@ public class SharingRegistryService {
       tmpMap.put(_Fields.ENTITY, new org.apache.thrift.meta_data.FieldMetaData("entity", org.apache.thrift.TFieldRequirementType.REQUIRED, 
           new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.sharing.registry.models.Entity.class)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
-      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(registerEntity_args.class, metaDataMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createEntity_args.class, metaDataMap);
     }
 
-    public registerEntity_args() {
+    public createEntity_args() {
     }
 
-    public registerEntity_args(
+    public createEntity_args(
       org.apache.airavata.sharing.registry.models.Entity entity)
     {
       this();
@@ -31482,14 +31482,14 @@ public class SharingRegistryService {
     /**
      * Performs a deep copy on <i>other</i>.
      */
-    public registerEntity_args(registerEntity_args other) {
+    public createEntity_args(createEntity_args other) {
       if (other.isSetEntity()) {
         this.entity = new org.apache.airavata.sharing.registry.models.Entity(other.entity);
       }
     }
 
-    public registerEntity_args deepCopy() {
-      return new registerEntity_args(this);
+    public createEntity_args deepCopy() {
+      return new createEntity_args(this);
     }
 
     @Override
@@ -31501,7 +31501,7 @@ public class SharingRegistryService {
       return this.entity;
     }
 
-    public registerEntity_args setEntity(org.apache.airavata.sharing.registry.models.Entity entity) {
+    public createEntity_args setEntity(org.apache.airavata.sharing.registry.models.Entity entity) {
       this.entity = entity;
       return this;
     }
@@ -31560,12 +31560,12 @@ public class SharingRegistryService {
     public boolean equals(Object that) {
       if (that == null)
         return false;
-      if (that instanceof registerEntity_args)
-        return this.equals((registerEntity_args)that);
+      if (that instanceof createEntity_args)
+        return this.equals((createEntity_args)that);
       return false;
     }
 
-    public boolean equals(registerEntity_args that) {
+    public boolean equals(createEntity_args that) {
       if (that == null)
         return false;
 
@@ -31594,7 +31594,7 @@ public class SharingRegistryService {
     }
 
     @Override
-    public int compareTo(registerEntity_args other) {
+    public int compareTo(createEntity_args other) {
       if (!getClass().equals(other.getClass())) {
         return getClass().getName().compareTo(other.getClass().getName());
       }
@@ -31628,7 +31628,7 @@ public class SharingRegistryService {
 
     @Override
     public String toString() {
-      StringBuilder sb = new StringBuilder("registerEntity_args(");
+      StringBuilder sb = new StringBuilder("createEntity_args(");
       boolean first = true;
 
       sb.append("entity:");
@@ -31669,15 +31669,15 @@ public class SharingRegistryService {
       }
     }
 
-    private static class registerEntity_argsStandardSchemeFactory implements SchemeFactory {
-      public registerEntity_argsStandardScheme getScheme() {
-        return new registerEntity_argsStandardScheme();
+    private static class createEntity_argsStandardSchemeFactory implements SchemeFactory {
+      public createEntity_argsStandardScheme getScheme() {
+        return new createEntity_argsStandardScheme();
       }
     }
 
-    private static class registerEntity_argsStandardScheme extends StandardScheme<registerEntity_args> {
+    private static class createEntity_argsStandardScheme extends StandardScheme<createEntity_args> {
 
-      public void read(org.apache.thrift.protocol.TProtocol iprot, registerEntity_args struct) throws org.apache.thrift.TException {
+      public void read(org.apache.thrift.protocol.TProtocol iprot, createEntity_args struct) throws org.apache.thrift.TException {
         org.apache.thrift.protocol.TField schemeField;
         iprot.readStructBegin();
         while (true)
@@ -31707,7 +31707,7 @@ public class SharingRegistryService {
         struct.validate();
       }
 
-      public void write(org.apache.thrift.protocol.TProtocol oprot, registerEntity_args struct) throws org.apache.thrift.TException {
+      public void write(org.apache.thrift.protocol.TProtocol oprot, createEntity_args struct) throws org.apache.thrift.TException {
         struct.validate();
 
         oprot.writeStructBegin(STRUCT_DESC);
@@ -31722,22 +31722,22 @@ public class SharingRegistryService {
 
     }
 
-    private static class registerEntity_argsTupleSchemeFactory implements SchemeFactory {
-      public registerEntity_argsTupleScheme getScheme() {
-        return new registerEntity_argsTupleScheme();
+    private static class createEntity_argsTupleSchemeFactory implements SchemeFactory {
+      public createEntity_argsTupleScheme getScheme() {
+        return new createEntity_argsTupleScheme();
       }
     }
 
-    private static class registerEntity_argsTupleScheme extends TupleScheme<registerEntity_args> {
+    private static class createEntity_argsTupleScheme extends TupleScheme<createEntity_args> {
 
       @Override
-      public void write(org.apache.thrift.protocol.TProtocol prot, registerEntity_args struct) throws org.apache.thrift.TException {
+      public void write(org.apache.thrift.protocol.TProtocol prot, createEntity_args struct) throws org.apache.thrift.TException {
         TTupleProtocol oprot = (TTupleProtocol) prot;
         struct.entity.write(oprot);
       }
 
       @Override
-      public void read(org.apache.thrift.protocol.TProtocol prot, registerEntity_args struct) throws org.apache.thrift.TException {
+      public void read(org.apache.thrift.protocol.TProtocol prot, createEntity_args struct) throws org.apache.thrift.TException {
         TTupleProtocol iprot = (TTupleProtocol) prot;
         struct.entity = new org.apache.airavata.sharing.registry.models.Entity();
         struct.entity.read(iprot);
@@ -31747,16 +31747,16 @@ public class SharingRegistryService {
 
   }
 
-  public static class registerEntity_result implements org.apache.thrift.TBase<registerEntity_result, registerEntity_result._Fields>, java.io.Serializable, Cloneable, Comparable<registerEntity_result>   {
-    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("registerEntity_result");
+  public static class createEntity_result implements org.apache.thrift.TBase<createEntity_result, createEntity_result._Fields>, java.io.Serializable, Cloneable, Comparable<createEntity_result>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createEntity_result");
 
     private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
     private static final org.apache.thrift.protocol.TField SRE_FIELD_DESC = new org.apache.thrift.protocol.TField("sre", org.apache.thrift.protocol.TType.STRUCT, (short)1);
 
     private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
-      schemes.put(StandardScheme.class, new registerEntity_resultStandardSchemeFactory());
-      schemes.put(TupleScheme.class, new registerEntity_resultTupleSchemeFactory());
+      schemes.put(StandardScheme.class, new createEntity_resultStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new createEntity_resultTupleSchemeFactory());
     }
 
     public String success; // required
@@ -31832,13 +31832,13 @@ public class SharingRegistryService {
       tmpMap.put(_Fields.SRE, new org.apache.thrift.meta_data.FieldMetaData("sre", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
-      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(registerEntity_result.class, metaDataMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createEntity_result.class, metaDataMap);
     }
 
-    public registerEntity_result() {
+    public createEntity_result() {
     }
 
-    public registerEntity_result(
+    public createEntity_result(
       String success,
       org.apache.airavata.sharing.registry.models.SharingRegistryException sre)
     {
@@ -31850,7 +31850,7 @@ public class SharingRegistryService {
     /**
      * Performs a deep copy on <i>other</i>.
      */
-    public registerEntity_result(registerEntity_result other) {
+    public createEntity_result(createEntity_result other) {
       if (other.isSetSuccess()) {
         this.success = other.success;
       }
@@ -31859,8 +31859,8 @@ public class SharingRegistryService {
       }
     }
 
-    public registerEntity_result deepCopy() {
-      return new registerEntity_result(this);
+    public createEntity_result deepCopy() {
+      return new createEntity_result(this);
     }
 
     @Override
@@ -31873,7 +31873,7 @@ public class SharingRegistryService {
       return this.success;
     }
 
-    public registerEntity_result setSuccess(String success) {
+    public createEntity_result setSuccess(String success) {
       this.success = success;
       return this;
     }
@@ -31897,7 +31897,7 @@ public class SharingRegistryService {
       return this.sre;
     }
 
-    public registerEntity_result setSre(org.apache.airavata.sharing.registry.models.SharingRegistryException sre) {
+    public createEntity_result setSre(org.apache.airavata.sharing.registry.models.SharingRegistryException sre) {
       this.sre = sre;
       return this;
     }
@@ -31969,12 +31969,12 @@ public class SharingRegistryService {
     public boolean equals(Object that) {
       if (that == null)
         return false;
-      if (that instanceof registerEntity_result)
-        return this.equals((registerEntity_result)that);
+      if (that instanceof createEntity_result)
+        return this.equals((createEntity_result)that);
       return false;
     }
 
-    public boolean equals(registerEntity_result that) {
+    public boolean equals(createEntity_result that) {
       if (that == null)
         return false;
 
@@ -32017,7 +32017,7 @@ public class SharingRegistryService {
     }
 
     @Override
-    public int compareTo(registerEntity_result other) {
+    public int compareTo(createEntity_result other) {
       if (!getClass().equals(other.getClass())) {
         return getClass().getName().compareTo(other.getClass().getName());
       }
@@ -32061,7 +32061,7 @@ public class SharingRegistryService {
 
     @Override
     public String toString() {
-      StringBuilder sb = new StringBuilder("registerEntity_result(");
+      StringBuilder sb = new StringBuilder("createEntity_result(");
       boolean first = true;
 
       sb.append("success:");
@@ -32104,15 +32104,15 @@ public class SharingRegistryService {
       }
     }
 
-    private static class registerEntity_resultStandardSchemeFactory implements SchemeFactory {
-      public registerEntity_resultStandardScheme getScheme() {
-        return new registerEntity_resultStandardScheme();
+    private static class createEntity_resultStandardSchemeFactory implements SchemeFactory {
+      public createEntity_resultStandardScheme getScheme() {
+        return new createEntity_resultStandardScheme();
       }
     }
 
-    private static class registerEntity_resultStandardScheme extends StandardScheme<registerEntity_result> {
+    private static class createEntity_resultStandardScheme extends StandardScheme<createEntity_result> {
 
-      public void read(org.apache.thrift.protocol.TProtocol iprot, registerEntity_result struct) throws org.apache.thrift.TException {
+      public void read(org.apache.thrift.protocol.TProtocol iprot, createEntity_result struct) throws org.apache.thrift.TException {
         org.apache.thrift.protocol.TField schemeField;
         iprot.readStructBegin();
         while (true)
@@ -32150,7 +32150,7 @@ public class SharingRegistryService {
         struct.validate();
       }
 
-      public void write(org.apache.thrift.protocol.TProtocol oprot, registerEntity_result struct) throws org.apache.thrift.TException {
+      public void write(org.apache.thrift.protocol.TProtocol oprot, createEntity_result struct) throws org.apache.thrift.TException {
         struct.validate();
 
         oprot.writeStructBegin(STRUCT_DESC);
@@ -32170,16 +32170,16 @@ public class SharingRegistryService {
 
     }
 
-    private static class registerEntity_resultTupleSchemeFactory implements SchemeFactory {
-      public registerEntity_resultTupleScheme getScheme() {
-        return new registerEntity_resultTupleScheme();
+    private static class createEntity_resultTupleSchemeFactory implements SchemeFactory {
+      public createEntity_resultTupleScheme getScheme() {
+        return new createEntity_resultTupleScheme();
       }
     }
 
-    private static class registerEntity_resultTupleScheme extends TupleScheme<registerEntity_result> {
+    private static class createEntity_resultTupleScheme extends TupleScheme<createEntity_result> {
 
       @Override
-      public void write(org.apache.thrift.protocol.TProtocol prot, registerEntity_result struct) throws org.apache.thrift.TException {
+      public void write(org.apache.thrift.protocol.TProtocol prot, createEntity_result struct) throws org.apache.thrift.TException {
         TTupleProtocol oprot = (TTupleProtocol) prot;
         BitSet optionals = new BitSet();
         if (struct.isSetSuccess()) {
@@ -32198,7 +32198,7 @@ public class SharingRegistryService {
       }
 
       @Override
-      public void read(org.apache.thrift.protocol.TProtocol prot, registerEntity_result struct) throws org.apache.thrift.TException {
+      public void read(org.apache.thrift.protocol.TProtocol prot, createEntity_result struct) throws org.apache.thrift.TException {
         TTupleProtocol iprot = (TTupleProtocol) prot;
         BitSet incoming = iprot.readBitSet(2);
         if (incoming.get(0)) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/273d074a/modules/sharing-registry/sharing-service-docs/api-docs/index.html
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-service-docs/api-docs/index.html b/modules/sharing-registry/sharing-service-docs/api-docs/index.html
index 6663a9d..e4f5e56 100644
--- a/modules/sharing-registry/sharing-service-docs/api-docs/index.html
+++ b/modules/sharing-registry/sharing-service-docs/api-docs/index.html
@@ -10,9 +10,11 @@
 <li><a href="sharing_cpi.html#Fn_SharingRegistryService_addChildGroupsToParentGroup">addChildGroupsToParentGroup</a></li>
 <li><a href="sharing_cpi.html#Fn_SharingRegistryService_addUsersToGroup">addUsersToGroup</a></li>
 <li><a href="sharing_cpi.html#Fn_SharingRegistryService_createDomain">createDomain</a></li>
+<li><a href="sharing_cpi.html#Fn_SharingRegistryService_createEntity">createEntity</a></li>
 <li><a href="sharing_cpi.html#Fn_SharingRegistryService_createEntityType">createEntityType</a></li>
 <li><a href="sharing_cpi.html#Fn_SharingRegistryService_createGroup">createGroup</a></li>
 <li><a href="sharing_cpi.html#Fn_SharingRegistryService_createPermissionType">createPermissionType</a></li>
+<li><a href="sharing_cpi.html#Fn_SharingRegistryService_createUser">createUser</a></li>
 <li><a href="sharing_cpi.html#Fn_SharingRegistryService_deleteDomain">deleteDomain</a></li>
 <li><a href="sharing_cpi.html#Fn_SharingRegistryService_deleteEntity">deleteEntity</a></li>
 <li><a href="sharing_cpi.html#Fn_SharingRegistryService_deleteEntityType">deleteEntityType</a></li>
@@ -34,8 +36,6 @@
 <li><a href="sharing_cpi.html#Fn_SharingRegistryService_getPermissionTypes">getPermissionTypes</a></li>
 <li><a href="sharing_cpi.html#Fn_SharingRegistryService_getUser">getUser</a></li>
 <li><a href="sharing_cpi.html#Fn_SharingRegistryService_getUsers">getUsers</a></li>
-<li><a href="sharing_cpi.html#Fn_SharingRegistryService_registerEntity">registerEntity</a></li>
-<li><a href="sharing_cpi.html#Fn_SharingRegistryService_registerUser">registerUser</a></li>
 <li><a href="sharing_cpi.html#Fn_SharingRegistryService_removeChildGroupFromParentGroup">removeChildGroupFromParentGroup</a></li>
 <li><a href="sharing_cpi.html#Fn_SharingRegistryService_removeUsersFromGroup">removeUsersFromGroup</a></li>
 <li><a href="sharing_cpi.html#Fn_SharingRegistryService_revokeEntitySharingFromGroups">revokeEntitySharingFromGroups</a></li>

http://git-wip-us.apache.org/repos/asf/airavata/blob/273d074a/modules/sharing-registry/sharing-service-docs/api-docs/sharing_cpi.html
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-service-docs/api-docs/sharing_cpi.html b/modules/sharing-registry/sharing-service-docs/api-docs/sharing_cpi.html
index ed7fb89..fc081dc 100644
--- a/modules/sharing-registry/sharing-service-docs/api-docs/sharing_cpi.html
+++ b/modules/sharing-registry/sharing-service-docs/api-docs/sharing_cpi.html
@@ -14,9 +14,11 @@
 <li><a href="#Fn_SharingRegistryService_addChildGroupsToParentGroup">addChildGroupsToParentGroup</a></li>
 <li><a href="#Fn_SharingRegistryService_addUsersToGroup">addUsersToGroup</a></li>
 <li><a href="#Fn_SharingRegistryService_createDomain">createDomain</a></li>
+<li><a href="#Fn_SharingRegistryService_createEntity">createEntity</a></li>
 <li><a href="#Fn_SharingRegistryService_createEntityType">createEntityType</a></li>
 <li><a href="#Fn_SharingRegistryService_createGroup">createGroup</a></li>
 <li><a href="#Fn_SharingRegistryService_createPermissionType">createPermissionType</a></li>
+<li><a href="#Fn_SharingRegistryService_createUser">createUser</a></li>
 <li><a href="#Fn_SharingRegistryService_deleteDomain">deleteDomain</a></li>
 <li><a href="#Fn_SharingRegistryService_deleteEntity">deleteEntity</a></li>
 <li><a href="#Fn_SharingRegistryService_deleteEntityType">deleteEntityType</a></li>
@@ -38,8 +40,6 @@
 <li><a href="#Fn_SharingRegistryService_getPermissionTypes">getPermissionTypes</a></li>
 <li><a href="#Fn_SharingRegistryService_getUser">getUser</a></li>
 <li><a href="#Fn_SharingRegistryService_getUsers">getUsers</a></li>
-<li><a href="#Fn_SharingRegistryService_registerEntity">registerEntity</a></li>
-<li><a href="#Fn_SharingRegistryService_registerUser">registerUser</a></li>
 <li><a href="#Fn_SharingRegistryService_removeChildGroupFromParentGroup">removeChildGroupFromParentGroup</a></li>
 <li><a href="#Fn_SharingRegistryService_removeUsersFromGroup">removeUsersFromGroup</a></li>
 <li><a href="#Fn_SharingRegistryService_revokeEntitySharingFromGroups">revokeEntitySharingFromGroups</a></li>
@@ -82,8 +82,8 @@
                                        <code>i32</code> limit)
     throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code>
 </pre><p>API method to get all domain.</p>
-<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_registerUser">Function: SharingRegistryService.registerUser</h4>
-<pre><code>string</code> registerUser(<code><a href="sharing_models.html#Struct_User">sharing_models.User</a></code> user)
+<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_createUser">Function: SharingRegistryService.createUser</h4>
+<pre><code>string</code> createUser(<code><a href="sharing_models.html#Struct_User">sharing_models.User</a></code> user)
     throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code>
 </pre><p>API method to register a user in the system</p>
 <br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_updatedUser">Function: SharingRegistryService.updatedUser</h4>
@@ -105,7 +105,7 @@
                                    <code>i32</code> offset,
                                    <code>i32</code> limit)
     throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code>
-</pre><p>API method to get a list of users in a specific domain Users will be reverse sorted based on the created time.</p>
+</pre><p>API method to get a list of users in a specific domain.</p>
 <li>domainId : Domain id</li>
 <li>offset : Starting result number</li>
 <li>limit : Number of max results to be sent</li>
@@ -131,7 +131,7 @@
 <pre><code>list&lt;<code><a href="sharing_models.html#Struct_UserGroup">sharing_models.UserGroup</a></code>&gt;</code> getGroups(<code>string</code> domainId,
                                          <code>i32</code> offset,
                                          <code>i32</code> limit)
-</pre><p>API method to get groups in a domainId. Results are reverse sorted based on created time.</p>
+</pre><p>API method to get groups in a domainId.</p>
 <br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_addUsersToGroup">Function: SharingRegistryService.addUsersToGroup</h4>
 <pre><code>bool</code> addUsersToGroup(<code>string</code> domainId,
                      <code>list&lt;<code>string</code>&gt;</code> userIds,
@@ -150,14 +150,14 @@
                                                     <code>i32</code> offset,
                                                     <code>i32</code> limit)
     throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code>
-</pre><p>API method to get list of child users in a group. Only the direct members will be returned. Results are reverse time sorted based on creation time</p>
+</pre><p>API method to get list of child users in a group. Only the direct members will be returned.</p>
 <br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_getGroupMembersOfTypeGroup">Function: SharingRegistryService.getGroupMembersOfTypeGroup</h4>
 <pre><code>list&lt;<code><a href="sharing_models.html#Struct_UserGroup">sharing_models.UserGroup</a></code>&gt;</code> getGroupMembersOfTypeGroup(<code>string</code> domainId,
                                                           <code>string</code> groupId,
                                                           <code>i32</code> offset,
                                                           <code>i32</code> limit)
     throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code>
-</pre><p>API method to get list of child groups in a group. Only the direct members will be returned. Results are reverse time sorted based on creation time</p>
+</pre><p>API method to get list of child groups in a group. Only the direct members will be returned.</p>
 <br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_addChildGroupsToParentGroup">Function: SharingRegistryService.addChildGroupsToParentGroup</h4>
 <pre><code>bool</code> addChildGroupsToParentGroup(<code>string</code> domainId,
                                  <code>list&lt;<code>string</code>&gt;</code> childIds,
@@ -193,9 +193,9 @@
                                                <code>i32</code> offset,
                                                <code>i32</code> limit)
     throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code>
-</pre><p>API method to get entity types in a domainId. Results are reverse time sorted based on creation time</p>
-<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_registerEntity">Function: SharingRegistryService.registerEntity</h4>
-<pre><code>string</code> registerEntity(<code><a href="sharing_models.html#Struct_Entity">sharing_models.Entity</a></code> entity)
+</pre><p>API method to get entity types in a domainId.</p>
+<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_createEntity">Function: SharingRegistryService.createEntity</h4>
+<pre><code>string</code> createEntity(<code><a href="sharing_models.html#Struct_Entity">sharing_models.Entity</a></code> entity)
     throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code>
 </pre><p>API method to register new entity</p>
 <br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_updateEntity">Function: SharingRegistryService.updateEntity</h4>
@@ -256,7 +256,7 @@
                                                        <code>i32</code> offset,
                                                        <code>i32</code> limit)
     throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code>
-</pre><p>API method to get list of permission types in a given domainId. Results are reverse time sorted based on creation time</p>
+</pre><p>API method to get list of permission types in a given domainId.</p>
 <br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_shareEntityWithUsers">Function: SharingRegistryService.shareEntityWithUsers</h4>
 <pre><code>bool</code> shareEntityWithUsers(<code>string</code> domainId,
                           <code>string</code> entityId,