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/05 08:20:52 UTC

[01/17] airavata git commit: renaming directory names

Repository: airavata
Updated Branches:
  refs/heads/airavata-gov-registry a3f9b19c5 -> 43f228fc2


http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/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
new file mode 100644
index 0000000..d3cc54f
--- /dev/null
+++ b/modules/sharing-registry/thrift_models/sharing_cpi.thrift
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+namespace java org.apache.airavata.sharing.registry.service.cpi
+
+include "./sharing_models.thrift"
+
+service GovRegistryService {
+
+    /**
+     * Domain Operations
+    **/
+    string createDomain(1: required sharing_models.Domain domain) throws (1: sharing_models.GovRegistryException gre)
+    bool updateDomain(1: required sharing_models.Domain domain) throws (1: sharing_models.GovRegistryException gre)
+    bool deleteDomain(1: required string domainId) throws (1: sharing_models.GovRegistryException gre)
+    sharing_models.Domain getDomain(1: required string domainId) throws (1: sharing_models.GovRegistryException gre)
+    list<sharing_models.Domain> getDomains(1: required i32 offset, 2: required i32 limit) throws (1: sharing_models.GovRegistryException gre);
+
+    /**
+     * User Operations
+    **/
+    string createUser(1: required sharing_models.User user) throws (1: sharing_models.GovRegistryException gre)
+    bool updatedUser(1: required sharing_models.User user) throws (1: sharing_models.GovRegistryException gre)
+    bool deleteUser(1: required string userId) throws (1: sharing_models.GovRegistryException gre)
+    sharing_models.User getUser(1: required string userId) throws (1: sharing_models.GovRegistryException gre)
+    list<sharing_models.User> getUsers(1: required string domain, 2: required i32 offset, 3: required i32 limit) throws (1: sharing_models.GovRegistryException gre);
+
+    /**
+     * Group Operations
+    **/
+    string createGroup(1: required sharing_models.UserGroup group) throws (1: sharing_models.GovRegistryException gre)
+    bool updateGroup(1: required sharing_models.UserGroup group) throws (1: sharing_models.GovRegistryException gre)
+    bool deleteGroup(1: required string groupId) throws (1: sharing_models.GovRegistryException gre)
+    sharing_models.UserGroup getGroup(1: required string groupId) throws (1: sharing_models.GovRegistryException gre)
+    list<sharing_models.UserGroup> getGroups(1: required string domain, 2: required i32 offset, 3: required i32 limit)
+
+    bool addUsersToGroup(1: required list<string> userIds, 2: required string groupId) throws (1: sharing_models.GovRegistryException gre);
+    bool removeUsersFromGroup(1: required list<string> userIds, 2: required string groupId) throws (1: sharing_models.GovRegistryException gre);
+    map<string, sharing_models.GroupChildType> getGroupMembers(1: required string groupId, 2: required i32 offset, 3: required i32 limit) throws (1: sharing_models.GovRegistryException gre);
+    bool addChildGroupToParentGroup(1: required string childId, 2: required string groupId) throws (1: sharing_models.GovRegistryException gre);
+    bool removeChildGroupFromParentGroup(1: required string childId, 2: required string groupId) throws (1: sharing_models.GovRegistryException gre);
+
+    /**
+     * EntityType Operations
+    **/
+    string createEntityType(1: required sharing_models.EntityType entityType) throws (1: sharing_models.GovRegistryException gre)
+    bool updateEntityType(1: required sharing_models.EntityType entityType) throws (1: sharing_models.GovRegistryException gre)
+    bool deleteEntityType(1: required string entityTypeId) throws (1: sharing_models.GovRegistryException gre)
+    sharing_models.EntityType getEntityType(1: required string entityTypeId) throws (1: sharing_models.GovRegistryException gre)
+    list<sharing_models.EntityType> getEntityTypes(1: required string domain, 2: required i32 offset, 3: required i32 limit) throws (1: sharing_models.GovRegistryException gre);
+
+    /**
+     * Entity Operations
+    **/
+    string createEntity(1: required sharing_models.Entity entity) throws (1: sharing_models.GovRegistryException gre)
+    bool updateEntity(1: required sharing_models.Entity entity) throws (1: sharing_models.GovRegistryException gre)
+    bool deleteEntity(1: required string entityId) throws (1: sharing_models.GovRegistryException gre)
+    sharing_models.Entity getEntity(1: required string entityId) throws (1: sharing_models.GovRegistryException gre)
+    list<sharing_models.Entity> searchEntities(1: required string userId, 2: required string entityTypeId, 3: required map<sharing_models.EntitySearchFields,
+     string> filters, 4: required i32 offset, 5: required i32 limit) throws (1: sharing_models.GovRegistryException gre)
+
+    /**
+     * Permission Operations
+    **/
+    string createPermissionType(1: required sharing_models.PermissionType permissionType) throws (1: sharing_models.GovRegistryException gre)
+    bool updatePermissionType(1: required sharing_models.PermissionType permissionType) throws (1: sharing_models.GovRegistryException gre)
+    bool deletePermissionType(1: required string entityTypeId) throws (1: sharing_models.GovRegistryException gre)
+    sharing_models.PermissionType getPermissionType(1: required string permissionTypeId) throws (1: sharing_models.GovRegistryException gre)
+    list<sharing_models.PermissionType> getPermissionTypes(1: required string domain, 2: required i32 offset, 3: required i32 limit) throws (1: sharing_models.GovRegistryException gre)
+
+    /**
+     * Sharing Entity with Users and Groups
+    **/
+    bool shareEntityWithUsers(1: required string entityId, 2: required list<string> userList, 3: required string perssionTypeId) throws (1: sharing_models.GovRegistryException gre)
+    bool revokeEntitySharingFromUsers(1: required string entityId, 2: required list<string> userList, 3: required string perssionTypeId) throws (1: sharing_models.GovRegistryException gre)
+    bool shareEntityWithGroups(1: required string entityId, 2: required list<string> groupList, 3: required string perssionTypeId) throws (1: sharing_models.GovRegistryException gre)
+    bool revokeEntitySharingFromGroups(1: required string entityId, 2: required list<string> groupList, 3: required string perssionTypeId) throws (1: sharing_models.GovRegistryException gre)
+    bool userHasAccess(1: required string domainId, 2: required string userId, 3: required string entityId, 4: required string permissionTypeId) throws (1: sharing_models.GovRegistryException gre)
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/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
new file mode 100644
index 0000000..5670c5e
--- /dev/null
+++ b/modules/sharing-registry/thrift_models/sharing_models.thrift
@@ -0,0 +1,129 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+ namespace java org.apache.airavata.sharing.registry.models
+
+const string DO_NOT_SET_AT_CLIENTS_ID = "DO_NOT_SET_AT_CLIENTS_ID"
+
+struct Domain {
+    1: optional string domainId = DO_NOT_SET_AT_CLIENTS_ID,
+    2: optional string name,
+    3: optional string description,
+    4: optional i64 createdTime,
+    5: optional i64 updatedTime
+}
+
+ struct User {
+     1: optional string userId = DO_NOT_SET_AT_CLIENTS_ID,
+     2: optional string domainId,
+     3: optional string userName,
+     4: optional i64 createdTime,
+     5: optional i64 updatedTime
+ }
+
+enum GroupType {
+    SINGLE_USER,
+    MULTI_USER
+}
+
+ struct UserGroup {
+     1: optional string groupId = DO_NOT_SET_AT_CLIENTS_ID,
+     2: optional string domainId,
+     3: optional string name,
+     6: optional string description,
+     7: optional string ownerId,
+     8: optional i64 createdTime,
+     9: optional i64 updatedTime,
+     10: optional GroupType groupType
+ }
+
+ enum GroupChildType {
+    USER,
+    GROUP
+ }
+
+ struct GroupMembership {
+    1: optional string parentId,
+    2: optional string childId,
+    3: optional GroupChildType childType
+    4: optional i64 createdTime,
+    5: optional i64 updatedTime
+ }
+
+
+
+struct EntityType {
+    1: optional string entityTypeId = DO_NOT_SET_AT_CLIENTS_ID,
+    2: optional string domainId,
+    3: optional string name,
+    4: optional string description,
+    5: optional i64 createdTime,
+    6: optional i64 updatedTime
+}
+
+enum EntitySearchFields {
+    NAME,
+    DESCRIPTION,
+    FULL_TEXT
+}
+
+
+struct Entity {
+    1: optional string entityId = DO_NOT_SET_AT_CLIENTS_ID,
+    2: optional string domainId,
+    3: optional string entityTypeId,
+    4: optional string ownerId,
+    5: optional string parentEntityId,
+    6: optional string name,
+    7: optional string description,
+    8: optional map<string,string> metadata,
+    9: optional string fullText,
+    10: optional i64 createdTime,
+    11: optional i64 updatedTime
+}
+
+struct PermissionType {
+    1: optional string permissionTypeId = DO_NOT_SET_AT_CLIENTS_ID,
+    2: optional string domainId,
+    3: optional string name,
+    4: optional string description,
+    5: optional i64 createdTime,
+    6: optional i64 updatedTime
+}
+
+enum SharingType {
+    DIRECT,
+    INHERITED
+ }
+
+struct Sharing {
+    1: optional string permissionTypeId,
+    2: optional string entityId,
+    3: optional string groupId,
+    4: optional GroupType groupType,
+    5: optional SharingType sharingType,
+    6: optional string inheritedParentId,
+    7: optional i64 createdTime,
+    8: optional i64 updatedTime
+}
+
+exception GovRegistryException {
+  1: required string message
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/thrift_models/thrift-gen.sh
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/thrift_models/thrift-gen.sh b/modules/sharing-registry/thrift_models/thrift-gen.sh
new file mode 100755
index 0000000..295be80
--- /dev/null
+++ b/modules/sharing-registry/thrift_models/thrift-gen.sh
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+
+thrift --gen java sharing_models.thrift
+cd gen-java
+rm -r ../../airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/*
+cp -r org/apache/airavata/sharing/registry/models/ ../../airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/
+
+cd ..
+thrift --gen java sharing_cpi.thrift
+cd gen-java
+rm -r ../../airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/service/cpi/*
+cp -r org/apache/airavata/sharing/registry/service/cpi/ ../../airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/service/cpi/
+
+cd ..
+
+rm -r gen-java
\ No newline at end of file


[14/17] airavata git commit: renaming directory names

Posted by sc...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/Entity.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/Entity.java b/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/Entity.java
deleted file mode 100644
index 462d892..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/Entity.java
+++ /dev/null
@@ -1,1511 +0,0 @@
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- *  @generated
- */
-package org.apache.airavata.sharing.registry.models;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-05")
-public class Entity implements org.apache.thrift.TBase<Entity, Entity._Fields>, java.io.Serializable, Cloneable, Comparable<Entity> {
-  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Entity");
-
-  private static final org.apache.thrift.protocol.TField ENTITY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("entityId", org.apache.thrift.protocol.TType.STRING, (short)1);
-  private static final org.apache.thrift.protocol.TField DOMAIN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("domainId", org.apache.thrift.protocol.TType.STRING, (short)2);
-  private static final org.apache.thrift.protocol.TField ENTITY_TYPE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("entityTypeId", org.apache.thrift.protocol.TType.STRING, (short)3);
-  private static final org.apache.thrift.protocol.TField OWNER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("ownerId", org.apache.thrift.protocol.TType.STRING, (short)4);
-  private static final org.apache.thrift.protocol.TField PARENT_ENTITY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("parentEntityId", org.apache.thrift.protocol.TType.STRING, (short)5);
-  private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)6);
-  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 METADATA_FIELD_DESC = new org.apache.thrift.protocol.TField("metadata", org.apache.thrift.protocol.TType.MAP, (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 Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-  static {
-    schemes.put(StandardScheme.class, new EntityStandardSchemeFactory());
-    schemes.put(TupleScheme.class, new EntityTupleSchemeFactory());
-  }
-
-  public String entityId; // optional
-  public String domainId; // optional
-  public String entityTypeId; // optional
-  public String ownerId; // optional
-  public String parentEntityId; // optional
-  public String name; // optional
-  public String description; // optional
-  public Map<String,String> metadata; // optional
-  public String fullText; // optional
-  public long createdTime; // optional
-  public long updatedTime; // optional
-
-  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
-    ENTITY_ID((short)1, "entityId"),
-    DOMAIN_ID((short)2, "domainId"),
-    ENTITY_TYPE_ID((short)3, "entityTypeId"),
-    OWNER_ID((short)4, "ownerId"),
-    PARENT_ENTITY_ID((short)5, "parentEntityId"),
-    NAME((short)6, "name"),
-    DESCRIPTION((short)7, "description"),
-    METADATA((short)8, "metadata"),
-    FULL_TEXT((short)9, "fullText"),
-    CREATED_TIME((short)10, "createdTime"),
-    UPDATED_TIME((short)11, "updatedTime");
-
-    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
-    static {
-      for (_Fields field : EnumSet.allOf(_Fields.class)) {
-        byName.put(field.getFieldName(), field);
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, or null if its not found.
-     */
-    public static _Fields findByThriftId(int fieldId) {
-      switch(fieldId) {
-        case 1: // ENTITY_ID
-          return ENTITY_ID;
-        case 2: // DOMAIN_ID
-          return DOMAIN_ID;
-        case 3: // ENTITY_TYPE_ID
-          return ENTITY_TYPE_ID;
-        case 4: // OWNER_ID
-          return OWNER_ID;
-        case 5: // PARENT_ENTITY_ID
-          return PARENT_ENTITY_ID;
-        case 6: // NAME
-          return NAME;
-        case 7: // DESCRIPTION
-          return DESCRIPTION;
-        case 8: // METADATA
-          return METADATA;
-        case 9: // FULL_TEXT
-          return FULL_TEXT;
-        case 10: // CREATED_TIME
-          return CREATED_TIME;
-        case 11: // UPDATED_TIME
-          return UPDATED_TIME;
-        default:
-          return null;
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, throwing an exception
-     * if it is not found.
-     */
-    public static _Fields findByThriftIdOrThrow(int fieldId) {
-      _Fields fields = findByThriftId(fieldId);
-      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-      return fields;
-    }
-
-    /**
-     * Find the _Fields constant that matches name, or null if its not found.
-     */
-    public static _Fields findByName(String name) {
-      return byName.get(name);
-    }
-
-    private final short _thriftId;
-    private final String _fieldName;
-
-    _Fields(short thriftId, String fieldName) {
-      _thriftId = thriftId;
-      _fieldName = fieldName;
-    }
-
-    public short getThriftFieldId() {
-      return _thriftId;
-    }
-
-    public String getFieldName() {
-      return _fieldName;
-    }
-  }
-
-  // isset id assignments
-  private static final int __CREATEDTIME_ISSET_ID = 0;
-  private static final int __UPDATEDTIME_ISSET_ID = 1;
-  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.METADATA,_Fields.FULL_TEXT,_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);
-    tmpMap.put(_Fields.ENTITY_ID, new org.apache.thrift.meta_data.FieldMetaData("entityId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.DOMAIN_ID, new org.apache.thrift.meta_data.FieldMetaData("domainId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.ENTITY_TYPE_ID, new org.apache.thrift.meta_data.FieldMetaData("entityTypeId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.OWNER_ID, new org.apache.thrift.meta_data.FieldMetaData("ownerId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.PARENT_ENTITY_ID, new org.apache.thrift.meta_data.FieldMetaData("parentEntityId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("description", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.METADATA, new org.apache.thrift.meta_data.FieldMetaData("metadata", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
-            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), 
-            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
-    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.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, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-    metaDataMap = Collections.unmodifiableMap(tmpMap);
-    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Entity.class, metaDataMap);
-  }
-
-  public Entity() {
-    this.entityId = "DO_NOT_SET_AT_CLIENTS_ID";
-
-  }
-
-  /**
-   * Performs a deep copy on <i>other</i>.
-   */
-  public Entity(Entity other) {
-    __isset_bitfield = other.__isset_bitfield;
-    if (other.isSetEntityId()) {
-      this.entityId = other.entityId;
-    }
-    if (other.isSetDomainId()) {
-      this.domainId = other.domainId;
-    }
-    if (other.isSetEntityTypeId()) {
-      this.entityTypeId = other.entityTypeId;
-    }
-    if (other.isSetOwnerId()) {
-      this.ownerId = other.ownerId;
-    }
-    if (other.isSetParentEntityId()) {
-      this.parentEntityId = other.parentEntityId;
-    }
-    if (other.isSetName()) {
-      this.name = other.name;
-    }
-    if (other.isSetDescription()) {
-      this.description = other.description;
-    }
-    if (other.isSetMetadata()) {
-      Map<String,String> __this__metadata = new HashMap<String,String>(other.metadata);
-      this.metadata = __this__metadata;
-    }
-    if (other.isSetFullText()) {
-      this.fullText = other.fullText;
-    }
-    this.createdTime = other.createdTime;
-    this.updatedTime = other.updatedTime;
-  }
-
-  public Entity deepCopy() {
-    return new Entity(this);
-  }
-
-  @Override
-  public void clear() {
-    this.entityId = "DO_NOT_SET_AT_CLIENTS_ID";
-
-    this.domainId = null;
-    this.entityTypeId = null;
-    this.ownerId = null;
-    this.parentEntityId = null;
-    this.name = null;
-    this.description = null;
-    this.metadata = null;
-    this.fullText = null;
-    setCreatedTimeIsSet(false);
-    this.createdTime = 0;
-    setUpdatedTimeIsSet(false);
-    this.updatedTime = 0;
-  }
-
-  public String getEntityId() {
-    return this.entityId;
-  }
-
-  public Entity setEntityId(String entityId) {
-    this.entityId = entityId;
-    return this;
-  }
-
-  public void unsetEntityId() {
-    this.entityId = null;
-  }
-
-  /** Returns true if field entityId is set (has been assigned a value) and false otherwise */
-  public boolean isSetEntityId() {
-    return this.entityId != null;
-  }
-
-  public void setEntityIdIsSet(boolean value) {
-    if (!value) {
-      this.entityId = null;
-    }
-  }
-
-  public String getDomainId() {
-    return this.domainId;
-  }
-
-  public Entity setDomainId(String domainId) {
-    this.domainId = domainId;
-    return this;
-  }
-
-  public void unsetDomainId() {
-    this.domainId = null;
-  }
-
-  /** Returns true if field domainId is set (has been assigned a value) and false otherwise */
-  public boolean isSetDomainId() {
-    return this.domainId != null;
-  }
-
-  public void setDomainIdIsSet(boolean value) {
-    if (!value) {
-      this.domainId = null;
-    }
-  }
-
-  public String getEntityTypeId() {
-    return this.entityTypeId;
-  }
-
-  public Entity setEntityTypeId(String entityTypeId) {
-    this.entityTypeId = entityTypeId;
-    return this;
-  }
-
-  public void unsetEntityTypeId() {
-    this.entityTypeId = null;
-  }
-
-  /** Returns true if field entityTypeId is set (has been assigned a value) and false otherwise */
-  public boolean isSetEntityTypeId() {
-    return this.entityTypeId != null;
-  }
-
-  public void setEntityTypeIdIsSet(boolean value) {
-    if (!value) {
-      this.entityTypeId = null;
-    }
-  }
-
-  public String getOwnerId() {
-    return this.ownerId;
-  }
-
-  public Entity setOwnerId(String ownerId) {
-    this.ownerId = ownerId;
-    return this;
-  }
-
-  public void unsetOwnerId() {
-    this.ownerId = null;
-  }
-
-  /** Returns true if field ownerId is set (has been assigned a value) and false otherwise */
-  public boolean isSetOwnerId() {
-    return this.ownerId != null;
-  }
-
-  public void setOwnerIdIsSet(boolean value) {
-    if (!value) {
-      this.ownerId = null;
-    }
-  }
-
-  public String getParentEntityId() {
-    return this.parentEntityId;
-  }
-
-  public Entity setParentEntityId(String parentEntityId) {
-    this.parentEntityId = parentEntityId;
-    return this;
-  }
-
-  public void unsetParentEntityId() {
-    this.parentEntityId = null;
-  }
-
-  /** Returns true if field parentEntityId is set (has been assigned a value) and false otherwise */
-  public boolean isSetParentEntityId() {
-    return this.parentEntityId != null;
-  }
-
-  public void setParentEntityIdIsSet(boolean value) {
-    if (!value) {
-      this.parentEntityId = null;
-    }
-  }
-
-  public String getName() {
-    return this.name;
-  }
-
-  public Entity setName(String name) {
-    this.name = name;
-    return this;
-  }
-
-  public void unsetName() {
-    this.name = null;
-  }
-
-  /** Returns true if field name is set (has been assigned a value) and false otherwise */
-  public boolean isSetName() {
-    return this.name != null;
-  }
-
-  public void setNameIsSet(boolean value) {
-    if (!value) {
-      this.name = null;
-    }
-  }
-
-  public String getDescription() {
-    return this.description;
-  }
-
-  public Entity setDescription(String description) {
-    this.description = description;
-    return this;
-  }
-
-  public void unsetDescription() {
-    this.description = null;
-  }
-
-  /** Returns true if field description is set (has been assigned a value) and false otherwise */
-  public boolean isSetDescription() {
-    return this.description != null;
-  }
-
-  public void setDescriptionIsSet(boolean value) {
-    if (!value) {
-      this.description = null;
-    }
-  }
-
-  public int getMetadataSize() {
-    return (this.metadata == null) ? 0 : this.metadata.size();
-  }
-
-  public void putToMetadata(String key, String val) {
-    if (this.metadata == null) {
-      this.metadata = new HashMap<String,String>();
-    }
-    this.metadata.put(key, val);
-  }
-
-  public Map<String,String> getMetadata() {
-    return this.metadata;
-  }
-
-  public Entity setMetadata(Map<String,String> metadata) {
-    this.metadata = metadata;
-    return this;
-  }
-
-  public void unsetMetadata() {
-    this.metadata = null;
-  }
-
-  /** Returns true if field metadata is set (has been assigned a value) and false otherwise */
-  public boolean isSetMetadata() {
-    return this.metadata != null;
-  }
-
-  public void setMetadataIsSet(boolean value) {
-    if (!value) {
-      this.metadata = null;
-    }
-  }
-
-  public String getFullText() {
-    return this.fullText;
-  }
-
-  public Entity setFullText(String fullText) {
-    this.fullText = fullText;
-    return this;
-  }
-
-  public void unsetFullText() {
-    this.fullText = null;
-  }
-
-  /** Returns true if field fullText is set (has been assigned a value) and false otherwise */
-  public boolean isSetFullText() {
-    return this.fullText != null;
-  }
-
-  public void setFullTextIsSet(boolean value) {
-    if (!value) {
-      this.fullText = null;
-    }
-  }
-
-  public long getCreatedTime() {
-    return this.createdTime;
-  }
-
-  public Entity setCreatedTime(long createdTime) {
-    this.createdTime = createdTime;
-    setCreatedTimeIsSet(true);
-    return this;
-  }
-
-  public void unsetCreatedTime() {
-    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CREATEDTIME_ISSET_ID);
-  }
-
-  /** Returns true if field createdTime is set (has been assigned a value) and false otherwise */
-  public boolean isSetCreatedTime() {
-    return EncodingUtils.testBit(__isset_bitfield, __CREATEDTIME_ISSET_ID);
-  }
-
-  public void setCreatedTimeIsSet(boolean value) {
-    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CREATEDTIME_ISSET_ID, value);
-  }
-
-  public long getUpdatedTime() {
-    return this.updatedTime;
-  }
-
-  public Entity setUpdatedTime(long updatedTime) {
-    this.updatedTime = updatedTime;
-    setUpdatedTimeIsSet(true);
-    return this;
-  }
-
-  public void unsetUpdatedTime() {
-    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID);
-  }
-
-  /** Returns true if field updatedTime is set (has been assigned a value) and false otherwise */
-  public boolean isSetUpdatedTime() {
-    return EncodingUtils.testBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID);
-  }
-
-  public void setUpdatedTimeIsSet(boolean value) {
-    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID, value);
-  }
-
-  public void setFieldValue(_Fields field, Object value) {
-    switch (field) {
-    case ENTITY_ID:
-      if (value == null) {
-        unsetEntityId();
-      } else {
-        setEntityId((String)value);
-      }
-      break;
-
-    case DOMAIN_ID:
-      if (value == null) {
-        unsetDomainId();
-      } else {
-        setDomainId((String)value);
-      }
-      break;
-
-    case ENTITY_TYPE_ID:
-      if (value == null) {
-        unsetEntityTypeId();
-      } else {
-        setEntityTypeId((String)value);
-      }
-      break;
-
-    case OWNER_ID:
-      if (value == null) {
-        unsetOwnerId();
-      } else {
-        setOwnerId((String)value);
-      }
-      break;
-
-    case PARENT_ENTITY_ID:
-      if (value == null) {
-        unsetParentEntityId();
-      } else {
-        setParentEntityId((String)value);
-      }
-      break;
-
-    case NAME:
-      if (value == null) {
-        unsetName();
-      } else {
-        setName((String)value);
-      }
-      break;
-
-    case DESCRIPTION:
-      if (value == null) {
-        unsetDescription();
-      } else {
-        setDescription((String)value);
-      }
-      break;
-
-    case METADATA:
-      if (value == null) {
-        unsetMetadata();
-      } else {
-        setMetadata((Map<String,String>)value);
-      }
-      break;
-
-    case FULL_TEXT:
-      if (value == null) {
-        unsetFullText();
-      } else {
-        setFullText((String)value);
-      }
-      break;
-
-    case CREATED_TIME:
-      if (value == null) {
-        unsetCreatedTime();
-      } else {
-        setCreatedTime((Long)value);
-      }
-      break;
-
-    case UPDATED_TIME:
-      if (value == null) {
-        unsetUpdatedTime();
-      } else {
-        setUpdatedTime((Long)value);
-      }
-      break;
-
-    }
-  }
-
-  public Object getFieldValue(_Fields field) {
-    switch (field) {
-    case ENTITY_ID:
-      return getEntityId();
-
-    case DOMAIN_ID:
-      return getDomainId();
-
-    case ENTITY_TYPE_ID:
-      return getEntityTypeId();
-
-    case OWNER_ID:
-      return getOwnerId();
-
-    case PARENT_ENTITY_ID:
-      return getParentEntityId();
-
-    case NAME:
-      return getName();
-
-    case DESCRIPTION:
-      return getDescription();
-
-    case METADATA:
-      return getMetadata();
-
-    case FULL_TEXT:
-      return getFullText();
-
-    case CREATED_TIME:
-      return getCreatedTime();
-
-    case UPDATED_TIME:
-      return getUpdatedTime();
-
-    }
-    throw new IllegalStateException();
-  }
-
-  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
-  public boolean isSet(_Fields field) {
-    if (field == null) {
-      throw new IllegalArgumentException();
-    }
-
-    switch (field) {
-    case ENTITY_ID:
-      return isSetEntityId();
-    case DOMAIN_ID:
-      return isSetDomainId();
-    case ENTITY_TYPE_ID:
-      return isSetEntityTypeId();
-    case OWNER_ID:
-      return isSetOwnerId();
-    case PARENT_ENTITY_ID:
-      return isSetParentEntityId();
-    case NAME:
-      return isSetName();
-    case DESCRIPTION:
-      return isSetDescription();
-    case METADATA:
-      return isSetMetadata();
-    case FULL_TEXT:
-      return isSetFullText();
-    case CREATED_TIME:
-      return isSetCreatedTime();
-    case UPDATED_TIME:
-      return isSetUpdatedTime();
-    }
-    throw new IllegalStateException();
-  }
-
-  @Override
-  public boolean equals(Object that) {
-    if (that == null)
-      return false;
-    if (that instanceof Entity)
-      return this.equals((Entity)that);
-    return false;
-  }
-
-  public boolean equals(Entity that) {
-    if (that == null)
-      return false;
-
-    boolean this_present_entityId = true && this.isSetEntityId();
-    boolean that_present_entityId = true && that.isSetEntityId();
-    if (this_present_entityId || that_present_entityId) {
-      if (!(this_present_entityId && that_present_entityId))
-        return false;
-      if (!this.entityId.equals(that.entityId))
-        return false;
-    }
-
-    boolean this_present_domainId = true && this.isSetDomainId();
-    boolean that_present_domainId = true && that.isSetDomainId();
-    if (this_present_domainId || that_present_domainId) {
-      if (!(this_present_domainId && that_present_domainId))
-        return false;
-      if (!this.domainId.equals(that.domainId))
-        return false;
-    }
-
-    boolean this_present_entityTypeId = true && this.isSetEntityTypeId();
-    boolean that_present_entityTypeId = true && that.isSetEntityTypeId();
-    if (this_present_entityTypeId || that_present_entityTypeId) {
-      if (!(this_present_entityTypeId && that_present_entityTypeId))
-        return false;
-      if (!this.entityTypeId.equals(that.entityTypeId))
-        return false;
-    }
-
-    boolean this_present_ownerId = true && this.isSetOwnerId();
-    boolean that_present_ownerId = true && that.isSetOwnerId();
-    if (this_present_ownerId || that_present_ownerId) {
-      if (!(this_present_ownerId && that_present_ownerId))
-        return false;
-      if (!this.ownerId.equals(that.ownerId))
-        return false;
-    }
-
-    boolean this_present_parentEntityId = true && this.isSetParentEntityId();
-    boolean that_present_parentEntityId = true && that.isSetParentEntityId();
-    if (this_present_parentEntityId || that_present_parentEntityId) {
-      if (!(this_present_parentEntityId && that_present_parentEntityId))
-        return false;
-      if (!this.parentEntityId.equals(that.parentEntityId))
-        return false;
-    }
-
-    boolean this_present_name = true && this.isSetName();
-    boolean that_present_name = true && that.isSetName();
-    if (this_present_name || that_present_name) {
-      if (!(this_present_name && that_present_name))
-        return false;
-      if (!this.name.equals(that.name))
-        return false;
-    }
-
-    boolean this_present_description = true && this.isSetDescription();
-    boolean that_present_description = true && that.isSetDescription();
-    if (this_present_description || that_present_description) {
-      if (!(this_present_description && that_present_description))
-        return false;
-      if (!this.description.equals(that.description))
-        return false;
-    }
-
-    boolean this_present_metadata = true && this.isSetMetadata();
-    boolean that_present_metadata = true && that.isSetMetadata();
-    if (this_present_metadata || that_present_metadata) {
-      if (!(this_present_metadata && that_present_metadata))
-        return false;
-      if (!this.metadata.equals(that.metadata))
-        return false;
-    }
-
-    boolean this_present_fullText = true && this.isSetFullText();
-    boolean that_present_fullText = true && that.isSetFullText();
-    if (this_present_fullText || that_present_fullText) {
-      if (!(this_present_fullText && that_present_fullText))
-        return false;
-      if (!this.fullText.equals(that.fullText))
-        return false;
-    }
-
-    boolean this_present_createdTime = true && this.isSetCreatedTime();
-    boolean that_present_createdTime = true && that.isSetCreatedTime();
-    if (this_present_createdTime || that_present_createdTime) {
-      if (!(this_present_createdTime && that_present_createdTime))
-        return false;
-      if (this.createdTime != that.createdTime)
-        return false;
-    }
-
-    boolean this_present_updatedTime = true && this.isSetUpdatedTime();
-    boolean that_present_updatedTime = true && that.isSetUpdatedTime();
-    if (this_present_updatedTime || that_present_updatedTime) {
-      if (!(this_present_updatedTime && that_present_updatedTime))
-        return false;
-      if (this.updatedTime != that.updatedTime)
-        return false;
-    }
-
-    return true;
-  }
-
-  @Override
-  public int hashCode() {
-    List<Object> list = new ArrayList<Object>();
-
-    boolean present_entityId = true && (isSetEntityId());
-    list.add(present_entityId);
-    if (present_entityId)
-      list.add(entityId);
-
-    boolean present_domainId = true && (isSetDomainId());
-    list.add(present_domainId);
-    if (present_domainId)
-      list.add(domainId);
-
-    boolean present_entityTypeId = true && (isSetEntityTypeId());
-    list.add(present_entityTypeId);
-    if (present_entityTypeId)
-      list.add(entityTypeId);
-
-    boolean present_ownerId = true && (isSetOwnerId());
-    list.add(present_ownerId);
-    if (present_ownerId)
-      list.add(ownerId);
-
-    boolean present_parentEntityId = true && (isSetParentEntityId());
-    list.add(present_parentEntityId);
-    if (present_parentEntityId)
-      list.add(parentEntityId);
-
-    boolean present_name = true && (isSetName());
-    list.add(present_name);
-    if (present_name)
-      list.add(name);
-
-    boolean present_description = true && (isSetDescription());
-    list.add(present_description);
-    if (present_description)
-      list.add(description);
-
-    boolean present_metadata = true && (isSetMetadata());
-    list.add(present_metadata);
-    if (present_metadata)
-      list.add(metadata);
-
-    boolean present_fullText = true && (isSetFullText());
-    list.add(present_fullText);
-    if (present_fullText)
-      list.add(fullText);
-
-    boolean present_createdTime = true && (isSetCreatedTime());
-    list.add(present_createdTime);
-    if (present_createdTime)
-      list.add(createdTime);
-
-    boolean present_updatedTime = true && (isSetUpdatedTime());
-    list.add(present_updatedTime);
-    if (present_updatedTime)
-      list.add(updatedTime);
-
-    return list.hashCode();
-  }
-
-  @Override
-  public int compareTo(Entity other) {
-    if (!getClass().equals(other.getClass())) {
-      return getClass().getName().compareTo(other.getClass().getName());
-    }
-
-    int lastComparison = 0;
-
-    lastComparison = Boolean.valueOf(isSetEntityId()).compareTo(other.isSetEntityId());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetEntityId()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityId, other.entityId);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetDomainId()).compareTo(other.isSetDomainId());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetDomainId()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domainId, other.domainId);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetEntityTypeId()).compareTo(other.isSetEntityTypeId());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetEntityTypeId()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityTypeId, other.entityTypeId);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetOwnerId()).compareTo(other.isSetOwnerId());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetOwnerId()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ownerId, other.ownerId);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetParentEntityId()).compareTo(other.isSetParentEntityId());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetParentEntityId()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parentEntityId, other.parentEntityId);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetName()).compareTo(other.isSetName());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetName()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetDescription()).compareTo(other.isSetDescription());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetDescription()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.description, other.description);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetMetadata()).compareTo(other.isSetMetadata());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetMetadata()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.metadata, other.metadata);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetFullText()).compareTo(other.isSetFullText());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetFullText()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fullText, other.fullText);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetCreatedTime()).compareTo(other.isSetCreatedTime());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetCreatedTime()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.createdTime, other.createdTime);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetUpdatedTime()).compareTo(other.isSetUpdatedTime());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetUpdatedTime()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updatedTime, other.updatedTime);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    return 0;
-  }
-
-  public _Fields fieldForId(int fieldId) {
-    return _Fields.findByThriftId(fieldId);
-  }
-
-  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
-  }
-
-  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
-  }
-
-  @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder("Entity(");
-    boolean first = true;
-
-    if (isSetEntityId()) {
-      sb.append("entityId:");
-      if (this.entityId == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.entityId);
-      }
-      first = false;
-    }
-    if (isSetDomainId()) {
-      if (!first) sb.append(", ");
-      sb.append("domainId:");
-      if (this.domainId == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.domainId);
-      }
-      first = false;
-    }
-    if (isSetEntityTypeId()) {
-      if (!first) sb.append(", ");
-      sb.append("entityTypeId:");
-      if (this.entityTypeId == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.entityTypeId);
-      }
-      first = false;
-    }
-    if (isSetOwnerId()) {
-      if (!first) sb.append(", ");
-      sb.append("ownerId:");
-      if (this.ownerId == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.ownerId);
-      }
-      first = false;
-    }
-    if (isSetParentEntityId()) {
-      if (!first) sb.append(", ");
-      sb.append("parentEntityId:");
-      if (this.parentEntityId == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.parentEntityId);
-      }
-      first = false;
-    }
-    if (isSetName()) {
-      if (!first) sb.append(", ");
-      sb.append("name:");
-      if (this.name == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.name);
-      }
-      first = false;
-    }
-    if (isSetDescription()) {
-      if (!first) sb.append(", ");
-      sb.append("description:");
-      if (this.description == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.description);
-      }
-      first = false;
-    }
-    if (isSetMetadata()) {
-      if (!first) sb.append(", ");
-      sb.append("metadata:");
-      if (this.metadata == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.metadata);
-      }
-      first = false;
-    }
-    if (isSetFullText()) {
-      if (!first) sb.append(", ");
-      sb.append("fullText:");
-      if (this.fullText == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.fullText);
-      }
-      first = false;
-    }
-    if (isSetCreatedTime()) {
-      if (!first) sb.append(", ");
-      sb.append("createdTime:");
-      sb.append(this.createdTime);
-      first = false;
-    }
-    if (isSetUpdatedTime()) {
-      if (!first) sb.append(", ");
-      sb.append("updatedTime:");
-      sb.append(this.updatedTime);
-      first = false;
-    }
-    sb.append(")");
-    return sb.toString();
-  }
-
-  public void validate() throws org.apache.thrift.TException {
-    // check for required fields
-    // check for sub-struct validity
-  }
-
-  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-    try {
-      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-    } catch (org.apache.thrift.TException te) {
-      throw new java.io.IOException(te);
-    }
-  }
-
-  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-    try {
-      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
-      __isset_bitfield = 0;
-      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-    } catch (org.apache.thrift.TException te) {
-      throw new java.io.IOException(te);
-    }
-  }
-
-  private static class EntityStandardSchemeFactory implements SchemeFactory {
-    public EntityStandardScheme getScheme() {
-      return new EntityStandardScheme();
-    }
-  }
-
-  private static class EntityStandardScheme extends StandardScheme<Entity> {
-
-    public void read(org.apache.thrift.protocol.TProtocol iprot, Entity struct) throws org.apache.thrift.TException {
-      org.apache.thrift.protocol.TField schemeField;
-      iprot.readStructBegin();
-      while (true)
-      {
-        schemeField = iprot.readFieldBegin();
-        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
-          break;
-        }
-        switch (schemeField.id) {
-          case 1: // ENTITY_ID
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.entityId = iprot.readString();
-              struct.setEntityIdIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 2: // DOMAIN_ID
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.domainId = iprot.readString();
-              struct.setDomainIdIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 3: // ENTITY_TYPE_ID
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.entityTypeId = iprot.readString();
-              struct.setEntityTypeIdIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 4: // OWNER_ID
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.ownerId = iprot.readString();
-              struct.setOwnerIdIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 5: // PARENT_ENTITY_ID
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.parentEntityId = iprot.readString();
-              struct.setParentEntityIdIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 6: // NAME
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.name = iprot.readString();
-              struct.setNameIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 7: // DESCRIPTION
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.description = iprot.readString();
-              struct.setDescriptionIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 8: // METADATA
-            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
-              {
-                org.apache.thrift.protocol.TMap _map0 = iprot.readMapBegin();
-                struct.metadata = new HashMap<String,String>(2*_map0.size);
-                String _key1;
-                String _val2;
-                for (int _i3 = 0; _i3 < _map0.size; ++_i3)
-                {
-                  _key1 = iprot.readString();
-                  _val2 = iprot.readString();
-                  struct.metadata.put(_key1, _val2);
-                }
-                iprot.readMapEnd();
-              }
-              struct.setMetadataIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 9: // FULL_TEXT
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.fullText = iprot.readString();
-              struct.setFullTextIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 10: // CREATED_TIME
-            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
-              struct.createdTime = iprot.readI64();
-              struct.setCreatedTimeIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 11: // UPDATED_TIME
-            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
-              struct.updatedTime = iprot.readI64();
-              struct.setUpdatedTimeIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          default:
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-        }
-        iprot.readFieldEnd();
-      }
-      iprot.readStructEnd();
-
-      // check for required fields of primitive type, which can't be checked in the validate method
-      struct.validate();
-    }
-
-    public void write(org.apache.thrift.protocol.TProtocol oprot, Entity struct) throws org.apache.thrift.TException {
-      struct.validate();
-
-      oprot.writeStructBegin(STRUCT_DESC);
-      if (struct.entityId != null) {
-        if (struct.isSetEntityId()) {
-          oprot.writeFieldBegin(ENTITY_ID_FIELD_DESC);
-          oprot.writeString(struct.entityId);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.domainId != null) {
-        if (struct.isSetDomainId()) {
-          oprot.writeFieldBegin(DOMAIN_ID_FIELD_DESC);
-          oprot.writeString(struct.domainId);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.entityTypeId != null) {
-        if (struct.isSetEntityTypeId()) {
-          oprot.writeFieldBegin(ENTITY_TYPE_ID_FIELD_DESC);
-          oprot.writeString(struct.entityTypeId);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.ownerId != null) {
-        if (struct.isSetOwnerId()) {
-          oprot.writeFieldBegin(OWNER_ID_FIELD_DESC);
-          oprot.writeString(struct.ownerId);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.parentEntityId != null) {
-        if (struct.isSetParentEntityId()) {
-          oprot.writeFieldBegin(PARENT_ENTITY_ID_FIELD_DESC);
-          oprot.writeString(struct.parentEntityId);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.name != null) {
-        if (struct.isSetName()) {
-          oprot.writeFieldBegin(NAME_FIELD_DESC);
-          oprot.writeString(struct.name);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.description != null) {
-        if (struct.isSetDescription()) {
-          oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC);
-          oprot.writeString(struct.description);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.metadata != null) {
-        if (struct.isSetMetadata()) {
-          oprot.writeFieldBegin(METADATA_FIELD_DESC);
-          {
-            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.metadata.size()));
-            for (Map.Entry<String, String> _iter4 : struct.metadata.entrySet())
-            {
-              oprot.writeString(_iter4.getKey());
-              oprot.writeString(_iter4.getValue());
-            }
-            oprot.writeMapEnd();
-          }
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.fullText != null) {
-        if (struct.isSetFullText()) {
-          oprot.writeFieldBegin(FULL_TEXT_FIELD_DESC);
-          oprot.writeString(struct.fullText);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.isSetCreatedTime()) {
-        oprot.writeFieldBegin(CREATED_TIME_FIELD_DESC);
-        oprot.writeI64(struct.createdTime);
-        oprot.writeFieldEnd();
-      }
-      if (struct.isSetUpdatedTime()) {
-        oprot.writeFieldBegin(UPDATED_TIME_FIELD_DESC);
-        oprot.writeI64(struct.updatedTime);
-        oprot.writeFieldEnd();
-      }
-      oprot.writeFieldStop();
-      oprot.writeStructEnd();
-    }
-
-  }
-
-  private static class EntityTupleSchemeFactory implements SchemeFactory {
-    public EntityTupleScheme getScheme() {
-      return new EntityTupleScheme();
-    }
-  }
-
-  private static class EntityTupleScheme extends TupleScheme<Entity> {
-
-    @Override
-    public void write(org.apache.thrift.protocol.TProtocol prot, Entity struct) throws org.apache.thrift.TException {
-      TTupleProtocol oprot = (TTupleProtocol) prot;
-      BitSet optionals = new BitSet();
-      if (struct.isSetEntityId()) {
-        optionals.set(0);
-      }
-      if (struct.isSetDomainId()) {
-        optionals.set(1);
-      }
-      if (struct.isSetEntityTypeId()) {
-        optionals.set(2);
-      }
-      if (struct.isSetOwnerId()) {
-        optionals.set(3);
-      }
-      if (struct.isSetParentEntityId()) {
-        optionals.set(4);
-      }
-      if (struct.isSetName()) {
-        optionals.set(5);
-      }
-      if (struct.isSetDescription()) {
-        optionals.set(6);
-      }
-      if (struct.isSetMetadata()) {
-        optionals.set(7);
-      }
-      if (struct.isSetFullText()) {
-        optionals.set(8);
-      }
-      if (struct.isSetCreatedTime()) {
-        optionals.set(9);
-      }
-      if (struct.isSetUpdatedTime()) {
-        optionals.set(10);
-      }
-      oprot.writeBitSet(optionals, 11);
-      if (struct.isSetEntityId()) {
-        oprot.writeString(struct.entityId);
-      }
-      if (struct.isSetDomainId()) {
-        oprot.writeString(struct.domainId);
-      }
-      if (struct.isSetEntityTypeId()) {
-        oprot.writeString(struct.entityTypeId);
-      }
-      if (struct.isSetOwnerId()) {
-        oprot.writeString(struct.ownerId);
-      }
-      if (struct.isSetParentEntityId()) {
-        oprot.writeString(struct.parentEntityId);
-      }
-      if (struct.isSetName()) {
-        oprot.writeString(struct.name);
-      }
-      if (struct.isSetDescription()) {
-        oprot.writeString(struct.description);
-      }
-      if (struct.isSetMetadata()) {
-        {
-          oprot.writeI32(struct.metadata.size());
-          for (Map.Entry<String, String> _iter5 : struct.metadata.entrySet())
-          {
-            oprot.writeString(_iter5.getKey());
-            oprot.writeString(_iter5.getValue());
-          }
-        }
-      }
-      if (struct.isSetFullText()) {
-        oprot.writeString(struct.fullText);
-      }
-      if (struct.isSetCreatedTime()) {
-        oprot.writeI64(struct.createdTime);
-      }
-      if (struct.isSetUpdatedTime()) {
-        oprot.writeI64(struct.updatedTime);
-      }
-    }
-
-    @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);
-      if (incoming.get(0)) {
-        struct.entityId = iprot.readString();
-        struct.setEntityIdIsSet(true);
-      }
-      if (incoming.get(1)) {
-        struct.domainId = iprot.readString();
-        struct.setDomainIdIsSet(true);
-      }
-      if (incoming.get(2)) {
-        struct.entityTypeId = iprot.readString();
-        struct.setEntityTypeIdIsSet(true);
-      }
-      if (incoming.get(3)) {
-        struct.ownerId = iprot.readString();
-        struct.setOwnerIdIsSet(true);
-      }
-      if (incoming.get(4)) {
-        struct.parentEntityId = iprot.readString();
-        struct.setParentEntityIdIsSet(true);
-      }
-      if (incoming.get(5)) {
-        struct.name = iprot.readString();
-        struct.setNameIsSet(true);
-      }
-      if (incoming.get(6)) {
-        struct.description = iprot.readString();
-        struct.setDescriptionIsSet(true);
-      }
-      if (incoming.get(7)) {
-        {
-          org.apache.thrift.protocol.TMap _map6 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
-          struct.metadata = new HashMap<String,String>(2*_map6.size);
-          String _key7;
-          String _val8;
-          for (int _i9 = 0; _i9 < _map6.size; ++_i9)
-          {
-            _key7 = iprot.readString();
-            _val8 = iprot.readString();
-            struct.metadata.put(_key7, _val8);
-          }
-        }
-        struct.setMetadataIsSet(true);
-      }
-      if (incoming.get(8)) {
-        struct.fullText = iprot.readString();
-        struct.setFullTextIsSet(true);
-      }
-      if (incoming.get(9)) {
-        struct.createdTime = iprot.readI64();
-        struct.setCreatedTimeIsSet(true);
-      }
-      if (incoming.get(10)) {
-        struct.updatedTime = iprot.readI64();
-        struct.setUpdatedTimeIsSet(true);
-      }
-    }
-  }
-
-}
-

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/EntityType.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/EntityType.java b/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/EntityType.java
deleted file mode 100644
index d2ddffa..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/EntityType.java
+++ /dev/null
@@ -1,924 +0,0 @@
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- *  @generated
- */
-package org.apache.airavata.sharing.registry.models;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-05")
-public class EntityType implements org.apache.thrift.TBase<EntityType, EntityType._Fields>, java.io.Serializable, Cloneable, Comparable<EntityType> {
-  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("EntityType");
-
-  private static final org.apache.thrift.protocol.TField ENTITY_TYPE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("entityTypeId", org.apache.thrift.protocol.TType.STRING, (short)1);
-  private static final org.apache.thrift.protocol.TField DOMAIN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("domainId", org.apache.thrift.protocol.TType.STRING, (short)2);
-  private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)3);
-  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)4);
-  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)5);
-  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)6);
-
-  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-  static {
-    schemes.put(StandardScheme.class, new EntityTypeStandardSchemeFactory());
-    schemes.put(TupleScheme.class, new EntityTypeTupleSchemeFactory());
-  }
-
-  public String entityTypeId; // optional
-  public String domainId; // optional
-  public String name; // optional
-  public String description; // optional
-  public long createdTime; // optional
-  public long updatedTime; // optional
-
-  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
-    ENTITY_TYPE_ID((short)1, "entityTypeId"),
-    DOMAIN_ID((short)2, "domainId"),
-    NAME((short)3, "name"),
-    DESCRIPTION((short)4, "description"),
-    CREATED_TIME((short)5, "createdTime"),
-    UPDATED_TIME((short)6, "updatedTime");
-
-    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
-    static {
-      for (_Fields field : EnumSet.allOf(_Fields.class)) {
-        byName.put(field.getFieldName(), field);
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, or null if its not found.
-     */
-    public static _Fields findByThriftId(int fieldId) {
-      switch(fieldId) {
-        case 1: // ENTITY_TYPE_ID
-          return ENTITY_TYPE_ID;
-        case 2: // DOMAIN_ID
-          return DOMAIN_ID;
-        case 3: // NAME
-          return NAME;
-        case 4: // DESCRIPTION
-          return DESCRIPTION;
-        case 5: // CREATED_TIME
-          return CREATED_TIME;
-        case 6: // UPDATED_TIME
-          return UPDATED_TIME;
-        default:
-          return null;
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, throwing an exception
-     * if it is not found.
-     */
-    public static _Fields findByThriftIdOrThrow(int fieldId) {
-      _Fields fields = findByThriftId(fieldId);
-      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-      return fields;
-    }
-
-    /**
-     * Find the _Fields constant that matches name, or null if its not found.
-     */
-    public static _Fields findByName(String name) {
-      return byName.get(name);
-    }
-
-    private final short _thriftId;
-    private final String _fieldName;
-
-    _Fields(short thriftId, String fieldName) {
-      _thriftId = thriftId;
-      _fieldName = fieldName;
-    }
-
-    public short getThriftFieldId() {
-      return _thriftId;
-    }
-
-    public String getFieldName() {
-      return _fieldName;
-    }
-  }
-
-  // isset id assignments
-  private static final int __CREATEDTIME_ISSET_ID = 0;
-  private static final int __UPDATEDTIME_ISSET_ID = 1;
-  private byte __isset_bitfield = 0;
-  private static final _Fields optionals[] = {_Fields.ENTITY_TYPE_ID,_Fields.DOMAIN_ID,_Fields.NAME,_Fields.DESCRIPTION,_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);
-    tmpMap.put(_Fields.ENTITY_TYPE_ID, new org.apache.thrift.meta_data.FieldMetaData("entityTypeId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.DOMAIN_ID, new org.apache.thrift.meta_data.FieldMetaData("domainId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("description", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    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, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-    metaDataMap = Collections.unmodifiableMap(tmpMap);
-    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(EntityType.class, metaDataMap);
-  }
-
-  public EntityType() {
-    this.entityTypeId = "DO_NOT_SET_AT_CLIENTS_ID";
-
-  }
-
-  /**
-   * Performs a deep copy on <i>other</i>.
-   */
-  public EntityType(EntityType other) {
-    __isset_bitfield = other.__isset_bitfield;
-    if (other.isSetEntityTypeId()) {
-      this.entityTypeId = other.entityTypeId;
-    }
-    if (other.isSetDomainId()) {
-      this.domainId = other.domainId;
-    }
-    if (other.isSetName()) {
-      this.name = other.name;
-    }
-    if (other.isSetDescription()) {
-      this.description = other.description;
-    }
-    this.createdTime = other.createdTime;
-    this.updatedTime = other.updatedTime;
-  }
-
-  public EntityType deepCopy() {
-    return new EntityType(this);
-  }
-
-  @Override
-  public void clear() {
-    this.entityTypeId = "DO_NOT_SET_AT_CLIENTS_ID";
-
-    this.domainId = null;
-    this.name = null;
-    this.description = null;
-    setCreatedTimeIsSet(false);
-    this.createdTime = 0;
-    setUpdatedTimeIsSet(false);
-    this.updatedTime = 0;
-  }
-
-  public String getEntityTypeId() {
-    return this.entityTypeId;
-  }
-
-  public EntityType setEntityTypeId(String entityTypeId) {
-    this.entityTypeId = entityTypeId;
-    return this;
-  }
-
-  public void unsetEntityTypeId() {
-    this.entityTypeId = null;
-  }
-
-  /** Returns true if field entityTypeId is set (has been assigned a value) and false otherwise */
-  public boolean isSetEntityTypeId() {
-    return this.entityTypeId != null;
-  }
-
-  public void setEntityTypeIdIsSet(boolean value) {
-    if (!value) {
-      this.entityTypeId = null;
-    }
-  }
-
-  public String getDomainId() {
-    return this.domainId;
-  }
-
-  public EntityType setDomainId(String domainId) {
-    this.domainId = domainId;
-    return this;
-  }
-
-  public void unsetDomainId() {
-    this.domainId = null;
-  }
-
-  /** Returns true if field domainId is set (has been assigned a value) and false otherwise */
-  public boolean isSetDomainId() {
-    return this.domainId != null;
-  }
-
-  public void setDomainIdIsSet(boolean value) {
-    if (!value) {
-      this.domainId = null;
-    }
-  }
-
-  public String getName() {
-    return this.name;
-  }
-
-  public EntityType setName(String name) {
-    this.name = name;
-    return this;
-  }
-
-  public void unsetName() {
-    this.name = null;
-  }
-
-  /** Returns true if field name is set (has been assigned a value) and false otherwise */
-  public boolean isSetName() {
-    return this.name != null;
-  }
-
-  public void setNameIsSet(boolean value) {
-    if (!value) {
-      this.name = null;
-    }
-  }
-
-  public String getDescription() {
-    return this.description;
-  }
-
-  public EntityType setDescription(String description) {
-    this.description = description;
-    return this;
-  }
-
-  public void unsetDescription() {
-    this.description = null;
-  }
-
-  /** Returns true if field description is set (has been assigned a value) and false otherwise */
-  public boolean isSetDescription() {
-    return this.description != null;
-  }
-
-  public void setDescriptionIsSet(boolean value) {
-    if (!value) {
-      this.description = null;
-    }
-  }
-
-  public long getCreatedTime() {
-    return this.createdTime;
-  }
-
-  public EntityType setCreatedTime(long createdTime) {
-    this.createdTime = createdTime;
-    setCreatedTimeIsSet(true);
-    return this;
-  }
-
-  public void unsetCreatedTime() {
-    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CREATEDTIME_ISSET_ID);
-  }
-
-  /** Returns true if field createdTime is set (has been assigned a value) and false otherwise */
-  public boolean isSetCreatedTime() {
-    return EncodingUtils.testBit(__isset_bitfield, __CREATEDTIME_ISSET_ID);
-  }
-
-  public void setCreatedTimeIsSet(boolean value) {
-    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CREATEDTIME_ISSET_ID, value);
-  }
-
-  public long getUpdatedTime() {
-    return this.updatedTime;
-  }
-
-  public EntityType setUpdatedTime(long updatedTime) {
-    this.updatedTime = updatedTime;
-    setUpdatedTimeIsSet(true);
-    return this;
-  }
-
-  public void unsetUpdatedTime() {
-    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID);
-  }
-
-  /** Returns true if field updatedTime is set (has been assigned a value) and false otherwise */
-  public boolean isSetUpdatedTime() {
-    return EncodingUtils.testBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID);
-  }
-
-  public void setUpdatedTimeIsSet(boolean value) {
-    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID, value);
-  }
-
-  public void setFieldValue(_Fields field, Object value) {
-    switch (field) {
-    case ENTITY_TYPE_ID:
-      if (value == null) {
-        unsetEntityTypeId();
-      } else {
-        setEntityTypeId((String)value);
-      }
-      break;
-
-    case DOMAIN_ID:
-      if (value == null) {
-        unsetDomainId();
-      } else {
-        setDomainId((String)value);
-      }
-      break;
-
-    case NAME:
-      if (value == null) {
-        unsetName();
-      } else {
-        setName((String)value);
-      }
-      break;
-
-    case DESCRIPTION:
-      if (value == null) {
-        unsetDescription();
-      } else {
-        setDescription((String)value);
-      }
-      break;
-
-    case CREATED_TIME:
-      if (value == null) {
-        unsetCreatedTime();
-      } else {
-        setCreatedTime((Long)value);
-      }
-      break;
-
-    case UPDATED_TIME:
-      if (value == null) {
-        unsetUpdatedTime();
-      } else {
-        setUpdatedTime((Long)value);
-      }
-      break;
-
-    }
-  }
-
-  public Object getFieldValue(_Fields field) {
-    switch (field) {
-    case ENTITY_TYPE_ID:
-      return getEntityTypeId();
-
-    case DOMAIN_ID:
-      return getDomainId();
-
-    case NAME:
-      return getName();
-
-    case DESCRIPTION:
-      return getDescription();
-
-    case CREATED_TIME:
-      return getCreatedTime();
-
-    case UPDATED_TIME:
-      return getUpdatedTime();
-
-    }
-    throw new IllegalStateException();
-  }
-
-  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
-  public boolean isSet(_Fields field) {
-    if (field == null) {
-      throw new IllegalArgumentException();
-    }
-
-    switch (field) {
-    case ENTITY_TYPE_ID:
-      return isSetEntityTypeId();
-    case DOMAIN_ID:
-      return isSetDomainId();
-    case NAME:
-      return isSetName();
-    case DESCRIPTION:
-      return isSetDescription();
-    case CREATED_TIME:
-      return isSetCreatedTime();
-    case UPDATED_TIME:
-      return isSetUpdatedTime();
-    }
-    throw new IllegalStateException();
-  }
-
-  @Override
-  public boolean equals(Object that) {
-    if (that == null)
-      return false;
-    if (that instanceof EntityType)
-      return this.equals((EntityType)that);
-    return false;
-  }
-
-  public boolean equals(EntityType that) {
-    if (that == null)
-      return false;
-
-    boolean this_present_entityTypeId = true && this.isSetEntityTypeId();
-    boolean that_present_entityTypeId = true && that.isSetEntityTypeId();
-    if (this_present_entityTypeId || that_present_entityTypeId) {
-      if (!(this_present_entityTypeId && that_present_entityTypeId))
-        return false;
-      if (!this.entityTypeId.equals(that.entityTypeId))
-        return false;
-    }
-
-    boolean this_present_domainId = true && this.isSetDomainId();
-    boolean that_present_domainId = true && that.isSetDomainId();
-    if (this_present_domainId || that_present_domainId) {
-      if (!(this_present_domainId && that_present_domainId))
-        return false;
-      if (!this.domainId.equals(that.domainId))
-        return false;
-    }
-
-    boolean this_present_name = true && this.isSetName();
-    boolean that_present_name = true && that.isSetName();
-    if (this_present_name || that_present_name) {
-      if (!(this_present_name && that_present_name))
-        return false;
-      if (!this.name.equals(that.name))
-        return false;
-    }
-
-    boolean this_present_description = true && this.isSetDescription();
-    boolean that_present_description = true && that.isSetDescription();
-    if (this_present_description || that_present_description) {
-      if (!(this_present_description && that_present_description))
-        return false;
-      if (!this.description.equals(that.description))
-        return false;
-    }
-
-    boolean this_present_createdTime = true && this.isSetCreatedTime();
-    boolean that_present_createdTime = true && that.isSetCreatedTime();
-    if (this_present_createdTime || that_present_createdTime) {
-      if (!(this_present_createdTime && that_present_createdTime))
-        return false;
-      if (this.createdTime != that.createdTime)
-        return false;
-    }
-
-    boolean this_present_updatedTime = true && this.isSetUpdatedTime();
-    boolean that_present_updatedTime = true && that.isSetUpdatedTime();
-    if (this_present_updatedTime || that_present_updatedTime) {
-      if (!(this_present_updatedTime && that_present_updatedTime))
-        return false;
-      if (this.updatedTime != that.updatedTime)
-        return false;
-    }
-
-    return true;
-  }
-
-  @Override
-  public int hashCode() {
-    List<Object> list = new ArrayList<Object>();
-
-    boolean present_entityTypeId = true && (isSetEntityTypeId());
-    list.add(present_entityTypeId);
-    if (present_entityTypeId)
-      list.add(entityTypeId);
-
-    boolean present_domainId = true && (isSetDomainId());
-    list.add(present_domainId);
-    if (present_domainId)
-      list.add(domainId);
-
-    boolean present_name = true && (isSetName());
-    list.add(present_name);
-    if (present_name)
-      list.add(name);
-
-    boolean present_description = true && (isSetDescription());
-    list.add(present_description);
-    if (present_description)
-      list.add(description);
-
-    boolean present_createdTime = true && (isSetCreatedTime());
-    list.add(present_createdTime);
-    if (present_createdTime)
-      list.add(createdTime);
-
-    boolean present_updatedTime = true && (isSetUpdatedTime());
-    list.add(present_updatedTime);
-    if (present_updatedTime)
-      list.add(updatedTime);
-
-    return list.hashCode();
-  }
-
-  @Override
-  public int compareTo(EntityType other) {
-    if (!getClass().equals(other.getClass())) {
-      return getClass().getName().compareTo(other.getClass().getName());
-    }
-
-    int lastComparison = 0;
-
-    lastComparison = Boolean.valueOf(isSetEntityTypeId()).compareTo(other.isSetEntityTypeId());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetEntityTypeId()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityTypeId, other.entityTypeId);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetDomainId()).compareTo(other.isSetDomainId());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetDomainId()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domainId, other.domainId);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetName()).compareTo(other.isSetName());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetName()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetDescription()).compareTo(other.isSetDescription());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetDescription()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.description, other.description);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetCreatedTime()).compareTo(other.isSetCreatedTime());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetCreatedTime()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.createdTime, other.createdTime);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetUpdatedTime()).compareTo(other.isSetUpdatedTime());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetUpdatedTime()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updatedTime, other.updatedTime);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    return 0;
-  }
-
-  public _Fields fieldForId(int fieldId) {
-    return _Fields.findByThriftId(fieldId);
-  }
-
-  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
-  }
-
-  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
-  }
-
-  @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder("EntityType(");
-    boolean first = true;
-
-    if (isSetEntityTypeId()) {
-      sb.append("entityTypeId:");
-      if (this.entityTypeId == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.entityTypeId);
-      }
-      first = false;
-    }
-    if (isSetDomainId()) {
-      if (!first) sb.append(", ");
-      sb.append("domainId:");
-      if (this.domainId == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.domainId);
-      }
-      first = false;
-    }
-    if (isSetName()) {
-      if (!first) sb.append(", ");
-      sb.append("name:");
-      if (this.name == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.name);
-      }
-      first = false;
-    }
-    if (isSetDescription()) {
-      if (!first) sb.append(", ");
-      sb.append("description:");
-      if (this.description == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.description);
-      }
-      first = false;
-    }
-    if (isSetCreatedTime()) {
-      if (!first) sb.append(", ");
-      sb.append("createdTime:");
-      sb.append(this.createdTime);
-      first = false;
-    }
-    if (isSetUpdatedTime()) {
-      if (!first) sb.append(", ");
-      sb.append("updatedTime:");
-      sb.append(this.updatedTime);
-      first = false;
-    }
-    sb.append(")");
-    return sb.toString();
-  }
-
-  public void validate() throws org.apache.thrift.TException {
-    // check for required fields
-    // check for sub-struct validity
-  }
-
-  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-    try {
-      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-    } catch (org.apache.thrift.TException te) {
-      throw new java.io.IOException(te);
-    }
-  }
-
-  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-    try {
-      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
-      __isset_bitfield = 0;
-      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-    } catch (org.apache.thrift.TException te) {
-      throw new java.io.IOException(te);
-    }
-  }
-
-  private static class EntityTypeStandardSchemeFactory implements SchemeFactory {
-    public EntityTypeStandardScheme getScheme() {
-      return new EntityTypeStandardScheme();
-    }
-  }
-
-  private static class EntityTypeStandardScheme extends StandardScheme<EntityType> {
-
-    public void read(org.apache.thrift.protocol.TProtocol iprot, EntityType struct) throws org.apache.thrift.TException {
-      org.apache.thrift.protocol.TField schemeField;
-      iprot.readStructBegin();
-      while (true)
-      {
-        schemeField = iprot.readFieldBegin();
-        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
-          break;
-        }
-        switch (schemeField.id) {
-          case 1: // ENTITY_TYPE_ID
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.entityTypeId = iprot.readString();
-              struct.setEntityTypeIdIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 2: // DOMAIN_ID
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.domainId = iprot.readString();
-              struct.setDomainIdIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 3: // NAME
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.name = iprot.readString();
-              struct.setNameIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 4: // DESCRIPTION
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.description = iprot.readString();
-              struct.setDescriptionIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 5: // CREATED_TIME
-            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
-              struct.createdTime = iprot.readI64();
-              struct.setCreatedTimeIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 6: // UPDATED_TIME
-            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
-              struct.updatedTime = iprot.readI64();
-              struct.setUpdatedTimeIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          default:
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-        }
-        iprot.readFieldEnd();
-      }
-      iprot.readStructEnd();
-
-      // check for required fields of primitive type, which can't be checked in the validate method
-      struct.validate();
-    }
-
-    public void write(org.apache.thrift.protocol.TProtocol oprot, EntityType struct) throws org.apache.thrift.TException {
-      struct.validate();
-
-      oprot.writeStructBegin(STRUCT_DESC);
-      if (struct.entityTypeId != null) {
-        if (struct.isSetEntityTypeId()) {
-          oprot.writeFieldBegin(ENTITY_TYPE_ID_FIELD_DESC);
-          oprot.writeString(struct.entityTypeId);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.domainId != null) {
-        if (struct.isSetDomainId()) {
-          oprot.writeFieldBegin(DOMAIN_ID_FIELD_DESC);
-          oprot.writeString(struct.domainId);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.name != null) {
-        if (struct.isSetName()) {
-          oprot.writeFieldBegin(NAME_FIELD_DESC);
-          oprot.writeString(struct.name);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.description != null) {
-        if (struct.isSetDescription()) {
-          oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC);
-          oprot.writeString(struct.description);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.isSetCreatedTime()) {
-        oprot.writeFieldBegin(CREATED_TIME_FIELD_DESC);
-        oprot.writeI64(struct.createdTime);
-        oprot.writeFieldEnd();
-      }
-      if (struct.isSetUpdatedTime()) {
-        oprot.writeFieldBegin(UPDATED_TIME_FIELD_DESC);
-        oprot.writeI64(struct.updatedTime);
-        oprot.writeFieldEnd();
-      }
-      oprot.writeFieldStop();
-      oprot.writeStructEnd();
-    }
-
-  }
-
-  private static class EntityTypeTupleSchemeFactory implements SchemeFactory {
-    public EntityTypeTupleScheme getScheme() {
-      return new EntityTypeTupleScheme();
-    }
-  }
-
-  private static class EntityTypeTupleScheme extends TupleScheme<EntityType> {
-
-    @Override
-    public void write(org.apache.thrift.protocol.TProtocol prot, EntityType struct) throws org.apache.thrift.TException {
-      TTupleProtocol oprot = (TTupleProtocol) prot;
-      BitSet optionals = new BitSet();
-      if (struct.isSetEntityTypeId()) {
-        optionals.set(0);
-      }
-      if (struct.isSetDomainId()) {
-        optionals.set(1);
-      }
-      if (struct.isSetName()) {
-        optionals.set(2);
-      }
-      if (struct.isSetDescription()) {
-        optionals.set(3);
-      }
-      if (struct.isSetCreatedTime()) {
-        optionals.set(4);
-      }
-      if (struct.isSetUpdatedTime()) {
-        optionals.set(5);
-      }
-      oprot.writeBitSet(optionals, 6);
-      if (struct.isSetEntityTypeId()) {
-        oprot.writeString(struct.entityTypeId);
-      }
-      if (struct.isSetDomainId()) {
-        oprot.writeString(struct.domainId);
-      }
-      if (struct.isSetName()) {
-        oprot.writeString(struct.name);
-      }
-      if (struct.isSetDescription()) {
-        oprot.writeString(struct.description);
-      }
-      if (struct.isSetCreatedTime()) {
-        oprot.writeI64(struct.createdTime);
-      }
-      if (struct.isSetUpdatedTime()) {
-        oprot.writeI64(struct.updatedTime);
-      }
-    }
-
-    @Override
-    public void read(org.apache.thrift.protocol.TProtocol prot, EntityType struct) throws org.apache.thrift.TException {
-      TTupleProtocol iprot = (TTupleProtocol) prot;
-      BitSet incoming = iprot.readBitSet(6);
-      if (incoming.get(0)) {
-        struct.entityTypeId = iprot.readString();
-        struct.setEntityTypeIdIsSet(true);
-      }
-      if (incoming.get(1)) {
-        struct.domainId = iprot.readString();
-        struct.setDomainIdIsSet(true);
-      }
-      if (incoming.get(2)) {
-        struct.name = iprot.readString();
-        struct.setNameIsSet(true);
-      }
-      if (incoming.get(3)) {
-        struct.description = iprot.readString();
-        struct.setDescriptionIsSet(true);
-      }
-      if (incoming.get(4)) {
-        struct.createdTime = iprot.readI64();
-        struct.setCreatedTimeIsSet(true);
-      }
-      if (incoming.get(5)) {
-        struct.updatedTime = iprot.readI64();
-        struct.setUpdatedTimeIsSet(true);
-      }
-    }
-  }
-
-}
-


[13/17] airavata git commit: renaming directory names

Posted by sc...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/GovRegistryException.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/GovRegistryException.java b/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/GovRegistryException.java
deleted file mode 100644
index 7df20a7..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/GovRegistryException.java
+++ /dev/null
@@ -1,391 +0,0 @@
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- *  @generated
- */
-package org.apache.airavata.sharing.registry.models;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-05")
-public class GovRegistryException extends TException implements org.apache.thrift.TBase<GovRegistryException, GovRegistryException._Fields>, java.io.Serializable, Cloneable, Comparable<GovRegistryException> {
-  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GovRegistryException");
-
-  private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1);
-
-  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-  static {
-    schemes.put(StandardScheme.class, new GovRegistryExceptionStandardSchemeFactory());
-    schemes.put(TupleScheme.class, new GovRegistryExceptionTupleSchemeFactory());
-  }
-
-  public String message; // required
-
-  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
-    MESSAGE((short)1, "message");
-
-    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
-    static {
-      for (_Fields field : EnumSet.allOf(_Fields.class)) {
-        byName.put(field.getFieldName(), field);
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, or null if its not found.
-     */
-    public static _Fields findByThriftId(int fieldId) {
-      switch(fieldId) {
-        case 1: // MESSAGE
-          return MESSAGE;
-        default:
-          return null;
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, throwing an exception
-     * if it is not found.
-     */
-    public static _Fields findByThriftIdOrThrow(int fieldId) {
-      _Fields fields = findByThriftId(fieldId);
-      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-      return fields;
-    }
-
-    /**
-     * Find the _Fields constant that matches name, or null if its not found.
-     */
-    public static _Fields findByName(String name) {
-      return byName.get(name);
-    }
-
-    private final short _thriftId;
-    private final String _fieldName;
-
-    _Fields(short thriftId, String fieldName) {
-      _thriftId = thriftId;
-      _fieldName = fieldName;
-    }
-
-    public short getThriftFieldId() {
-      return _thriftId;
-    }
-
-    public String getFieldName() {
-      return _fieldName;
-    }
-  }
-
-  // isset id assignments
-  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);
-    tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.REQUIRED, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    metaDataMap = Collections.unmodifiableMap(tmpMap);
-    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GovRegistryException.class, metaDataMap);
-  }
-
-  public GovRegistryException() {
-  }
-
-  public GovRegistryException(
-    String message)
-  {
-    this();
-    this.message = message;
-  }
-
-  /**
-   * Performs a deep copy on <i>other</i>.
-   */
-  public GovRegistryException(GovRegistryException other) {
-    if (other.isSetMessage()) {
-      this.message = other.message;
-    }
-  }
-
-  public GovRegistryException deepCopy() {
-    return new GovRegistryException(this);
-  }
-
-  @Override
-  public void clear() {
-    this.message = null;
-  }
-
-  public String getMessage() {
-    return this.message;
-  }
-
-  public GovRegistryException setMessage(String message) {
-    this.message = message;
-    return this;
-  }
-
-  public void unsetMessage() {
-    this.message = null;
-  }
-
-  /** Returns true if field message is set (has been assigned a value) and false otherwise */
-  public boolean isSetMessage() {
-    return this.message != null;
-  }
-
-  public void setMessageIsSet(boolean value) {
-    if (!value) {
-      this.message = null;
-    }
-  }
-
-  public void setFieldValue(_Fields field, Object value) {
-    switch (field) {
-    case MESSAGE:
-      if (value == null) {
-        unsetMessage();
-      } else {
-        setMessage((String)value);
-      }
-      break;
-
-    }
-  }
-
-  public Object getFieldValue(_Fields field) {
-    switch (field) {
-    case MESSAGE:
-      return getMessage();
-
-    }
-    throw new IllegalStateException();
-  }
-
-  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
-  public boolean isSet(_Fields field) {
-    if (field == null) {
-      throw new IllegalArgumentException();
-    }
-
-    switch (field) {
-    case MESSAGE:
-      return isSetMessage();
-    }
-    throw new IllegalStateException();
-  }
-
-  @Override
-  public boolean equals(Object that) {
-    if (that == null)
-      return false;
-    if (that instanceof GovRegistryException)
-      return this.equals((GovRegistryException)that);
-    return false;
-  }
-
-  public boolean equals(GovRegistryException that) {
-    if (that == null)
-      return false;
-
-    boolean this_present_message = true && this.isSetMessage();
-    boolean that_present_message = true && that.isSetMessage();
-    if (this_present_message || that_present_message) {
-      if (!(this_present_message && that_present_message))
-        return false;
-      if (!this.message.equals(that.message))
-        return false;
-    }
-
-    return true;
-  }
-
-  @Override
-  public int hashCode() {
-    List<Object> list = new ArrayList<Object>();
-
-    boolean present_message = true && (isSetMessage());
-    list.add(present_message);
-    if (present_message)
-      list.add(message);
-
-    return list.hashCode();
-  }
-
-  @Override
-  public int compareTo(GovRegistryException other) {
-    if (!getClass().equals(other.getClass())) {
-      return getClass().getName().compareTo(other.getClass().getName());
-    }
-
-    int lastComparison = 0;
-
-    lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetMessage()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    return 0;
-  }
-
-  public _Fields fieldForId(int fieldId) {
-    return _Fields.findByThriftId(fieldId);
-  }
-
-  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
-  }
-
-  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
-  }
-
-  @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder("GovRegistryException(");
-    boolean first = true;
-
-    sb.append("message:");
-    if (this.message == null) {
-      sb.append("null");
-    } else {
-      sb.append(this.message);
-    }
-    first = false;
-    sb.append(")");
-    return sb.toString();
-  }
-
-  public void validate() throws org.apache.thrift.TException {
-    // check for required fields
-    if (message == null) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'message' was not present! Struct: " + toString());
-    }
-    // check for sub-struct validity
-  }
-
-  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-    try {
-      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-    } catch (org.apache.thrift.TException te) {
-      throw new java.io.IOException(te);
-    }
-  }
-
-  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-    try {
-      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-    } catch (org.apache.thrift.TException te) {
-      throw new java.io.IOException(te);
-    }
-  }
-
-  private static class GovRegistryExceptionStandardSchemeFactory implements SchemeFactory {
-    public GovRegistryExceptionStandardScheme getScheme() {
-      return new GovRegistryExceptionStandardScheme();
-    }
-  }
-
-  private static class GovRegistryExceptionStandardScheme extends StandardScheme<GovRegistryException> {
-
-    public void read(org.apache.thrift.protocol.TProtocol iprot, GovRegistryException struct) throws org.apache.thrift.TException {
-      org.apache.thrift.protocol.TField schemeField;
-      iprot.readStructBegin();
-      while (true)
-      {
-        schemeField = iprot.readFieldBegin();
-        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
-          break;
-        }
-        switch (schemeField.id) {
-          case 1: // MESSAGE
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.message = iprot.readString();
-              struct.setMessageIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          default:
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-        }
-        iprot.readFieldEnd();
-      }
-      iprot.readStructEnd();
-
-      // check for required fields of primitive type, which can't be checked in the validate method
-      struct.validate();
-    }
-
-    public void write(org.apache.thrift.protocol.TProtocol oprot, GovRegistryException struct) throws org.apache.thrift.TException {
-      struct.validate();
-
-      oprot.writeStructBegin(STRUCT_DESC);
-      if (struct.message != null) {
-        oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
-        oprot.writeString(struct.message);
-        oprot.writeFieldEnd();
-      }
-      oprot.writeFieldStop();
-      oprot.writeStructEnd();
-    }
-
-  }
-
-  private static class GovRegistryExceptionTupleSchemeFactory implements SchemeFactory {
-    public GovRegistryExceptionTupleScheme getScheme() {
-      return new GovRegistryExceptionTupleScheme();
-    }
-  }
-
-  private static class GovRegistryExceptionTupleScheme extends TupleScheme<GovRegistryException> {
-
-    @Override
-    public void write(org.apache.thrift.protocol.TProtocol prot, GovRegistryException struct) throws org.apache.thrift.TException {
-      TTupleProtocol oprot = (TTupleProtocol) prot;
-      oprot.writeString(struct.message);
-    }
-
-    @Override
-    public void read(org.apache.thrift.protocol.TProtocol prot, GovRegistryException struct) throws org.apache.thrift.TException {
-      TTupleProtocol iprot = (TTupleProtocol) prot;
-      struct.message = iprot.readString();
-      struct.setMessageIsSet(true);
-    }
-  }
-
-}
-

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/GroupChildType.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/GroupChildType.java b/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/GroupChildType.java
deleted file mode 100644
index ba7b659..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/GroupChildType.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- *  @generated
- */
-package org.apache.airavata.sharing.registry.models;
-
-
-import java.util.Map;
-import java.util.HashMap;
-import org.apache.thrift.TEnum;
-
-public enum GroupChildType implements org.apache.thrift.TEnum {
-  USER(0),
-  GROUP(1);
-
-  private final int value;
-
-  private GroupChildType(int value) {
-    this.value = value;
-  }
-
-  /**
-   * Get the integer value of this enum value, as defined in the Thrift IDL.
-   */
-  public int getValue() {
-    return value;
-  }
-
-  /**
-   * Find a the enum type by its integer value, as defined in the Thrift IDL.
-   * @return null if the value is not found.
-   */
-  public static GroupChildType findByValue(int value) { 
-    switch (value) {
-      case 0:
-        return USER;
-      case 1:
-        return GROUP;
-      default:
-        return null;
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/GroupMembership.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/GroupMembership.java b/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/GroupMembership.java
deleted file mode 100644
index 00843aa..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/GroupMembership.java
+++ /dev/null
@@ -1,830 +0,0 @@
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- *  @generated
- */
-package org.apache.airavata.sharing.registry.models;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-05")
-public class GroupMembership implements org.apache.thrift.TBase<GroupMembership, GroupMembership._Fields>, java.io.Serializable, Cloneable, Comparable<GroupMembership> {
-  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GroupMembership");
-
-  private static final org.apache.thrift.protocol.TField PARENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("parentId", org.apache.thrift.protocol.TType.STRING, (short)1);
-  private static final org.apache.thrift.protocol.TField CHILD_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("childId", org.apache.thrift.protocol.TType.STRING, (short)2);
-  private static final org.apache.thrift.protocol.TField CHILD_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("childType", org.apache.thrift.protocol.TType.I32, (short)3);
-  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)4);
-  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)5);
-
-  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-  static {
-    schemes.put(StandardScheme.class, new GroupMembershipStandardSchemeFactory());
-    schemes.put(TupleScheme.class, new GroupMembershipTupleSchemeFactory());
-  }
-
-  public String parentId; // optional
-  public String childId; // optional
-  /**
-   * 
-   * @see GroupChildType
-   */
-  public GroupChildType childType; // optional
-  public long createdTime; // optional
-  public long updatedTime; // optional
-
-  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
-    PARENT_ID((short)1, "parentId"),
-    CHILD_ID((short)2, "childId"),
-    /**
-     * 
-     * @see GroupChildType
-     */
-    CHILD_TYPE((short)3, "childType"),
-    CREATED_TIME((short)4, "createdTime"),
-    UPDATED_TIME((short)5, "updatedTime");
-
-    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
-    static {
-      for (_Fields field : EnumSet.allOf(_Fields.class)) {
-        byName.put(field.getFieldName(), field);
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, or null if its not found.
-     */
-    public static _Fields findByThriftId(int fieldId) {
-      switch(fieldId) {
-        case 1: // PARENT_ID
-          return PARENT_ID;
-        case 2: // CHILD_ID
-          return CHILD_ID;
-        case 3: // CHILD_TYPE
-          return CHILD_TYPE;
-        case 4: // CREATED_TIME
-          return CREATED_TIME;
-        case 5: // UPDATED_TIME
-          return UPDATED_TIME;
-        default:
-          return null;
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, throwing an exception
-     * if it is not found.
-     */
-    public static _Fields findByThriftIdOrThrow(int fieldId) {
-      _Fields fields = findByThriftId(fieldId);
-      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-      return fields;
-    }
-
-    /**
-     * Find the _Fields constant that matches name, or null if its not found.
-     */
-    public static _Fields findByName(String name) {
-      return byName.get(name);
-    }
-
-    private final short _thriftId;
-    private final String _fieldName;
-
-    _Fields(short thriftId, String fieldName) {
-      _thriftId = thriftId;
-      _fieldName = fieldName;
-    }
-
-    public short getThriftFieldId() {
-      return _thriftId;
-    }
-
-    public String getFieldName() {
-      return _fieldName;
-    }
-  }
-
-  // isset id assignments
-  private static final int __CREATEDTIME_ISSET_ID = 0;
-  private static final int __UPDATEDTIME_ISSET_ID = 1;
-  private byte __isset_bitfield = 0;
-  private static final _Fields optionals[] = {_Fields.PARENT_ID,_Fields.CHILD_ID,_Fields.CHILD_TYPE,_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);
-    tmpMap.put(_Fields.PARENT_ID, new org.apache.thrift.meta_data.FieldMetaData("parentId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.CHILD_ID, new org.apache.thrift.meta_data.FieldMetaData("childId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.CHILD_TYPE, new org.apache.thrift.meta_data.FieldMetaData("childType", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, GroupChildType.class)));
-    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, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-    metaDataMap = Collections.unmodifiableMap(tmpMap);
-    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GroupMembership.class, metaDataMap);
-  }
-
-  public GroupMembership() {
-  }
-
-  /**
-   * Performs a deep copy on <i>other</i>.
-   */
-  public GroupMembership(GroupMembership other) {
-    __isset_bitfield = other.__isset_bitfield;
-    if (other.isSetParentId()) {
-      this.parentId = other.parentId;
-    }
-    if (other.isSetChildId()) {
-      this.childId = other.childId;
-    }
-    if (other.isSetChildType()) {
-      this.childType = other.childType;
-    }
-    this.createdTime = other.createdTime;
-    this.updatedTime = other.updatedTime;
-  }
-
-  public GroupMembership deepCopy() {
-    return new GroupMembership(this);
-  }
-
-  @Override
-  public void clear() {
-    this.parentId = null;
-    this.childId = null;
-    this.childType = null;
-    setCreatedTimeIsSet(false);
-    this.createdTime = 0;
-    setUpdatedTimeIsSet(false);
-    this.updatedTime = 0;
-  }
-
-  public String getParentId() {
-    return this.parentId;
-  }
-
-  public GroupMembership setParentId(String parentId) {
-    this.parentId = parentId;
-    return this;
-  }
-
-  public void unsetParentId() {
-    this.parentId = null;
-  }
-
-  /** Returns true if field parentId is set (has been assigned a value) and false otherwise */
-  public boolean isSetParentId() {
-    return this.parentId != null;
-  }
-
-  public void setParentIdIsSet(boolean value) {
-    if (!value) {
-      this.parentId = null;
-    }
-  }
-
-  public String getChildId() {
-    return this.childId;
-  }
-
-  public GroupMembership setChildId(String childId) {
-    this.childId = childId;
-    return this;
-  }
-
-  public void unsetChildId() {
-    this.childId = null;
-  }
-
-  /** Returns true if field childId is set (has been assigned a value) and false otherwise */
-  public boolean isSetChildId() {
-    return this.childId != null;
-  }
-
-  public void setChildIdIsSet(boolean value) {
-    if (!value) {
-      this.childId = null;
-    }
-  }
-
-  /**
-   * 
-   * @see GroupChildType
-   */
-  public GroupChildType getChildType() {
-    return this.childType;
-  }
-
-  /**
-   * 
-   * @see GroupChildType
-   */
-  public GroupMembership setChildType(GroupChildType childType) {
-    this.childType = childType;
-    return this;
-  }
-
-  public void unsetChildType() {
-    this.childType = null;
-  }
-
-  /** Returns true if field childType is set (has been assigned a value) and false otherwise */
-  public boolean isSetChildType() {
-    return this.childType != null;
-  }
-
-  public void setChildTypeIsSet(boolean value) {
-    if (!value) {
-      this.childType = null;
-    }
-  }
-
-  public long getCreatedTime() {
-    return this.createdTime;
-  }
-
-  public GroupMembership setCreatedTime(long createdTime) {
-    this.createdTime = createdTime;
-    setCreatedTimeIsSet(true);
-    return this;
-  }
-
-  public void unsetCreatedTime() {
-    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CREATEDTIME_ISSET_ID);
-  }
-
-  /** Returns true if field createdTime is set (has been assigned a value) and false otherwise */
-  public boolean isSetCreatedTime() {
-    return EncodingUtils.testBit(__isset_bitfield, __CREATEDTIME_ISSET_ID);
-  }
-
-  public void setCreatedTimeIsSet(boolean value) {
-    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CREATEDTIME_ISSET_ID, value);
-  }
-
-  public long getUpdatedTime() {
-    return this.updatedTime;
-  }
-
-  public GroupMembership setUpdatedTime(long updatedTime) {
-    this.updatedTime = updatedTime;
-    setUpdatedTimeIsSet(true);
-    return this;
-  }
-
-  public void unsetUpdatedTime() {
-    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID);
-  }
-
-  /** Returns true if field updatedTime is set (has been assigned a value) and false otherwise */
-  public boolean isSetUpdatedTime() {
-    return EncodingUtils.testBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID);
-  }
-
-  public void setUpdatedTimeIsSet(boolean value) {
-    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID, value);
-  }
-
-  public void setFieldValue(_Fields field, Object value) {
-    switch (field) {
-    case PARENT_ID:
-      if (value == null) {
-        unsetParentId();
-      } else {
-        setParentId((String)value);
-      }
-      break;
-
-    case CHILD_ID:
-      if (value == null) {
-        unsetChildId();
-      } else {
-        setChildId((String)value);
-      }
-      break;
-
-    case CHILD_TYPE:
-      if (value == null) {
-        unsetChildType();
-      } else {
-        setChildType((GroupChildType)value);
-      }
-      break;
-
-    case CREATED_TIME:
-      if (value == null) {
-        unsetCreatedTime();
-      } else {
-        setCreatedTime((Long)value);
-      }
-      break;
-
-    case UPDATED_TIME:
-      if (value == null) {
-        unsetUpdatedTime();
-      } else {
-        setUpdatedTime((Long)value);
-      }
-      break;
-
-    }
-  }
-
-  public Object getFieldValue(_Fields field) {
-    switch (field) {
-    case PARENT_ID:
-      return getParentId();
-
-    case CHILD_ID:
-      return getChildId();
-
-    case CHILD_TYPE:
-      return getChildType();
-
-    case CREATED_TIME:
-      return getCreatedTime();
-
-    case UPDATED_TIME:
-      return getUpdatedTime();
-
-    }
-    throw new IllegalStateException();
-  }
-
-  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
-  public boolean isSet(_Fields field) {
-    if (field == null) {
-      throw new IllegalArgumentException();
-    }
-
-    switch (field) {
-    case PARENT_ID:
-      return isSetParentId();
-    case CHILD_ID:
-      return isSetChildId();
-    case CHILD_TYPE:
-      return isSetChildType();
-    case CREATED_TIME:
-      return isSetCreatedTime();
-    case UPDATED_TIME:
-      return isSetUpdatedTime();
-    }
-    throw new IllegalStateException();
-  }
-
-  @Override
-  public boolean equals(Object that) {
-    if (that == null)
-      return false;
-    if (that instanceof GroupMembership)
-      return this.equals((GroupMembership)that);
-    return false;
-  }
-
-  public boolean equals(GroupMembership that) {
-    if (that == null)
-      return false;
-
-    boolean this_present_parentId = true && this.isSetParentId();
-    boolean that_present_parentId = true && that.isSetParentId();
-    if (this_present_parentId || that_present_parentId) {
-      if (!(this_present_parentId && that_present_parentId))
-        return false;
-      if (!this.parentId.equals(that.parentId))
-        return false;
-    }
-
-    boolean this_present_childId = true && this.isSetChildId();
-    boolean that_present_childId = true && that.isSetChildId();
-    if (this_present_childId || that_present_childId) {
-      if (!(this_present_childId && that_present_childId))
-        return false;
-      if (!this.childId.equals(that.childId))
-        return false;
-    }
-
-    boolean this_present_childType = true && this.isSetChildType();
-    boolean that_present_childType = true && that.isSetChildType();
-    if (this_present_childType || that_present_childType) {
-      if (!(this_present_childType && that_present_childType))
-        return false;
-      if (!this.childType.equals(that.childType))
-        return false;
-    }
-
-    boolean this_present_createdTime = true && this.isSetCreatedTime();
-    boolean that_present_createdTime = true && that.isSetCreatedTime();
-    if (this_present_createdTime || that_present_createdTime) {
-      if (!(this_present_createdTime && that_present_createdTime))
-        return false;
-      if (this.createdTime != that.createdTime)
-        return false;
-    }
-
-    boolean this_present_updatedTime = true && this.isSetUpdatedTime();
-    boolean that_present_updatedTime = true && that.isSetUpdatedTime();
-    if (this_present_updatedTime || that_present_updatedTime) {
-      if (!(this_present_updatedTime && that_present_updatedTime))
-        return false;
-      if (this.updatedTime != that.updatedTime)
-        return false;
-    }
-
-    return true;
-  }
-
-  @Override
-  public int hashCode() {
-    List<Object> list = new ArrayList<Object>();
-
-    boolean present_parentId = true && (isSetParentId());
-    list.add(present_parentId);
-    if (present_parentId)
-      list.add(parentId);
-
-    boolean present_childId = true && (isSetChildId());
-    list.add(present_childId);
-    if (present_childId)
-      list.add(childId);
-
-    boolean present_childType = true && (isSetChildType());
-    list.add(present_childType);
-    if (present_childType)
-      list.add(childType.getValue());
-
-    boolean present_createdTime = true && (isSetCreatedTime());
-    list.add(present_createdTime);
-    if (present_createdTime)
-      list.add(createdTime);
-
-    boolean present_updatedTime = true && (isSetUpdatedTime());
-    list.add(present_updatedTime);
-    if (present_updatedTime)
-      list.add(updatedTime);
-
-    return list.hashCode();
-  }
-
-  @Override
-  public int compareTo(GroupMembership other) {
-    if (!getClass().equals(other.getClass())) {
-      return getClass().getName().compareTo(other.getClass().getName());
-    }
-
-    int lastComparison = 0;
-
-    lastComparison = Boolean.valueOf(isSetParentId()).compareTo(other.isSetParentId());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetParentId()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parentId, other.parentId);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetChildId()).compareTo(other.isSetChildId());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetChildId()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.childId, other.childId);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetChildType()).compareTo(other.isSetChildType());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetChildType()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.childType, other.childType);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetCreatedTime()).compareTo(other.isSetCreatedTime());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetCreatedTime()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.createdTime, other.createdTime);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetUpdatedTime()).compareTo(other.isSetUpdatedTime());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetUpdatedTime()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updatedTime, other.updatedTime);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    return 0;
-  }
-
-  public _Fields fieldForId(int fieldId) {
-    return _Fields.findByThriftId(fieldId);
-  }
-
-  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
-  }
-
-  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
-  }
-
-  @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder("GroupMembership(");
-    boolean first = true;
-
-    if (isSetParentId()) {
-      sb.append("parentId:");
-      if (this.parentId == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.parentId);
-      }
-      first = false;
-    }
-    if (isSetChildId()) {
-      if (!first) sb.append(", ");
-      sb.append("childId:");
-      if (this.childId == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.childId);
-      }
-      first = false;
-    }
-    if (isSetChildType()) {
-      if (!first) sb.append(", ");
-      sb.append("childType:");
-      if (this.childType == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.childType);
-      }
-      first = false;
-    }
-    if (isSetCreatedTime()) {
-      if (!first) sb.append(", ");
-      sb.append("createdTime:");
-      sb.append(this.createdTime);
-      first = false;
-    }
-    if (isSetUpdatedTime()) {
-      if (!first) sb.append(", ");
-      sb.append("updatedTime:");
-      sb.append(this.updatedTime);
-      first = false;
-    }
-    sb.append(")");
-    return sb.toString();
-  }
-
-  public void validate() throws org.apache.thrift.TException {
-    // check for required fields
-    // check for sub-struct validity
-  }
-
-  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-    try {
-      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-    } catch (org.apache.thrift.TException te) {
-      throw new java.io.IOException(te);
-    }
-  }
-
-  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-    try {
-      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
-      __isset_bitfield = 0;
-      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-    } catch (org.apache.thrift.TException te) {
-      throw new java.io.IOException(te);
-    }
-  }
-
-  private static class GroupMembershipStandardSchemeFactory implements SchemeFactory {
-    public GroupMembershipStandardScheme getScheme() {
-      return new GroupMembershipStandardScheme();
-    }
-  }
-
-  private static class GroupMembershipStandardScheme extends StandardScheme<GroupMembership> {
-
-    public void read(org.apache.thrift.protocol.TProtocol iprot, GroupMembership struct) throws org.apache.thrift.TException {
-      org.apache.thrift.protocol.TField schemeField;
-      iprot.readStructBegin();
-      while (true)
-      {
-        schemeField = iprot.readFieldBegin();
-        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
-          break;
-        }
-        switch (schemeField.id) {
-          case 1: // PARENT_ID
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.parentId = iprot.readString();
-              struct.setParentIdIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 2: // CHILD_ID
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.childId = iprot.readString();
-              struct.setChildIdIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 3: // CHILD_TYPE
-            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
-              struct.childType = org.apache.airavata.sharing.registry.models.GroupChildType.findByValue(iprot.readI32());
-              struct.setChildTypeIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 4: // CREATED_TIME
-            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
-              struct.createdTime = iprot.readI64();
-              struct.setCreatedTimeIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 5: // UPDATED_TIME
-            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
-              struct.updatedTime = iprot.readI64();
-              struct.setUpdatedTimeIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          default:
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-        }
-        iprot.readFieldEnd();
-      }
-      iprot.readStructEnd();
-
-      // check for required fields of primitive type, which can't be checked in the validate method
-      struct.validate();
-    }
-
-    public void write(org.apache.thrift.protocol.TProtocol oprot, GroupMembership struct) throws org.apache.thrift.TException {
-      struct.validate();
-
-      oprot.writeStructBegin(STRUCT_DESC);
-      if (struct.parentId != null) {
-        if (struct.isSetParentId()) {
-          oprot.writeFieldBegin(PARENT_ID_FIELD_DESC);
-          oprot.writeString(struct.parentId);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.childId != null) {
-        if (struct.isSetChildId()) {
-          oprot.writeFieldBegin(CHILD_ID_FIELD_DESC);
-          oprot.writeString(struct.childId);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.childType != null) {
-        if (struct.isSetChildType()) {
-          oprot.writeFieldBegin(CHILD_TYPE_FIELD_DESC);
-          oprot.writeI32(struct.childType.getValue());
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.isSetCreatedTime()) {
-        oprot.writeFieldBegin(CREATED_TIME_FIELD_DESC);
-        oprot.writeI64(struct.createdTime);
-        oprot.writeFieldEnd();
-      }
-      if (struct.isSetUpdatedTime()) {
-        oprot.writeFieldBegin(UPDATED_TIME_FIELD_DESC);
-        oprot.writeI64(struct.updatedTime);
-        oprot.writeFieldEnd();
-      }
-      oprot.writeFieldStop();
-      oprot.writeStructEnd();
-    }
-
-  }
-
-  private static class GroupMembershipTupleSchemeFactory implements SchemeFactory {
-    public GroupMembershipTupleScheme getScheme() {
-      return new GroupMembershipTupleScheme();
-    }
-  }
-
-  private static class GroupMembershipTupleScheme extends TupleScheme<GroupMembership> {
-
-    @Override
-    public void write(org.apache.thrift.protocol.TProtocol prot, GroupMembership struct) throws org.apache.thrift.TException {
-      TTupleProtocol oprot = (TTupleProtocol) prot;
-      BitSet optionals = new BitSet();
-      if (struct.isSetParentId()) {
-        optionals.set(0);
-      }
-      if (struct.isSetChildId()) {
-        optionals.set(1);
-      }
-      if (struct.isSetChildType()) {
-        optionals.set(2);
-      }
-      if (struct.isSetCreatedTime()) {
-        optionals.set(3);
-      }
-      if (struct.isSetUpdatedTime()) {
-        optionals.set(4);
-      }
-      oprot.writeBitSet(optionals, 5);
-      if (struct.isSetParentId()) {
-        oprot.writeString(struct.parentId);
-      }
-      if (struct.isSetChildId()) {
-        oprot.writeString(struct.childId);
-      }
-      if (struct.isSetChildType()) {
-        oprot.writeI32(struct.childType.getValue());
-      }
-      if (struct.isSetCreatedTime()) {
-        oprot.writeI64(struct.createdTime);
-      }
-      if (struct.isSetUpdatedTime()) {
-        oprot.writeI64(struct.updatedTime);
-      }
-    }
-
-    @Override
-    public void read(org.apache.thrift.protocol.TProtocol prot, GroupMembership struct) throws org.apache.thrift.TException {
-      TTupleProtocol iprot = (TTupleProtocol) prot;
-      BitSet incoming = iprot.readBitSet(5);
-      if (incoming.get(0)) {
-        struct.parentId = iprot.readString();
-        struct.setParentIdIsSet(true);
-      }
-      if (incoming.get(1)) {
-        struct.childId = iprot.readString();
-        struct.setChildIdIsSet(true);
-      }
-      if (incoming.get(2)) {
-        struct.childType = org.apache.airavata.sharing.registry.models.GroupChildType.findByValue(iprot.readI32());
-        struct.setChildTypeIsSet(true);
-      }
-      if (incoming.get(3)) {
-        struct.createdTime = iprot.readI64();
-        struct.setCreatedTimeIsSet(true);
-      }
-      if (incoming.get(4)) {
-        struct.updatedTime = iprot.readI64();
-        struct.setUpdatedTimeIsSet(true);
-      }
-    }
-  }
-
-}
-

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/GroupType.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/GroupType.java b/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/GroupType.java
deleted file mode 100644
index 5727f83..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/GroupType.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- *  @generated
- */
-package org.apache.airavata.sharing.registry.models;
-
-
-import java.util.Map;
-import java.util.HashMap;
-import org.apache.thrift.TEnum;
-
-public enum GroupType implements org.apache.thrift.TEnum {
-  SINGLE_USER(0),
-  MULTI_USER(1);
-
-  private final int value;
-
-  private GroupType(int value) {
-    this.value = value;
-  }
-
-  /**
-   * Get the integer value of this enum value, as defined in the Thrift IDL.
-   */
-  public int getValue() {
-    return value;
-  }
-
-  /**
-   * Find a the enum type by its integer value, as defined in the Thrift IDL.
-   * @return null if the value is not found.
-   */
-  public static GroupType findByValue(int value) { 
-    switch (value) {
-      case 0:
-        return SINGLE_USER;
-      case 1:
-        return MULTI_USER;
-      default:
-        return null;
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/PermissionType.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/PermissionType.java b/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/PermissionType.java
deleted file mode 100644
index 91645ce..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/PermissionType.java
+++ /dev/null
@@ -1,924 +0,0 @@
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- *  @generated
- */
-package org.apache.airavata.sharing.registry.models;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-05")
-public class PermissionType implements org.apache.thrift.TBase<PermissionType, PermissionType._Fields>, java.io.Serializable, Cloneable, Comparable<PermissionType> {
-  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("PermissionType");
-
-  private static final org.apache.thrift.protocol.TField PERMISSION_TYPE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("permissionTypeId", org.apache.thrift.protocol.TType.STRING, (short)1);
-  private static final org.apache.thrift.protocol.TField DOMAIN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("domainId", org.apache.thrift.protocol.TType.STRING, (short)2);
-  private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)3);
-  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)4);
-  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)5);
-  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)6);
-
-  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-  static {
-    schemes.put(StandardScheme.class, new PermissionTypeStandardSchemeFactory());
-    schemes.put(TupleScheme.class, new PermissionTypeTupleSchemeFactory());
-  }
-
-  public String permissionTypeId; // optional
-  public String domainId; // optional
-  public String name; // optional
-  public String description; // optional
-  public long createdTime; // optional
-  public long updatedTime; // optional
-
-  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
-    PERMISSION_TYPE_ID((short)1, "permissionTypeId"),
-    DOMAIN_ID((short)2, "domainId"),
-    NAME((short)3, "name"),
-    DESCRIPTION((short)4, "description"),
-    CREATED_TIME((short)5, "createdTime"),
-    UPDATED_TIME((short)6, "updatedTime");
-
-    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
-    static {
-      for (_Fields field : EnumSet.allOf(_Fields.class)) {
-        byName.put(field.getFieldName(), field);
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, or null if its not found.
-     */
-    public static _Fields findByThriftId(int fieldId) {
-      switch(fieldId) {
-        case 1: // PERMISSION_TYPE_ID
-          return PERMISSION_TYPE_ID;
-        case 2: // DOMAIN_ID
-          return DOMAIN_ID;
-        case 3: // NAME
-          return NAME;
-        case 4: // DESCRIPTION
-          return DESCRIPTION;
-        case 5: // CREATED_TIME
-          return CREATED_TIME;
-        case 6: // UPDATED_TIME
-          return UPDATED_TIME;
-        default:
-          return null;
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, throwing an exception
-     * if it is not found.
-     */
-    public static _Fields findByThriftIdOrThrow(int fieldId) {
-      _Fields fields = findByThriftId(fieldId);
-      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-      return fields;
-    }
-
-    /**
-     * Find the _Fields constant that matches name, or null if its not found.
-     */
-    public static _Fields findByName(String name) {
-      return byName.get(name);
-    }
-
-    private final short _thriftId;
-    private final String _fieldName;
-
-    _Fields(short thriftId, String fieldName) {
-      _thriftId = thriftId;
-      _fieldName = fieldName;
-    }
-
-    public short getThriftFieldId() {
-      return _thriftId;
-    }
-
-    public String getFieldName() {
-      return _fieldName;
-    }
-  }
-
-  // isset id assignments
-  private static final int __CREATEDTIME_ISSET_ID = 0;
-  private static final int __UPDATEDTIME_ISSET_ID = 1;
-  private byte __isset_bitfield = 0;
-  private static final _Fields optionals[] = {_Fields.PERMISSION_TYPE_ID,_Fields.DOMAIN_ID,_Fields.NAME,_Fields.DESCRIPTION,_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);
-    tmpMap.put(_Fields.PERMISSION_TYPE_ID, new org.apache.thrift.meta_data.FieldMetaData("permissionTypeId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.DOMAIN_ID, new org.apache.thrift.meta_data.FieldMetaData("domainId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("description", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    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, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-    metaDataMap = Collections.unmodifiableMap(tmpMap);
-    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PermissionType.class, metaDataMap);
-  }
-
-  public PermissionType() {
-    this.permissionTypeId = "DO_NOT_SET_AT_CLIENTS_ID";
-
-  }
-
-  /**
-   * Performs a deep copy on <i>other</i>.
-   */
-  public PermissionType(PermissionType other) {
-    __isset_bitfield = other.__isset_bitfield;
-    if (other.isSetPermissionTypeId()) {
-      this.permissionTypeId = other.permissionTypeId;
-    }
-    if (other.isSetDomainId()) {
-      this.domainId = other.domainId;
-    }
-    if (other.isSetName()) {
-      this.name = other.name;
-    }
-    if (other.isSetDescription()) {
-      this.description = other.description;
-    }
-    this.createdTime = other.createdTime;
-    this.updatedTime = other.updatedTime;
-  }
-
-  public PermissionType deepCopy() {
-    return new PermissionType(this);
-  }
-
-  @Override
-  public void clear() {
-    this.permissionTypeId = "DO_NOT_SET_AT_CLIENTS_ID";
-
-    this.domainId = null;
-    this.name = null;
-    this.description = null;
-    setCreatedTimeIsSet(false);
-    this.createdTime = 0;
-    setUpdatedTimeIsSet(false);
-    this.updatedTime = 0;
-  }
-
-  public String getPermissionTypeId() {
-    return this.permissionTypeId;
-  }
-
-  public PermissionType setPermissionTypeId(String permissionTypeId) {
-    this.permissionTypeId = permissionTypeId;
-    return this;
-  }
-
-  public void unsetPermissionTypeId() {
-    this.permissionTypeId = null;
-  }
-
-  /** Returns true if field permissionTypeId is set (has been assigned a value) and false otherwise */
-  public boolean isSetPermissionTypeId() {
-    return this.permissionTypeId != null;
-  }
-
-  public void setPermissionTypeIdIsSet(boolean value) {
-    if (!value) {
-      this.permissionTypeId = null;
-    }
-  }
-
-  public String getDomainId() {
-    return this.domainId;
-  }
-
-  public PermissionType setDomainId(String domainId) {
-    this.domainId = domainId;
-    return this;
-  }
-
-  public void unsetDomainId() {
-    this.domainId = null;
-  }
-
-  /** Returns true if field domainId is set (has been assigned a value) and false otherwise */
-  public boolean isSetDomainId() {
-    return this.domainId != null;
-  }
-
-  public void setDomainIdIsSet(boolean value) {
-    if (!value) {
-      this.domainId = null;
-    }
-  }
-
-  public String getName() {
-    return this.name;
-  }
-
-  public PermissionType setName(String name) {
-    this.name = name;
-    return this;
-  }
-
-  public void unsetName() {
-    this.name = null;
-  }
-
-  /** Returns true if field name is set (has been assigned a value) and false otherwise */
-  public boolean isSetName() {
-    return this.name != null;
-  }
-
-  public void setNameIsSet(boolean value) {
-    if (!value) {
-      this.name = null;
-    }
-  }
-
-  public String getDescription() {
-    return this.description;
-  }
-
-  public PermissionType setDescription(String description) {
-    this.description = description;
-    return this;
-  }
-
-  public void unsetDescription() {
-    this.description = null;
-  }
-
-  /** Returns true if field description is set (has been assigned a value) and false otherwise */
-  public boolean isSetDescription() {
-    return this.description != null;
-  }
-
-  public void setDescriptionIsSet(boolean value) {
-    if (!value) {
-      this.description = null;
-    }
-  }
-
-  public long getCreatedTime() {
-    return this.createdTime;
-  }
-
-  public PermissionType setCreatedTime(long createdTime) {
-    this.createdTime = createdTime;
-    setCreatedTimeIsSet(true);
-    return this;
-  }
-
-  public void unsetCreatedTime() {
-    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CREATEDTIME_ISSET_ID);
-  }
-
-  /** Returns true if field createdTime is set (has been assigned a value) and false otherwise */
-  public boolean isSetCreatedTime() {
-    return EncodingUtils.testBit(__isset_bitfield, __CREATEDTIME_ISSET_ID);
-  }
-
-  public void setCreatedTimeIsSet(boolean value) {
-    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CREATEDTIME_ISSET_ID, value);
-  }
-
-  public long getUpdatedTime() {
-    return this.updatedTime;
-  }
-
-  public PermissionType setUpdatedTime(long updatedTime) {
-    this.updatedTime = updatedTime;
-    setUpdatedTimeIsSet(true);
-    return this;
-  }
-
-  public void unsetUpdatedTime() {
-    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID);
-  }
-
-  /** Returns true if field updatedTime is set (has been assigned a value) and false otherwise */
-  public boolean isSetUpdatedTime() {
-    return EncodingUtils.testBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID);
-  }
-
-  public void setUpdatedTimeIsSet(boolean value) {
-    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID, value);
-  }
-
-  public void setFieldValue(_Fields field, Object value) {
-    switch (field) {
-    case PERMISSION_TYPE_ID:
-      if (value == null) {
-        unsetPermissionTypeId();
-      } else {
-        setPermissionTypeId((String)value);
-      }
-      break;
-
-    case DOMAIN_ID:
-      if (value == null) {
-        unsetDomainId();
-      } else {
-        setDomainId((String)value);
-      }
-      break;
-
-    case NAME:
-      if (value == null) {
-        unsetName();
-      } else {
-        setName((String)value);
-      }
-      break;
-
-    case DESCRIPTION:
-      if (value == null) {
-        unsetDescription();
-      } else {
-        setDescription((String)value);
-      }
-      break;
-
-    case CREATED_TIME:
-      if (value == null) {
-        unsetCreatedTime();
-      } else {
-        setCreatedTime((Long)value);
-      }
-      break;
-
-    case UPDATED_TIME:
-      if (value == null) {
-        unsetUpdatedTime();
-      } else {
-        setUpdatedTime((Long)value);
-      }
-      break;
-
-    }
-  }
-
-  public Object getFieldValue(_Fields field) {
-    switch (field) {
-    case PERMISSION_TYPE_ID:
-      return getPermissionTypeId();
-
-    case DOMAIN_ID:
-      return getDomainId();
-
-    case NAME:
-      return getName();
-
-    case DESCRIPTION:
-      return getDescription();
-
-    case CREATED_TIME:
-      return getCreatedTime();
-
-    case UPDATED_TIME:
-      return getUpdatedTime();
-
-    }
-    throw new IllegalStateException();
-  }
-
-  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
-  public boolean isSet(_Fields field) {
-    if (field == null) {
-      throw new IllegalArgumentException();
-    }
-
-    switch (field) {
-    case PERMISSION_TYPE_ID:
-      return isSetPermissionTypeId();
-    case DOMAIN_ID:
-      return isSetDomainId();
-    case NAME:
-      return isSetName();
-    case DESCRIPTION:
-      return isSetDescription();
-    case CREATED_TIME:
-      return isSetCreatedTime();
-    case UPDATED_TIME:
-      return isSetUpdatedTime();
-    }
-    throw new IllegalStateException();
-  }
-
-  @Override
-  public boolean equals(Object that) {
-    if (that == null)
-      return false;
-    if (that instanceof PermissionType)
-      return this.equals((PermissionType)that);
-    return false;
-  }
-
-  public boolean equals(PermissionType that) {
-    if (that == null)
-      return false;
-
-    boolean this_present_permissionTypeId = true && this.isSetPermissionTypeId();
-    boolean that_present_permissionTypeId = true && that.isSetPermissionTypeId();
-    if (this_present_permissionTypeId || that_present_permissionTypeId) {
-      if (!(this_present_permissionTypeId && that_present_permissionTypeId))
-        return false;
-      if (!this.permissionTypeId.equals(that.permissionTypeId))
-        return false;
-    }
-
-    boolean this_present_domainId = true && this.isSetDomainId();
-    boolean that_present_domainId = true && that.isSetDomainId();
-    if (this_present_domainId || that_present_domainId) {
-      if (!(this_present_domainId && that_present_domainId))
-        return false;
-      if (!this.domainId.equals(that.domainId))
-        return false;
-    }
-
-    boolean this_present_name = true && this.isSetName();
-    boolean that_present_name = true && that.isSetName();
-    if (this_present_name || that_present_name) {
-      if (!(this_present_name && that_present_name))
-        return false;
-      if (!this.name.equals(that.name))
-        return false;
-    }
-
-    boolean this_present_description = true && this.isSetDescription();
-    boolean that_present_description = true && that.isSetDescription();
-    if (this_present_description || that_present_description) {
-      if (!(this_present_description && that_present_description))
-        return false;
-      if (!this.description.equals(that.description))
-        return false;
-    }
-
-    boolean this_present_createdTime = true && this.isSetCreatedTime();
-    boolean that_present_createdTime = true && that.isSetCreatedTime();
-    if (this_present_createdTime || that_present_createdTime) {
-      if (!(this_present_createdTime && that_present_createdTime))
-        return false;
-      if (this.createdTime != that.createdTime)
-        return false;
-    }
-
-    boolean this_present_updatedTime = true && this.isSetUpdatedTime();
-    boolean that_present_updatedTime = true && that.isSetUpdatedTime();
-    if (this_present_updatedTime || that_present_updatedTime) {
-      if (!(this_present_updatedTime && that_present_updatedTime))
-        return false;
-      if (this.updatedTime != that.updatedTime)
-        return false;
-    }
-
-    return true;
-  }
-
-  @Override
-  public int hashCode() {
-    List<Object> list = new ArrayList<Object>();
-
-    boolean present_permissionTypeId = true && (isSetPermissionTypeId());
-    list.add(present_permissionTypeId);
-    if (present_permissionTypeId)
-      list.add(permissionTypeId);
-
-    boolean present_domainId = true && (isSetDomainId());
-    list.add(present_domainId);
-    if (present_domainId)
-      list.add(domainId);
-
-    boolean present_name = true && (isSetName());
-    list.add(present_name);
-    if (present_name)
-      list.add(name);
-
-    boolean present_description = true && (isSetDescription());
-    list.add(present_description);
-    if (present_description)
-      list.add(description);
-
-    boolean present_createdTime = true && (isSetCreatedTime());
-    list.add(present_createdTime);
-    if (present_createdTime)
-      list.add(createdTime);
-
-    boolean present_updatedTime = true && (isSetUpdatedTime());
-    list.add(present_updatedTime);
-    if (present_updatedTime)
-      list.add(updatedTime);
-
-    return list.hashCode();
-  }
-
-  @Override
-  public int compareTo(PermissionType other) {
-    if (!getClass().equals(other.getClass())) {
-      return getClass().getName().compareTo(other.getClass().getName());
-    }
-
-    int lastComparison = 0;
-
-    lastComparison = Boolean.valueOf(isSetPermissionTypeId()).compareTo(other.isSetPermissionTypeId());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetPermissionTypeId()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.permissionTypeId, other.permissionTypeId);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetDomainId()).compareTo(other.isSetDomainId());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetDomainId()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domainId, other.domainId);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetName()).compareTo(other.isSetName());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetName()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetDescription()).compareTo(other.isSetDescription());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetDescription()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.description, other.description);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetCreatedTime()).compareTo(other.isSetCreatedTime());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetCreatedTime()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.createdTime, other.createdTime);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetUpdatedTime()).compareTo(other.isSetUpdatedTime());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetUpdatedTime()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updatedTime, other.updatedTime);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    return 0;
-  }
-
-  public _Fields fieldForId(int fieldId) {
-    return _Fields.findByThriftId(fieldId);
-  }
-
-  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
-  }
-
-  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
-  }
-
-  @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder("PermissionType(");
-    boolean first = true;
-
-    if (isSetPermissionTypeId()) {
-      sb.append("permissionTypeId:");
-      if (this.permissionTypeId == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.permissionTypeId);
-      }
-      first = false;
-    }
-    if (isSetDomainId()) {
-      if (!first) sb.append(", ");
-      sb.append("domainId:");
-      if (this.domainId == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.domainId);
-      }
-      first = false;
-    }
-    if (isSetName()) {
-      if (!first) sb.append(", ");
-      sb.append("name:");
-      if (this.name == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.name);
-      }
-      first = false;
-    }
-    if (isSetDescription()) {
-      if (!first) sb.append(", ");
-      sb.append("description:");
-      if (this.description == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.description);
-      }
-      first = false;
-    }
-    if (isSetCreatedTime()) {
-      if (!first) sb.append(", ");
-      sb.append("createdTime:");
-      sb.append(this.createdTime);
-      first = false;
-    }
-    if (isSetUpdatedTime()) {
-      if (!first) sb.append(", ");
-      sb.append("updatedTime:");
-      sb.append(this.updatedTime);
-      first = false;
-    }
-    sb.append(")");
-    return sb.toString();
-  }
-
-  public void validate() throws org.apache.thrift.TException {
-    // check for required fields
-    // check for sub-struct validity
-  }
-
-  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-    try {
-      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-    } catch (org.apache.thrift.TException te) {
-      throw new java.io.IOException(te);
-    }
-  }
-
-  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-    try {
-      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
-      __isset_bitfield = 0;
-      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-    } catch (org.apache.thrift.TException te) {
-      throw new java.io.IOException(te);
-    }
-  }
-
-  private static class PermissionTypeStandardSchemeFactory implements SchemeFactory {
-    public PermissionTypeStandardScheme getScheme() {
-      return new PermissionTypeStandardScheme();
-    }
-  }
-
-  private static class PermissionTypeStandardScheme extends StandardScheme<PermissionType> {
-
-    public void read(org.apache.thrift.protocol.TProtocol iprot, PermissionType struct) throws org.apache.thrift.TException {
-      org.apache.thrift.protocol.TField schemeField;
-      iprot.readStructBegin();
-      while (true)
-      {
-        schemeField = iprot.readFieldBegin();
-        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
-          break;
-        }
-        switch (schemeField.id) {
-          case 1: // PERMISSION_TYPE_ID
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.permissionTypeId = iprot.readString();
-              struct.setPermissionTypeIdIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 2: // DOMAIN_ID
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.domainId = iprot.readString();
-              struct.setDomainIdIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 3: // NAME
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.name = iprot.readString();
-              struct.setNameIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 4: // DESCRIPTION
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.description = iprot.readString();
-              struct.setDescriptionIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 5: // CREATED_TIME
-            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
-              struct.createdTime = iprot.readI64();
-              struct.setCreatedTimeIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 6: // UPDATED_TIME
-            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
-              struct.updatedTime = iprot.readI64();
-              struct.setUpdatedTimeIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          default:
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-        }
-        iprot.readFieldEnd();
-      }
-      iprot.readStructEnd();
-
-      // check for required fields of primitive type, which can't be checked in the validate method
-      struct.validate();
-    }
-
-    public void write(org.apache.thrift.protocol.TProtocol oprot, PermissionType struct) throws org.apache.thrift.TException {
-      struct.validate();
-
-      oprot.writeStructBegin(STRUCT_DESC);
-      if (struct.permissionTypeId != null) {
-        if (struct.isSetPermissionTypeId()) {
-          oprot.writeFieldBegin(PERMISSION_TYPE_ID_FIELD_DESC);
-          oprot.writeString(struct.permissionTypeId);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.domainId != null) {
-        if (struct.isSetDomainId()) {
-          oprot.writeFieldBegin(DOMAIN_ID_FIELD_DESC);
-          oprot.writeString(struct.domainId);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.name != null) {
-        if (struct.isSetName()) {
-          oprot.writeFieldBegin(NAME_FIELD_DESC);
-          oprot.writeString(struct.name);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.description != null) {
-        if (struct.isSetDescription()) {
-          oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC);
-          oprot.writeString(struct.description);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.isSetCreatedTime()) {
-        oprot.writeFieldBegin(CREATED_TIME_FIELD_DESC);
-        oprot.writeI64(struct.createdTime);
-        oprot.writeFieldEnd();
-      }
-      if (struct.isSetUpdatedTime()) {
-        oprot.writeFieldBegin(UPDATED_TIME_FIELD_DESC);
-        oprot.writeI64(struct.updatedTime);
-        oprot.writeFieldEnd();
-      }
-      oprot.writeFieldStop();
-      oprot.writeStructEnd();
-    }
-
-  }
-
-  private static class PermissionTypeTupleSchemeFactory implements SchemeFactory {
-    public PermissionTypeTupleScheme getScheme() {
-      return new PermissionTypeTupleScheme();
-    }
-  }
-
-  private static class PermissionTypeTupleScheme extends TupleScheme<PermissionType> {
-
-    @Override
-    public void write(org.apache.thrift.protocol.TProtocol prot, PermissionType struct) throws org.apache.thrift.TException {
-      TTupleProtocol oprot = (TTupleProtocol) prot;
-      BitSet optionals = new BitSet();
-      if (struct.isSetPermissionTypeId()) {
-        optionals.set(0);
-      }
-      if (struct.isSetDomainId()) {
-        optionals.set(1);
-      }
-      if (struct.isSetName()) {
-        optionals.set(2);
-      }
-      if (struct.isSetDescription()) {
-        optionals.set(3);
-      }
-      if (struct.isSetCreatedTime()) {
-        optionals.set(4);
-      }
-      if (struct.isSetUpdatedTime()) {
-        optionals.set(5);
-      }
-      oprot.writeBitSet(optionals, 6);
-      if (struct.isSetPermissionTypeId()) {
-        oprot.writeString(struct.permissionTypeId);
-      }
-      if (struct.isSetDomainId()) {
-        oprot.writeString(struct.domainId);
-      }
-      if (struct.isSetName()) {
-        oprot.writeString(struct.name);
-      }
-      if (struct.isSetDescription()) {
-        oprot.writeString(struct.description);
-      }
-      if (struct.isSetCreatedTime()) {
-        oprot.writeI64(struct.createdTime);
-      }
-      if (struct.isSetUpdatedTime()) {
-        oprot.writeI64(struct.updatedTime);
-      }
-    }
-
-    @Override
-    public void read(org.apache.thrift.protocol.TProtocol prot, PermissionType struct) throws org.apache.thrift.TException {
-      TTupleProtocol iprot = (TTupleProtocol) prot;
-      BitSet incoming = iprot.readBitSet(6);
-      if (incoming.get(0)) {
-        struct.permissionTypeId = iprot.readString();
-        struct.setPermissionTypeIdIsSet(true);
-      }
-      if (incoming.get(1)) {
-        struct.domainId = iprot.readString();
-        struct.setDomainIdIsSet(true);
-      }
-      if (incoming.get(2)) {
-        struct.name = iprot.readString();
-        struct.setNameIsSet(true);
-      }
-      if (incoming.get(3)) {
-        struct.description = iprot.readString();
-        struct.setDescriptionIsSet(true);
-      }
-      if (incoming.get(4)) {
-        struct.createdTime = iprot.readI64();
-        struct.setCreatedTimeIsSet(true);
-      }
-      if (incoming.get(5)) {
-        struct.updatedTime = iprot.readI64();
-        struct.setUpdatedTimeIsSet(true);
-      }
-    }
-  }
-
-}
-


[15/17] airavata git commit: renaming directory names

Posted by sc...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/server/SharingRegistryServerHandler.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/server/SharingRegistryServerHandler.java b/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/server/SharingRegistryServerHandler.java
deleted file mode 100644
index 7ae1c64..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/server/SharingRegistryServerHandler.java
+++ /dev/null
@@ -1,585 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.sharing.registry.server;
-
-import org.apache.airavata.sharing.registry.db.entities.GroupMembershipEntityPK;
-import org.apache.airavata.sharing.registry.db.entities.SharingEntityPK;
-import org.apache.airavata.sharing.registry.db.repositories.*;
-import org.apache.airavata.sharing.registry.db.utils.DBConstants;
-import org.apache.airavata.sharing.registry.models.*;
-import org.apache.airavata.sharing.registry.service.cpi.GovRegistryService;
-import org.apache.thrift.TException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.lang.reflect.Field;
-import java.util.*;
-
-public class SharingRegistryServerHandler implements GovRegistryService.Iface{
-    private final static Logger logger = LoggerFactory.getLogger(SharingRegistryServerHandler.class);
-
-    public static String GLOBAL_PERMISSION_NAME = "GLOBAL";
-
-    private DomainRepository domainRepository;
-    private UserRepository userRepository;
-    private UserGroupRepository userGroupRepository;
-    private GroupMembershipRepository groupMembershipRepository;
-    private EntityTypeRepository entityTypeRepository;
-    private PermissionTypeRepository permissionTypeRepository;
-    private EntityRepository entityRepository;
-    private SharingRepository sharingRepository;
-
-    public SharingRegistryServerHandler(){
-        this.domainRepository = new DomainRepository();
-        this.userRepository = new UserRepository();
-        this.userGroupRepository = new UserGroupRepository();
-        this.groupMembershipRepository = new GroupMembershipRepository();
-        this.entityTypeRepository = new EntityTypeRepository();
-        this.permissionTypeRepository = new PermissionTypeRepository();
-        this.entityRepository = new EntityRepository();
-        this.sharingRepository = new SharingRepository();
-    }
-
-    /**
-     * * Domain Operations
-     * *
-     */
-    @Override
-    public String createDomain(Domain domain) throws GovRegistryException, TException {
-        if(domainRepository.get(domain.domainId) != null)
-            throw new GovRegistryException("There exist domain with given domain id");
-
-        domain.setCreatedTime(System.currentTimeMillis());
-        domain.setUpdatedTime(System.currentTimeMillis());
-        domainRepository.create(domain);
-
-        //create the global permission for the domain
-        PermissionType permissionType = new PermissionType();
-        permissionType.setPermissionTypeId(domain.domainId+":"+GLOBAL_PERMISSION_NAME);
-        permissionType.setDomainId(domain.domainId);
-        permissionType.setName(GLOBAL_PERMISSION_NAME);
-        permissionType.setDescription("GLOBAL permission to " + domain.domainId);
-        permissionType.setCreatedTime(System.currentTimeMillis());
-        permissionType.setUpdatedTime(System.currentTimeMillis());
-        permissionTypeRepository.create(permissionType);
-
-        return domain.domainId;
-    }
-
-    @Override
-    public boolean updateDomain(Domain domain) throws GovRegistryException, TException {
-        Domain oldDomain = domainRepository.get(domain.domainId);
-        domain.setCreatedTime(oldDomain.createdTime);
-        domain.setUpdatedTime(System.currentTimeMillis());
-        domain = getUpdatedObject(oldDomain, domain);
-        domainRepository.update(domain);
-        return true;
-    }
-
-    @Override
-    public boolean deleteDomain(String domainId) throws GovRegistryException, TException {
-        domainRepository.delete(domainId);
-        return true;
-    }
-
-    @Override
-    public Domain getDomain(String domainId) throws GovRegistryException, TException {
-        return domainRepository.get(domainId);
-    }
-
-    @Override
-    public List<Domain> getDomains(int offset, int limit) throws TException {
-        return domainRepository.select(new HashMap<>(), offset, limit);
-    }
-
-    /**
-     * * User Operations
-     * *
-     */
-    @Override
-    public String createUser(User user) throws GovRegistryException, TException {
-        if(userRepository.get(user.userId) != null)
-            throw new GovRegistryException("There exist user with given user id");
-
-        user.setCreatedTime(System.currentTimeMillis());
-        user.setUpdatedTime(System.currentTimeMillis());
-        userRepository.create(user);
-
-        UserGroup userGroup = new UserGroup();
-        userGroup.setGroupId(user.userId);
-        userGroup.setDomainId(user.domainId);
-        userGroup.setName(user.userName);
-        userGroup.setDescription("user " + user.userName + " group");
-        userGroup.setOwnerId(user.userId);
-        userGroup.setGroupType(GroupType.SINGLE_USER);
-        createGroup(userGroup);
-
-        return user.userId;
-    }
-
-    @Override
-    public boolean updatedUser(User user) throws GovRegistryException, TException {
-        User oldUser = userRepository.get(user.userId);
-        user.setCreatedTime(oldUser.createdTime);
-        user.setUpdatedTime(System.currentTimeMillis());
-        user = getUpdatedObject(oldUser, user);
-        userRepository.update(user);
-
-        UserGroup userGroup = userGroupRepository.get(user.userId);
-        userGroup.setName(user.userName);
-        userGroup.setDescription("user " + user.userName + " group");
-        updateGroup(userGroup);
-        return true;
-    }
-
-    @Override
-    public boolean deleteUser(String userId) throws GovRegistryException, TException {
-        userRepository.delete(userId);
-        userGroupRepository.delete(userId);
-        return true;
-    }
-
-    @Override
-    public User getUser(String userId) throws GovRegistryException, TException {
-        return userRepository.get(userId);
-    }
-
-    @Override
-    public List<User> getUsers(String domain, int offset, int limit) throws  GovRegistryException, TException {
-        HashMap<String, String> filters = new HashMap<>();
-        filters.put(DBConstants.UserTable.DOMAIN_ID, domain);
-        return userRepository.select(filters, offset, limit);
-    }
-
-    /**
-     * * Group Operations
-     * *
-     */
-    @Override
-    public String createGroup(UserGroup group) throws GovRegistryException, TException {
-        if(userGroupRepository.get(group.groupId) != null)
-            throw new GovRegistryException("There exist group with given group id");
-
-        group.setCreatedTime(System.currentTimeMillis());
-        group.setUpdatedTime(System.currentTimeMillis());
-        userGroupRepository.create(group);
-        return group.groupId;
-    }
-
-    @Override
-    public boolean updateGroup(UserGroup group) throws GovRegistryException, TException {
-        group.setUpdatedTime(System.currentTimeMillis());
-        UserGroup oldGroup = userGroupRepository.get(group.groupId);
-        group.setCreatedTime(oldGroup.createdTime);
-        group = getUpdatedObject(oldGroup, group);
-        userGroupRepository.update(group);
-        return true;
-    }
-
-    @Override
-    public boolean deleteGroup(String groupId) throws GovRegistryException, TException {
-        userGroupRepository.delete(groupId);
-        return true;
-    }
-
-    @Override
-    public UserGroup getGroup(String groupId) throws GovRegistryException, TException {
-        return userGroupRepository.get(groupId);
-    }
-
-    @Override
-    public List<UserGroup> getGroups(String domain, int offset, int limit) throws TException {
-        HashMap<String, String> filters = new HashMap<>();
-        filters.put(DBConstants.UserTable.DOMAIN_ID, domain);
-        return userGroupRepository.select(filters, offset, limit);
-    }
-
-    @Override
-    public boolean addUsersToGroup(List<String> userIds, String groupId) throws GovRegistryException, TException {
-        for(int i=0; i < userIds.size(); i++){
-            GroupMembership groupMembership = new GroupMembership();
-            groupMembership.setParentId(groupId);
-            groupMembership.setChildId(userIds.get(i));
-            groupMembership.setChildType(GroupChildType.USER);
-            groupMembership.setCreatedTime(System.currentTimeMillis());
-            groupMembership.setUpdatedTime(System.currentTimeMillis());
-            groupMembershipRepository.create(groupMembership);
-        }
-        return true;
-    }
-
-    @Override
-    public boolean removeUsersFromGroup(List<String> userIds, String groupId) throws GovRegistryException, TException {
-        for(int i=0; i < userIds.size(); i++){
-            GroupMembershipEntityPK groupMembershipEntityPK = new GroupMembershipEntityPK();
-            groupMembershipEntityPK.setParentId(groupId);
-            groupMembershipEntityPK.setChildId(userIds.get(i));
-            groupMembershipRepository.delete(groupMembershipEntityPK);
-        }
-        return true;
-    }
-
-    @Override
-    public Map<String, GroupChildType> getGroupMembers(String groupId, int offset, int limit) throws  GovRegistryException, TException {
-        HashMap<String, GroupChildType> groupMembers = new HashMap<>();
-        HashMap<String, String> filters = new HashMap<>();
-        filters.put(DBConstants.GroupMembershipTable.PARENT_ID, groupId);
-        List<GroupMembership> groupMembershipList = groupMembershipRepository.select(filters, 0, -1);
-        groupMembershipList.stream().forEach(gm->{groupMembers.put(gm.getChildId(), gm.getChildType());});
-        return groupMembers;
-    }
-
-    @Override
-    public boolean addChildGroupToParentGroup(String childId, String groupId) throws GovRegistryException, TException {
-        //Todo check for cyclic dependencies
-        GroupMembership groupMembership = new GroupMembership();
-        groupMembership.setParentId(groupId);
-        groupMembership.setChildId(childId);
-        groupMembership.setChildType(GroupChildType.GROUP);
-        groupMembership.setCreatedTime(System.currentTimeMillis());
-        groupMembership.setUpdatedTime(System.currentTimeMillis());
-        groupMembershipRepository.create(groupMembership);
-        return true;
-    }
-
-    @Override
-    public boolean removeChildGroupFromParentGroup(String childId, String groupId) throws GovRegistryException, TException {
-        GroupMembershipEntityPK groupMembershipEntityPK = new GroupMembershipEntityPK();
-        groupMembershipEntityPK.setParentId(groupId);
-        groupMembershipEntityPK.setChildId(childId);
-        groupMembershipRepository.delete(groupMembershipEntityPK);
-        return true;
-    }
-
-    /**
-     * * EntityType Operations
-     * *
-     */
-    @Override
-    public String createEntityType(EntityType entityType) throws GovRegistryException, TException {
-        if(entityTypeRepository.get(entityType.entityTypeId) != null)
-            throw new GovRegistryException("There exist EntityType with given EntityType id");
-
-        entityType.setCreatedTime(System.currentTimeMillis());
-        entityType.setUpdatedTime(System.currentTimeMillis());
-        entityTypeRepository.create(entityType);
-        return entityType.entityTypeId;
-    }
-
-    @Override
-    public boolean updateEntityType(EntityType entityType) throws GovRegistryException, TException {
-        entityType.setUpdatedTime(System.currentTimeMillis());
-        EntityType oldEntityType = entityTypeRepository.get(entityType.entityTypeId);
-        entityType.setCreatedTime(oldEntityType.createdTime);
-        entityType = getUpdatedObject(oldEntityType, entityType);
-        entityTypeRepository.update(entityType);
-        return true;
-    }
-
-    @Override
-    public boolean deleteEntityType(String entityTypeId) throws GovRegistryException, TException {
-        entityTypeRepository.delete(entityTypeId);
-        return true;
-    }
-
-    @Override
-    public EntityType getEntityType(String entityTypeId) throws GovRegistryException, TException {
-        return entityTypeRepository.get(entityTypeId);
-    }
-
-    @Override
-    public List<EntityType> getEntityTypes(String domain, int offset, int limit) throws TException {
-        HashMap<String, String> filters = new HashMap<>();
-        filters.put(DBConstants.EntityTypeTable.DOMAIN_ID, domain);
-        return entityTypeRepository.select(domain, offset, limit);
-    }
-
-    /**
-     * * Permission Operations
-     * *
-     */
-    @Override
-    public String createPermissionType(PermissionType permissionType) throws GovRegistryException, TException {
-        if(permissionTypeRepository.get(permissionType.permissionTypeId) != null)
-            throw new GovRegistryException("There exist PermissionType with given PermissionType id");
-        permissionType.setCreatedTime(System.currentTimeMillis());
-        permissionType.setUpdatedTime(System.currentTimeMillis());
-        permissionTypeRepository.create(permissionType);
-        return permissionType.permissionTypeId;
-    }
-
-    @Override
-    public boolean updatePermissionType(PermissionType permissionType) throws GovRegistryException, TException {
-        permissionType.setUpdatedTime(System.currentTimeMillis());
-        PermissionType oldPermissionType = permissionTypeRepository.get(permissionType.permissionTypeId);
-        permissionType = getUpdatedObject(oldPermissionType, permissionType);
-        permissionTypeRepository.update(permissionType);
-        return true;
-    }
-
-    @Override
-    public boolean deletePermissionType(String entityTypeId) throws GovRegistryException, TException {
-        permissionTypeRepository.delete(entityTypeId);
-        return true;
-    }
-
-    @Override
-    public PermissionType getPermissionType(String permissionTypeId) throws GovRegistryException, TException {
-        return permissionTypeRepository.get(permissionTypeId);
-    }
-
-    @Override
-    public List<PermissionType> getPermissionTypes(String domain, int offset, int limit) throws GovRegistryException, TException {
-        HashMap<String, String> filters = new HashMap<>();
-        filters.put(DBConstants.PermissionTypeTable.DOMAIN_ID, domain);
-        return permissionTypeRepository.select(filters, offset, limit);
-    }
-
-    /**
-     * * Entity Operations
-     * *
-     */
-    @Override
-    public String createEntity(Entity entity) throws GovRegistryException, TException {
-        if(entityRepository.get(entity.entityId) != null)
-            throw new GovRegistryException("There exist Entity with given Entity id");
-
-        entity.setCreatedTime(System.currentTimeMillis());
-        entity.setUpdatedTime(System.currentTimeMillis());
-        entityRepository.create(entity);
-
-        //Assigning global permission for the owner
-        Sharing newSharing = new Sharing();
-        newSharing.setPermissionTypeId(permissionTypeRepository.getGlobalPermissionTypeIdForDomain(entity.domainId));
-        newSharing.setEntityId(entity.entityId);
-        newSharing.setGroupId(entity.ownerId);
-        newSharing.setGroupType(GroupType.SINGLE_USER);
-        newSharing.setSharingType(SharingType.DIRECT);
-        newSharing.setCreatedTime(System.currentTimeMillis());
-        newSharing.setUpdatedTime(System.currentTimeMillis());
-
-        sharingRepository.create(newSharing);
-
-        //creating records for inherited permissions
-        if(entity.getParentEntityId() != null && entity.getParentEntityId() != ""){
-            List<Sharing> sharings = sharingRepository.getPermissionsForEntity(entity.parentEntityId);
-            for(Sharing sharing : sharings){
-                newSharing = new Sharing();
-                newSharing.setPermissionTypeId(sharing.permissionTypeId);
-                newSharing.setEntityId(entity.entityId);
-                newSharing.setGroupId(sharing.groupId);
-                newSharing.setGroupType(sharing.groupType);
-                newSharing.setSharingType(SharingType.INHERITED);
-                newSharing.setCreatedTime(System.currentTimeMillis());
-                newSharing.setUpdatedTime(System.currentTimeMillis());
-
-                sharingRepository.create(newSharing);
-            }
-        }
-
-        return entity.entityId;
-    }
-
-    @Override
-    public boolean updateEntity(Entity entity) throws GovRegistryException, TException {
-        //TODO Check for permission changes
-        entity.setUpdatedTime(System.currentTimeMillis());
-        Entity oldEntity = entityRepository.get(entity.getEntityId());
-        entity.setCreatedTime(oldEntity.createdTime);
-        entity = getUpdatedObject(oldEntity, entity);
-        entityRepository.update(entity);
-        return true;
-    }
-
-    @Override
-    public boolean deleteEntity(String entityId) throws GovRegistryException, TException {
-        //TODO Check for permission changes
-        entityRepository.delete(entityId);
-        return true;
-    }
-
-    @Override
-    public Entity getEntity(String entityId) throws GovRegistryException, TException {
-        return entityRepository.get(entityId);
-    }
-
-    @Override
-    public List<Entity> searchEntities(String userId, String entityTypeId, Map<EntitySearchFields, String> filters,
-                                       int offset, int limit) throws GovRegistryException, TException {
-        List<String> groupIds = new ArrayList<>();
-        groupIds.add(userId);
-        groupMembershipRepository.getAllParentMembershipsForChild(userId).stream().forEach(gm->groupIds.add(gm.parentId));
-        return entityRepository.searchEntities(groupIds, entityTypeId, filters, offset, limit);
-    }
-
-    /**
-     * * Sharing Entity with Users and Groups
-     * *
-     *
-     * @param entityId
-     * @param userList
-     * @param permissionType
-     */
-    @Override
-    public boolean shareEntityWithUsers(String entityId, List<String> userList, String permissionTypeId) throws GovRegistryException, TException {
-        return shareEntity(entityId, userList, permissionTypeId, GroupType.SINGLE_USER);
-    }
-
-    @Override
-    public boolean shareEntityWithGroups(String entityId, List<String> groupList, String permissionTypeId) throws GovRegistryException, TException {
-        return shareEntity(entityId, groupList, permissionTypeId, GroupType.MULTI_USER);
-    }
-
-    private boolean shareEntity(String entityId, List<String> groupOrUserList, String permissionTypeId, GroupType groupType)  throws GovRegistryException, TException {
-        //Adding permission for the specified users/groups for the specified entity
-        LinkedList<Entity> temp = new LinkedList<>();
-        for(String userId : groupOrUserList){
-            Sharing sharing = new Sharing();
-            sharing.setPermissionTypeId(permissionTypeId);
-            sharing.setEntityId(entityId);
-            sharing.setGroupId(userId);
-            sharing.setGroupType(groupType);
-            sharing.setSharingType(SharingType.DIRECT);
-            sharing.setCreatedTime(System.currentTimeMillis());
-            sharing.setUpdatedTime(System.currentTimeMillis());
-
-            sharingRepository.create(sharing);
-        }
-
-        //Adding permission for the specified users/groups for all child entities
-        entityRepository.getChildEntities(entityId).stream().forEach(e-> temp.addLast(e));
-        while(temp.size() > 0){
-            Entity entity = temp.pop();
-            String childEntityId = entity.entityId;
-            String parentEntityId = entity.parentEntityId;
-            for(String userId : groupOrUserList){
-                Sharing sharing = new Sharing();
-                sharing.setPermissionTypeId(permissionTypeId);
-                sharing.setEntityId(childEntityId);
-                sharing.setGroupId(userId);
-                sharing.setGroupType(groupType);
-                sharing.setSharingType(SharingType.INHERITED);
-                sharing.setInheritedParentId(parentEntityId);
-                sharing.setCreatedTime(System.currentTimeMillis());
-                sharing.setUpdatedTime(System.currentTimeMillis());
-                sharingRepository.create(sharing);
-                entityRepository.getChildEntities(childEntityId).stream().forEach(e-> temp.addLast(e));
-            }
-        }
-        return true;
-    }
-
-    @Override
-    public boolean revokeEntitySharingFromUsers(String entityId, List<String> userList, String permissionTypeId) throws GovRegistryException, TException {
-        return revokeEntitySharing(entityId, userList, permissionTypeId);
-    }
-
-
-    @Override
-    public boolean revokeEntitySharingFromGroups(String entityId, List<String> groupList, String permissionTypeId) throws GovRegistryException, TException {
-        return revokeEntitySharing(entityId, groupList, permissionTypeId);
-    }
-
-    @Override
-    public boolean userHasAccess(String domainId, String userId, String entityId, String permissionTypeId) throws GovRegistryException, TException {
-        //check whether the user has permission directly or indirectly
-        List<GroupMembership> parentMemberships = groupMembershipRepository.getAllParentMembershipsForChild(userId);
-        List<String> groupIds = new ArrayList<>();
-        parentMemberships.stream().forEach(pm->groupIds.add(pm.parentId));
-        groupIds.add(userId);
-        return sharingRepository.hasAccess(entityId, groupIds, Arrays.asList(permissionTypeId,
-                permissionTypeRepository.getGlobalPermissionTypeIdForDomain(domainId)));
-    }
-
-    public boolean revokeEntitySharing(String entityId, List<String> groupOrUserList, String permissionTypeId) throws GovRegistryException {
-        //revoking permission for the entity
-        LinkedList<Sharing> temp = new LinkedList<>();
-        sharingRepository.getIndirectSharedChildren(entityId, permissionTypeId).stream().forEach(s->temp.addLast(s));
-        for(String groupId : groupOrUserList){
-            SharingEntityPK sharingEntityPK = new SharingEntityPK();
-            sharingEntityPK.setEntityId(entityId);
-            sharingEntityPK.setGroupId(groupId);
-            sharingEntityPK.setPermissionTypeId(permissionTypeId);
-
-            sharingRepository.delete(sharingEntityPK);
-        }
-
-        //revoking permission from inheritance
-        while(temp.size() > 0){
-            Sharing sharing = temp.pop();
-            String childEntityId = sharing.entityId;
-            sharingRepository.getIndirectSharedChildren(sharing.entityId, permissionTypeId).stream().forEach(s->temp.addLast(s));
-            for(String groupId : groupOrUserList){
-                SharingEntityPK sharingEntityPK = new SharingEntityPK();
-                sharingEntityPK.setEntityId(childEntityId);
-                sharingEntityPK.setGroupId(groupId);
-                sharingEntityPK.setPermissionTypeId(permissionTypeId);
-
-                sharingRepository.delete(sharingEntityPK);
-            }
-        }
-        return true;
-    }
-
-
-
-    private <T> T getUpdatedObject(T oldEntity, T newEntity) throws GovRegistryException {
-        Field[] newEntityFields = newEntity.getClass().getDeclaredFields();
-        Hashtable newHT = fieldsToHT(newEntityFields, newEntity);
-
-        Class oldEntityClass = oldEntity.getClass();
-        Field[] oldEntityFields = oldEntityClass.getDeclaredFields();
-
-        for (Field field : oldEntityFields){
-            field.setAccessible(true);
-            Object o = newHT.get(field.getName());
-            if (o != null){
-                Field f = null;
-                try {
-                    f = oldEntityClass.getDeclaredField(field.getName());
-                    f.setAccessible(true);
-                    logger.debug("setting " + f.getName());
-                    f.set(oldEntity, o);
-                } catch (Exception e) {
-                    throw new GovRegistryException(e.getMessage());
-                }
-            }
-        }
-        return oldEntity;
-    }
-
-    private static Hashtable<String, Object> fieldsToHT(Field[] fields, Object obj){
-        Hashtable<String,Object> hashtable = new Hashtable<>();
-        for (Field field: fields){
-            field.setAccessible(true);
-            try {
-                Object retrievedObject = field.get(obj);
-                if (retrievedObject != null){
-                    logger.debug("scanning " + field.getName());
-                    hashtable.put(field.getName(), field.get(obj));
-                }
-            } catch (IllegalAccessException e) {
-                e.printStackTrace();
-            }
-        }
-        return hashtable;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/resources/META-INF/persistence.xml
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/resources/META-INF/persistence.xml b/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/resources/META-INF/persistence.xml
deleted file mode 100644
index a9f808c..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/resources/META-INF/persistence.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0">
-
-    <persistence-unit name="airavata-sharing-registry">
-        <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
-        <class>org.apache.airavata.sharing.registry.db.entities.DomainEntity</class>
-        <class>org.apache.airavata.sharing.registry.db.entities.EntityEntity</class>
-        <class>org.apache.airavata.sharing.registry.db.entities.EntityTypeEntity</class>
-        <class>org.apache.airavata.sharing.registry.db.entities.GroupMembershipEntity</class>
-        <class>org.apache.airavata.sharing.registry.db.entities.PermissionTypeEntity</class>
-        <class>org.apache.airavata.sharing.registry.db.entities.SharingEntity</class>
-        <class>org.apache.airavata.sharing.registry.db.entities.UserEntity</class>
-        <class>org.apache.airavata.sharing.registry.db.entities.UserGroupEntity</class>
-    </persistence-unit>
-</persistence>

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/resources/sharing-registry-derby.sql
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/resources/sharing-registry-derby.sql b/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/resources/sharing-registry-derby.sql
deleted file mode 100644
index 4b046ce..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/resources/sharing-registry-derby.sql
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-CREATE TABLE DOMAIN (
-  DOMAIN_ID VARCHAR(255) NOT NULL,
-  NAME VARCHAR(255) NOT NULL,
-  DESCRIPTION VARCHAR(255),
-  CREATED_TIME BIGINT NOT NULL,
-  UPDATED_TIME BIGINT NOT NULL,
-  PRIMARY KEY (DOMAIN_ID)
-);
-
-CREATE TABLE USER (
-  USER_ID VARCHAR(255) NOT NULL,
-  DOMAIN_ID VARCHAR(255) NOT NULL,
-  USER_NAME VARCHAR(255) NOT NULL,
-  CREATED_TIME BIGINT NOT NULL,
-  UPDATED_TIME BIGINT NOT NULL,
-  PRIMARY KEY (USER_ID),
-  FOREIGN KEY (DOMAIN_ID) REFERENCES DOMAIN(DOMAIN_ID) ON DELETE CASCADE ON UPDATE CASCADE
-);
-
-CREATE TABLE USER_GROUP (
-  GROUP_ID VARCHAR(255) NOT NULL,
-  DOMAIN_ID VARCHAR(255) NOT NULL,
-  NAME VARCHAR(255) NOT NULL,
-  DESCRIPTION VARCHAR(255),
-  OWNER_ID VARCHAR(255) NOT NULL,
-  GROUP_TYPE VARCHAR(255) NOT NULL,
-  CREATED_TIME BIGINT NOT NULL,
-  UPDATED_TIME BIGINT NOT NULL,
-  PRIMARY KEY (GROUP_ID),
-  FOREIGN KEY (DOMAIN_ID) REFERENCES DOMAIN(DOMAIN_ID) ON DELETE CASCADE ON UPDATE CASCADE,
-  FOREIGN KEY (OWNER_ID) REFERENCES USER(USER_ID) ON DELETE CASCADE ON UPDATE CASCADE
-);
-
-
-CREATE TABLE GROUP_MEMBERSHIP (
-  PARENT_ID VARCHAR(255) NOT NULL,
-  CHILD_ID VARCHAR(255) NOT NULL,
-  CHILD_TYPE VARCHAR(255) NOT NULL,
-  CREATED_TIME BIGINT NOT NULL,
-  UPDATED_TIME BIGINT NOT NULL,
-  PRIMARY KEY (PARENT_ID, CHILD_ID),
-  FOREIGN KEY (PARENT_ID) REFERENCES USER_GROUP(GROUP_ID) ON DELETE CASCADE ON UPDATE CASCADE,
-  FOREIGN KEY (CHILD_ID) REFERENCES USER_GROUP(GROUP_ID) ON DELETE CASCADE ON UPDATE CASCADE
-);
-
-CREATE TABLE ENTITY_TYPE (
-  ENTITY_TYPE_ID VARCHAR(255) NOT NULL,
-  DOMAIN_ID VARCHAR(255) NOT NULL,
-  NAME VARCHAR(255) NOT NULL,
-  DESCRIPTION VARCHAR(255),
-  CREATED_TIME BIGINT NOT NULL,
-  UPDATED_TIME BIGINT NOT NULL,
-  PRIMARY KEY (ENTITY_TYPE_ID),
-  FOREIGN KEY (DOMAIN_ID) REFERENCES DOMAIN(DOMAIN_ID) ON DELETE CASCADE ON UPDATE CASCADE
-);
-
-CREATE TABLE PERMISSION_TYPE (
-  PERMISSION_TYPE_ID VARCHAR(255) NOT NULL,
-  DOMAIN_ID VARCHAR(255) NOT NULL,
-  NAME VARCHAR(255) NOT NULL,
-  DESCRIPTION VARCHAR(255),
-  CREATED_TIME BIGINT NOT NULL,
-  UPDATED_TIME BIGINT NOT NULL,
-  PRIMARY KEY (PERMISSION_TYPE_ID),
-  FOREIGN KEY (DOMAIN_ID) REFERENCES DOMAIN(DOMAIN_ID) ON DELETE CASCADE ON UPDATE CASCADE
-);
-
-CREATE TABLE ENTITY (
-  ENTITY_ID VARCHAR(255) NOT NULL,
-  DOMAIN_ID VARCHAR(255) NOT NULL,
-  ENTITY_TYPE_ID VARCHAR(255) NOT NULL,
-  OWNER_ID VARCHAR(255) NOT NULL,
-  PARENT_ENTITY_ID VARCHAR(255),
-  NAME VARCHAR(255) NOT NULL,
-  DESCRIPTION VARCHAR(255),
-  FULL_TEXT TEXT,
-  CREATED_TIME BIGINT NOT NULL,
-  UPDATED_TIME BIGINT NOT NULL,
-  PRIMARY KEY (ENTITY_ID),
-  FOREIGN KEY (DOMAIN_ID) REFERENCES DOMAIN(DOMAIN_ID) ON DELETE CASCADE ON UPDATE CASCADE,
-  FOREIGN KEY (ENTITY_TYPE_ID) REFERENCES ENTITY_TYPE(ENTITY_TYPE_ID) ON DELETE CASCADE ON UPDATE CASCADE,
-  FOREIGN KEY (OWNER_ID) REFERENCES USER(USER_ID) ON DELETE CASCADE ON UPDATE CASCADE,
-  FOREIGN KEY (PARENT_ENTITY_ID) REFERENCES ENTITY(ENTITY_ID) ON DELETE CASCADE ON UPDATE CASCADE
-);
-
-ALTER TABLE ENTITY ADD FULLTEXT FULL_TEXT_INDEX(FULL_TEXT);
-
-CREATE TABLE ENTITY_METADATA (
-  ENTITY_ID VARCHAR (255) NOT NULL,
-  META_KEY VARCHAR (255) NOT NULL,
-  META_VALUE VARCHAR (255) NOT NULL,
-  PRIMARY KEY (ENTITY_ID, META_KEY),
-  FOREIGN KEY (ENTITY_ID) REFERENCES ENTITY(ENTITY_ID) ON DELETE CASCADE ON UPDATE CASCADE
-);
-
-CREATE TABLE SHARING (
-  PERMISSION_TYPE_ID VARCHAR(255) NOT NULL,
-  ENTITY_ID VARCHAR(255) NOT NULL,
-  GROUP_ID VARCHAR(255) NOT NULL,
-  GROUP_TYPE VARCHAR(255) NOT NULL,
-  SHARING_TYPE VARCHAR(255) NOT NULL,
-  INHERITED_PARENT_ID VARCHAR(255),
-  CREATED_TIME BIGINT NOT NULL,
-  UPDATED_TIME BIGINT NOT NULL,
-  PRIMARY KEY (PERMISSION_TYPE_ID, ENTITY_ID, GROUP_ID),
-  FOREIGN KEY (PERMISSION_TYPE_ID) REFERENCES PERMISSION_TYPE(PERMISSION_TYPE_ID) ON DELETE CASCADE ON UPDATE CASCADE,
-  FOREIGN KEY (INHERITED_PARENT_ID) REFERENCES ENTITY(ENTITY_ID) ON DELETE CASCADE ON UPDATE CASCADE,
-  FOREIGN KEY (GROUP_ID) REFERENCES USER_GROUP(GROUP_ID) ON DELETE CASCADE ON UPDATE CASCADE
-);
-
-CREATE TABLE CONFIGURATION
-(
-  CONFIG_KEY VARCHAR(255) NOT NULL,
-  CONFIG_VALUE VARCHAR(255) NOT NULL,
-  PRIMARY KEY(CONFIG_KEY, CONFIG_VALUE)
-);
-
-INSERT INTO CONFIGURATION (CONFIG_KEY, CONFIG_VALUE) VALUES('sharing_reg_version', '0.17');
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/resources/sharing-registry-mysql.sql
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/resources/sharing-registry-mysql.sql b/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/resources/sharing-registry-mysql.sql
deleted file mode 100644
index 4b046ce..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/resources/sharing-registry-mysql.sql
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-CREATE TABLE DOMAIN (
-  DOMAIN_ID VARCHAR(255) NOT NULL,
-  NAME VARCHAR(255) NOT NULL,
-  DESCRIPTION VARCHAR(255),
-  CREATED_TIME BIGINT NOT NULL,
-  UPDATED_TIME BIGINT NOT NULL,
-  PRIMARY KEY (DOMAIN_ID)
-);
-
-CREATE TABLE USER (
-  USER_ID VARCHAR(255) NOT NULL,
-  DOMAIN_ID VARCHAR(255) NOT NULL,
-  USER_NAME VARCHAR(255) NOT NULL,
-  CREATED_TIME BIGINT NOT NULL,
-  UPDATED_TIME BIGINT NOT NULL,
-  PRIMARY KEY (USER_ID),
-  FOREIGN KEY (DOMAIN_ID) REFERENCES DOMAIN(DOMAIN_ID) ON DELETE CASCADE ON UPDATE CASCADE
-);
-
-CREATE TABLE USER_GROUP (
-  GROUP_ID VARCHAR(255) NOT NULL,
-  DOMAIN_ID VARCHAR(255) NOT NULL,
-  NAME VARCHAR(255) NOT NULL,
-  DESCRIPTION VARCHAR(255),
-  OWNER_ID VARCHAR(255) NOT NULL,
-  GROUP_TYPE VARCHAR(255) NOT NULL,
-  CREATED_TIME BIGINT NOT NULL,
-  UPDATED_TIME BIGINT NOT NULL,
-  PRIMARY KEY (GROUP_ID),
-  FOREIGN KEY (DOMAIN_ID) REFERENCES DOMAIN(DOMAIN_ID) ON DELETE CASCADE ON UPDATE CASCADE,
-  FOREIGN KEY (OWNER_ID) REFERENCES USER(USER_ID) ON DELETE CASCADE ON UPDATE CASCADE
-);
-
-
-CREATE TABLE GROUP_MEMBERSHIP (
-  PARENT_ID VARCHAR(255) NOT NULL,
-  CHILD_ID VARCHAR(255) NOT NULL,
-  CHILD_TYPE VARCHAR(255) NOT NULL,
-  CREATED_TIME BIGINT NOT NULL,
-  UPDATED_TIME BIGINT NOT NULL,
-  PRIMARY KEY (PARENT_ID, CHILD_ID),
-  FOREIGN KEY (PARENT_ID) REFERENCES USER_GROUP(GROUP_ID) ON DELETE CASCADE ON UPDATE CASCADE,
-  FOREIGN KEY (CHILD_ID) REFERENCES USER_GROUP(GROUP_ID) ON DELETE CASCADE ON UPDATE CASCADE
-);
-
-CREATE TABLE ENTITY_TYPE (
-  ENTITY_TYPE_ID VARCHAR(255) NOT NULL,
-  DOMAIN_ID VARCHAR(255) NOT NULL,
-  NAME VARCHAR(255) NOT NULL,
-  DESCRIPTION VARCHAR(255),
-  CREATED_TIME BIGINT NOT NULL,
-  UPDATED_TIME BIGINT NOT NULL,
-  PRIMARY KEY (ENTITY_TYPE_ID),
-  FOREIGN KEY (DOMAIN_ID) REFERENCES DOMAIN(DOMAIN_ID) ON DELETE CASCADE ON UPDATE CASCADE
-);
-
-CREATE TABLE PERMISSION_TYPE (
-  PERMISSION_TYPE_ID VARCHAR(255) NOT NULL,
-  DOMAIN_ID VARCHAR(255) NOT NULL,
-  NAME VARCHAR(255) NOT NULL,
-  DESCRIPTION VARCHAR(255),
-  CREATED_TIME BIGINT NOT NULL,
-  UPDATED_TIME BIGINT NOT NULL,
-  PRIMARY KEY (PERMISSION_TYPE_ID),
-  FOREIGN KEY (DOMAIN_ID) REFERENCES DOMAIN(DOMAIN_ID) ON DELETE CASCADE ON UPDATE CASCADE
-);
-
-CREATE TABLE ENTITY (
-  ENTITY_ID VARCHAR(255) NOT NULL,
-  DOMAIN_ID VARCHAR(255) NOT NULL,
-  ENTITY_TYPE_ID VARCHAR(255) NOT NULL,
-  OWNER_ID VARCHAR(255) NOT NULL,
-  PARENT_ENTITY_ID VARCHAR(255),
-  NAME VARCHAR(255) NOT NULL,
-  DESCRIPTION VARCHAR(255),
-  FULL_TEXT TEXT,
-  CREATED_TIME BIGINT NOT NULL,
-  UPDATED_TIME BIGINT NOT NULL,
-  PRIMARY KEY (ENTITY_ID),
-  FOREIGN KEY (DOMAIN_ID) REFERENCES DOMAIN(DOMAIN_ID) ON DELETE CASCADE ON UPDATE CASCADE,
-  FOREIGN KEY (ENTITY_TYPE_ID) REFERENCES ENTITY_TYPE(ENTITY_TYPE_ID) ON DELETE CASCADE ON UPDATE CASCADE,
-  FOREIGN KEY (OWNER_ID) REFERENCES USER(USER_ID) ON DELETE CASCADE ON UPDATE CASCADE,
-  FOREIGN KEY (PARENT_ENTITY_ID) REFERENCES ENTITY(ENTITY_ID) ON DELETE CASCADE ON UPDATE CASCADE
-);
-
-ALTER TABLE ENTITY ADD FULLTEXT FULL_TEXT_INDEX(FULL_TEXT);
-
-CREATE TABLE ENTITY_METADATA (
-  ENTITY_ID VARCHAR (255) NOT NULL,
-  META_KEY VARCHAR (255) NOT NULL,
-  META_VALUE VARCHAR (255) NOT NULL,
-  PRIMARY KEY (ENTITY_ID, META_KEY),
-  FOREIGN KEY (ENTITY_ID) REFERENCES ENTITY(ENTITY_ID) ON DELETE CASCADE ON UPDATE CASCADE
-);
-
-CREATE TABLE SHARING (
-  PERMISSION_TYPE_ID VARCHAR(255) NOT NULL,
-  ENTITY_ID VARCHAR(255) NOT NULL,
-  GROUP_ID VARCHAR(255) NOT NULL,
-  GROUP_TYPE VARCHAR(255) NOT NULL,
-  SHARING_TYPE VARCHAR(255) NOT NULL,
-  INHERITED_PARENT_ID VARCHAR(255),
-  CREATED_TIME BIGINT NOT NULL,
-  UPDATED_TIME BIGINT NOT NULL,
-  PRIMARY KEY (PERMISSION_TYPE_ID, ENTITY_ID, GROUP_ID),
-  FOREIGN KEY (PERMISSION_TYPE_ID) REFERENCES PERMISSION_TYPE(PERMISSION_TYPE_ID) ON DELETE CASCADE ON UPDATE CASCADE,
-  FOREIGN KEY (INHERITED_PARENT_ID) REFERENCES ENTITY(ENTITY_ID) ON DELETE CASCADE ON UPDATE CASCADE,
-  FOREIGN KEY (GROUP_ID) REFERENCES USER_GROUP(GROUP_ID) ON DELETE CASCADE ON UPDATE CASCADE
-);
-
-CREATE TABLE CONFIGURATION
-(
-  CONFIG_KEY VARCHAR(255) NOT NULL,
-  CONFIG_VALUE VARCHAR(255) NOT NULL,
-  PRIMARY KEY(CONFIG_KEY, CONFIG_VALUE)
-);
-
-INSERT INTO CONFIGURATION (CONFIG_KEY, CONFIG_VALUE) VALUES('sharing_reg_version', '0.17');
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/test/java/org/apache/airavata/sharing/registry/GovRegistryServerHandlerTest.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/test/java/org/apache/airavata/sharing/registry/GovRegistryServerHandlerTest.java b/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/test/java/org/apache/airavata/sharing/registry/GovRegistryServerHandlerTest.java
deleted file mode 100644
index 688117c..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/test/java/org/apache/airavata/sharing/registry/GovRegistryServerHandlerTest.java
+++ /dev/null
@@ -1,272 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.sharing.registry;
-
-import junit.framework.Assert;
-import org.apache.airavata.sharing.registry.models.*;
-import org.apache.airavata.sharing.registry.server.SharingRegistryServerHandler;
-import org.apache.thrift.TException;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Map;
-
-public class GovRegistryServerHandlerTest {
-    private final static Logger logger = LoggerFactory.getLogger(GovRegistryServerHandlerTest.class);
-
-    @Test
-    public void test() throws TException {
-        SharingRegistryServerHandler govRegistryServerHandler = new SharingRegistryServerHandler();
-
-        //Creating domain
-        Domain domain = new Domain();
-        String domainId = "test-domain."+System.currentTimeMillis();
-        domain.setDomainId(domainId);
-        domain.setName(domainId);
-        domain.setDescription("test domain description");
-        domain.setCreatedTime(System.currentTimeMillis());
-        domain.setUpdatedTime(System.currentTimeMillis());
-
-        Assert.assertNotNull(govRegistryServerHandler.createDomain(domain));
-        Assert.assertTrue(govRegistryServerHandler.getDomains(0, 10).size() > 0);
-
-
-        //Creating users
-        User user1 = new User();
-        String userName1 = "test-user-1." + System.currentTimeMillis();
-        String userId1 = domainId + ":" + userName1;
-        user1.setUserId(userId1);
-        user1.setUserName(userName1);
-        user1.setDomainId(domainId);
-        user1.setCreatedTime(System.currentTimeMillis());
-        user1.setUpdatedTime(System.currentTimeMillis());
-
-        Assert.assertNotNull(govRegistryServerHandler.createUser(user1));
-
-        User user2 = new User();
-        String userName2 = "test-user-2." + System.currentTimeMillis();
-        String userId2 = domainId + ":" + userName2;
-        user2.setUserId(userId2);
-        user2.setUserName(userName2);
-        user2.setDomainId(domainId);
-        user2.setCreatedTime(System.currentTimeMillis());
-        user2.setUpdatedTime(System.currentTimeMillis());
-
-        Assert.assertNotNull(govRegistryServerHandler.createUser(user2));
-
-        User user3 = new User();
-        String userName3 = "test-user-3." + System.currentTimeMillis();
-        String userId3 = domainId + ":" + userName3;
-        user3.setUserId(userId3);
-        user3.setUserName(userName3);
-        user3.setDomainId(domainId);
-        user3.setCreatedTime(System.currentTimeMillis());
-        user3.setUpdatedTime(System.currentTimeMillis());
-
-        Assert.assertNotNull(govRegistryServerHandler.createUser(user3));
-
-        Assert.assertTrue(govRegistryServerHandler.getUsers(domainId, 0, 10).size() > 0);
-
-        // Creating user groups
-        UserGroup userGroup1 = new UserGroup();
-        String groupName1 = "test-group-1." + System.currentTimeMillis();
-        String groupId1 = domainId + ":" + groupName1;
-        userGroup1.setGroupId(groupId1);
-        userGroup1.setDomainId(domainId);
-        userGroup1.setName(groupName1);
-        userGroup1.setDescription("test group description");
-        userGroup1.setOwnerId(userId1);
-        userGroup1.setGroupType(GroupType.MULTI_USER);
-        userGroup1.setCreatedTime(System.currentTimeMillis());
-        userGroup1.setUpdatedTime(System.currentTimeMillis());
-
-        Assert.assertNotNull(govRegistryServerHandler.createGroup(userGroup1));
-
-        UserGroup userGroup2 = new UserGroup();
-        String groupName2 = "test-group-2." + System.currentTimeMillis();
-        String groupId2 = domainId + ":" + groupName2;
-        userGroup2.setGroupId(groupId2);
-        userGroup2.setDomainId(domainId);
-        userGroup2.setName(groupName2);
-        userGroup2.setDescription("test group description");
-        userGroup2.setOwnerId(userId2);
-        userGroup2.setGroupType(GroupType.MULTI_USER);
-        userGroup2.setCreatedTime(System.currentTimeMillis());
-        userGroup2.setUpdatedTime(System.currentTimeMillis());
-
-        Assert.assertNotNull(govRegistryServerHandler.createGroup(userGroup2));
-
-        govRegistryServerHandler.addUsersToGroup(Arrays.asList(userId1), groupId1);
-        govRegistryServerHandler.addUsersToGroup(Arrays.asList(userId2, userId3), groupId2);
-        govRegistryServerHandler.addChildGroupToParentGroup(groupId2, groupId1);
-
-        Assert.assertTrue(govRegistryServerHandler.getGroupMembers(groupId1, 0, 10).size() == 2);
-        Assert.assertTrue(govRegistryServerHandler.getGroupMembers(groupId2, 0, 10).size() == 2);
-
-
-        //Creating permission types
-        PermissionType permissionType1 = new PermissionType();
-        String permissionName1 = "READ";
-        permissionType1.setPermissionTypeId(domainId+":"+permissionName1);
-        permissionType1.setDomainId(domainId);
-        permissionType1.setName(permissionName1);
-        permissionType1.setDescription("READ description");
-        permissionType1.setCreatedTime(System.currentTimeMillis());
-        permissionType1.setUpdatedTime(System.currentTimeMillis());
-        String permissionTypeId1 = govRegistryServerHandler.createPermissionType(permissionType1);
-        Assert.assertNotNull(permissionTypeId1);
-
-        PermissionType permissionType2 = new PermissionType();
-        String permissionName2 = "WRITE";
-        permissionType2.setPermissionTypeId(domainId+":"+permissionName2);
-        permissionType2.setDomainId(domainId);
-        permissionType2.setName(permissionName2);
-        permissionType2.setDescription("WRITE description");
-        permissionType2.setCreatedTime(System.currentTimeMillis());
-        permissionType2.setUpdatedTime(System.currentTimeMillis());
-        String permissionTypeId2 = govRegistryServerHandler.createPermissionType(permissionType2);
-        Assert.assertNotNull(permissionTypeId2);
-
-        //Creating entity types
-        EntityType entityType1 = new EntityType();
-        String entityType1Name = "Project";
-        entityType1.setEntityTypeId(domainId+":"+entityType1Name);
-        entityType1.setDomainId(domainId);
-        entityType1.setName(entityType1Name);
-        entityType1.setDescription("test entity type");
-        entityType1.setCreatedTime(System.currentTimeMillis());
-        entityType1.setUpdatedTime(System.currentTimeMillis());
-        String entityTypeId1 = govRegistryServerHandler.createEntityType(entityType1);
-        Assert.assertNotNull(entityTypeId1);
-
-        EntityType entityType2 = new EntityType();
-        String entityType2Name = "Experiment";
-        entityType2.setEntityTypeId(domainId+":"+entityType2Name);
-        entityType2.setDomainId(domainId);
-        entityType2.setName(entityType2Name);
-        entityType2.setDescription("test entity type");
-        entityType2.setCreatedTime(System.currentTimeMillis());
-        entityType2.setUpdatedTime(System.currentTimeMillis());
-        String entityTypeId2 = govRegistryServerHandler.createEntityType(entityType2);
-        Assert.assertNotNull(entityTypeId2);
-
-        EntityType entityType3 = new EntityType();
-        String entityType3Name = "FileInput";
-        entityType3.setEntityTypeId(domainId+":"+entityType3Name);
-        entityType3.setDomainId(domainId);
-        entityType3.setName(entityType3Name);
-        entityType3.setDescription("file input type");
-        entityType3.setCreatedTime(System.currentTimeMillis());
-        entityType3.setUpdatedTime(System.currentTimeMillis());
-        String entityTypeId3 = govRegistryServerHandler.createEntityType(entityType3);
-        Assert.assertNotNull(entityTypeId3);
-
-        //Creating Entities
-        Entity entity1 = new Entity();
-        entity1.setEntityId(domainId+":Entity1");
-        entity1.setDomainId(domainId);
-        entity1.setEntityTypeId(entityTypeId1);
-        entity1.setOwnerId(userId1);
-        entity1.setName("Project name 1");
-        entity1.setDescription("Project description");
-        Map<String, String> metadataMap = new HashMap<>();
-        metadataMap.put("key", "val");
-        entity1.setMetadata(metadataMap);
-        entity1.setFullText("Project name project description");
-        entity1.setCreatedTime(System.currentTimeMillis());
-        entity1.setUpdatedTime(System.currentTimeMillis());
-
-        String entityId1 = govRegistryServerHandler.createEntity(entity1);
-        Assert.assertNotNull(entityId1);
-
-        Entity entity2 = new Entity();
-        entity2.setEntityId(domainId+":Entity2");
-        entity2.setDomainId(domainId);
-        entity2.setEntityTypeId(entityTypeId2);
-        entity2.setOwnerId(userId1);
-        entity2.setName("Experiment name");
-        entity2.setDescription("Experiment description");
-        entity2.setParentEntityId(entityId1);
-        metadataMap = new HashMap<>();
-        metadataMap.put("key", "val");
-        entity2.setMetadata(metadataMap);
-        entity2.setFullText("Project name project description");
-        entity2.setCreatedTime(System.currentTimeMillis());
-        entity2.setUpdatedTime(System.currentTimeMillis());
-
-        String entityId2 = govRegistryServerHandler.createEntity(entity2);
-        Assert.assertNotNull(entityId2);
-
-        Entity entity3 = new Entity();
-        entity3.setEntityId(domainId+":Entity3");
-        entity3.setDomainId(domainId);
-        entity3.setEntityTypeId(entityTypeId2);
-        entity3.setOwnerId(userId1);
-        entity3.setName("Experiment name");
-        entity3.setDescription("Experiment description");
-        entity3.setParentEntityId(entityId1);
-        metadataMap = new HashMap<>();
-        metadataMap.put("key", "val");
-        entity3.setMetadata(metadataMap);
-        entity3.setFullText("Project name project description");
-        entity3.setCreatedTime(System.currentTimeMillis());
-        entity3.setUpdatedTime(System.currentTimeMillis());
-
-        String entityId3 = govRegistryServerHandler.createEntity(entity3);
-        Assert.assertNotNull(entityId3);
-
-        govRegistryServerHandler.shareEntityWithUsers(entityId1, Arrays.asList(userId2), permissionTypeId1);
-        govRegistryServerHandler.shareEntityWithGroups(entityId3, Arrays.asList(groupId2), permissionTypeId1);
-
-        Entity entity4 = new Entity();
-        entity4.setEntityId(domainId+":Entity4");
-        entity4.setDomainId(domainId);
-        entity4.setEntityTypeId(entityTypeId3);
-        entity4.setOwnerId(userId3);
-        entity4.setName("Input name");
-        entity4.setDescription("Input file description");
-        entity4.setParentEntityId(entityId3);
-        metadataMap = new HashMap<>();
-        metadataMap.put("key", "val");
-        entity4.setMetadata(metadataMap);
-        entity4.setFullText("Input File");
-        entity4.setCreatedTime(System.currentTimeMillis());
-        entity4.setUpdatedTime(System.currentTimeMillis());
-
-        String entityId4 = govRegistryServerHandler.createEntity(entity4);
-        Assert.assertNotNull(entityId4);
-
-        Assert.assertTrue(govRegistryServerHandler.userHasAccess(domainId, userId3, entityId4, permissionTypeId1));
-        Assert.assertTrue(govRegistryServerHandler.userHasAccess(domainId, userId2, entityId4, permissionTypeId1));
-        Assert.assertTrue(govRegistryServerHandler.userHasAccess(domainId, userId1, entityId4, permissionTypeId1));
-        Assert.assertFalse(govRegistryServerHandler.userHasAccess(domainId, userId3, entityId1, permissionTypeId1));
-
-        HashMap<EntitySearchFields, String> filters = new HashMap<>();
-        filters.put(EntitySearchFields.NAME, "Input");
-        Assert.assertTrue(govRegistryServerHandler.searchEntities(userId1, entityTypeId3, filters, 0, -1).size() > 0);
-
-//        govRegistryServerHandler.revokeEntitySharingFromUsers(entityId1, Arrays.asList(userId2), permissionTypeId1);
-//        govRegistryServerHandler.revokeEntitySharingFromGroups(entityId3, Arrays.asList(groupId2), permissionTypeId1);
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/pom.xml
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/pom.xml b/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/pom.xml
deleted file mode 100644
index ff0334c..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/pom.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <artifactId>airavata-sharing-registry</artifactId>
-        <groupId>org.apache.airavata</groupId>
-        <relativePath>../pom.xml</relativePath>
-        <version>${global.version}</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>airavata-sharing-registry-stubs</artifactId>
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.thrift</groupId>
-            <artifactId>libthrift</artifactId>
-            <version>0.9.3</version>
-        </dependency>
-    </dependencies>
-
-
-</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/Domain.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/Domain.java b/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/Domain.java
deleted file mode 100644
index 367e04f..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/Domain.java
+++ /dev/null
@@ -1,817 +0,0 @@
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- *  @generated
- */
-package org.apache.airavata.sharing.registry.models;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-05")
-public class Domain implements org.apache.thrift.TBase<Domain, Domain._Fields>, java.io.Serializable, Cloneable, Comparable<Domain> {
-  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Domain");
-
-  private static final org.apache.thrift.protocol.TField DOMAIN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("domainId", org.apache.thrift.protocol.TType.STRING, (short)1);
-  private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)2);
-  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)3);
-  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)4);
-  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)5);
-
-  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-  static {
-    schemes.put(StandardScheme.class, new DomainStandardSchemeFactory());
-    schemes.put(TupleScheme.class, new DomainTupleSchemeFactory());
-  }
-
-  public String domainId; // optional
-  public String name; // optional
-  public String description; // optional
-  public long createdTime; // optional
-  public long updatedTime; // optional
-
-  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
-    DOMAIN_ID((short)1, "domainId"),
-    NAME((short)2, "name"),
-    DESCRIPTION((short)3, "description"),
-    CREATED_TIME((short)4, "createdTime"),
-    UPDATED_TIME((short)5, "updatedTime");
-
-    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
-    static {
-      for (_Fields field : EnumSet.allOf(_Fields.class)) {
-        byName.put(field.getFieldName(), field);
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, or null if its not found.
-     */
-    public static _Fields findByThriftId(int fieldId) {
-      switch(fieldId) {
-        case 1: // DOMAIN_ID
-          return DOMAIN_ID;
-        case 2: // NAME
-          return NAME;
-        case 3: // DESCRIPTION
-          return DESCRIPTION;
-        case 4: // CREATED_TIME
-          return CREATED_TIME;
-        case 5: // UPDATED_TIME
-          return UPDATED_TIME;
-        default:
-          return null;
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, throwing an exception
-     * if it is not found.
-     */
-    public static _Fields findByThriftIdOrThrow(int fieldId) {
-      _Fields fields = findByThriftId(fieldId);
-      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-      return fields;
-    }
-
-    /**
-     * Find the _Fields constant that matches name, or null if its not found.
-     */
-    public static _Fields findByName(String name) {
-      return byName.get(name);
-    }
-
-    private final short _thriftId;
-    private final String _fieldName;
-
-    _Fields(short thriftId, String fieldName) {
-      _thriftId = thriftId;
-      _fieldName = fieldName;
-    }
-
-    public short getThriftFieldId() {
-      return _thriftId;
-    }
-
-    public String getFieldName() {
-      return _fieldName;
-    }
-  }
-
-  // isset id assignments
-  private static final int __CREATEDTIME_ISSET_ID = 0;
-  private static final int __UPDATEDTIME_ISSET_ID = 1;
-  private byte __isset_bitfield = 0;
-  private static final _Fields optionals[] = {_Fields.DOMAIN_ID,_Fields.NAME,_Fields.DESCRIPTION,_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);
-    tmpMap.put(_Fields.DOMAIN_ID, new org.apache.thrift.meta_data.FieldMetaData("domainId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("description", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    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, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-    metaDataMap = Collections.unmodifiableMap(tmpMap);
-    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Domain.class, metaDataMap);
-  }
-
-  public Domain() {
-    this.domainId = "DO_NOT_SET_AT_CLIENTS_ID";
-
-  }
-
-  /**
-   * Performs a deep copy on <i>other</i>.
-   */
-  public Domain(Domain other) {
-    __isset_bitfield = other.__isset_bitfield;
-    if (other.isSetDomainId()) {
-      this.domainId = other.domainId;
-    }
-    if (other.isSetName()) {
-      this.name = other.name;
-    }
-    if (other.isSetDescription()) {
-      this.description = other.description;
-    }
-    this.createdTime = other.createdTime;
-    this.updatedTime = other.updatedTime;
-  }
-
-  public Domain deepCopy() {
-    return new Domain(this);
-  }
-
-  @Override
-  public void clear() {
-    this.domainId = "DO_NOT_SET_AT_CLIENTS_ID";
-
-    this.name = null;
-    this.description = null;
-    setCreatedTimeIsSet(false);
-    this.createdTime = 0;
-    setUpdatedTimeIsSet(false);
-    this.updatedTime = 0;
-  }
-
-  public String getDomainId() {
-    return this.domainId;
-  }
-
-  public Domain setDomainId(String domainId) {
-    this.domainId = domainId;
-    return this;
-  }
-
-  public void unsetDomainId() {
-    this.domainId = null;
-  }
-
-  /** Returns true if field domainId is set (has been assigned a value) and false otherwise */
-  public boolean isSetDomainId() {
-    return this.domainId != null;
-  }
-
-  public void setDomainIdIsSet(boolean value) {
-    if (!value) {
-      this.domainId = null;
-    }
-  }
-
-  public String getName() {
-    return this.name;
-  }
-
-  public Domain setName(String name) {
-    this.name = name;
-    return this;
-  }
-
-  public void unsetName() {
-    this.name = null;
-  }
-
-  /** Returns true if field name is set (has been assigned a value) and false otherwise */
-  public boolean isSetName() {
-    return this.name != null;
-  }
-
-  public void setNameIsSet(boolean value) {
-    if (!value) {
-      this.name = null;
-    }
-  }
-
-  public String getDescription() {
-    return this.description;
-  }
-
-  public Domain setDescription(String description) {
-    this.description = description;
-    return this;
-  }
-
-  public void unsetDescription() {
-    this.description = null;
-  }
-
-  /** Returns true if field description is set (has been assigned a value) and false otherwise */
-  public boolean isSetDescription() {
-    return this.description != null;
-  }
-
-  public void setDescriptionIsSet(boolean value) {
-    if (!value) {
-      this.description = null;
-    }
-  }
-
-  public long getCreatedTime() {
-    return this.createdTime;
-  }
-
-  public Domain setCreatedTime(long createdTime) {
-    this.createdTime = createdTime;
-    setCreatedTimeIsSet(true);
-    return this;
-  }
-
-  public void unsetCreatedTime() {
-    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CREATEDTIME_ISSET_ID);
-  }
-
-  /** Returns true if field createdTime is set (has been assigned a value) and false otherwise */
-  public boolean isSetCreatedTime() {
-    return EncodingUtils.testBit(__isset_bitfield, __CREATEDTIME_ISSET_ID);
-  }
-
-  public void setCreatedTimeIsSet(boolean value) {
-    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CREATEDTIME_ISSET_ID, value);
-  }
-
-  public long getUpdatedTime() {
-    return this.updatedTime;
-  }
-
-  public Domain setUpdatedTime(long updatedTime) {
-    this.updatedTime = updatedTime;
-    setUpdatedTimeIsSet(true);
-    return this;
-  }
-
-  public void unsetUpdatedTime() {
-    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID);
-  }
-
-  /** Returns true if field updatedTime is set (has been assigned a value) and false otherwise */
-  public boolean isSetUpdatedTime() {
-    return EncodingUtils.testBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID);
-  }
-
-  public void setUpdatedTimeIsSet(boolean value) {
-    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID, value);
-  }
-
-  public void setFieldValue(_Fields field, Object value) {
-    switch (field) {
-    case DOMAIN_ID:
-      if (value == null) {
-        unsetDomainId();
-      } else {
-        setDomainId((String)value);
-      }
-      break;
-
-    case NAME:
-      if (value == null) {
-        unsetName();
-      } else {
-        setName((String)value);
-      }
-      break;
-
-    case DESCRIPTION:
-      if (value == null) {
-        unsetDescription();
-      } else {
-        setDescription((String)value);
-      }
-      break;
-
-    case CREATED_TIME:
-      if (value == null) {
-        unsetCreatedTime();
-      } else {
-        setCreatedTime((Long)value);
-      }
-      break;
-
-    case UPDATED_TIME:
-      if (value == null) {
-        unsetUpdatedTime();
-      } else {
-        setUpdatedTime((Long)value);
-      }
-      break;
-
-    }
-  }
-
-  public Object getFieldValue(_Fields field) {
-    switch (field) {
-    case DOMAIN_ID:
-      return getDomainId();
-
-    case NAME:
-      return getName();
-
-    case DESCRIPTION:
-      return getDescription();
-
-    case CREATED_TIME:
-      return getCreatedTime();
-
-    case UPDATED_TIME:
-      return getUpdatedTime();
-
-    }
-    throw new IllegalStateException();
-  }
-
-  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
-  public boolean isSet(_Fields field) {
-    if (field == null) {
-      throw new IllegalArgumentException();
-    }
-
-    switch (field) {
-    case DOMAIN_ID:
-      return isSetDomainId();
-    case NAME:
-      return isSetName();
-    case DESCRIPTION:
-      return isSetDescription();
-    case CREATED_TIME:
-      return isSetCreatedTime();
-    case UPDATED_TIME:
-      return isSetUpdatedTime();
-    }
-    throw new IllegalStateException();
-  }
-
-  @Override
-  public boolean equals(Object that) {
-    if (that == null)
-      return false;
-    if (that instanceof Domain)
-      return this.equals((Domain)that);
-    return false;
-  }
-
-  public boolean equals(Domain that) {
-    if (that == null)
-      return false;
-
-    boolean this_present_domainId = true && this.isSetDomainId();
-    boolean that_present_domainId = true && that.isSetDomainId();
-    if (this_present_domainId || that_present_domainId) {
-      if (!(this_present_domainId && that_present_domainId))
-        return false;
-      if (!this.domainId.equals(that.domainId))
-        return false;
-    }
-
-    boolean this_present_name = true && this.isSetName();
-    boolean that_present_name = true && that.isSetName();
-    if (this_present_name || that_present_name) {
-      if (!(this_present_name && that_present_name))
-        return false;
-      if (!this.name.equals(that.name))
-        return false;
-    }
-
-    boolean this_present_description = true && this.isSetDescription();
-    boolean that_present_description = true && that.isSetDescription();
-    if (this_present_description || that_present_description) {
-      if (!(this_present_description && that_present_description))
-        return false;
-      if (!this.description.equals(that.description))
-        return false;
-    }
-
-    boolean this_present_createdTime = true && this.isSetCreatedTime();
-    boolean that_present_createdTime = true && that.isSetCreatedTime();
-    if (this_present_createdTime || that_present_createdTime) {
-      if (!(this_present_createdTime && that_present_createdTime))
-        return false;
-      if (this.createdTime != that.createdTime)
-        return false;
-    }
-
-    boolean this_present_updatedTime = true && this.isSetUpdatedTime();
-    boolean that_present_updatedTime = true && that.isSetUpdatedTime();
-    if (this_present_updatedTime || that_present_updatedTime) {
-      if (!(this_present_updatedTime && that_present_updatedTime))
-        return false;
-      if (this.updatedTime != that.updatedTime)
-        return false;
-    }
-
-    return true;
-  }
-
-  @Override
-  public int hashCode() {
-    List<Object> list = new ArrayList<Object>();
-
-    boolean present_domainId = true && (isSetDomainId());
-    list.add(present_domainId);
-    if (present_domainId)
-      list.add(domainId);
-
-    boolean present_name = true && (isSetName());
-    list.add(present_name);
-    if (present_name)
-      list.add(name);
-
-    boolean present_description = true && (isSetDescription());
-    list.add(present_description);
-    if (present_description)
-      list.add(description);
-
-    boolean present_createdTime = true && (isSetCreatedTime());
-    list.add(present_createdTime);
-    if (present_createdTime)
-      list.add(createdTime);
-
-    boolean present_updatedTime = true && (isSetUpdatedTime());
-    list.add(present_updatedTime);
-    if (present_updatedTime)
-      list.add(updatedTime);
-
-    return list.hashCode();
-  }
-
-  @Override
-  public int compareTo(Domain other) {
-    if (!getClass().equals(other.getClass())) {
-      return getClass().getName().compareTo(other.getClass().getName());
-    }
-
-    int lastComparison = 0;
-
-    lastComparison = Boolean.valueOf(isSetDomainId()).compareTo(other.isSetDomainId());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetDomainId()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domainId, other.domainId);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetName()).compareTo(other.isSetName());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetName()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetDescription()).compareTo(other.isSetDescription());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetDescription()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.description, other.description);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetCreatedTime()).compareTo(other.isSetCreatedTime());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetCreatedTime()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.createdTime, other.createdTime);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetUpdatedTime()).compareTo(other.isSetUpdatedTime());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetUpdatedTime()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updatedTime, other.updatedTime);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    return 0;
-  }
-
-  public _Fields fieldForId(int fieldId) {
-    return _Fields.findByThriftId(fieldId);
-  }
-
-  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
-  }
-
-  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
-  }
-
-  @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder("Domain(");
-    boolean first = true;
-
-    if (isSetDomainId()) {
-      sb.append("domainId:");
-      if (this.domainId == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.domainId);
-      }
-      first = false;
-    }
-    if (isSetName()) {
-      if (!first) sb.append(", ");
-      sb.append("name:");
-      if (this.name == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.name);
-      }
-      first = false;
-    }
-    if (isSetDescription()) {
-      if (!first) sb.append(", ");
-      sb.append("description:");
-      if (this.description == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.description);
-      }
-      first = false;
-    }
-    if (isSetCreatedTime()) {
-      if (!first) sb.append(", ");
-      sb.append("createdTime:");
-      sb.append(this.createdTime);
-      first = false;
-    }
-    if (isSetUpdatedTime()) {
-      if (!first) sb.append(", ");
-      sb.append("updatedTime:");
-      sb.append(this.updatedTime);
-      first = false;
-    }
-    sb.append(")");
-    return sb.toString();
-  }
-
-  public void validate() throws org.apache.thrift.TException {
-    // check for required fields
-    // check for sub-struct validity
-  }
-
-  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-    try {
-      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-    } catch (org.apache.thrift.TException te) {
-      throw new java.io.IOException(te);
-    }
-  }
-
-  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-    try {
-      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
-      __isset_bitfield = 0;
-      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-    } catch (org.apache.thrift.TException te) {
-      throw new java.io.IOException(te);
-    }
-  }
-
-  private static class DomainStandardSchemeFactory implements SchemeFactory {
-    public DomainStandardScheme getScheme() {
-      return new DomainStandardScheme();
-    }
-  }
-
-  private static class DomainStandardScheme extends StandardScheme<Domain> {
-
-    public void read(org.apache.thrift.protocol.TProtocol iprot, Domain struct) throws org.apache.thrift.TException {
-      org.apache.thrift.protocol.TField schemeField;
-      iprot.readStructBegin();
-      while (true)
-      {
-        schemeField = iprot.readFieldBegin();
-        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
-          break;
-        }
-        switch (schemeField.id) {
-          case 1: // DOMAIN_ID
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.domainId = iprot.readString();
-              struct.setDomainIdIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 2: // NAME
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.name = iprot.readString();
-              struct.setNameIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 3: // DESCRIPTION
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.description = iprot.readString();
-              struct.setDescriptionIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 4: // CREATED_TIME
-            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
-              struct.createdTime = iprot.readI64();
-              struct.setCreatedTimeIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 5: // UPDATED_TIME
-            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
-              struct.updatedTime = iprot.readI64();
-              struct.setUpdatedTimeIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          default:
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-        }
-        iprot.readFieldEnd();
-      }
-      iprot.readStructEnd();
-
-      // check for required fields of primitive type, which can't be checked in the validate method
-      struct.validate();
-    }
-
-    public void write(org.apache.thrift.protocol.TProtocol oprot, Domain struct) throws org.apache.thrift.TException {
-      struct.validate();
-
-      oprot.writeStructBegin(STRUCT_DESC);
-      if (struct.domainId != null) {
-        if (struct.isSetDomainId()) {
-          oprot.writeFieldBegin(DOMAIN_ID_FIELD_DESC);
-          oprot.writeString(struct.domainId);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.name != null) {
-        if (struct.isSetName()) {
-          oprot.writeFieldBegin(NAME_FIELD_DESC);
-          oprot.writeString(struct.name);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.description != null) {
-        if (struct.isSetDescription()) {
-          oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC);
-          oprot.writeString(struct.description);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.isSetCreatedTime()) {
-        oprot.writeFieldBegin(CREATED_TIME_FIELD_DESC);
-        oprot.writeI64(struct.createdTime);
-        oprot.writeFieldEnd();
-      }
-      if (struct.isSetUpdatedTime()) {
-        oprot.writeFieldBegin(UPDATED_TIME_FIELD_DESC);
-        oprot.writeI64(struct.updatedTime);
-        oprot.writeFieldEnd();
-      }
-      oprot.writeFieldStop();
-      oprot.writeStructEnd();
-    }
-
-  }
-
-  private static class DomainTupleSchemeFactory implements SchemeFactory {
-    public DomainTupleScheme getScheme() {
-      return new DomainTupleScheme();
-    }
-  }
-
-  private static class DomainTupleScheme extends TupleScheme<Domain> {
-
-    @Override
-    public void write(org.apache.thrift.protocol.TProtocol prot, Domain struct) throws org.apache.thrift.TException {
-      TTupleProtocol oprot = (TTupleProtocol) prot;
-      BitSet optionals = new BitSet();
-      if (struct.isSetDomainId()) {
-        optionals.set(0);
-      }
-      if (struct.isSetName()) {
-        optionals.set(1);
-      }
-      if (struct.isSetDescription()) {
-        optionals.set(2);
-      }
-      if (struct.isSetCreatedTime()) {
-        optionals.set(3);
-      }
-      if (struct.isSetUpdatedTime()) {
-        optionals.set(4);
-      }
-      oprot.writeBitSet(optionals, 5);
-      if (struct.isSetDomainId()) {
-        oprot.writeString(struct.domainId);
-      }
-      if (struct.isSetName()) {
-        oprot.writeString(struct.name);
-      }
-      if (struct.isSetDescription()) {
-        oprot.writeString(struct.description);
-      }
-      if (struct.isSetCreatedTime()) {
-        oprot.writeI64(struct.createdTime);
-      }
-      if (struct.isSetUpdatedTime()) {
-        oprot.writeI64(struct.updatedTime);
-      }
-    }
-
-    @Override
-    public void read(org.apache.thrift.protocol.TProtocol prot, Domain struct) throws org.apache.thrift.TException {
-      TTupleProtocol iprot = (TTupleProtocol) prot;
-      BitSet incoming = iprot.readBitSet(5);
-      if (incoming.get(0)) {
-        struct.domainId = iprot.readString();
-        struct.setDomainIdIsSet(true);
-      }
-      if (incoming.get(1)) {
-        struct.name = iprot.readString();
-        struct.setNameIsSet(true);
-      }
-      if (incoming.get(2)) {
-        struct.description = iprot.readString();
-        struct.setDescriptionIsSet(true);
-      }
-      if (incoming.get(3)) {
-        struct.createdTime = iprot.readI64();
-        struct.setCreatedTimeIsSet(true);
-      }
-      if (incoming.get(4)) {
-        struct.updatedTime = iprot.readI64();
-        struct.setUpdatedTimeIsSet(true);
-      }
-    }
-  }
-
-}
-


[16/17] airavata git commit: renaming directory names

Posted by sc...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/GroupMembershipRepository.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/GroupMembershipRepository.java b/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/GroupMembershipRepository.java
deleted file mode 100644
index 259e22c..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/GroupMembershipRepository.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.sharing.registry.db.repositories;
-
-import org.apache.airavata.sharing.registry.db.entities.GroupMembershipEntity;
-import org.apache.airavata.sharing.registry.db.entities.GroupMembershipEntityPK;
-import org.apache.airavata.sharing.registry.db.entities.UserEntity;
-import org.apache.airavata.sharing.registry.db.entities.UserGroupEntity;
-import org.apache.airavata.sharing.registry.db.utils.DBConstants;
-import org.apache.airavata.sharing.registry.models.*;
-
-import java.util.*;
-
-public class GroupMembershipRepository extends AbstractRepository<GroupMembership, GroupMembershipEntity, GroupMembershipEntityPK> {
-
-    public GroupMembershipRepository() {
-        super(GroupMembership.class, GroupMembershipEntity.class);
-    }
-
-    public List<GroupMembership> getChildMembershipsOfGroup(String parentId) throws GovRegistryException {
-        Map<String, String> filters = new HashMap<>();
-        filters.put(DBConstants.GroupMembershipTable.PARENT_ID, parentId);
-        return select(filters, 0, -1);
-    }
-
-    public List<User> getAllChildUsers(String groupId) throws GovRegistryException {
-        String queryString = "SELECT 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.PARENT_ID+"='"+groupId + "' AND gm." + DBConstants.GroupMembershipTable.CHILD_TYPE
-                + "='" + GroupChildType.USER.toString() + "'";
-        UserRepository userRepository = new UserRepository();
-        List<User> users = userRepository.select(queryString, 0, -1);
-        return users;
-    }
-
-    public List<UserGroup> getAllChildGroups(String groupId) throws GovRegistryException {
-        String queryString = "SELECT 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.PARENT_ID+"='"+groupId + "' AND GM." + DBConstants.GroupMembershipTable.CHILD_TYPE
-                + "='" + GroupChildType.GROUP.toString() + "'";
-        UserGroupRepository userGroupRepository = new UserGroupRepository();
-        List<UserGroup> groups = userGroupRepository.select(queryString, 0, -1);
-        return groups;
-    }
-
-    public List<GroupMembership> getAllParentMembershipsForChild(String childId) throws GovRegistryException {
-        List<GroupMembership> finalParentGroups = new ArrayList<>();
-        Map<String, String> filters = new HashMap<>();
-        filters.put(DBConstants.GroupMembershipTable.CHILD_ID, childId);
-        LinkedList<GroupMembership> temp = new LinkedList<>();
-        select(filters, 0, -1).stream().forEach(m -> temp.addLast(m));
-        while (temp.size() > 0){
-            GroupMembership gm = temp.pop();
-            filters = new HashMap<>();
-            filters.put(DBConstants.GroupMembershipTable.CHILD_ID, gm.parentId);
-            select(filters, 0, -1).stream().forEach(m -> temp.addLast(m));
-            finalParentGroups.add(gm);
-        }
-        return finalParentGroups;
-    }
-
-    public List<UserGroup> getAllParentGroupsForChild(String childId) throws GovRegistryException {
-        List<UserGroup> finalParentGroups = new ArrayList<>();
-        Map<String, String> filters = new HashMap<>();
-        filters.put(DBConstants.GroupMembershipTable.CHILD_ID, childId);
-        LinkedList<GroupMembership> temp = new LinkedList<>();
-        select(filters, 0, -1).stream().forEach(m -> temp.addLast(m));
-        UserGroupRepository userGroupRepository = new UserGroupRepository();
-        while (temp.size() > 0){
-            GroupMembership gm = temp.pop();
-            filters = new HashMap<>();
-            filters.put(DBConstants.GroupMembershipTable.CHILD_ID, gm.parentId);
-            select(filters, 0, -1).stream().forEach(m -> temp.addLast(m));
-            finalParentGroups.add(userGroupRepository.get(gm.parentId));
-        }
-        return finalParentGroups;
-    }
-
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/PermissionTypeRepository.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/PermissionTypeRepository.java b/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/PermissionTypeRepository.java
deleted file mode 100644
index e61f1ec..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/PermissionTypeRepository.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.sharing.registry.db.repositories;
-
-import org.apache.airavata.sharing.registry.db.entities.PermissionTypeEntity;
-import org.apache.airavata.sharing.registry.db.utils.DBConstants;
-import org.apache.airavata.sharing.registry.models.GovRegistryException;
-import org.apache.airavata.sharing.registry.models.PermissionType;
-import org.apache.airavata.sharing.registry.server.SharingRegistryServerHandler;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.HashMap;
-import java.util.List;
-
-public class PermissionTypeRepository extends AbstractRepository<PermissionType, PermissionTypeEntity, String> {
-    private final static Logger logger = LoggerFactory.getLogger(PermissionTypeRepository.class);
-
-    public PermissionTypeRepository() {
-        super(PermissionType.class, PermissionTypeEntity.class);
-    }
-
-    public String getGlobalPermissionTypeIdForDomain(String domainId) throws GovRegistryException {
-        HashMap<String, String> filters = new HashMap<>();
-        filters.put(DBConstants.PermissionTypeTable.DOMAIN_ID, domainId);
-        filters.put(DBConstants.PermissionTypeTable.NAME, SharingRegistryServerHandler.GLOBAL_PERMISSION_NAME);
-        List<PermissionType> permissionTypeList = select(filters, 0, -1);
-        if(permissionTypeList.size() != 1){
-            throw new GovRegistryException("GLOBAL Permission inconsistency. Found " + permissionTypeList.size()
-                    + " records with " + SharingRegistryServerHandler.GLOBAL_PERMISSION_NAME + " name");
-        }
-        return permissionTypeList.get(0).getPermissionTypeId();
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/SharingRepository.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/SharingRepository.java b/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/SharingRepository.java
deleted file mode 100644
index 27f9e0e..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/SharingRepository.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.sharing.registry.db.repositories;
-
-import org.apache.airavata.sharing.registry.db.entities.SharingEntity;
-import org.apache.airavata.sharing.registry.db.entities.SharingEntityPK;
-import org.apache.airavata.sharing.registry.db.utils.DBConstants;
-import org.apache.airavata.sharing.registry.models.GovRegistryException;
-import org.apache.airavata.sharing.registry.models.Sharing;
-import org.apache.airavata.sharing.registry.models.SharingType;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.HashMap;
-import java.util.List;
-
-public class SharingRepository extends AbstractRepository<Sharing, SharingEntity, SharingEntityPK> {
-    private final static Logger logger = LoggerFactory.getLogger(SharingRepository.class);
-
-    public SharingRepository() {
-        super(Sharing.class, SharingEntity.class);
-    }
-
-    public List<Sharing> getIndirectSharedChildren(String parentId, String permissionTypeId) throws GovRegistryException {
-        HashMap<String, String> filters = new HashMap<>();
-        filters.put(DBConstants.SharingTable.INHERITED_PARENT_ID, parentId);
-        filters.put(DBConstants.SharingTable.SHARING_TYPE, SharingType.INHERITED.toString());
-        filters.put(DBConstants.SharingTable.PERMISSION_TYPE_ID, permissionTypeId);
-
-        return select(filters, 0, -1);
-    }
-
-    public List<Sharing> getPermissionsForEntity(String entityId) throws GovRegistryException {
-        HashMap<String, String> filters = new HashMap<>();
-        filters.put(DBConstants.SharingTable.ENTITY_ID, entityId);
-        return select(filters, 0, -1);
-    }
-
-    public boolean hasAccess(String entityId, List<String> groupIds, List<String> permissionTypeIds) throws GovRegistryException {
-        String query = "SELECT p from " + SharingEntity.class.getSimpleName() + " as p";
-        query += " WHERE ";
-        query += "p." + DBConstants.SharingTable.ENTITY_ID + " = '" + entityId + "' AND ";
-        String permissionTypeIdString = "'";
-        for(String permissionId : permissionTypeIds)
-            permissionTypeIdString += permissionId + "','";
-        permissionTypeIdString = permissionTypeIdString.substring(0, permissionTypeIdString.length()-2);
-        query += "p." + DBConstants.SharingTable.PERMISSION_TYPE_ID + " IN(" + permissionTypeIdString + ") AND ";
-        String groupIdString = "'";
-        for(String groupId : groupIds)
-            groupIdString += groupId + "','";
-        groupIdString = groupIdString.substring(0, groupIdString.length()-2);
-        query += "p." + DBConstants.SharingTable.GROUP_ID + " IN(" + groupIdString + ") ";
-        query += " ORDER BY p.createdTime DESC";
-        return select(query, 0, -1).size() > 0;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/UserGroupRepository.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/UserGroupRepository.java b/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/UserGroupRepository.java
deleted file mode 100644
index 170b1fd..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/UserGroupRepository.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.sharing.registry.db.repositories;
-
-import org.apache.airavata.sharing.registry.db.entities.UserGroupEntity;
-import org.apache.airavata.sharing.registry.models.UserGroup;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class UserGroupRepository extends AbstractRepository<UserGroup, UserGroupEntity, String> {
-    private final static Logger logger = LoggerFactory.getLogger(UserGroupRepository.class);
-
-    public UserGroupRepository() {
-        super(UserGroup.class, UserGroupEntity.class);
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/UserRepository.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/UserRepository.java b/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/UserRepository.java
deleted file mode 100644
index f4ec03f..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/UserRepository.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.sharing.registry.db.repositories;
-
-
-import org.apache.airavata.sharing.registry.db.entities.UserEntity;
-import org.apache.airavata.sharing.registry.models.User;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class UserRepository extends AbstractRepository<User, UserEntity, String> {
-    private final static Logger logger = LoggerFactory.getLogger(UserRepository.class);
-
-    public UserRepository() {
-        super(User.class, UserEntity.class);
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/Committer.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/Committer.java b/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/Committer.java
deleted file mode 100644
index ed8c9b3..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/Committer.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.sharing.registry.db.utils;
-
-@FunctionalInterface
-public interface Committer<T, R>  {
-
-    R commit(T t);
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/ConnectionPool.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/ConnectionPool.java b/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/ConnectionPool.java
deleted file mode 100644
index 02484f7..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/ConnectionPool.java
+++ /dev/null
@@ -1,382 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.sharing.registry.db.utils;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.sql.DataSource;
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.SQLException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Stack;
-import java.util.concurrent.Semaphore;
-
-
-/**
- * A class for preallocating, recycling, and managing JDBC connections.
- */
-public class ConnectionPool {
-    private static final Logger logger = LoggerFactory.getLogger(ConnectionPool.class);
-
-    private long MAX_IDLE_TIME = 5 * 60 * 1000; // 5 minutes
-
-    private String driver;
-    private String url;
-    private String username;
-    private String password;
-    private String jdbcUrl;
-
-    private int maxConnections;
-
-    private boolean autoCommit = true;
-    private boolean waitIfBusy;
-
-    private Semaphore needConnection = new Semaphore(0);
-    private boolean stop;
-
-    private Stack<Connection> availableConnections;
-    private Stack<Connection> busyConnections;
-
-    private HashMap<Connection, Long> lastAccessTimeRecord = new HashMap<Connection, Long>();
-
-    private String urlType = "";
-
-    private DataSource datasource;
-
-    private int transactionIsolation = Connection.TRANSACTION_NONE;
-
-    private Thread clenupThread;
-    private Thread producerThread;
-
-    public ConnectionPool(String driver, String url, String username, String password, int initialConnections,
-                          int maxConnections, boolean waitIfBusy) throws SQLException {
-        this.driver = driver;
-        this.url = url;
-        this.username = username;
-        this.password = password;
-        this.urlType = "speratedURL";
-        initialize(initialConnections, maxConnections, waitIfBusy);
-    }
-
-    public ConnectionPool(String driver, String jdbcUrl, int initialConnections, int maxConnections,
-                          boolean waitIfBusy, boolean autoCommit, int transactionIsolation) throws SQLException {
-        this.driver = driver;
-        this.jdbcUrl = jdbcUrl;
-        this.urlType = "simpleURL";
-        this.autoCommit = autoCommit;
-        this.transactionIsolation = transactionIsolation;
-        initialize(initialConnections, maxConnections, waitIfBusy);
-    }
-
-    public ConnectionPool(String driver, String jdbcUrl, int initialConnections, int maxConnections, boolean waitIfBusy)
-            throws SQLException {
-        this.driver = driver;
-        this.jdbcUrl = jdbcUrl;
-        this.urlType = "simpleURL";
-        initialize(initialConnections, maxConnections, waitIfBusy);
-    }
-
-    public ConnectionPool(DataSource dataSource, int initialConnections, int maxConnections, boolean waitIfBusy)
-            throws SQLException {
-        this.urlType = "dataSource";
-        this.datasource = dataSource;
-        initialize(initialConnections, maxConnections, waitIfBusy);
-    }
-
-    /**
-     * Check if this connection pool is auto commit or not
-     *
-     * @return
-     */
-    public boolean isAutoCommit() {
-        return this.autoCommit;
-    }
-
-    private void initialize(int initialConnections, int maxConnections, boolean waitIfBusy) throws SQLException {
-        this.maxConnections = maxConnections;
-        this.waitIfBusy = waitIfBusy;
-
-        int sizeOfConnections = (initialConnections > maxConnections) ? maxConnections : initialConnections;
-
-        availableConnections = new Stack<Connection>();
-        busyConnections = new Stack<Connection>();
-
-        for (int i = 0; i < sizeOfConnections; i++) {
-            Connection con = makeNewConnection();
-            setTimeStamp(con);
-            availableConnections.push(con);
-
-        }
-
-        producerThread = new Thread(new FillUpThread());
-        producerThread.start();
-
-        clenupThread = new Thread(new CleanUpThread());
-        clenupThread.start();
-    }
-
-    public synchronized Connection getConnection() throws SQLException {
-        if (!availableConnections.isEmpty()) {
-            Connection existingConnection = availableConnections.pop();
-
-            // If connection on available list is closed (e.g.,
-            // it timed out), then remove it from available list
-            // and race for a connection again.
-            if (existingConnection.isClosed()) {
-                lastAccessTimeRecord.remove(existingConnection);
-                // notifyAll for fairness
-                notifyAll();
-            } else {
-                busyConnections.push(existingConnection);
-                setTimeStamp(existingConnection);
-                return existingConnection;
-            }
-        } else if (!waitIfBusy && busyConnections.size() >= maxConnections) {
-            // You reached maxConnections limit and waitIfBusy flag is false.
-            // Throw SQLException in such a case.
-            throw new SQLException("Connection limit reached");
-        } else {
-
-            if (busyConnections.size() < maxConnections) {
-                // available connection is empty, but total number of connection
-                // doesn't reach maxConnection. Request for more connection
-                needConnection.release();
-            }
-
-            try {
-                // wait for free connection
-                wait();
-            } catch (InterruptedException ie) {
-            }
-        }
-        // always race for connection forever
-        return getConnection();
-    }
-
-    // This explicitly makes a new connection. Called in
-    // the foreground when initializing the ConnectionPool,
-    // and called in the background when running.
-    private Connection makeNewConnection() throws SQLException {
-        try {
-            // Load database driver if not already loaded
-            Class.forName(driver);
-            Connection connection;
-            // Establish network connection to database
-            if (urlType.equals("speratedURL")) {
-                connection = DriverManager.getConnection(url, username, password);
-            } else if (urlType.equals("simpleURL")) {
-                connection = DriverManager.getConnection(jdbcUrl);
-            } else { // if(urlType.equals("dataSource")){
-                connection = datasource.getConnection();
-            }
-            connection.setTransactionIsolation(this.transactionIsolation);
-            connection.setAutoCommit(this.autoCommit);
-            return connection;
-        } catch (ClassNotFoundException cnfe) {
-            // Simplify try/catch blocks of people using this by
-            // throwing only one exception type.
-            throw new SQLException("Can't find class for driver: " + driver);
-        }
-    }
-
-    private synchronized void fillUpConnection(Connection conn) {
-        setTimeStamp(conn);
-        availableConnections.push(conn);
-
-        // notify all since new connection is created
-        notifyAll();
-    }
-
-    private void setTimeStamp(Connection connection) {
-        lastAccessTimeRecord.put(connection, System.currentTimeMillis());
-    }
-
-    // The database connection cannot be left idle for too long, otherwise TCP
-    // connection will be broken.
-    /**
-     * From http://forums.mysql.com/read.php?39,28450,57460#msg-57460 Okay, then it looks like wait_timeout on the
-     * server is killing your connection (it is set to 8 hours of idle time by default). Either set that value higher on
-     * your server, or configure your connection pool to not hold connections idle that long (I prefer the latter). Most
-     * folks I know that run MySQL with a connection pool in high-load production environments only let connections sit
-     * idle for a matter of minutes, since it only takes a few milliseconds to open a connection, and the longer one
-     * sits idle the more chance it will go "bad" because of a network hiccup or the MySQL server being restarted.
-     *
-     * @throws java.sql.SQLException
-     */
-    private boolean isConnectionStale(Connection connection) {
-        long currentTime = System.currentTimeMillis();
-        long lastAccess = lastAccessTimeRecord.get(connection);
-        if (currentTime - lastAccess > MAX_IDLE_TIME) {
-            return true;
-        } else
-            return false;
-    }
-
-    private synchronized void closeStaleConnections() {
-        // close idle connections
-        Iterator<Connection> iter = availableConnections.iterator();
-        while (iter.hasNext()) {
-            Connection existingConnection = iter.next();
-            if (isConnectionStale(existingConnection)) {
-                try {
-                    existingConnection.close();
-                    iter.remove();
-                } catch (SQLException sql) {
-                    logger.error(sql.getMessage(), sql);
-                }
-            }
-        }
-        // close busy connections that have been checked out for too long.
-        // This should not happen since this means program has bug for not
-        // releasing connections .
-        iter = busyConnections.iterator();
-        while (iter.hasNext()) {
-            Connection busyConnection = iter.next();
-            if (isConnectionStale(busyConnection)) {
-                try {
-                    busyConnection.close();
-                    iter.remove();
-                    logger.warn("****Connection has checked out too long. Forced release. Check the program for calling release connection [free(Connection) method]");
-                } catch (SQLException sql) {
-                    logger.error(sql.getMessage(), sql);
-                }
-            }
-        }
-    }
-
-    public synchronized void free(Connection connection) {
-        busyConnections.removeElement(connection);
-        availableConnections.addElement(connection);
-        // Wake up threads that are waiting for a connection
-        notifyAll();
-    }
-
-    /**
-     * Close all the connections. Use with caution: be sure no connections are in use before calling. Note that you are
-     * not <I>required</I> to call this when done with a ConnectionPool, since connections are guaranteed to be closed
-     * when garbage collected. But this method gives more control regarding when the connections are closed.
-     */
-    public synchronized void dispose() {
-        logger.info("Connection Pool Shutting down");
-
-        // stop clean up thread
-        this.stop = true;
-        this.clenupThread.interrupt();
-
-        // stop producer up thread
-        this.producerThread.interrupt();
-
-        // close all connection
-        closeConnections(availableConnections);
-        availableConnections = new Stack<Connection>();
-        closeConnections(busyConnections);
-        busyConnections = new Stack<Connection>();
-        lastAccessTimeRecord.clear();
-
-        logger.info("All connection is closed");
-
-        try {
-            this.clenupThread.join();
-            this.producerThread.join();
-        } catch (Exception e) {
-            logger.error("Cannot shutdown cleanup thread", e);
-        }
-
-        logger.info("Connection Pool Shutdown");
-    }
-
-    private void closeConnections(Stack<Connection> connections) {
-        while (!connections.isEmpty()) {
-            Connection connection = connections.pop();
-            try {
-                if (!connection.isClosed()) {
-                    connection.close();
-                }
-            } catch (SQLException sqle) {
-                // Ignore errors; garbage collect anyhow
-                logger.warn(sqle.getMessage());
-            }
-        }
-    }
-
-    public synchronized String toString() {
-        String info = "ConnectionPool(" + url + "," + username + ")" + ", available=" + availableConnections.size()
-                + ", busy=" + busyConnections.size() + ", max=" + maxConnections;
-        return (info);
-    }
-
-    class CleanUpThread implements Runnable {
-        public void run() {
-            while (!stop) {
-                try {
-                    Thread.sleep(MAX_IDLE_TIME);
-                    closeStaleConnections();
-                } catch (InterruptedException e) {
-                    logger.info("Clean up thread is interrupted to close");
-                }
-            }
-        }
-    }
-
-    class FillUpThread implements Runnable {
-        public void run() {
-            while (!stop) {
-                try {
-                    // block until get
-                    needConnection.acquire();
-
-                    Connection conn = makeNewConnection();
-                    fillUpConnection(conn);
-                } catch (SQLException e) {
-                    // cannot create connection (increase semaphore value back)
-                    needConnection.release();
-                    logger.error(e.getMessage(), e);
-                } catch (InterruptedException e) {
-                    logger.info("Fill up thread is interrupted to close");
-                    break;
-                }
-            }
-        }
-    }
-
-    public void shutdown() throws SQLException{
-        for (Connection c : availableConnections) {
-            try {
-                c.close();
-            } catch (SQLException e) {
-                logger.error("Error while closing the connection", e);
-                throw new SQLException("Error while closing the connection", e);
-            }
-        }
-
-        for (Connection c : busyConnections) {
-            try {
-                c.close();
-            } catch (SQLException e) {
-                logger.error("Error while closing the connection", e);
-                throw new SQLException("Error while closing the connection", e);
-            }
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/DBConstants.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/DBConstants.java b/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/DBConstants.java
deleted file mode 100644
index f963de2..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/DBConstants.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.sharing.registry.db.utils;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class DBConstants {
-    private final static Logger logger = LoggerFactory.getLogger(DBConstants.class);
-
-    public static int SELECT_MAX_ROWS = 10000;
-
-    public static class DomainTable {
-        public static String DOMAIN_ID = "domainId";
-        public static String NAME = "name";
-        public static String DESCRIPTION = "description";
-    }
-
-    public static class UserTable {
-        public static String USER_ID = "userId";
-        public static String DOMAIN_ID = "domainId";
-        public static String USER_NAME = "userName";
-    }
-
-    public static class UserGroupTable {
-        public static String GROUP_ID = "groupId";
-        public static String DOMAIN_ID = "domainId";
-        public static String NAME = "name";
-        public static String DESCRIPTION = "description";
-        public static String OWNER_ID = "ownerId";
-        public static String GROUP_TYPE = "groupType";
-    }
-
-    public static class GroupMembershipTable {
-        public static String PARENT_ID = "parentId";
-        public static String CHILD_ID = "childId";
-        public static String CHILD_TYPE = "childType";
-    }
-
-    public static class EntityTypeTable {
-        public static String ENTITY_TYPE_ID = "entityTypeId";
-        public static String DOMAIN_ID = "domainId";
-    }
-
-    public static class PermissionTypeTable {
-        public static String ENTITY_TYPE_ID = "permissionTypeId";
-        public static String DOMAIN_ID = "domainId";
-        public static String NAME = "name";
-    }
-
-    public static class EntityTable {
-        public static String ENTITY_ID = "entityId";
-        public static String PARENT_ENTITY_ID = "parentEntityId";
-        public static String ENTITY_TYPE_ID = "entityTypeId";
-        public static String NAME = "name";
-        public static String DESCRIPTION = "description";
-        public static String FULL_TEXT = "fullText";
-    }
-
-    public static class SharingTable {
-        public static String PERMISSION_TYPE_ID = "permissionTypeId";
-        public static String ENTITY_ID = "entityId";
-        public static String GROUP_ID = "groupId";
-        public static String INHERITED_PARENT_ID = "inheritedParentId";
-        public static final String SHARING_TYPE = "sharingType";
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/DatabaseCreator.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/DatabaseCreator.java b/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/DatabaseCreator.java
deleted file mode 100644
index 5aa423c..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/DatabaseCreator.java
+++ /dev/null
@@ -1,353 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.sharing.registry.db.utils;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.sql.*;
-import java.util.StringTokenizer;
-
-/**
- * This class creates the database tables required for airavata with default configuration this
- * class creates derby database in server mode. User can specify required database in appropriate
- * properties files.
- */
-public class DatabaseCreator {
-    private final static Logger logger = LoggerFactory.getLogger(DatabaseCreator.class);
-
-    public enum DatabaseType {
-        derby("(?i).*derby.*"), mysql("(?i).*mysql.*"), other("");
-
-        private String pattern;
-
-        private DatabaseType(String matchingPattern) {
-            this.pattern = matchingPattern;
-        }
-
-        public String getMatchingPattern() {
-            return this.pattern;
-        }
-    }
-
-    private static DatabaseType[] supportedDatabase = new DatabaseType[] { DatabaseType.derby, DatabaseType.mysql };
-
-    private static Logger log = LoggerFactory.getLogger(DatabaseCreator.class);
-    private static final String delimiter = ";";
-
-    /**
-     * Creates database
-     *
-     * @throws Exception
-     */
-    public static void createRegistryDatabase(String prefix, Connection conn) throws Exception {
-        createDatabase(prefix, conn);
-    }
-
-
-
-    /**
-     * Checks whether database tables are created by using select * on given table name
-     *
-     * @param tableName
-     *            Table which should be existed
-     * @return <code>true</core> if checkSQL is success, else <code>false</code> .
-     */
-    public static boolean isDatabaseStructureCreated(String tableName, Connection conn) {
-        try {
-
-            log.debug("Running a query to test the database tables existence.");
-
-            // check whether the tables are already created with a query
-            Statement statement = null;
-            try {
-                statement = conn.createStatement();
-                ResultSet rs = statement.executeQuery("select * from " + tableName);
-                if (rs != null) {
-                    rs.close();
-                }
-            } finally {
-                try {
-                    if (statement != null) {
-                        statement.close();
-                    }
-                } catch (SQLException e) {
-                    return false;
-                }
-            }
-        } catch (SQLException e) {
-            return false;
-        }
-
-        return true;
-    }
-
-    /**
-     * executes given sql
-     *
-     * @param sql
-     * @throws Exception
-     */
-    private static void executeSQL(String sql, Connection conn) throws Exception {
-        // Check and ignore empty statements
-        if ("".equals(sql.trim())) {
-            return;
-        }
-
-        Statement statement = null;
-        try {
-            log.debug("SQL : " + sql);
-
-            boolean ret;
-            int updateCount = 0, updateCountTotal = 0;
-            statement = conn.createStatement();
-            ret = statement.execute(sql);
-            updateCount = statement.getUpdateCount();
-            do {
-                if (!ret) {
-                    if (updateCount != -1) {
-                        updateCountTotal += updateCount;
-                    }
-                }
-                ret = statement.getMoreResults();
-                if (ret) {
-                    updateCount = statement.getUpdateCount();
-                }
-            } while (ret);
-
-            log.debug(sql + " : " + updateCountTotal + " rows affected");
-
-            SQLWarning warning = conn.getWarnings();
-            while (warning != null) {
-                log.info(warning + " sql warning");
-                warning = warning.getNextWarning();
-            }
-            conn.clearWarnings();
-        } catch (SQLException e) {
-            if (e.getSQLState().equals("X0Y32")) {
-                // eliminating the table already exception for the derby
-                // database
-                log.info("Table Already Exists", e);
-            } else {
-                throw new Exception("Error occurred while executing : " + sql, e);
-            }
-        } finally {
-            if (statement != null) {
-                try {
-                    statement.close();
-                } catch (SQLException e) {
-                    log.error("Error occurred while closing result set.", e);
-                }
-            }
-        }
-    }
-
-    /**
-     * computes relatational database type using database name
-     *
-     * @return DatabaseType
-     * @throws Exception
-     *
-     */
-    public static DatabaseType getDatabaseType(Connection conn) throws Exception {
-        try {
-            if (conn != null && (!conn.isClosed())) {
-                DatabaseMetaData metaData = conn.getMetaData();
-                String databaseProductName = metaData.getDatabaseProductName();
-                return checkType(databaseProductName);
-            }
-        } catch (SQLException e) {
-            String msg = "Failed to create Airavata database." + e.getMessage();
-            log.error(msg, e);
-            throw new Exception(msg, e);
-        }
-        return DatabaseType.other;
-    }
-
-    /**
-     * Overloaded method with String input
-     *
-     * @return DatabaseType
-     * @throws Exception
-     *
-     */
-    public static DatabaseType getDatabaseType(String dbUrl) throws Exception {
-        return checkType(dbUrl);
-    }
-
-    private static DatabaseType checkType(String text) throws Exception {
-        try {
-            if (text != null) {
-                for (DatabaseType type : supportedDatabase) {
-                    if (text.matches(type.getMatchingPattern()))
-                        return type;
-                }
-            }
-            String msg = "Unsupported database: " + text
-                    + ". Database will not be created automatically by the Airavata. "
-                    + "Please create the database using appropriate database scripts for " + "the database.";
-            throw new Exception(msg);
-
-        } catch (SQLException e) {
-            String msg = "Failed to create Airavatadatabase." + e.getMessage();
-            log.error(msg, e);
-            throw new Exception(msg, e);
-        }
-    }
-
-    /**
-     * Get scripts location which is prefix + "-" + databaseType + ".sql"
-     *
-     * @param prefix
-     * @param databaseType
-     * @return script location
-     */
-    private static String getScriptLocation(String prefix, DatabaseType databaseType) {
-        String scriptName = prefix + "-" + databaseType + ".sql";
-        log.debug("Loading database script from :" + scriptName);
-        return  scriptName;
-    }
-
-    private static void createDatabase(String prefix, Connection conn) throws Exception {
-        Statement statement = null;
-        try {
-            conn.setAutoCommit(false);
-            statement = conn.createStatement();
-            executeSQLScript(getScriptLocation(prefix, DatabaseCreator.getDatabaseType(conn)), conn);
-            conn.commit();
-            log.debug("Tables are created successfully.");
-        } catch (SQLException e) {
-            String msg = "Failed to create database tables for Airavata resource store. " + e.getMessage();
-            log.error(msg, e);
-            conn.rollback();
-            throw new Exception(msg, e);
-        } finally {
-            conn.setAutoCommit(true);
-            try {
-                if (statement != null) {
-                    statement.close();
-                }
-            } catch (SQLException e) {
-                log.error("Failed to close statement.", e);
-            }
-        }
-    }
-
-    private static void executeSQLScript(String dbscriptName, Connection conn) throws Exception {
-        StringBuffer sql = new StringBuffer();
-        BufferedReader reader = null;
-
-        try {
-            InputStream is = DatabaseCreator.class.getClassLoader().getResourceAsStream(dbscriptName);
-            if(is == null) {
-                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");
-                }else if(databaseType.equals(DatabaseType.mysql)){
-                    is = DatabaseCreator.class.getClassLoader().getResourceAsStream("experiment-mysql.sql");
-                }
-            }
-            reader = new BufferedReader(new InputStreamReader(is));
-            String line;
-            while ((line = reader.readLine()) != null) {
-                line = line.trim();
-                if (line.startsWith("//")) {
-                    continue;
-                }
-                if (line.startsWith("--")) {
-                    continue;
-                }
-                StringTokenizer st = new StringTokenizer(line);
-                if (st.hasMoreTokens()) {
-                    String token = st.nextToken();
-                    if ("REM".equalsIgnoreCase(token)) {
-                        continue;
-                    }
-                }
-                sql.append(" ").append(line);
-
-                // SQL defines "--" as a comment to EOL
-                // and in Oracle it may contain a hint
-                // so we cannot just remove it, instead we must end it
-                if (line.indexOf("--") >= 0) {
-                    sql.append("\n");
-                }
-                if ((checkStringBufferEndsWith(sql, delimiter))) {
-                    executeSQL(sql.substring(0, sql.length() - delimiter.length()), conn);
-                    sql.replace(0, sql.length(), "");
-                }
-            }
-            // Catch any statements not followed by ;
-            if (sql.length() > 0) {
-                executeSQL(sql.toString(), conn);
-            }
-        } catch (IOException e) {
-            log.error("Error occurred while executing SQL script for creating Airavata database", e);
-            throw new Exception("Error occurred while executing SQL script for creating Airavata database", e);
-
-        } finally {
-            if (reader != null) {
-                reader.close();
-            }
-        }
-    }
-
-    /**
-     * Checks that a string buffer ends up with a given string. It may sound trivial with the existing JDK API but the
-     * various implementation among JDKs can make those methods extremely resource intensive and perform poorly due to
-     * massive memory allocation and copying. See
-     *
-     * @param buffer
-     *            the buffer to perform the check on
-     * @param suffix
-     *            the suffix
-     * @return <code>true</code> if the character sequence represented by the argument is a suffix of the character
-     *         sequence represented by the StringBuffer object; <code>false</code> otherwise. Note that the result will
-     *         be <code>true</code> if the argument is the empty string.
-     */
-    public static boolean checkStringBufferEndsWith(StringBuffer buffer, String suffix) {
-        if (suffix.length() > buffer.length()) {
-            return false;
-        }
-        // this loop is done on purpose to avoid memory allocation performance
-        // problems on various JDKs
-        // StringBuffer.lastIndexOf() was introduced in jdk 1.4 and
-        // implementation is ok though does allocation/copying
-        // StringBuffer.toString().endsWith() does massive memory
-        // allocation/copying on JDK 1.5
-        // See http://issues.apache.org/bugzilla/show_bug.cgi?id=37169
-        int endIndex = suffix.length() - 1;
-        int bufferIndex = buffer.length() - 1;
-        while (endIndex >= 0) {
-            if (buffer.charAt(bufferIndex) != suffix.charAt(endIndex)) {
-                return false;
-            }
-            bufferIndex--;
-            endIndex--;
-        }
-        return true;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/JPAUtils.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/JPAUtils.java b/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/JPAUtils.java
deleted file mode 100644
index f2f7c3a..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/JPAUtils.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.sharing.registry.db.utils;
-
-import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.ServerSettings;
-import org.apache.airavata.sharing.registry.models.GovRegistryException;
-import org.apache.derby.drda.NetworkServerControl;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.persistence.*;
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.URI;
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.util.HashMap;
-import java.util.Map;
-
-public class JPAUtils {
-    private final static Logger logger = LoggerFactory.getLogger(JPAUtils.class);
-
-    private static final String PERSISTENCE_UNIT_NAME = "airavata-sharing-registry";
-    private static final String SHARING_REG_JDBC_DRIVER = "sharingcatalog.jdbc.driver";
-    private static final String SHARING_REG_JDBC_URL = "sharingcatalog.jdbc.url";
-    private static final String SHARING_REG_JDBC_USER = "sharingcatalog.jdbc.user";
-    private static final String SHARING_REG_JDBC_PWD = "sharingcatalog.jdbc.password";
-    private static final String SHARING_REG_VALIDATION_QUERY = "sharingcatalog.validationQuery";
-    private static final String JPA_CACHE_SIZE = "jpa.cache.size";
-    private static final String JPA_CACHE_ENABLED = "cache.enable";
-
-    public static final String CONFIGURATION = "CONFIGURATION";
-    public static final String START_DERBY_ENABLE = "start.derby.server.mode";
-    public static final String DERBY_SERVER_MODE_SYS_PROPERTY = "derby.drda.startNetworkServer";
-    private static NetworkServerControl server;
-    private static JdbcStorage db;
-    private static String jdbcURl;
-    private static String jdbcDriver;
-    private static String jdbcUser;
-    private static String jdbcPassword;
-
-
-    @PersistenceUnit(unitName = PERSISTENCE_UNIT_NAME)
-    protected static EntityManagerFactory factory;
-    @PersistenceContext(unitName = PERSISTENCE_UNIT_NAME)
-    private static EntityManager entityManager;
-
-    public static EntityManager getEntityManager() {
-        if (factory == null) {
-//            String connectionProperties = "DriverClassName=" + readServerProperties(SHARING_REG_JDBC_DRIVER) + "," +
-//                    "Url=" + readServerProperties(SHARING_REG_JDBC_URL) + "?autoReconnect=true," +
-//                    "Username=" + readServerProperties(SHARING_REG_JDBC_USER) + "," +
-//                    "Password=" + readServerProperties(SHARING_REG_JDBC_PWD) +
-//                    ",validationQuery=" + readServerProperties(SHARING_REG_VALIDATION_QUERY);
-//
-
-            String connectionProperties = "DriverClassName=com.mysql.jdbc.Driver," +
-                    "Url=jdbc:mysql://localhost:3306/airavata_sharing_catalog?autoReconnect=true," +
-                    "Username=root," +
-                    "Password=," +
-                    ",validationQuery=SELECT 1 FROM CONFIGURATION";
-
-            Map<String, String> properties = new HashMap<String, String>();
-            properties.put("openjpa.ConnectionDriverName", "org.apache.commons.dbcp.BasicDataSource");
-            properties.put("openjpa.ConnectionProperties", connectionProperties);
-            properties.put("openjpa.DynamicEnhancementAgent", "true");
-            properties.put("openjpa.RuntimeUnenhancedClasses", "unsupported");
-            // For app catalog, we don't need caching
-//            properties.put("openjpa.DataCache","" + readServerProperties(JPA_CACHE_ENABLED) + "(CacheSize=" + Integer.valueOf(readServerProperties(JPA_CACHE_SIZE)) + ", SoftReferenceSize=0)");
-//            properties.put("openjpa.QueryCache","" + readServerProperties(JPA_CACHE_ENABLED) + "(CacheSize=" + Integer.valueOf(readServerProperties(JPA_CACHE_SIZE)) + ", SoftReferenceSize=0)");
-            properties.put("openjpa.RemoteCommitProvider", "sjvm");
-            properties.put("openjpa.Log", "DefaultLevel=INFO, Runtime=INFO, Tool=INFO, SQL=INFO");
-            properties.put("openjpa.jdbc.SynchronizeMappings", "buildSchema(ForeignKeys=true)");
-            properties.put("openjpa.jdbc.QuerySQLCache", "false");
-            properties.put("openjpa.ConnectionFactoryProperties", "PrettyPrint=true, PrettyPrintLineLength=72," +
-                    " PrintParameters=true, MaxActive=10, MaxIdle=5, MinIdle=2, MaxWait=31536000,  autoReconnect=true");
-            properties.put("openjpa.RuntimeUnenhancedClasses", "warn");
-            factory = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME, properties);
-        }
-        entityManager = factory.createEntityManager();
-        return entityManager;
-    }
-
-    public static <R> R execute(Committer<EntityManager, R> committer) throws GovRegistryException {
-        EntityManager entityManager = JPAUtils.getEntityManager();
-        try {
-            entityManager.getTransaction().begin();
-            R r = committer.commit(entityManager);
-            entityManager.getTransaction().commit();
-            return  r;
-        }finally {
-            if (entityManager != null && entityManager.isOpen()) {
-                if (entityManager.getTransaction().isActive()) {
-                    entityManager.getTransaction().rollback();
-                }
-                entityManager.close();
-            }
-        }
-    }
-
-    public static void initializeDB() throws GovRegistryException {
-        jdbcDriver = readServerProperties(SHARING_REG_JDBC_DRIVER);
-        jdbcURl = readServerProperties(SHARING_REG_JDBC_URL);
-        jdbcUser = readServerProperties(SHARING_REG_JDBC_USER);
-        jdbcPassword = readServerProperties(SHARING_REG_JDBC_PWD);
-        jdbcURl = jdbcURl + "?" + "user=" + jdbcUser + "&" + "password=" + jdbcPassword;
-
-        if (getDBType(jdbcURl).equals("derby") && isDerbyStartEnabled()) {
-            startDerbyInServerMode();
-        }
-        db = new JdbcStorage(10, 50, jdbcURl, jdbcDriver, true);
-
-        Connection conn = null;
-        try {
-            conn = db.connect();
-            if (!DatabaseCreator.isDatabaseStructureCreated(CONFIGURATION, conn)) {
-                DatabaseCreator.createRegistryDatabase("database_scripts/sharing-registry", conn);
-                logger.info("New Database created for Sharing Catalog !!! ");
-            } else {
-                logger.info("Database already created for Sharing Catalog !!!");
-            }
-        } catch (Exception e) {
-            logger.error(e.getMessage(), e);
-            throw new RuntimeException("Database failure", e);
-        } finally {
-            db.closeConnection(conn);
-            try {
-                if(conn != null){
-                    if (!conn.getAutoCommit()) {
-                        conn.commit();
-                    }
-                    conn.close();
-                }
-            } catch (SQLException e) {
-                logger.error("Error while closing database connection...", e.getMessage(), e);
-            }
-        }
-    }
-
-    public static String getDBType(String jdbcUrl){
-        try{
-            String cleanURI = jdbcUrl.substring(5);
-            URI uri = URI.create(cleanURI);
-            return uri.getScheme();
-        } catch (Exception e) {
-            logger.error(e.getMessage(), e);
-            return null;
-        }
-    }
-
-    public static boolean isDerbyStartEnabled(){
-        try {
-            String s = ServerSettings.getSetting(START_DERBY_ENABLE);
-            if("true".equals(s)){
-                return true;
-            }
-        }  catch (ApplicationSettingsException e) {
-            logger.error("Unable to read airavata server properties", e.getMessage(), e);
-            return false;
-        }
-        return false;
-    }
-
-    public static void startDerbyInServerMode() {
-        try {
-            System.setProperty(DERBY_SERVER_MODE_SYS_PROPERTY, "true");
-            server = new NetworkServerControl(InetAddress.getByName("0.0.0.0"),
-                    getPort(jdbcURl),
-                    jdbcUser, jdbcPassword);
-            java.io.PrintWriter consoleWriter = new java.io.PrintWriter(System.out, true);
-            server.start(consoleWriter);
-        } catch (IOException e) {
-            logger.error("Unable to start Apache derby in the server mode! Check whether " +
-                    "specified port is available");
-        } catch (Exception e) {
-            logger.error("Unable to start Apache derby in the server mode! Check whether " +
-                    "specified port is available");
-        }
-    }
-
-    public static void stopDerbyInServerMode() {
-        System.setProperty(DERBY_SERVER_MODE_SYS_PROPERTY, "false");
-        if (server!=null){
-            try {
-                server.shutdown();
-            } catch (Exception e) {
-                logger.error("Error when stopping the derby server : "+e.getLocalizedMessage());
-            }
-        }
-    }
-
-    public static int getPort(String jdbcURL){
-        try{
-            String cleanURI = jdbcURL.substring(5);
-            URI uri = URI.create(cleanURI);
-            return uri.getPort();
-        } catch (Exception e) {
-            logger.error(e.getMessage(), e);
-            return -1;
-        }
-    }
-
-    private static String readServerProperties(String propertyName) throws GovRegistryException {
-        try {
-            return ServerSettings.getSetting(propertyName);
-        } catch (ApplicationSettingsException e) {
-            logger.error("Unable to read airavata-server.properties...", e);
-            throw new GovRegistryException("Unable to read airavata-server.properties...");
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/JdbcStorage.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/JdbcStorage.java b/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/JdbcStorage.java
deleted file mode 100644
index 377c50b..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/JdbcStorage.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.sharing.registry.db.utils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.sql.*;
-
-public class JdbcStorage {
-    private static Logger log = LoggerFactory.getLogger(JdbcStorage.class);
-
-    private ConnectionPool connectionPool;
-
-    public JdbcStorage(String jdbcUrl, String jdbcDriver) {
-        // default init connection and max connection
-        this(3, 50, jdbcUrl, jdbcDriver, true);
-    }
-
-    public JdbcStorage(int initCon, int maxCon, String url, String driver, boolean enableTransactions) {
-        try {
-            if (enableTransactions) {
-                connectionPool = new ConnectionPool(driver, url, initCon, maxCon, true, false,
-                        Connection.TRANSACTION_SERIALIZABLE);
-            } else {
-                connectionPool = new ConnectionPool(driver, url, initCon, maxCon, true);
-            }
-        } catch (Exception e) {
-            throw new RuntimeException("Failed to create database connection pool.", e);
-        }
-    }
-
-    /**
-     * Check if this connection pool is auto commit or not
-     *
-     * @return
-     */
-    public boolean isAutoCommit() {
-        return connectionPool.isAutoCommit();
-    }
-
-    public void commit(Connection conn) {
-        try {
-            if (conn != null && !conn.getAutoCommit()) {
-                conn.commit();
-            }
-        } catch (SQLException sqle) {
-            log.error("Cannot commit data", sqle);
-        }
-    }
-
-    public void commitAndFree(Connection conn) {
-        commit(conn);
-        closeConnection(conn);
-    }
-
-    public void rollback(Connection conn) {
-        try {
-            if (conn != null && !conn.getAutoCommit()) {
-                conn.rollback();
-            }
-        } catch (SQLException sqle) {
-            log.error("Cannot Rollback data", sqle);
-        }
-    }
-
-    public void rollbackAndFree(Connection conn) {
-        rollback(conn);
-        closeConnection(conn);
-    }
-
-    public Connection connect() {
-
-        Connection conn = null;
-        try {
-            conn = connectionPool.getConnection();
-        } catch (SQLException e) {
-            log.error(e.getMessage(), e);
-        }
-        return conn;
-    }
-
-    /**
-     * This method is provided so that you can have better control over the statement. For example: You can use
-     * stmt.setString to convert quotation mark automatically in an UPDATE statement
-     *
-     * NOTE: Statement is closed after execution
-     */
-    public int executeUpdateAndClose(PreparedStatement stmt) throws SQLException {
-        int rows = 0;
-        try {
-            rows = stmt.executeUpdate();
-            if (rows == 0) {
-                log.info("Problem: 0 rows affected by insert/update/delete statement.");
-            }
-        } finally {
-            stmt.close();
-        }
-        return rows;
-    }
-
-    public int countRow(String tableName, String columnName) throws SQLException {
-        String query = new String("SELECT COUNT(" + columnName + ") FROM " + tableName);
-        int count = -1;
-        Connection conn = null;
-        PreparedStatement stmt = null;
-        try {
-            conn = connectionPool.getConnection();
-            stmt = conn.prepareStatement(query);
-            ResultSet rs = stmt.executeQuery();
-            rs.next();
-            count = rs.getInt(1);
-            commit(conn);
-        } catch (SQLException sql) {
-            rollback(conn);
-            throw sql;
-        } finally {
-            try {
-                if (stmt != null && !stmt.isClosed()) {
-                    stmt.close();
-                }
-            } finally {
-                closeConnection(conn);
-            }
-        }
-        return count;
-    }
-
-    public void quietlyClose(Connection conn, Statement... stmts) {
-        if (stmts != null) {
-            for (Statement stmt : stmts) {
-                try {
-                    if (stmt != null && !stmt.isClosed()) {
-                        stmt.close();
-                    }
-                } catch (SQLException sql) {
-                    log.error(sql.getMessage(), sql);
-                }
-            }
-        }
-        closeConnection(conn);
-    }
-
-    public void closeConnection(Connection conn) {
-        if (conn != null) {
-            connectionPool.free(conn);
-        }
-    }
-
-    public void closeAllConnections() {
-        if (connectionPool != null)
-            connectionPool.dispose();
-    }
-
-    public void shutdown() throws SQLException {
-        connectionPool.shutdown();
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/ObjectMapperSingleton.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/ObjectMapperSingleton.java b/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/ObjectMapperSingleton.java
deleted file mode 100644
index de6bea9..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/ObjectMapperSingleton.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.sharing.registry.db.utils;
-
-import org.dozer.DozerBeanMapper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ObjectMapperSingleton extends DozerBeanMapper{
-    private final static Logger logger = LoggerFactory.getLogger(ObjectMapperSingleton.class);
-
-    private static ObjectMapperSingleton instance;
-
-    private ObjectMapperSingleton(){}
-
-    public static ObjectMapperSingleton getInstance(){
-        if(instance == null)
-            instance = new ObjectMapperSingleton();
-        return instance;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/server/SharingRegistryServer.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/server/SharingRegistryServer.java b/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/server/SharingRegistryServer.java
deleted file mode 100644
index 96fdb90..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/server/SharingRegistryServer.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.sharing.registry.server;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class SharingRegistryServer {
-    private final static Logger logger = LoggerFactory.getLogger(SharingRegistryServer.class);
-}
\ No newline at end of file


[12/17] airavata git commit: renaming directory names

Posted by sc...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/Sharing.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/Sharing.java b/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/Sharing.java
deleted file mode 100644
index 5106eab..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/Sharing.java
+++ /dev/null
@@ -1,1167 +0,0 @@
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- *  @generated
- */
-package org.apache.airavata.sharing.registry.models;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-05")
-public class Sharing implements org.apache.thrift.TBase<Sharing, Sharing._Fields>, java.io.Serializable, Cloneable, Comparable<Sharing> {
-  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Sharing");
-
-  private static final org.apache.thrift.protocol.TField PERMISSION_TYPE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("permissionTypeId", org.apache.thrift.protocol.TType.STRING, (short)1);
-  private static final org.apache.thrift.protocol.TField ENTITY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("entityId", org.apache.thrift.protocol.TType.STRING, (short)2);
-  private static final org.apache.thrift.protocol.TField GROUP_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("groupId", org.apache.thrift.protocol.TType.STRING, (short)3);
-  private static final org.apache.thrift.protocol.TField GROUP_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("groupType", org.apache.thrift.protocol.TType.I32, (short)4);
-  private static final org.apache.thrift.protocol.TField SHARING_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("sharingType", org.apache.thrift.protocol.TType.I32, (short)5);
-  private static final org.apache.thrift.protocol.TField INHERITED_PARENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("inheritedParentId", org.apache.thrift.protocol.TType.STRING, (short)6);
-  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)7);
-  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)8);
-
-  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-  static {
-    schemes.put(StandardScheme.class, new SharingStandardSchemeFactory());
-    schemes.put(TupleScheme.class, new SharingTupleSchemeFactory());
-  }
-
-  public String permissionTypeId; // optional
-  public String entityId; // optional
-  public String groupId; // optional
-  /**
-   * 
-   * @see GroupType
-   */
-  public GroupType groupType; // optional
-  /**
-   * 
-   * @see SharingType
-   */
-  public SharingType sharingType; // optional
-  public String inheritedParentId; // optional
-  public long createdTime; // optional
-  public long updatedTime; // optional
-
-  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
-    PERMISSION_TYPE_ID((short)1, "permissionTypeId"),
-    ENTITY_ID((short)2, "entityId"),
-    GROUP_ID((short)3, "groupId"),
-    /**
-     * 
-     * @see GroupType
-     */
-    GROUP_TYPE((short)4, "groupType"),
-    /**
-     * 
-     * @see SharingType
-     */
-    SHARING_TYPE((short)5, "sharingType"),
-    INHERITED_PARENT_ID((short)6, "inheritedParentId"),
-    CREATED_TIME((short)7, "createdTime"),
-    UPDATED_TIME((short)8, "updatedTime");
-
-    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
-    static {
-      for (_Fields field : EnumSet.allOf(_Fields.class)) {
-        byName.put(field.getFieldName(), field);
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, or null if its not found.
-     */
-    public static _Fields findByThriftId(int fieldId) {
-      switch(fieldId) {
-        case 1: // PERMISSION_TYPE_ID
-          return PERMISSION_TYPE_ID;
-        case 2: // ENTITY_ID
-          return ENTITY_ID;
-        case 3: // GROUP_ID
-          return GROUP_ID;
-        case 4: // GROUP_TYPE
-          return GROUP_TYPE;
-        case 5: // SHARING_TYPE
-          return SHARING_TYPE;
-        case 6: // INHERITED_PARENT_ID
-          return INHERITED_PARENT_ID;
-        case 7: // CREATED_TIME
-          return CREATED_TIME;
-        case 8: // UPDATED_TIME
-          return UPDATED_TIME;
-        default:
-          return null;
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, throwing an exception
-     * if it is not found.
-     */
-    public static _Fields findByThriftIdOrThrow(int fieldId) {
-      _Fields fields = findByThriftId(fieldId);
-      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-      return fields;
-    }
-
-    /**
-     * Find the _Fields constant that matches name, or null if its not found.
-     */
-    public static _Fields findByName(String name) {
-      return byName.get(name);
-    }
-
-    private final short _thriftId;
-    private final String _fieldName;
-
-    _Fields(short thriftId, String fieldName) {
-      _thriftId = thriftId;
-      _fieldName = fieldName;
-    }
-
-    public short getThriftFieldId() {
-      return _thriftId;
-    }
-
-    public String getFieldName() {
-      return _fieldName;
-    }
-  }
-
-  // isset id assignments
-  private static final int __CREATEDTIME_ISSET_ID = 0;
-  private static final int __UPDATEDTIME_ISSET_ID = 1;
-  private byte __isset_bitfield = 0;
-  private static final _Fields optionals[] = {_Fields.PERMISSION_TYPE_ID,_Fields.ENTITY_ID,_Fields.GROUP_ID,_Fields.GROUP_TYPE,_Fields.SHARING_TYPE,_Fields.INHERITED_PARENT_ID,_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);
-    tmpMap.put(_Fields.PERMISSION_TYPE_ID, new org.apache.thrift.meta_data.FieldMetaData("permissionTypeId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.ENTITY_ID, new org.apache.thrift.meta_data.FieldMetaData("entityId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.GROUP_ID, new org.apache.thrift.meta_data.FieldMetaData("groupId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.GROUP_TYPE, new org.apache.thrift.meta_data.FieldMetaData("groupType", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, GroupType.class)));
-    tmpMap.put(_Fields.SHARING_TYPE, new org.apache.thrift.meta_data.FieldMetaData("sharingType", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, SharingType.class)));
-    tmpMap.put(_Fields.INHERITED_PARENT_ID, new org.apache.thrift.meta_data.FieldMetaData("inheritedParentId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    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, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-    metaDataMap = Collections.unmodifiableMap(tmpMap);
-    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Sharing.class, metaDataMap);
-  }
-
-  public Sharing() {
-  }
-
-  /**
-   * Performs a deep copy on <i>other</i>.
-   */
-  public Sharing(Sharing other) {
-    __isset_bitfield = other.__isset_bitfield;
-    if (other.isSetPermissionTypeId()) {
-      this.permissionTypeId = other.permissionTypeId;
-    }
-    if (other.isSetEntityId()) {
-      this.entityId = other.entityId;
-    }
-    if (other.isSetGroupId()) {
-      this.groupId = other.groupId;
-    }
-    if (other.isSetGroupType()) {
-      this.groupType = other.groupType;
-    }
-    if (other.isSetSharingType()) {
-      this.sharingType = other.sharingType;
-    }
-    if (other.isSetInheritedParentId()) {
-      this.inheritedParentId = other.inheritedParentId;
-    }
-    this.createdTime = other.createdTime;
-    this.updatedTime = other.updatedTime;
-  }
-
-  public Sharing deepCopy() {
-    return new Sharing(this);
-  }
-
-  @Override
-  public void clear() {
-    this.permissionTypeId = null;
-    this.entityId = null;
-    this.groupId = null;
-    this.groupType = null;
-    this.sharingType = null;
-    this.inheritedParentId = null;
-    setCreatedTimeIsSet(false);
-    this.createdTime = 0;
-    setUpdatedTimeIsSet(false);
-    this.updatedTime = 0;
-  }
-
-  public String getPermissionTypeId() {
-    return this.permissionTypeId;
-  }
-
-  public Sharing setPermissionTypeId(String permissionTypeId) {
-    this.permissionTypeId = permissionTypeId;
-    return this;
-  }
-
-  public void unsetPermissionTypeId() {
-    this.permissionTypeId = null;
-  }
-
-  /** Returns true if field permissionTypeId is set (has been assigned a value) and false otherwise */
-  public boolean isSetPermissionTypeId() {
-    return this.permissionTypeId != null;
-  }
-
-  public void setPermissionTypeIdIsSet(boolean value) {
-    if (!value) {
-      this.permissionTypeId = null;
-    }
-  }
-
-  public String getEntityId() {
-    return this.entityId;
-  }
-
-  public Sharing setEntityId(String entityId) {
-    this.entityId = entityId;
-    return this;
-  }
-
-  public void unsetEntityId() {
-    this.entityId = null;
-  }
-
-  /** Returns true if field entityId is set (has been assigned a value) and false otherwise */
-  public boolean isSetEntityId() {
-    return this.entityId != null;
-  }
-
-  public void setEntityIdIsSet(boolean value) {
-    if (!value) {
-      this.entityId = null;
-    }
-  }
-
-  public String getGroupId() {
-    return this.groupId;
-  }
-
-  public Sharing setGroupId(String groupId) {
-    this.groupId = groupId;
-    return this;
-  }
-
-  public void unsetGroupId() {
-    this.groupId = null;
-  }
-
-  /** Returns true if field groupId is set (has been assigned a value) and false otherwise */
-  public boolean isSetGroupId() {
-    return this.groupId != null;
-  }
-
-  public void setGroupIdIsSet(boolean value) {
-    if (!value) {
-      this.groupId = null;
-    }
-  }
-
-  /**
-   * 
-   * @see GroupType
-   */
-  public GroupType getGroupType() {
-    return this.groupType;
-  }
-
-  /**
-   * 
-   * @see GroupType
-   */
-  public Sharing setGroupType(GroupType groupType) {
-    this.groupType = groupType;
-    return this;
-  }
-
-  public void unsetGroupType() {
-    this.groupType = null;
-  }
-
-  /** Returns true if field groupType is set (has been assigned a value) and false otherwise */
-  public boolean isSetGroupType() {
-    return this.groupType != null;
-  }
-
-  public void setGroupTypeIsSet(boolean value) {
-    if (!value) {
-      this.groupType = null;
-    }
-  }
-
-  /**
-   * 
-   * @see SharingType
-   */
-  public SharingType getSharingType() {
-    return this.sharingType;
-  }
-
-  /**
-   * 
-   * @see SharingType
-   */
-  public Sharing setSharingType(SharingType sharingType) {
-    this.sharingType = sharingType;
-    return this;
-  }
-
-  public void unsetSharingType() {
-    this.sharingType = null;
-  }
-
-  /** Returns true if field sharingType is set (has been assigned a value) and false otherwise */
-  public boolean isSetSharingType() {
-    return this.sharingType != null;
-  }
-
-  public void setSharingTypeIsSet(boolean value) {
-    if (!value) {
-      this.sharingType = null;
-    }
-  }
-
-  public String getInheritedParentId() {
-    return this.inheritedParentId;
-  }
-
-  public Sharing setInheritedParentId(String inheritedParentId) {
-    this.inheritedParentId = inheritedParentId;
-    return this;
-  }
-
-  public void unsetInheritedParentId() {
-    this.inheritedParentId = null;
-  }
-
-  /** Returns true if field inheritedParentId is set (has been assigned a value) and false otherwise */
-  public boolean isSetInheritedParentId() {
-    return this.inheritedParentId != null;
-  }
-
-  public void setInheritedParentIdIsSet(boolean value) {
-    if (!value) {
-      this.inheritedParentId = null;
-    }
-  }
-
-  public long getCreatedTime() {
-    return this.createdTime;
-  }
-
-  public Sharing setCreatedTime(long createdTime) {
-    this.createdTime = createdTime;
-    setCreatedTimeIsSet(true);
-    return this;
-  }
-
-  public void unsetCreatedTime() {
-    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CREATEDTIME_ISSET_ID);
-  }
-
-  /** Returns true if field createdTime is set (has been assigned a value) and false otherwise */
-  public boolean isSetCreatedTime() {
-    return EncodingUtils.testBit(__isset_bitfield, __CREATEDTIME_ISSET_ID);
-  }
-
-  public void setCreatedTimeIsSet(boolean value) {
-    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CREATEDTIME_ISSET_ID, value);
-  }
-
-  public long getUpdatedTime() {
-    return this.updatedTime;
-  }
-
-  public Sharing setUpdatedTime(long updatedTime) {
-    this.updatedTime = updatedTime;
-    setUpdatedTimeIsSet(true);
-    return this;
-  }
-
-  public void unsetUpdatedTime() {
-    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID);
-  }
-
-  /** Returns true if field updatedTime is set (has been assigned a value) and false otherwise */
-  public boolean isSetUpdatedTime() {
-    return EncodingUtils.testBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID);
-  }
-
-  public void setUpdatedTimeIsSet(boolean value) {
-    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID, value);
-  }
-
-  public void setFieldValue(_Fields field, Object value) {
-    switch (field) {
-    case PERMISSION_TYPE_ID:
-      if (value == null) {
-        unsetPermissionTypeId();
-      } else {
-        setPermissionTypeId((String)value);
-      }
-      break;
-
-    case ENTITY_ID:
-      if (value == null) {
-        unsetEntityId();
-      } else {
-        setEntityId((String)value);
-      }
-      break;
-
-    case GROUP_ID:
-      if (value == null) {
-        unsetGroupId();
-      } else {
-        setGroupId((String)value);
-      }
-      break;
-
-    case GROUP_TYPE:
-      if (value == null) {
-        unsetGroupType();
-      } else {
-        setGroupType((GroupType)value);
-      }
-      break;
-
-    case SHARING_TYPE:
-      if (value == null) {
-        unsetSharingType();
-      } else {
-        setSharingType((SharingType)value);
-      }
-      break;
-
-    case INHERITED_PARENT_ID:
-      if (value == null) {
-        unsetInheritedParentId();
-      } else {
-        setInheritedParentId((String)value);
-      }
-      break;
-
-    case CREATED_TIME:
-      if (value == null) {
-        unsetCreatedTime();
-      } else {
-        setCreatedTime((Long)value);
-      }
-      break;
-
-    case UPDATED_TIME:
-      if (value == null) {
-        unsetUpdatedTime();
-      } else {
-        setUpdatedTime((Long)value);
-      }
-      break;
-
-    }
-  }
-
-  public Object getFieldValue(_Fields field) {
-    switch (field) {
-    case PERMISSION_TYPE_ID:
-      return getPermissionTypeId();
-
-    case ENTITY_ID:
-      return getEntityId();
-
-    case GROUP_ID:
-      return getGroupId();
-
-    case GROUP_TYPE:
-      return getGroupType();
-
-    case SHARING_TYPE:
-      return getSharingType();
-
-    case INHERITED_PARENT_ID:
-      return getInheritedParentId();
-
-    case CREATED_TIME:
-      return getCreatedTime();
-
-    case UPDATED_TIME:
-      return getUpdatedTime();
-
-    }
-    throw new IllegalStateException();
-  }
-
-  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
-  public boolean isSet(_Fields field) {
-    if (field == null) {
-      throw new IllegalArgumentException();
-    }
-
-    switch (field) {
-    case PERMISSION_TYPE_ID:
-      return isSetPermissionTypeId();
-    case ENTITY_ID:
-      return isSetEntityId();
-    case GROUP_ID:
-      return isSetGroupId();
-    case GROUP_TYPE:
-      return isSetGroupType();
-    case SHARING_TYPE:
-      return isSetSharingType();
-    case INHERITED_PARENT_ID:
-      return isSetInheritedParentId();
-    case CREATED_TIME:
-      return isSetCreatedTime();
-    case UPDATED_TIME:
-      return isSetUpdatedTime();
-    }
-    throw new IllegalStateException();
-  }
-
-  @Override
-  public boolean equals(Object that) {
-    if (that == null)
-      return false;
-    if (that instanceof Sharing)
-      return this.equals((Sharing)that);
-    return false;
-  }
-
-  public boolean equals(Sharing that) {
-    if (that == null)
-      return false;
-
-    boolean this_present_permissionTypeId = true && this.isSetPermissionTypeId();
-    boolean that_present_permissionTypeId = true && that.isSetPermissionTypeId();
-    if (this_present_permissionTypeId || that_present_permissionTypeId) {
-      if (!(this_present_permissionTypeId && that_present_permissionTypeId))
-        return false;
-      if (!this.permissionTypeId.equals(that.permissionTypeId))
-        return false;
-    }
-
-    boolean this_present_entityId = true && this.isSetEntityId();
-    boolean that_present_entityId = true && that.isSetEntityId();
-    if (this_present_entityId || that_present_entityId) {
-      if (!(this_present_entityId && that_present_entityId))
-        return false;
-      if (!this.entityId.equals(that.entityId))
-        return false;
-    }
-
-    boolean this_present_groupId = true && this.isSetGroupId();
-    boolean that_present_groupId = true && that.isSetGroupId();
-    if (this_present_groupId || that_present_groupId) {
-      if (!(this_present_groupId && that_present_groupId))
-        return false;
-      if (!this.groupId.equals(that.groupId))
-        return false;
-    }
-
-    boolean this_present_groupType = true && this.isSetGroupType();
-    boolean that_present_groupType = true && that.isSetGroupType();
-    if (this_present_groupType || that_present_groupType) {
-      if (!(this_present_groupType && that_present_groupType))
-        return false;
-      if (!this.groupType.equals(that.groupType))
-        return false;
-    }
-
-    boolean this_present_sharingType = true && this.isSetSharingType();
-    boolean that_present_sharingType = true && that.isSetSharingType();
-    if (this_present_sharingType || that_present_sharingType) {
-      if (!(this_present_sharingType && that_present_sharingType))
-        return false;
-      if (!this.sharingType.equals(that.sharingType))
-        return false;
-    }
-
-    boolean this_present_inheritedParentId = true && this.isSetInheritedParentId();
-    boolean that_present_inheritedParentId = true && that.isSetInheritedParentId();
-    if (this_present_inheritedParentId || that_present_inheritedParentId) {
-      if (!(this_present_inheritedParentId && that_present_inheritedParentId))
-        return false;
-      if (!this.inheritedParentId.equals(that.inheritedParentId))
-        return false;
-    }
-
-    boolean this_present_createdTime = true && this.isSetCreatedTime();
-    boolean that_present_createdTime = true && that.isSetCreatedTime();
-    if (this_present_createdTime || that_present_createdTime) {
-      if (!(this_present_createdTime && that_present_createdTime))
-        return false;
-      if (this.createdTime != that.createdTime)
-        return false;
-    }
-
-    boolean this_present_updatedTime = true && this.isSetUpdatedTime();
-    boolean that_present_updatedTime = true && that.isSetUpdatedTime();
-    if (this_present_updatedTime || that_present_updatedTime) {
-      if (!(this_present_updatedTime && that_present_updatedTime))
-        return false;
-      if (this.updatedTime != that.updatedTime)
-        return false;
-    }
-
-    return true;
-  }
-
-  @Override
-  public int hashCode() {
-    List<Object> list = new ArrayList<Object>();
-
-    boolean present_permissionTypeId = true && (isSetPermissionTypeId());
-    list.add(present_permissionTypeId);
-    if (present_permissionTypeId)
-      list.add(permissionTypeId);
-
-    boolean present_entityId = true && (isSetEntityId());
-    list.add(present_entityId);
-    if (present_entityId)
-      list.add(entityId);
-
-    boolean present_groupId = true && (isSetGroupId());
-    list.add(present_groupId);
-    if (present_groupId)
-      list.add(groupId);
-
-    boolean present_groupType = true && (isSetGroupType());
-    list.add(present_groupType);
-    if (present_groupType)
-      list.add(groupType.getValue());
-
-    boolean present_sharingType = true && (isSetSharingType());
-    list.add(present_sharingType);
-    if (present_sharingType)
-      list.add(sharingType.getValue());
-
-    boolean present_inheritedParentId = true && (isSetInheritedParentId());
-    list.add(present_inheritedParentId);
-    if (present_inheritedParentId)
-      list.add(inheritedParentId);
-
-    boolean present_createdTime = true && (isSetCreatedTime());
-    list.add(present_createdTime);
-    if (present_createdTime)
-      list.add(createdTime);
-
-    boolean present_updatedTime = true && (isSetUpdatedTime());
-    list.add(present_updatedTime);
-    if (present_updatedTime)
-      list.add(updatedTime);
-
-    return list.hashCode();
-  }
-
-  @Override
-  public int compareTo(Sharing other) {
-    if (!getClass().equals(other.getClass())) {
-      return getClass().getName().compareTo(other.getClass().getName());
-    }
-
-    int lastComparison = 0;
-
-    lastComparison = Boolean.valueOf(isSetPermissionTypeId()).compareTo(other.isSetPermissionTypeId());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetPermissionTypeId()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.permissionTypeId, other.permissionTypeId);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetEntityId()).compareTo(other.isSetEntityId());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetEntityId()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityId, other.entityId);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetGroupId()).compareTo(other.isSetGroupId());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetGroupId()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.groupId, other.groupId);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetGroupType()).compareTo(other.isSetGroupType());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetGroupType()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.groupType, other.groupType);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetSharingType()).compareTo(other.isSetSharingType());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetSharingType()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sharingType, other.sharingType);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetInheritedParentId()).compareTo(other.isSetInheritedParentId());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetInheritedParentId()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.inheritedParentId, other.inheritedParentId);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetCreatedTime()).compareTo(other.isSetCreatedTime());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetCreatedTime()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.createdTime, other.createdTime);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetUpdatedTime()).compareTo(other.isSetUpdatedTime());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetUpdatedTime()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updatedTime, other.updatedTime);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    return 0;
-  }
-
-  public _Fields fieldForId(int fieldId) {
-    return _Fields.findByThriftId(fieldId);
-  }
-
-  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
-  }
-
-  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
-  }
-
-  @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder("Sharing(");
-    boolean first = true;
-
-    if (isSetPermissionTypeId()) {
-      sb.append("permissionTypeId:");
-      if (this.permissionTypeId == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.permissionTypeId);
-      }
-      first = false;
-    }
-    if (isSetEntityId()) {
-      if (!first) sb.append(", ");
-      sb.append("entityId:");
-      if (this.entityId == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.entityId);
-      }
-      first = false;
-    }
-    if (isSetGroupId()) {
-      if (!first) sb.append(", ");
-      sb.append("groupId:");
-      if (this.groupId == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.groupId);
-      }
-      first = false;
-    }
-    if (isSetGroupType()) {
-      if (!first) sb.append(", ");
-      sb.append("groupType:");
-      if (this.groupType == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.groupType);
-      }
-      first = false;
-    }
-    if (isSetSharingType()) {
-      if (!first) sb.append(", ");
-      sb.append("sharingType:");
-      if (this.sharingType == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.sharingType);
-      }
-      first = false;
-    }
-    if (isSetInheritedParentId()) {
-      if (!first) sb.append(", ");
-      sb.append("inheritedParentId:");
-      if (this.inheritedParentId == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.inheritedParentId);
-      }
-      first = false;
-    }
-    if (isSetCreatedTime()) {
-      if (!first) sb.append(", ");
-      sb.append("createdTime:");
-      sb.append(this.createdTime);
-      first = false;
-    }
-    if (isSetUpdatedTime()) {
-      if (!first) sb.append(", ");
-      sb.append("updatedTime:");
-      sb.append(this.updatedTime);
-      first = false;
-    }
-    sb.append(")");
-    return sb.toString();
-  }
-
-  public void validate() throws org.apache.thrift.TException {
-    // check for required fields
-    // check for sub-struct validity
-  }
-
-  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-    try {
-      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-    } catch (org.apache.thrift.TException te) {
-      throw new java.io.IOException(te);
-    }
-  }
-
-  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-    try {
-      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
-      __isset_bitfield = 0;
-      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-    } catch (org.apache.thrift.TException te) {
-      throw new java.io.IOException(te);
-    }
-  }
-
-  private static class SharingStandardSchemeFactory implements SchemeFactory {
-    public SharingStandardScheme getScheme() {
-      return new SharingStandardScheme();
-    }
-  }
-
-  private static class SharingStandardScheme extends StandardScheme<Sharing> {
-
-    public void read(org.apache.thrift.protocol.TProtocol iprot, Sharing struct) throws org.apache.thrift.TException {
-      org.apache.thrift.protocol.TField schemeField;
-      iprot.readStructBegin();
-      while (true)
-      {
-        schemeField = iprot.readFieldBegin();
-        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
-          break;
-        }
-        switch (schemeField.id) {
-          case 1: // PERMISSION_TYPE_ID
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.permissionTypeId = iprot.readString();
-              struct.setPermissionTypeIdIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 2: // ENTITY_ID
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.entityId = iprot.readString();
-              struct.setEntityIdIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 3: // GROUP_ID
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.groupId = iprot.readString();
-              struct.setGroupIdIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 4: // GROUP_TYPE
-            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
-              struct.groupType = org.apache.airavata.sharing.registry.models.GroupType.findByValue(iprot.readI32());
-              struct.setGroupTypeIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 5: // SHARING_TYPE
-            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
-              struct.sharingType = org.apache.airavata.sharing.registry.models.SharingType.findByValue(iprot.readI32());
-              struct.setSharingTypeIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 6: // INHERITED_PARENT_ID
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.inheritedParentId = iprot.readString();
-              struct.setInheritedParentIdIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 7: // CREATED_TIME
-            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
-              struct.createdTime = iprot.readI64();
-              struct.setCreatedTimeIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 8: // UPDATED_TIME
-            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
-              struct.updatedTime = iprot.readI64();
-              struct.setUpdatedTimeIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          default:
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-        }
-        iprot.readFieldEnd();
-      }
-      iprot.readStructEnd();
-
-      // check for required fields of primitive type, which can't be checked in the validate method
-      struct.validate();
-    }
-
-    public void write(org.apache.thrift.protocol.TProtocol oprot, Sharing struct) throws org.apache.thrift.TException {
-      struct.validate();
-
-      oprot.writeStructBegin(STRUCT_DESC);
-      if (struct.permissionTypeId != null) {
-        if (struct.isSetPermissionTypeId()) {
-          oprot.writeFieldBegin(PERMISSION_TYPE_ID_FIELD_DESC);
-          oprot.writeString(struct.permissionTypeId);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.entityId != null) {
-        if (struct.isSetEntityId()) {
-          oprot.writeFieldBegin(ENTITY_ID_FIELD_DESC);
-          oprot.writeString(struct.entityId);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.groupId != null) {
-        if (struct.isSetGroupId()) {
-          oprot.writeFieldBegin(GROUP_ID_FIELD_DESC);
-          oprot.writeString(struct.groupId);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.groupType != null) {
-        if (struct.isSetGroupType()) {
-          oprot.writeFieldBegin(GROUP_TYPE_FIELD_DESC);
-          oprot.writeI32(struct.groupType.getValue());
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.sharingType != null) {
-        if (struct.isSetSharingType()) {
-          oprot.writeFieldBegin(SHARING_TYPE_FIELD_DESC);
-          oprot.writeI32(struct.sharingType.getValue());
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.inheritedParentId != null) {
-        if (struct.isSetInheritedParentId()) {
-          oprot.writeFieldBegin(INHERITED_PARENT_ID_FIELD_DESC);
-          oprot.writeString(struct.inheritedParentId);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.isSetCreatedTime()) {
-        oprot.writeFieldBegin(CREATED_TIME_FIELD_DESC);
-        oprot.writeI64(struct.createdTime);
-        oprot.writeFieldEnd();
-      }
-      if (struct.isSetUpdatedTime()) {
-        oprot.writeFieldBegin(UPDATED_TIME_FIELD_DESC);
-        oprot.writeI64(struct.updatedTime);
-        oprot.writeFieldEnd();
-      }
-      oprot.writeFieldStop();
-      oprot.writeStructEnd();
-    }
-
-  }
-
-  private static class SharingTupleSchemeFactory implements SchemeFactory {
-    public SharingTupleScheme getScheme() {
-      return new SharingTupleScheme();
-    }
-  }
-
-  private static class SharingTupleScheme extends TupleScheme<Sharing> {
-
-    @Override
-    public void write(org.apache.thrift.protocol.TProtocol prot, Sharing struct) throws org.apache.thrift.TException {
-      TTupleProtocol oprot = (TTupleProtocol) prot;
-      BitSet optionals = new BitSet();
-      if (struct.isSetPermissionTypeId()) {
-        optionals.set(0);
-      }
-      if (struct.isSetEntityId()) {
-        optionals.set(1);
-      }
-      if (struct.isSetGroupId()) {
-        optionals.set(2);
-      }
-      if (struct.isSetGroupType()) {
-        optionals.set(3);
-      }
-      if (struct.isSetSharingType()) {
-        optionals.set(4);
-      }
-      if (struct.isSetInheritedParentId()) {
-        optionals.set(5);
-      }
-      if (struct.isSetCreatedTime()) {
-        optionals.set(6);
-      }
-      if (struct.isSetUpdatedTime()) {
-        optionals.set(7);
-      }
-      oprot.writeBitSet(optionals, 8);
-      if (struct.isSetPermissionTypeId()) {
-        oprot.writeString(struct.permissionTypeId);
-      }
-      if (struct.isSetEntityId()) {
-        oprot.writeString(struct.entityId);
-      }
-      if (struct.isSetGroupId()) {
-        oprot.writeString(struct.groupId);
-      }
-      if (struct.isSetGroupType()) {
-        oprot.writeI32(struct.groupType.getValue());
-      }
-      if (struct.isSetSharingType()) {
-        oprot.writeI32(struct.sharingType.getValue());
-      }
-      if (struct.isSetInheritedParentId()) {
-        oprot.writeString(struct.inheritedParentId);
-      }
-      if (struct.isSetCreatedTime()) {
-        oprot.writeI64(struct.createdTime);
-      }
-      if (struct.isSetUpdatedTime()) {
-        oprot.writeI64(struct.updatedTime);
-      }
-    }
-
-    @Override
-    public void read(org.apache.thrift.protocol.TProtocol prot, Sharing struct) throws org.apache.thrift.TException {
-      TTupleProtocol iprot = (TTupleProtocol) prot;
-      BitSet incoming = iprot.readBitSet(8);
-      if (incoming.get(0)) {
-        struct.permissionTypeId = iprot.readString();
-        struct.setPermissionTypeIdIsSet(true);
-      }
-      if (incoming.get(1)) {
-        struct.entityId = iprot.readString();
-        struct.setEntityIdIsSet(true);
-      }
-      if (incoming.get(2)) {
-        struct.groupId = iprot.readString();
-        struct.setGroupIdIsSet(true);
-      }
-      if (incoming.get(3)) {
-        struct.groupType = org.apache.airavata.sharing.registry.models.GroupType.findByValue(iprot.readI32());
-        struct.setGroupTypeIsSet(true);
-      }
-      if (incoming.get(4)) {
-        struct.sharingType = org.apache.airavata.sharing.registry.models.SharingType.findByValue(iprot.readI32());
-        struct.setSharingTypeIsSet(true);
-      }
-      if (incoming.get(5)) {
-        struct.inheritedParentId = iprot.readString();
-        struct.setInheritedParentIdIsSet(true);
-      }
-      if (incoming.get(6)) {
-        struct.createdTime = iprot.readI64();
-        struct.setCreatedTimeIsSet(true);
-      }
-      if (incoming.get(7)) {
-        struct.updatedTime = iprot.readI64();
-        struct.setUpdatedTimeIsSet(true);
-      }
-    }
-  }
-
-}
-

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/SharingType.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/SharingType.java b/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/SharingType.java
deleted file mode 100644
index ff9f919..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/SharingType.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- *  @generated
- */
-package org.apache.airavata.sharing.registry.models;
-
-
-import java.util.Map;
-import java.util.HashMap;
-import org.apache.thrift.TEnum;
-
-public enum SharingType implements org.apache.thrift.TEnum {
-  DIRECT(0),
-  INHERITED(1);
-
-  private final int value;
-
-  private SharingType(int value) {
-    this.value = value;
-  }
-
-  /**
-   * Get the integer value of this enum value, as defined in the Thrift IDL.
-   */
-  public int getValue() {
-    return value;
-  }
-
-  /**
-   * Find a the enum type by its integer value, as defined in the Thrift IDL.
-   * @return null if the value is not found.
-   */
-  public static SharingType findByValue(int value) { 
-    switch (value) {
-      case 0:
-        return DIRECT;
-      case 1:
-        return INHERITED;
-      default:
-        return null;
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/User.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/User.java b/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/User.java
deleted file mode 100644
index 69be6e7..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/User.java
+++ /dev/null
@@ -1,817 +0,0 @@
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- *  @generated
- */
-package org.apache.airavata.sharing.registry.models;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-05")
-public class User implements org.apache.thrift.TBase<User, User._Fields>, java.io.Serializable, Cloneable, Comparable<User> {
-  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("User");
-
-  private static final org.apache.thrift.protocol.TField USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userId", org.apache.thrift.protocol.TType.STRING, (short)1);
-  private static final org.apache.thrift.protocol.TField DOMAIN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("domainId", org.apache.thrift.protocol.TType.STRING, (short)2);
-  private static final org.apache.thrift.protocol.TField USER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("userName", org.apache.thrift.protocol.TType.STRING, (short)3);
-  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)4);
-  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)5);
-
-  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-  static {
-    schemes.put(StandardScheme.class, new UserStandardSchemeFactory());
-    schemes.put(TupleScheme.class, new UserTupleSchemeFactory());
-  }
-
-  public String userId; // optional
-  public String domainId; // optional
-  public String userName; // optional
-  public long createdTime; // optional
-  public long updatedTime; // optional
-
-  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
-    USER_ID((short)1, "userId"),
-    DOMAIN_ID((short)2, "domainId"),
-    USER_NAME((short)3, "userName"),
-    CREATED_TIME((short)4, "createdTime"),
-    UPDATED_TIME((short)5, "updatedTime");
-
-    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
-    static {
-      for (_Fields field : EnumSet.allOf(_Fields.class)) {
-        byName.put(field.getFieldName(), field);
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, or null if its not found.
-     */
-    public static _Fields findByThriftId(int fieldId) {
-      switch(fieldId) {
-        case 1: // USER_ID
-          return USER_ID;
-        case 2: // DOMAIN_ID
-          return DOMAIN_ID;
-        case 3: // USER_NAME
-          return USER_NAME;
-        case 4: // CREATED_TIME
-          return CREATED_TIME;
-        case 5: // UPDATED_TIME
-          return UPDATED_TIME;
-        default:
-          return null;
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, throwing an exception
-     * if it is not found.
-     */
-    public static _Fields findByThriftIdOrThrow(int fieldId) {
-      _Fields fields = findByThriftId(fieldId);
-      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-      return fields;
-    }
-
-    /**
-     * Find the _Fields constant that matches name, or null if its not found.
-     */
-    public static _Fields findByName(String name) {
-      return byName.get(name);
-    }
-
-    private final short _thriftId;
-    private final String _fieldName;
-
-    _Fields(short thriftId, String fieldName) {
-      _thriftId = thriftId;
-      _fieldName = fieldName;
-    }
-
-    public short getThriftFieldId() {
-      return _thriftId;
-    }
-
-    public String getFieldName() {
-      return _fieldName;
-    }
-  }
-
-  // isset id assignments
-  private static final int __CREATEDTIME_ISSET_ID = 0;
-  private static final int __UPDATEDTIME_ISSET_ID = 1;
-  private byte __isset_bitfield = 0;
-  private static final _Fields optionals[] = {_Fields.USER_ID,_Fields.DOMAIN_ID,_Fields.USER_NAME,_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);
-    tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.DOMAIN_ID, new org.apache.thrift.meta_data.FieldMetaData("domainId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.USER_NAME, new org.apache.thrift.meta_data.FieldMetaData("userName", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    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, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-    metaDataMap = Collections.unmodifiableMap(tmpMap);
-    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(User.class, metaDataMap);
-  }
-
-  public User() {
-    this.userId = "DO_NOT_SET_AT_CLIENTS_ID";
-
-  }
-
-  /**
-   * Performs a deep copy on <i>other</i>.
-   */
-  public User(User other) {
-    __isset_bitfield = other.__isset_bitfield;
-    if (other.isSetUserId()) {
-      this.userId = other.userId;
-    }
-    if (other.isSetDomainId()) {
-      this.domainId = other.domainId;
-    }
-    if (other.isSetUserName()) {
-      this.userName = other.userName;
-    }
-    this.createdTime = other.createdTime;
-    this.updatedTime = other.updatedTime;
-  }
-
-  public User deepCopy() {
-    return new User(this);
-  }
-
-  @Override
-  public void clear() {
-    this.userId = "DO_NOT_SET_AT_CLIENTS_ID";
-
-    this.domainId = null;
-    this.userName = null;
-    setCreatedTimeIsSet(false);
-    this.createdTime = 0;
-    setUpdatedTimeIsSet(false);
-    this.updatedTime = 0;
-  }
-
-  public String getUserId() {
-    return this.userId;
-  }
-
-  public User setUserId(String userId) {
-    this.userId = userId;
-    return this;
-  }
-
-  public void unsetUserId() {
-    this.userId = null;
-  }
-
-  /** Returns true if field userId is set (has been assigned a value) and false otherwise */
-  public boolean isSetUserId() {
-    return this.userId != null;
-  }
-
-  public void setUserIdIsSet(boolean value) {
-    if (!value) {
-      this.userId = null;
-    }
-  }
-
-  public String getDomainId() {
-    return this.domainId;
-  }
-
-  public User setDomainId(String domainId) {
-    this.domainId = domainId;
-    return this;
-  }
-
-  public void unsetDomainId() {
-    this.domainId = null;
-  }
-
-  /** Returns true if field domainId is set (has been assigned a value) and false otherwise */
-  public boolean isSetDomainId() {
-    return this.domainId != null;
-  }
-
-  public void setDomainIdIsSet(boolean value) {
-    if (!value) {
-      this.domainId = null;
-    }
-  }
-
-  public String getUserName() {
-    return this.userName;
-  }
-
-  public User setUserName(String userName) {
-    this.userName = userName;
-    return this;
-  }
-
-  public void unsetUserName() {
-    this.userName = null;
-  }
-
-  /** Returns true if field userName is set (has been assigned a value) and false otherwise */
-  public boolean isSetUserName() {
-    return this.userName != null;
-  }
-
-  public void setUserNameIsSet(boolean value) {
-    if (!value) {
-      this.userName = null;
-    }
-  }
-
-  public long getCreatedTime() {
-    return this.createdTime;
-  }
-
-  public User setCreatedTime(long createdTime) {
-    this.createdTime = createdTime;
-    setCreatedTimeIsSet(true);
-    return this;
-  }
-
-  public void unsetCreatedTime() {
-    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CREATEDTIME_ISSET_ID);
-  }
-
-  /** Returns true if field createdTime is set (has been assigned a value) and false otherwise */
-  public boolean isSetCreatedTime() {
-    return EncodingUtils.testBit(__isset_bitfield, __CREATEDTIME_ISSET_ID);
-  }
-
-  public void setCreatedTimeIsSet(boolean value) {
-    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CREATEDTIME_ISSET_ID, value);
-  }
-
-  public long getUpdatedTime() {
-    return this.updatedTime;
-  }
-
-  public User setUpdatedTime(long updatedTime) {
-    this.updatedTime = updatedTime;
-    setUpdatedTimeIsSet(true);
-    return this;
-  }
-
-  public void unsetUpdatedTime() {
-    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID);
-  }
-
-  /** Returns true if field updatedTime is set (has been assigned a value) and false otherwise */
-  public boolean isSetUpdatedTime() {
-    return EncodingUtils.testBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID);
-  }
-
-  public void setUpdatedTimeIsSet(boolean value) {
-    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID, value);
-  }
-
-  public void setFieldValue(_Fields field, Object value) {
-    switch (field) {
-    case USER_ID:
-      if (value == null) {
-        unsetUserId();
-      } else {
-        setUserId((String)value);
-      }
-      break;
-
-    case DOMAIN_ID:
-      if (value == null) {
-        unsetDomainId();
-      } else {
-        setDomainId((String)value);
-      }
-      break;
-
-    case USER_NAME:
-      if (value == null) {
-        unsetUserName();
-      } else {
-        setUserName((String)value);
-      }
-      break;
-
-    case CREATED_TIME:
-      if (value == null) {
-        unsetCreatedTime();
-      } else {
-        setCreatedTime((Long)value);
-      }
-      break;
-
-    case UPDATED_TIME:
-      if (value == null) {
-        unsetUpdatedTime();
-      } else {
-        setUpdatedTime((Long)value);
-      }
-      break;
-
-    }
-  }
-
-  public Object getFieldValue(_Fields field) {
-    switch (field) {
-    case USER_ID:
-      return getUserId();
-
-    case DOMAIN_ID:
-      return getDomainId();
-
-    case USER_NAME:
-      return getUserName();
-
-    case CREATED_TIME:
-      return getCreatedTime();
-
-    case UPDATED_TIME:
-      return getUpdatedTime();
-
-    }
-    throw new IllegalStateException();
-  }
-
-  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
-  public boolean isSet(_Fields field) {
-    if (field == null) {
-      throw new IllegalArgumentException();
-    }
-
-    switch (field) {
-    case USER_ID:
-      return isSetUserId();
-    case DOMAIN_ID:
-      return isSetDomainId();
-    case USER_NAME:
-      return isSetUserName();
-    case CREATED_TIME:
-      return isSetCreatedTime();
-    case UPDATED_TIME:
-      return isSetUpdatedTime();
-    }
-    throw new IllegalStateException();
-  }
-
-  @Override
-  public boolean equals(Object that) {
-    if (that == null)
-      return false;
-    if (that instanceof User)
-      return this.equals((User)that);
-    return false;
-  }
-
-  public boolean equals(User that) {
-    if (that == null)
-      return false;
-
-    boolean this_present_userId = true && this.isSetUserId();
-    boolean that_present_userId = true && that.isSetUserId();
-    if (this_present_userId || that_present_userId) {
-      if (!(this_present_userId && that_present_userId))
-        return false;
-      if (!this.userId.equals(that.userId))
-        return false;
-    }
-
-    boolean this_present_domainId = true && this.isSetDomainId();
-    boolean that_present_domainId = true && that.isSetDomainId();
-    if (this_present_domainId || that_present_domainId) {
-      if (!(this_present_domainId && that_present_domainId))
-        return false;
-      if (!this.domainId.equals(that.domainId))
-        return false;
-    }
-
-    boolean this_present_userName = true && this.isSetUserName();
-    boolean that_present_userName = true && that.isSetUserName();
-    if (this_present_userName || that_present_userName) {
-      if (!(this_present_userName && that_present_userName))
-        return false;
-      if (!this.userName.equals(that.userName))
-        return false;
-    }
-
-    boolean this_present_createdTime = true && this.isSetCreatedTime();
-    boolean that_present_createdTime = true && that.isSetCreatedTime();
-    if (this_present_createdTime || that_present_createdTime) {
-      if (!(this_present_createdTime && that_present_createdTime))
-        return false;
-      if (this.createdTime != that.createdTime)
-        return false;
-    }
-
-    boolean this_present_updatedTime = true && this.isSetUpdatedTime();
-    boolean that_present_updatedTime = true && that.isSetUpdatedTime();
-    if (this_present_updatedTime || that_present_updatedTime) {
-      if (!(this_present_updatedTime && that_present_updatedTime))
-        return false;
-      if (this.updatedTime != that.updatedTime)
-        return false;
-    }
-
-    return true;
-  }
-
-  @Override
-  public int hashCode() {
-    List<Object> list = new ArrayList<Object>();
-
-    boolean present_userId = true && (isSetUserId());
-    list.add(present_userId);
-    if (present_userId)
-      list.add(userId);
-
-    boolean present_domainId = true && (isSetDomainId());
-    list.add(present_domainId);
-    if (present_domainId)
-      list.add(domainId);
-
-    boolean present_userName = true && (isSetUserName());
-    list.add(present_userName);
-    if (present_userName)
-      list.add(userName);
-
-    boolean present_createdTime = true && (isSetCreatedTime());
-    list.add(present_createdTime);
-    if (present_createdTime)
-      list.add(createdTime);
-
-    boolean present_updatedTime = true && (isSetUpdatedTime());
-    list.add(present_updatedTime);
-    if (present_updatedTime)
-      list.add(updatedTime);
-
-    return list.hashCode();
-  }
-
-  @Override
-  public int compareTo(User other) {
-    if (!getClass().equals(other.getClass())) {
-      return getClass().getName().compareTo(other.getClass().getName());
-    }
-
-    int lastComparison = 0;
-
-    lastComparison = Boolean.valueOf(isSetUserId()).compareTo(other.isSetUserId());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetUserId()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, other.userId);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetDomainId()).compareTo(other.isSetDomainId());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetDomainId()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domainId, other.domainId);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetUserName()).compareTo(other.isSetUserName());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetUserName()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userName, other.userName);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetCreatedTime()).compareTo(other.isSetCreatedTime());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetCreatedTime()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.createdTime, other.createdTime);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetUpdatedTime()).compareTo(other.isSetUpdatedTime());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetUpdatedTime()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updatedTime, other.updatedTime);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    return 0;
-  }
-
-  public _Fields fieldForId(int fieldId) {
-    return _Fields.findByThriftId(fieldId);
-  }
-
-  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
-  }
-
-  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
-  }
-
-  @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder("User(");
-    boolean first = true;
-
-    if (isSetUserId()) {
-      sb.append("userId:");
-      if (this.userId == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.userId);
-      }
-      first = false;
-    }
-    if (isSetDomainId()) {
-      if (!first) sb.append(", ");
-      sb.append("domainId:");
-      if (this.domainId == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.domainId);
-      }
-      first = false;
-    }
-    if (isSetUserName()) {
-      if (!first) sb.append(", ");
-      sb.append("userName:");
-      if (this.userName == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.userName);
-      }
-      first = false;
-    }
-    if (isSetCreatedTime()) {
-      if (!first) sb.append(", ");
-      sb.append("createdTime:");
-      sb.append(this.createdTime);
-      first = false;
-    }
-    if (isSetUpdatedTime()) {
-      if (!first) sb.append(", ");
-      sb.append("updatedTime:");
-      sb.append(this.updatedTime);
-      first = false;
-    }
-    sb.append(")");
-    return sb.toString();
-  }
-
-  public void validate() throws org.apache.thrift.TException {
-    // check for required fields
-    // check for sub-struct validity
-  }
-
-  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-    try {
-      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-    } catch (org.apache.thrift.TException te) {
-      throw new java.io.IOException(te);
-    }
-  }
-
-  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-    try {
-      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
-      __isset_bitfield = 0;
-      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-    } catch (org.apache.thrift.TException te) {
-      throw new java.io.IOException(te);
-    }
-  }
-
-  private static class UserStandardSchemeFactory implements SchemeFactory {
-    public UserStandardScheme getScheme() {
-      return new UserStandardScheme();
-    }
-  }
-
-  private static class UserStandardScheme extends StandardScheme<User> {
-
-    public void read(org.apache.thrift.protocol.TProtocol iprot, User struct) throws org.apache.thrift.TException {
-      org.apache.thrift.protocol.TField schemeField;
-      iprot.readStructBegin();
-      while (true)
-      {
-        schemeField = iprot.readFieldBegin();
-        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
-          break;
-        }
-        switch (schemeField.id) {
-          case 1: // USER_ID
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.userId = iprot.readString();
-              struct.setUserIdIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 2: // DOMAIN_ID
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.domainId = iprot.readString();
-              struct.setDomainIdIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 3: // USER_NAME
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.userName = iprot.readString();
-              struct.setUserNameIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 4: // CREATED_TIME
-            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
-              struct.createdTime = iprot.readI64();
-              struct.setCreatedTimeIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 5: // UPDATED_TIME
-            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
-              struct.updatedTime = iprot.readI64();
-              struct.setUpdatedTimeIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          default:
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-        }
-        iprot.readFieldEnd();
-      }
-      iprot.readStructEnd();
-
-      // check for required fields of primitive type, which can't be checked in the validate method
-      struct.validate();
-    }
-
-    public void write(org.apache.thrift.protocol.TProtocol oprot, User struct) throws org.apache.thrift.TException {
-      struct.validate();
-
-      oprot.writeStructBegin(STRUCT_DESC);
-      if (struct.userId != null) {
-        if (struct.isSetUserId()) {
-          oprot.writeFieldBegin(USER_ID_FIELD_DESC);
-          oprot.writeString(struct.userId);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.domainId != null) {
-        if (struct.isSetDomainId()) {
-          oprot.writeFieldBegin(DOMAIN_ID_FIELD_DESC);
-          oprot.writeString(struct.domainId);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.userName != null) {
-        if (struct.isSetUserName()) {
-          oprot.writeFieldBegin(USER_NAME_FIELD_DESC);
-          oprot.writeString(struct.userName);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.isSetCreatedTime()) {
-        oprot.writeFieldBegin(CREATED_TIME_FIELD_DESC);
-        oprot.writeI64(struct.createdTime);
-        oprot.writeFieldEnd();
-      }
-      if (struct.isSetUpdatedTime()) {
-        oprot.writeFieldBegin(UPDATED_TIME_FIELD_DESC);
-        oprot.writeI64(struct.updatedTime);
-        oprot.writeFieldEnd();
-      }
-      oprot.writeFieldStop();
-      oprot.writeStructEnd();
-    }
-
-  }
-
-  private static class UserTupleSchemeFactory implements SchemeFactory {
-    public UserTupleScheme getScheme() {
-      return new UserTupleScheme();
-    }
-  }
-
-  private static class UserTupleScheme extends TupleScheme<User> {
-
-    @Override
-    public void write(org.apache.thrift.protocol.TProtocol prot, User struct) throws org.apache.thrift.TException {
-      TTupleProtocol oprot = (TTupleProtocol) prot;
-      BitSet optionals = new BitSet();
-      if (struct.isSetUserId()) {
-        optionals.set(0);
-      }
-      if (struct.isSetDomainId()) {
-        optionals.set(1);
-      }
-      if (struct.isSetUserName()) {
-        optionals.set(2);
-      }
-      if (struct.isSetCreatedTime()) {
-        optionals.set(3);
-      }
-      if (struct.isSetUpdatedTime()) {
-        optionals.set(4);
-      }
-      oprot.writeBitSet(optionals, 5);
-      if (struct.isSetUserId()) {
-        oprot.writeString(struct.userId);
-      }
-      if (struct.isSetDomainId()) {
-        oprot.writeString(struct.domainId);
-      }
-      if (struct.isSetUserName()) {
-        oprot.writeString(struct.userName);
-      }
-      if (struct.isSetCreatedTime()) {
-        oprot.writeI64(struct.createdTime);
-      }
-      if (struct.isSetUpdatedTime()) {
-        oprot.writeI64(struct.updatedTime);
-      }
-    }
-
-    @Override
-    public void read(org.apache.thrift.protocol.TProtocol prot, User struct) throws org.apache.thrift.TException {
-      TTupleProtocol iprot = (TTupleProtocol) prot;
-      BitSet incoming = iprot.readBitSet(5);
-      if (incoming.get(0)) {
-        struct.userId = iprot.readString();
-        struct.setUserIdIsSet(true);
-      }
-      if (incoming.get(1)) {
-        struct.domainId = iprot.readString();
-        struct.setDomainIdIsSet(true);
-      }
-      if (incoming.get(2)) {
-        struct.userName = iprot.readString();
-        struct.setUserNameIsSet(true);
-      }
-      if (incoming.get(3)) {
-        struct.createdTime = iprot.readI64();
-        struct.setCreatedTimeIsSet(true);
-      }
-      if (incoming.get(4)) {
-        struct.updatedTime = iprot.readI64();
-        struct.setUpdatedTimeIsSet(true);
-      }
-    }
-  }
-
-}
-


[09/17] airavata git commit: renaming directory names

Posted by sc...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/pom.xml
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/pom.xml b/modules/airavata-sharing-registry/pom.xml
deleted file mode 100644
index 78b65cc..0000000
--- a/modules/airavata-sharing-registry/pom.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
-        <artifactId>airavata</artifactId>
-        <groupId>org.apache.airavata</groupId>
-        <relativePath>../pom.xml</relativePath>
-        <version>0.17-SNAPSHOT</version>
-    </parent>
-
-    <groupId>org.apache.airavata</groupId>
-    <artifactId>airavata-sharing-registry</artifactId>
-    <packaging>pom</packaging>
-    <version>${global.version}</version>
-
-    <properties>
-        <global.version>0.17-SNAPSHOT</global.version>
-    </properties>
-
-    <modules>
-        <module>airavata-sharing-registry-stubs</module>
-        <module>airavata-sharing-registry-core</module>
-        <module>airavata-sharing-data-migrator</module>
-    </modules>
-</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/thrift_models/sharing_cpi.thrift
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/thrift_models/sharing_cpi.thrift b/modules/airavata-sharing-registry/thrift_models/sharing_cpi.thrift
deleted file mode 100644
index d3cc54f..0000000
--- a/modules/airavata-sharing-registry/thrift_models/sharing_cpi.thrift
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-namespace java org.apache.airavata.sharing.registry.service.cpi
-
-include "./sharing_models.thrift"
-
-service GovRegistryService {
-
-    /**
-     * Domain Operations
-    **/
-    string createDomain(1: required sharing_models.Domain domain) throws (1: sharing_models.GovRegistryException gre)
-    bool updateDomain(1: required sharing_models.Domain domain) throws (1: sharing_models.GovRegistryException gre)
-    bool deleteDomain(1: required string domainId) throws (1: sharing_models.GovRegistryException gre)
-    sharing_models.Domain getDomain(1: required string domainId) throws (1: sharing_models.GovRegistryException gre)
-    list<sharing_models.Domain> getDomains(1: required i32 offset, 2: required i32 limit) throws (1: sharing_models.GovRegistryException gre);
-
-    /**
-     * User Operations
-    **/
-    string createUser(1: required sharing_models.User user) throws (1: sharing_models.GovRegistryException gre)
-    bool updatedUser(1: required sharing_models.User user) throws (1: sharing_models.GovRegistryException gre)
-    bool deleteUser(1: required string userId) throws (1: sharing_models.GovRegistryException gre)
-    sharing_models.User getUser(1: required string userId) throws (1: sharing_models.GovRegistryException gre)
-    list<sharing_models.User> getUsers(1: required string domain, 2: required i32 offset, 3: required i32 limit) throws (1: sharing_models.GovRegistryException gre);
-
-    /**
-     * Group Operations
-    **/
-    string createGroup(1: required sharing_models.UserGroup group) throws (1: sharing_models.GovRegistryException gre)
-    bool updateGroup(1: required sharing_models.UserGroup group) throws (1: sharing_models.GovRegistryException gre)
-    bool deleteGroup(1: required string groupId) throws (1: sharing_models.GovRegistryException gre)
-    sharing_models.UserGroup getGroup(1: required string groupId) throws (1: sharing_models.GovRegistryException gre)
-    list<sharing_models.UserGroup> getGroups(1: required string domain, 2: required i32 offset, 3: required i32 limit)
-
-    bool addUsersToGroup(1: required list<string> userIds, 2: required string groupId) throws (1: sharing_models.GovRegistryException gre);
-    bool removeUsersFromGroup(1: required list<string> userIds, 2: required string groupId) throws (1: sharing_models.GovRegistryException gre);
-    map<string, sharing_models.GroupChildType> getGroupMembers(1: required string groupId, 2: required i32 offset, 3: required i32 limit) throws (1: sharing_models.GovRegistryException gre);
-    bool addChildGroupToParentGroup(1: required string childId, 2: required string groupId) throws (1: sharing_models.GovRegistryException gre);
-    bool removeChildGroupFromParentGroup(1: required string childId, 2: required string groupId) throws (1: sharing_models.GovRegistryException gre);
-
-    /**
-     * EntityType Operations
-    **/
-    string createEntityType(1: required sharing_models.EntityType entityType) throws (1: sharing_models.GovRegistryException gre)
-    bool updateEntityType(1: required sharing_models.EntityType entityType) throws (1: sharing_models.GovRegistryException gre)
-    bool deleteEntityType(1: required string entityTypeId) throws (1: sharing_models.GovRegistryException gre)
-    sharing_models.EntityType getEntityType(1: required string entityTypeId) throws (1: sharing_models.GovRegistryException gre)
-    list<sharing_models.EntityType> getEntityTypes(1: required string domain, 2: required i32 offset, 3: required i32 limit) throws (1: sharing_models.GovRegistryException gre);
-
-    /**
-     * Entity Operations
-    **/
-    string createEntity(1: required sharing_models.Entity entity) throws (1: sharing_models.GovRegistryException gre)
-    bool updateEntity(1: required sharing_models.Entity entity) throws (1: sharing_models.GovRegistryException gre)
-    bool deleteEntity(1: required string entityId) throws (1: sharing_models.GovRegistryException gre)
-    sharing_models.Entity getEntity(1: required string entityId) throws (1: sharing_models.GovRegistryException gre)
-    list<sharing_models.Entity> searchEntities(1: required string userId, 2: required string entityTypeId, 3: required map<sharing_models.EntitySearchFields,
-     string> filters, 4: required i32 offset, 5: required i32 limit) throws (1: sharing_models.GovRegistryException gre)
-
-    /**
-     * Permission Operations
-    **/
-    string createPermissionType(1: required sharing_models.PermissionType permissionType) throws (1: sharing_models.GovRegistryException gre)
-    bool updatePermissionType(1: required sharing_models.PermissionType permissionType) throws (1: sharing_models.GovRegistryException gre)
-    bool deletePermissionType(1: required string entityTypeId) throws (1: sharing_models.GovRegistryException gre)
-    sharing_models.PermissionType getPermissionType(1: required string permissionTypeId) throws (1: sharing_models.GovRegistryException gre)
-    list<sharing_models.PermissionType> getPermissionTypes(1: required string domain, 2: required i32 offset, 3: required i32 limit) throws (1: sharing_models.GovRegistryException gre)
-
-    /**
-     * Sharing Entity with Users and Groups
-    **/
-    bool shareEntityWithUsers(1: required string entityId, 2: required list<string> userList, 3: required string perssionTypeId) throws (1: sharing_models.GovRegistryException gre)
-    bool revokeEntitySharingFromUsers(1: required string entityId, 2: required list<string> userList, 3: required string perssionTypeId) throws (1: sharing_models.GovRegistryException gre)
-    bool shareEntityWithGroups(1: required string entityId, 2: required list<string> groupList, 3: required string perssionTypeId) throws (1: sharing_models.GovRegistryException gre)
-    bool revokeEntitySharingFromGroups(1: required string entityId, 2: required list<string> groupList, 3: required string perssionTypeId) throws (1: sharing_models.GovRegistryException gre)
-    bool userHasAccess(1: required string domainId, 2: required string userId, 3: required string entityId, 4: required string permissionTypeId) throws (1: sharing_models.GovRegistryException gre)
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/thrift_models/sharing_models.thrift
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/thrift_models/sharing_models.thrift b/modules/airavata-sharing-registry/thrift_models/sharing_models.thrift
deleted file mode 100644
index 5670c5e..0000000
--- a/modules/airavata-sharing-registry/thrift_models/sharing_models.thrift
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
- namespace java org.apache.airavata.sharing.registry.models
-
-const string DO_NOT_SET_AT_CLIENTS_ID = "DO_NOT_SET_AT_CLIENTS_ID"
-
-struct Domain {
-    1: optional string domainId = DO_NOT_SET_AT_CLIENTS_ID,
-    2: optional string name,
-    3: optional string description,
-    4: optional i64 createdTime,
-    5: optional i64 updatedTime
-}
-
- struct User {
-     1: optional string userId = DO_NOT_SET_AT_CLIENTS_ID,
-     2: optional string domainId,
-     3: optional string userName,
-     4: optional i64 createdTime,
-     5: optional i64 updatedTime
- }
-
-enum GroupType {
-    SINGLE_USER,
-    MULTI_USER
-}
-
- struct UserGroup {
-     1: optional string groupId = DO_NOT_SET_AT_CLIENTS_ID,
-     2: optional string domainId,
-     3: optional string name,
-     6: optional string description,
-     7: optional string ownerId,
-     8: optional i64 createdTime,
-     9: optional i64 updatedTime,
-     10: optional GroupType groupType
- }
-
- enum GroupChildType {
-    USER,
-    GROUP
- }
-
- struct GroupMembership {
-    1: optional string parentId,
-    2: optional string childId,
-    3: optional GroupChildType childType
-    4: optional i64 createdTime,
-    5: optional i64 updatedTime
- }
-
-
-
-struct EntityType {
-    1: optional string entityTypeId = DO_NOT_SET_AT_CLIENTS_ID,
-    2: optional string domainId,
-    3: optional string name,
-    4: optional string description,
-    5: optional i64 createdTime,
-    6: optional i64 updatedTime
-}
-
-enum EntitySearchFields {
-    NAME,
-    DESCRIPTION,
-    FULL_TEXT
-}
-
-
-struct Entity {
-    1: optional string entityId = DO_NOT_SET_AT_CLIENTS_ID,
-    2: optional string domainId,
-    3: optional string entityTypeId,
-    4: optional string ownerId,
-    5: optional string parentEntityId,
-    6: optional string name,
-    7: optional string description,
-    8: optional map<string,string> metadata,
-    9: optional string fullText,
-    10: optional i64 createdTime,
-    11: optional i64 updatedTime
-}
-
-struct PermissionType {
-    1: optional string permissionTypeId = DO_NOT_SET_AT_CLIENTS_ID,
-    2: optional string domainId,
-    3: optional string name,
-    4: optional string description,
-    5: optional i64 createdTime,
-    6: optional i64 updatedTime
-}
-
-enum SharingType {
-    DIRECT,
-    INHERITED
- }
-
-struct Sharing {
-    1: optional string permissionTypeId,
-    2: optional string entityId,
-    3: optional string groupId,
-    4: optional GroupType groupType,
-    5: optional SharingType sharingType,
-    6: optional string inheritedParentId,
-    7: optional i64 createdTime,
-    8: optional i64 updatedTime
-}
-
-exception GovRegistryException {
-  1: required string message
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/thrift_models/thrift-gen.sh
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/thrift_models/thrift-gen.sh b/modules/airavata-sharing-registry/thrift_models/thrift-gen.sh
deleted file mode 100755
index 295be80..0000000
--- a/modules/airavata-sharing-registry/thrift_models/thrift-gen.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env bash
-
-thrift --gen java sharing_models.thrift
-cd gen-java
-rm -r ../../airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/*
-cp -r org/apache/airavata/sharing/registry/models/ ../../airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/
-
-cd ..
-thrift --gen java sharing_cpi.thrift
-cd gen-java
-rm -r ../../airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/service/cpi/*
-cp -r org/apache/airavata/sharing/registry/service/cpi/ ../../airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/service/cpi/
-
-cd ..
-
-rm -r gen-java
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/README.md
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/README.md b/modules/sharing-registry/README.md
new file mode 100644
index 0000000..299e7b4
--- /dev/null
+++ b/modules/sharing-registry/README.md
@@ -0,0 +1,3 @@
+## Airavata Governance Registry
+
+* This module implements a generic service for access controlling to resources and to provide group based resource sharing
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/pom.xml
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/pom.xml b/modules/sharing-registry/pom.xml
new file mode 100644
index 0000000..78b65cc
--- /dev/null
+++ b/modules/sharing-registry/pom.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <artifactId>airavata</artifactId>
+        <groupId>org.apache.airavata</groupId>
+        <relativePath>../pom.xml</relativePath>
+        <version>0.17-SNAPSHOT</version>
+    </parent>
+
+    <groupId>org.apache.airavata</groupId>
+    <artifactId>airavata-sharing-registry</artifactId>
+    <packaging>pom</packaging>
+    <version>${global.version}</version>
+
+    <properties>
+        <global.version>0.17-SNAPSHOT</global.version>
+    </properties>
+
+    <modules>
+        <module>airavata-sharing-registry-stubs</module>
+        <module>airavata-sharing-registry-core</module>
+        <module>airavata-sharing-data-migrator</module>
+    </modules>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-data-migrator/pom.xml
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-data-migrator/pom.xml b/modules/sharing-registry/sharing-data-migrator/pom.xml
new file mode 100644
index 0000000..472b0a2
--- /dev/null
+++ b/modules/sharing-registry/sharing-data-migrator/pom.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>airavata-sharing-registry</artifactId>
+        <groupId>org.apache.airavata</groupId>
+        <version>${global.version}</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>airavata-sharing-data-migrator</artifactId>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-sharing-registry-core</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-data-migrator/src/main/java/org/apache/airavata/sharing/registry/ConnectionFactory.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-data-migrator/src/main/java/org/apache/airavata/sharing/registry/ConnectionFactory.java b/modules/sharing-registry/sharing-data-migrator/src/main/java/org/apache/airavata/sharing/registry/ConnectionFactory.java
new file mode 100644
index 0000000..d501b96
--- /dev/null
+++ b/modules/sharing-registry/sharing-data-migrator/src/main/java/org/apache/airavata/sharing/registry/ConnectionFactory.java
@@ -0,0 +1,59 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.sharing.registry;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+
+public class ConnectionFactory {
+    private final static Logger logger = LoggerFactory.getLogger(ConnectionFactory.class);
+
+    //static reference to itself
+    private static ConnectionFactory instance;
+
+    public static final String EXPCAT_URL = "jdbc:mysql://localhost/airavata_exp_catalog";
+    public static final String EXPCAT_USER = "root";
+    public static final String EXPCAT_PASSWORD = "";
+    public static final String DRIVER_CLASS = "com.mysql.jdbc.Driver";
+
+    private static Connection expCatConnection, sharingCatConnection;
+
+    //private constructor
+    private ConnectionFactory() throws ClassNotFoundException, SQLException {
+        Class.forName(DRIVER_CLASS);
+        expCatConnection = DriverManager.getConnection(EXPCAT_URL, EXPCAT_USER, EXPCAT_PASSWORD);
+    }
+
+    public static ConnectionFactory getInstance() throws SQLException, ClassNotFoundException {
+        if(instance == null)
+            instance = new ConnectionFactory();
+        return instance;
+    }
+
+    public Connection getExpCatConnection() throws SQLException {
+        return expCatConnection;
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-data-migrator/src/main/java/org/apache/airavata/sharing/registry/DataMigrator.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-data-migrator/src/main/java/org/apache/airavata/sharing/registry/DataMigrator.java b/modules/sharing-registry/sharing-data-migrator/src/main/java/org/apache/airavata/sharing/registry/DataMigrator.java
new file mode 100644
index 0000000..5e747dc
--- /dev/null
+++ b/modules/sharing-registry/sharing-data-migrator/src/main/java/org/apache/airavata/sharing/registry/DataMigrator.java
@@ -0,0 +1,165 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.sharing.registry;
+
+import org.apache.airavata.sharing.registry.models.*;
+import org.apache.airavata.sharing.registry.server.SharingRegistryServerHandler;
+import org.apache.thrift.TException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.HashMap;
+import java.util.Map;
+
+public class DataMigrator {
+    private final static Logger logger = LoggerFactory.getLogger(DataMigrator.class);
+
+    public static void main(String[] args) throws SQLException, ClassNotFoundException, TException {
+        Connection expCatConnection = ConnectionFactory.getInstance().getExpCatConnection();
+
+        SharingRegistryServerHandler govRegistryServerHandler = new SharingRegistryServerHandler();
+
+        String query = "SELECT * FROM GATEWAY";
+        Statement statement = expCatConnection.createStatement();
+        ResultSet rs = statement.executeQuery(query);
+
+        while (rs.next()) {
+            //Creating domain entries
+            Domain domain = new Domain();
+            domain.setDomainId(rs.getString("GATEWAY_ID"));
+            if(rs.getString("GATEWAY_NAME") != null)
+                domain.setName(rs.getString("GATEWAY_NAME"));
+            else
+                domain.setName(rs.getString("GATEWAY_ID"));
+            domain.setDescription("Domain entry for " + domain.name);
+
+            govRegistryServerHandler.createDomain(domain);
+
+            //Creating Entity Types for each domain
+            EntityType entityType = new EntityType();
+            entityType.setEntityTypeId(domain.domainId+":PROJECT");
+            entityType.setDomainId(domain.domainId);
+            entityType.setName("PROJECT");
+            entityType.setDescription("Project entity type");
+            govRegistryServerHandler.createEntityType(entityType);
+
+            entityType = new EntityType();
+            entityType.setEntityTypeId(domain.domainId+":EXPERIMENT");
+            entityType.setDomainId(domain.domainId);
+            entityType.setName("EXPERIMENT");
+            entityType.setDescription("Experiment entity type");
+            govRegistryServerHandler.createEntityType(entityType);
+
+            entityType = new EntityType();
+            entityType.setEntityTypeId(domain.domainId+":FILE");
+            entityType.setDomainId(domain.domainId);
+            entityType.setName("FILE");
+            entityType.setDescription("File entity type");
+            govRegistryServerHandler.createEntityType(entityType);
+
+            //Creating Permission Types for each domain
+            PermissionType permissionType = new PermissionType();
+            permissionType.setPermissionTypeId(domain.domainId+":READ");
+            permissionType.setDomainId(domain.domainId);
+            permissionType.setName("READ");
+            permissionType.setDescription("Read permission type");
+            govRegistryServerHandler.createPermissionType(permissionType);
+
+            permissionType = new PermissionType();
+            permissionType.setPermissionTypeId(domain.domainId+":WRITE");
+            permissionType.setDomainId(domain.domainId);
+            permissionType.setName("WRITE");
+            permissionType.setDescription("Write permission type");
+            govRegistryServerHandler.createPermissionType(permissionType);
+        }
+
+        //Creating user entries
+        query = "SELECT * FROM USERS";
+        statement = expCatConnection.createStatement();
+        rs = statement.executeQuery(query);
+        while(rs.next()){
+            User user = new User();
+            user.setUserId(rs.getString("AIRAVATA_INTERNAL_USER_ID"));
+            user.setDomainId(rs.getString("GATEWAY_ID"));
+            user.setUserName(rs.getString("USER_NAME"));
+
+            govRegistryServerHandler.createUser(user);
+        }
+
+        //Creating project entries
+        query = "SELECT * FROM PROJECT";
+        statement = expCatConnection.createStatement();
+        rs = statement.executeQuery(query);
+        while(rs.next()){
+            Entity entity = new Entity();
+            entity.setEntityId(rs.getString("PROJECT_ID"));
+            entity.setDomainId(rs.getString("GATEWAY_ID"));
+            entity.setEntityTypeId(rs.getString("GATEWAY_ID") + ":PROJECT");
+            entity.setOwnerId(rs.getString("USER_NAME") + "@" + rs.getString("GATEWAY_ID"));
+            entity.setName(rs.getString("PROJECT_NAME"));
+            entity.setDescription(rs.getString("DESCRIPTION"));
+            if(entity.getDescription() == null)
+                entity.setFullText(entity.getName());
+            else
+                entity.setFullText(entity.getName() + " " + entity.getDescription());
+            Map<String, String> metadata = new HashMap<>();
+            metadata.put("CREATION_TIME", rs.getDate("CREATION_TIME").toString());
+
+            govRegistryServerHandler.createEntity(entity);
+        }
+
+        //Creating experiment entries
+        query = "SELECT * FROM EXPERIMENT";
+        statement = expCatConnection.createStatement();
+        rs = statement.executeQuery(query);
+        while(rs.next()){
+            Entity entity = new Entity();
+            entity.setEntityId(rs.getString("EXPERIMENT_ID"));
+            entity.setDomainId(rs.getString("GATEWAY_ID"));
+            entity.setEntityTypeId(rs.getString("GATEWAY_ID") + ":EXPERIMENT");
+            entity.setOwnerId(rs.getString("USER_NAME") + "@" + rs.getString("GATEWAY_ID"));
+            entity.setParentEntityId(rs.getString("PROJECT_ID"));
+            entity.setName(rs.getString("EXPERIMENT_NAME"));
+            entity.setDescription(rs.getString("DESCRIPTION"));
+            if(entity.getDescription() == null)
+                entity.setFullText(entity.getName());
+            else
+                entity.setFullText(entity.getName() + " " + entity.getDescription());
+            Map<String, String> metadata = new HashMap<>();
+            metadata.put("CREATION_TIME", rs.getDate("CREATION_TIME").toString());
+            metadata.put("EXPERIMENT_TYPE", rs.getString("EXPERIMENT_TYPE"));
+            metadata.put("EXECUTION_ID", rs.getString("EXECUTION_ID"));
+            metadata.put("GATEWAY_EXECUTION_ID", rs.getString("GATEWAY_EXECUTION_ID"));
+            metadata.put("ENABLE_EMAIL_NOTIFICATION", rs.getString("ENABLE_EMAIL_NOTIFICATION"));
+            metadata.put("EMAIL_ADDRESSES", rs.getString("EMAIL_ADDRESSES"));
+            metadata.put("GATEWAY_INSTANCE_ID", rs.getString("GATEWAY_INSTANCE_ID"));
+            metadata.put("ARCHIVE", rs.getString("ARCHIVE"));
+
+            govRegistryServerHandler.createEntity(entity);
+        }
+
+        expCatConnection.close();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-core/pom.xml b/modules/sharing-registry/sharing-registry-core/pom.xml
new file mode 100644
index 0000000..f43f77c
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-core/pom.xml
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>airavata-sharing-registry</artifactId>
+        <groupId>org.apache.airavata</groupId>
+        <relativePath>../pom.xml</relativePath>
+        <version>${global.version}</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>airavata-sharing-registry-core</artifactId>
+    <dependencies>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <version>1.7.10</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.thrift</groupId>
+            <artifactId>libthrift</artifactId>
+            <version>0.9.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-sharing-registry-stubs</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-commons</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>net.sf.dozer</groupId>
+            <artifactId>dozer</artifactId>
+            <version>5.4.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.openjpa</groupId>
+            <artifactId>openjpa-all</artifactId>
+            <version>2.2.0</version>
+        </dependency>
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <version>5.1.34</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.5.1</version>
+                <configuration>
+                    <source>1.8</source>
+                    <target>1.8</target>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.openjpa</groupId>
+                <artifactId>openjpa-maven-plugin</artifactId>
+                <version>2.2.0</version>
+                <configuration>
+                    <includes>**/entities/*.class</includes>
+                    <excludes>**/entities/XML*.class</excludes>
+                    <addDefaultConstructor>true</addDefaultConstructor>
+                    <enforcePropertyRestrictions>true</enforcePropertyRestrictions>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>enhancer</id>
+                        <phase>process-classes</phase>
+                        <goals>
+                            <goal>enhance</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <dependencies>
+                    <dependency>
+                        <groupId>org.apache.openjpa</groupId>
+                        <artifactId>openjpa</artifactId>
+                        <version>2.2.0</version>
+                    </dependency>
+                </dependencies>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/DomainEntity.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/DomainEntity.java b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/DomainEntity.java
new file mode 100644
index 0000000..48b5314
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/DomainEntity.java
@@ -0,0 +1,113 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.sharing.registry.db.entities;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.*;
+
+@Entity
+@Table(name = "DOMAIN", schema = "" )
+public class DomainEntity {
+    private final static Logger logger = LoggerFactory.getLogger(DomainEntity.class);
+    private String domainId;
+    private String name;
+    private String description;
+    private Long createdTime;
+    private Long updatedTime;
+
+    @Id
+    @Column(name = "DOMAIN_ID")
+    public String getDomainId() {
+        return domainId;
+    }
+
+    public void setDomainId(String domainId) {
+        this.domainId = domainId;
+    }
+
+    @Basic
+    @Column(name = "NAME")
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    @Basic
+    @Column(name = "DESCRIPTION")
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    @Basic
+    @Column(name = "CREATED_TIME")
+    public Long getCreatedTime() {
+        return createdTime;
+    }
+
+    public void setCreatedTime(Long createdTime) {
+        this.createdTime = createdTime;
+    }
+
+    @Basic
+    @Column(name = "UPDATED_TIME")
+    public Long getUpdatedTime() {
+        return updatedTime;
+    }
+
+    public void setUpdatedTime(Long updatedTime) {
+        this.updatedTime = updatedTime;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        DomainEntity that = (DomainEntity) o;
+
+        if (domainId != null ? !domainId.equals(that.domainId) : that.domainId != null) return false;
+        if (name != null ? !name.equals(that.name) : that.name != null) return false;
+        if (description != null ? !description.equals(that.description) : that.description != 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;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = domainId != null ? domainId.hashCode() : 0;
+        result = 31 * result + (name != null ? name.hashCode() : 0);
+        result = 31 * result + (description != null ? description.hashCode() : 0);
+        result = 31 * result + (createdTime != null ? createdTime.hashCode() : 0);
+        result = 31 * result + (updatedTime != null ? updatedTime.hashCode() : 0);
+        return result;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/EntityEntity.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/EntityEntity.java b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/EntityEntity.java
new file mode 100644
index 0000000..de8abf4
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/EntityEntity.java
@@ -0,0 +1,192 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.sharing.registry.db.entities;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.*;
+import java.util.Map;
+
+@Entity
+@Table(name = "ENTITY", schema = "")
+public class EntityEntity {
+    private final static Logger logger = LoggerFactory.getLogger(EntityEntity.class);
+    private String entityId;
+    private String domainId;
+    private String entityTypeId;
+    private String ownerId;
+    private String parentEntityId;
+    private String name;
+    private String description;
+    private Map<String, String> metadata;
+    private String fullText;
+    private Long createdTime;
+    private Long updatedTime;
+
+    @Id
+    @Column(name = "ENTITY_ID")
+    public String getEntityId() {
+        return entityId;
+    }
+
+    public void setEntityId(String entityId) {
+        this.entityId = entityId;
+    }
+
+    @Basic
+    @Column(name = "DOMAIN_ID")
+    public String getDomainId() {
+        return domainId;
+    }
+
+    public void setDomainId(String domainId) {
+        this.domainId = domainId;
+    }
+
+    @Basic
+    @Column(name = "ENTITY_TYPE_ID")
+    public String getEntityTypeId() {
+        return entityTypeId;
+    }
+
+    public void setEntityTypeId(String entityTypeId) {
+        this.entityTypeId = entityTypeId;
+    }
+
+    @Basic
+    @Column(name = "OWNER_ID")
+    public String getOwnerId() {
+        return ownerId;
+    }
+
+    public void setOwnerId(String ownerId) {
+        this.ownerId = ownerId;
+    }
+
+    @Basic
+    @Column(name = "PARENT_ENTITY_ID")
+    public String getParentEntityId() {
+        return parentEntityId;
+    }
+
+    public void setParentEntityId(String parentEntityId) {
+        this.parentEntityId = parentEntityId;
+    }
+
+    @Basic
+    @Column(name = "NAME")
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    @Basic
+    @Column(name = "DESCRIPTION")
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    @ElementCollection
+    @CollectionTable(
+            name="ENTITY_METADATA",
+            joinColumns=@JoinColumn(name="ENTITY_ID")
+    )
+    @MapKeyColumn(name="META_KEY")
+    @Column(name="META_VALUE")
+    public Map<String, String> getMetadata() {
+        return metadata;
+    }
+
+    public void setMetadata(Map<String, String> metadata) {
+        this.metadata = metadata;
+    }
+
+    @Lob
+    @Column(name = "FULL_TEXT")
+    public String getFullText() {
+        return fullText;
+    }
+
+    public void setFullText(String fullText) {
+        this.fullText = fullText;
+    }
+
+    @Basic
+    @Column(name = "CREATED_TIME")
+    public Long getCreatedTime() {
+        return createdTime;
+    }
+
+    public void setCreatedTime(Long createdTime) {
+        this.createdTime = createdTime;
+    }
+
+    @Basic
+    @Column(name = "UPDATED_TIME")
+    public Long getUpdatedTime() {
+        return updatedTime;
+    }
+
+    public void setUpdatedTime(Long updatedTime) {
+        this.updatedTime = updatedTime;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        EntityEntity that = (EntityEntity) o;
+
+        if (entityId != null ? !entityId.equals(that.entityId) : that.entityId != null) return false;
+        if (domainId != null ? !domainId.equals(that.domainId) : that.domainId != null) return false;
+        if (parentEntityId != null ? !parentEntityId.equals(that.parentEntityId) : that.parentEntityId != null) return false;
+        if (name != null ? !name.equals(that.name) : that.name != null) return false;
+        if (description != null ? !description.equals(that.description) : that.description != null) return false;
+        if (metadata.equals(that.metadata)) return false;
+        if (fullText != null ? !fullText.equals(that.fullText) : that.fullText != 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;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = entityId != null ? entityId.hashCode() : 0;
+        result = 31 * result + (name != null ? name.hashCode() : 0);
+        result = 31 * result + (description != null ? description.hashCode() : 0);
+        result = 31 * result + (metadata != null ? metadata.hashCode() : 0);
+        result = 31 * result + (fullText != null ? fullText.hashCode() : 0);
+        result = 31 * result + (createdTime != null ? createdTime.hashCode() : 0);
+        result = 31 * result + (updatedTime != null ? updatedTime.hashCode() : 0);
+        return result;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/EntityTypeEntity.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/EntityTypeEntity.java b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/EntityTypeEntity.java
new file mode 100644
index 0000000..0b789ed
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/EntityTypeEntity.java
@@ -0,0 +1,125 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.sharing.registry.db.entities;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.*;
+
+@Entity
+@Table(name = "ENTITY_TYPE", schema = "")
+public class EntityTypeEntity {
+    private final static Logger logger = LoggerFactory.getLogger(EntityTypeEntity.class);
+    private String entityTypeId;
+    private String domainId;
+    private String name;
+    private String description;
+    private Long createdTime;
+    private Long updatedTime;
+
+    @Id
+    @Column(name = "ENTITY_TYPE_ID")
+    public String getEntityTypeId() {
+        return entityTypeId;
+    }
+
+    public void setEntityTypeId(String entityTypeId) {
+        this.entityTypeId = entityTypeId;
+    }
+
+    @Basic
+    @Column(name = "DOMAIN_ID")
+    public String getDomainId() {
+        return domainId;
+    }
+
+    public void setDomainId(String domainId) {
+        this.domainId = domainId;
+    }
+
+    @Basic
+    @Column(name = "NAME")
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    @Basic
+    @Column(name = "DESCRIPTION")
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    @Basic
+    @Column(name = "CREATED_TIME")
+    public Long getCreatedTime() {
+        return createdTime;
+    }
+
+    public void setCreatedTime(Long createdTime) {
+        this.createdTime = createdTime;
+    }
+
+    @Basic
+    @Column(name = "UPDATED_TIME")
+    public Long getUpdatedTime() {
+        return updatedTime;
+    }
+
+    public void setUpdatedTime(Long updatedTime) {
+        this.updatedTime = updatedTime;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        EntityTypeEntity that = (EntityTypeEntity) o;
+
+        if (entityTypeId != null ? !entityTypeId.equals(that.entityTypeId) : that.entityTypeId != null) return false;
+        if (domainId != null ? !domainId.equals(that.domainId) : that.domainId != null) return false;
+        if (name != null ? !name.equals(that.name) : that.name != null) return false;
+        if (description != null ? !description.equals(that.description) : that.description != 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;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = entityTypeId != null ? entityTypeId.hashCode() : 0;
+        result = 31 * result + (name != null ? name.hashCode() : 0);
+        result = 31 * result + (description != null ? description.hashCode() : 0);
+        result = 31 * result + (createdTime != null ? createdTime.hashCode() : 0);
+        result = 31 * result + (updatedTime != null ? updatedTime.hashCode() : 0);
+        return result;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/GroupMembershipEntity.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/GroupMembershipEntity.java b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/GroupMembershipEntity.java
new file mode 100644
index 0000000..c62a52d
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/GroupMembershipEntity.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.sharing.registry.db.entities;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.*;
+
+@Entity
+@Table(name = "GROUP_MEMBERSHIP", schema = "")
+@IdClass(GroupMembershipEntityPK.class)
+public class GroupMembershipEntity {
+    private final static Logger logger = LoggerFactory.getLogger(GroupMembershipEntity.class);
+    private String parentId;
+    private String childId;
+    private String childType;
+    private Long createdTime;
+    private Long updatedTime;
+
+    @Id
+    @Column(name = "PARENT_ID")
+    public String getParentId() {
+        return parentId;
+    }
+
+    public void setParentId(String parentId) {
+        this.parentId = parentId;
+    }
+
+    @Id
+    @Column(name = "CHILD_ID")
+    public String getChildId() {
+        return childId;
+    }
+
+    public void setChildId(String childId) {
+        this.childId = childId;
+    }
+
+    @Basic
+    @Column(name = "CHILD_TYPE")
+    public String getChildType() {
+        return childType;
+    }
+
+    public void setChildType(String childType) {
+        this.childType = childType;
+    }
+
+    @Basic
+    @Column(name = "CREATED_TIME")
+    public Long getCreatedTime() {
+        return createdTime;
+    }
+
+    public void setCreatedTime(Long createdTime) {
+        this.createdTime = createdTime;
+    }
+
+    @Basic
+    @Column(name = "UPDATED_TIME")
+    public Long getUpdatedTime() {
+        return updatedTime;
+    }
+
+    public void setUpdatedTime(Long updatedTime) {
+        this.updatedTime = updatedTime;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        GroupMembershipEntity that = (GroupMembershipEntity) o;
+
+        if (parentId != null ? !parentId.equals(that.parentId) : that.parentId != null) return false;
+        if (childId != null ? !childId.equals(that.childId) : that.childId != null) return false;
+        if (childType != null ? !childType.equals(that.childType) : that.childType != 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;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = parentId != null ? parentId.hashCode() : 0;
+        result = 31 * result + (childId != null ? childId.hashCode() : 0);
+        result = 31 * result + (childType != null ? childType.hashCode() : 0);
+        return result;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/GroupMembershipEntityPK.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/GroupMembershipEntityPK.java b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/GroupMembershipEntityPK.java
new file mode 100644
index 0000000..be3b1f9
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/GroupMembershipEntityPK.java
@@ -0,0 +1,74 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.sharing.registry.db.entities;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.Column;
+import javax.persistence.Id;
+import java.io.Serializable;
+
+public class GroupMembershipEntityPK implements Serializable {
+    private final static Logger logger = LoggerFactory.getLogger(GroupMembershipEntityPK.class);
+    private String parentId;
+    private String childId;
+
+    @Column(name = "PARENT_ID")
+    @Id
+    public String getParentId() {
+        return parentId;
+    }
+
+    public void setParentId(String parentId) {
+        this.parentId = parentId;
+    }
+
+    @Column(name = "CHILD_ID")
+    @Id
+    public String getChildId() {
+        return childId;
+    }
+
+    public void setChildId(String childId) {
+        this.childId = childId;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        GroupMembershipEntityPK that = (GroupMembershipEntityPK) o;
+
+        if (parentId != null ? !parentId.equals(that.parentId) : that.parentId != null) return false;
+        if (childId != null ? !childId.equals(that.childId) : that.childId != null) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = parentId != null ? parentId.hashCode() : 0;
+        result = 31 * result + (childId != null ? childId.hashCode() : 0);
+        return result;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/PermissionTypeEntity.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/PermissionTypeEntity.java b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/PermissionTypeEntity.java
new file mode 100644
index 0000000..c145cbe
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/PermissionTypeEntity.java
@@ -0,0 +1,125 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.sharing.registry.db.entities;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.*;
+
+@Entity
+@Table(name = "PERMISSION_TYPE", schema = "")
+public class PermissionTypeEntity {
+    private final static Logger logger = LoggerFactory.getLogger(PermissionTypeEntity.class);
+    private String permissionTypeId;
+    private String domainId;
+    private String name;
+    private String description;
+    private Long createdTime;
+    private Long updatedTime;
+
+    @Id
+    @Column(name = "PERMISSION_TYPE_ID")
+    public String getPermissionTypeId() {
+        return permissionTypeId;
+    }
+
+    public void setPermissionTypeId(String permissionTypeId) {
+        this.permissionTypeId = permissionTypeId;
+    }
+
+    @Basic
+    @Column(name = "DOMAIN_ID")
+    public String getDomainId() {
+        return domainId;
+    }
+
+    public void setDomainId(String domainId) {
+        this.domainId = domainId;
+    }
+
+    @Basic
+    @Column(name = "NAME")
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+
+    @Basic
+    @Column(name = "DESCRIPTION")
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    @Basic
+    @Column(name = "CREATED_TIME")
+    public Long getCreatedTime() {
+        return createdTime;
+    }
+
+    public void setCreatedTime(Long createdTime) {
+        this.createdTime = createdTime;
+    }
+
+    @Basic
+    @Column(name = "UPDATED_TIME")
+    public Long getUpdatedTime() {
+        return updatedTime;
+    }
+
+    public void setUpdatedTime(Long updatedTime) {
+        this.updatedTime = updatedTime;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        PermissionTypeEntity that = (PermissionTypeEntity) o;
+
+        if (permissionTypeId != null ? !permissionTypeId.equals(that.permissionTypeId) : that.permissionTypeId != null)
+            return false;
+        if (domainId != null ? !domainId.equals(that.domainId) : that.domainId != null) return false;
+        if (name != null ? !name.equals(that.name) : that.name != 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;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = permissionTypeId != null ? permissionTypeId.hashCode() : 0;
+        result = 31 * result + (name != null ? name.hashCode() : 0);
+        result = 31 * result + (createdTime != null ? createdTime.hashCode() : 0);
+        result = 31 * result + (updatedTime != null ? updatedTime.hashCode() : 0);
+        return result;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/SharingEntity.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/SharingEntity.java b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/SharingEntity.java
new file mode 100644
index 0000000..077d7cf
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/SharingEntity.java
@@ -0,0 +1,146 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.sharing.registry.db.entities;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.*;
+
+@Entity
+@Table(name = "SHARING", schema = "")
+@IdClass(SharingEntityPK.class)
+public class SharingEntity {
+    private final static Logger logger = LoggerFactory.getLogger(SharingEntity.class);
+    private String permissionTypeId;
+    private String entityId;
+    private String groupId;
+    private String groupType;
+    private String sharingType;
+    private String inheritedParentId;
+    private Long createdTime;
+    private Long updatedTime;
+
+    @Id
+    @Column(name = "PERMISSION_TYPE_ID")
+    public String getPermissionTypeId() {
+        return permissionTypeId;
+    }
+
+    public void setPermissionTypeId(String permissionTypeId) {
+        this.permissionTypeId = permissionTypeId;
+    }
+
+    @Id
+    @Column(name = "ENTITY_ID")
+    public String getEntityId() {
+        return entityId;
+    }
+
+    public void setEntityId(String entityId) {
+        this.entityId = entityId;
+    }
+
+    @Id
+    @Column(name = "GROUP_ID")
+    public String getGroupId() {
+        return groupId;
+    }
+
+    public void setGroupId(String groupId) {
+        this.groupId = groupId;
+    }
+
+    @Basic
+    @Column(name = "GROUP_TYPE")
+    public String getGroupType() {
+        return groupType;
+    }
+
+    public void setGroupType(String groupType) {
+        this.groupType = groupType;
+    }
+
+    @Basic
+    @Column(name = "SHARING_TYPE")
+    public String getSharingType() {
+        return sharingType;
+    }
+
+    public void setSharingType(String sharingType) {
+        this.sharingType = sharingType;
+    }
+
+    @Basic
+    @Column(name = "INHERITED_PARENT_ID")
+    public String getInheritedParentId() {
+        return inheritedParentId;
+    }
+
+    public void setInheritedParentId(String inheritedParentId) {
+        this.inheritedParentId = inheritedParentId;
+    }
+
+    @Basic
+    @Column(name = "CREATED_TIME")
+    public Long getCreatedTime() {
+        return createdTime;
+    }
+
+    public void setCreatedTime(Long createdTime) {
+        this.createdTime = createdTime;
+    }
+
+    @Basic
+    @Column(name = "UPDATED_TIME")
+    public Long getUpdatedTime() {
+        return updatedTime;
+    }
+
+    public void setUpdatedTime(Long updatedTime) {
+        this.updatedTime = updatedTime;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        SharingEntity that = (SharingEntity) o;
+
+        if (permissionTypeId != null ? !permissionTypeId.equals(that.permissionTypeId) : that.permissionTypeId != null)
+            return false;
+        if (entityId != null ? !entityId.equals(that.entityId) : that.entityId != null) return false;
+        if (groupId != null ? !groupId.equals(that.groupId) : that.groupId != 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;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = permissionTypeId != null ? permissionTypeId.hashCode() : 0;
+        result = 31 * result + (entityId != null ? entityId.hashCode() : 0);
+        result = 31 * result + (groupId != null ? groupId.hashCode() : 0);
+        return result;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/SharingEntityPK.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/SharingEntityPK.java b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/SharingEntityPK.java
new file mode 100644
index 0000000..fe6ebaf
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/SharingEntityPK.java
@@ -0,0 +1,113 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.sharing.registry.db.entities;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.Basic;
+import javax.persistence.Column;
+import javax.persistence.Id;
+import java.io.Serializable;
+
+public class SharingEntityPK implements Serializable {
+    private final static Logger logger = LoggerFactory.getLogger(SharingEntityPK.class);
+    private String permissionTypeId;
+    private String entityId;
+    private String groupId;
+    private Long createdTime;
+    private Long updatedTime;
+
+    @Column(name = "PERMISSION_TYPE_ID")
+    @Id
+    public String getPermissionTypeId() {
+        return permissionTypeId;
+    }
+
+    public void setPermissionTypeId(String permissionTypeId) {
+        this.permissionTypeId = permissionTypeId;
+    }
+
+    @Column(name = "ENTITY_ID")
+    @Id
+    public String getEntityId() {
+        return entityId;
+    }
+
+    public void setEntityId(String entityId) {
+        this.entityId = entityId;
+    }
+
+    @Column(name = "GROUP_ID")
+    @Id
+    public String getGroupId() {
+        return groupId;
+    }
+
+    public void setGroupId(String groupId) {
+        this.groupId = groupId;
+    }
+
+    @Basic
+    @Column(name = "CREATED_TIME")
+    public Long getCreatedTime() {
+        return createdTime;
+    }
+
+    public void setCreatedTime(Long createdTime) {
+        this.createdTime = createdTime;
+    }
+
+    @Basic
+    @Column(name = "UPDATED_TIME")
+    public Long getUpdatedTime() {
+        return updatedTime;
+    }
+
+    public void setUpdatedTime(Long updatedTime) {
+        this.updatedTime = updatedTime;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        SharingEntityPK that = (SharingEntityPK) o;
+
+        if (permissionTypeId != null ? !permissionTypeId.equals(that.permissionTypeId) : that.permissionTypeId != null)
+            return false;
+        if (entityId != null ? !entityId.equals(that.entityId) : that.entityId != null) return false;
+        if (groupId != null ? !groupId.equals(that.groupId) : that.groupId != 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;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = permissionTypeId != null ? permissionTypeId.hashCode() : 0;
+        result = 31 * result + (entityId != null ? entityId.hashCode() : 0);
+        result = 31 * result + (groupId != null ? groupId.hashCode() : 0);
+        return result;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/UserEntity.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/UserEntity.java b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/UserEntity.java
new file mode 100644
index 0000000..256d2e7
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/UserEntity.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.sharing.registry.db.entities;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.*;
+
+@Entity
+@Table(name = "USER", schema = "")
+public class UserEntity {
+    private final static Logger logger = LoggerFactory.getLogger(UserEntity.class);
+    private String userId;
+    private String domainId;
+    private String userName;
+    private Long createdTime;
+    private Long updatedTime;
+
+    @Id
+    @Column(name = "USER_ID")
+    public String getUserId() {
+        return userId;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
+
+    @Basic
+    @Column(name = "DOMAIN_ID")
+    public String getDomainId() {
+        return domainId;
+    }
+
+    public void setDomainId(String domainId) {
+        this.domainId = domainId;
+    }
+
+    @Basic
+    @Column(name = "USER_NAME")
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    @Basic
+    @Column(name = "CREATED_TIME")
+    public Long getCreatedTime() {
+        return createdTime;
+    }
+
+    public void setCreatedTime(Long createdTime) {
+        this.createdTime = createdTime;
+    }
+
+    @Basic
+    @Column(name = "UPDATED_TIME")
+    public Long getUpdatedTime() {
+        return updatedTime;
+    }
+
+    public void setUpdatedTime(Long updatedTime) {
+        this.updatedTime = updatedTime;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        UserEntity that = (UserEntity) o;
+
+        if (userId != null ? !userId.equals(that.userId) : that.userId != null) return false;
+        if (domainId != null ? !domainId.equals(that.domainId) : that.domainId != null) return false;
+        if (userName != null ? !userName.equals(that.userName) : that.userName != 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;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = userId != null ? userId.hashCode() : 0;
+        result = 31 * result + (userName != null ? userName.hashCode() : 0);
+        result = 31 * result + (createdTime != null ? createdTime.hashCode() : 0);
+        result = 31 * result + (updatedTime != null ? updatedTime.hashCode() : 0);
+        return result;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/UserGroupEntity.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/UserGroupEntity.java b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/UserGroupEntity.java
new file mode 100644
index 0000000..10d901a
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/UserGroupEntity.java
@@ -0,0 +1,150 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.sharing.registry.db.entities;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.*;
+
+@Entity
+@Table(name = "USER_GROUP", schema = "")
+public class UserGroupEntity {
+    private final static Logger logger = LoggerFactory.getLogger(UserGroupEntity.class);
+    private String groupId;
+    private String domainId;
+    private String name;
+    private String description;
+    private String ownerId;
+    private String groupType;
+    private Long createdTime;
+    private Long updatedTime;
+
+    @Id
+    @Column(name = "GROUP_ID")
+    public String getGroupId() {
+        return groupId;
+    }
+
+    public void setGroupId(String groupId) {
+        this.groupId = groupId;
+    }
+
+    @Basic
+    @Column(name = "DOMAIN_ID")
+    public String getDomainId() {
+        return domainId;
+    }
+
+    public void setDomainId(String domainId) {
+        this.domainId = domainId;
+    }
+
+    @Basic
+    @Column(name = "OWNER_ID")
+    public String getOwnerId() {
+        return ownerId;
+    }
+
+    public void setOwnerId(String ownerId) {
+        this.ownerId = ownerId;
+    }
+
+    @Basic
+    @Column(name = "NAME")
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    @Basic
+    @Column(name = "DESCRIPTION")
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    @Basic
+    @Column(name = "GROUP_TYPE")
+    public String getGroupType() {
+        return groupType;
+    }
+
+    public void setGroupType(String type) {
+        this.groupType = type;
+    }
+
+    @Basic
+    @Column(name = "CREATED_TIME")
+    public Long getCreatedTime() {
+        return createdTime;
+    }
+
+    public void setCreatedTime(Long createdTime) {
+        this.createdTime = createdTime;
+    }
+
+    @Basic
+    @Column(name = "UPDATED_TIME")
+    public Long getUpdatedTime() {
+        return updatedTime;
+    }
+
+    public void setUpdatedTime(Long updatedTime) {
+        this.updatedTime = updatedTime;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        UserGroupEntity that = (UserGroupEntity) o;
+
+        if (groupId != null ? !groupId.equals(that.groupId) : that.groupId != null) return false;
+        if (domainId != null ? !domainId.equals(that.domainId) : that.domainId != null) return false;
+        if (ownerId != null ? !ownerId.equals(that.ownerId) : that.ownerId != null) return false;
+        if (name != null ? !name.equals(that.name) : that.name != null) return false;
+        if (description != null ? !description.equals(that.description) : that.description != null) return false;
+        if (groupType != null ? !groupType.equals(that.groupType) : that.groupType != 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;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = groupId != null ? groupId.hashCode() : 0;
+        result = 31 * result + (name != null ? name.hashCode() : 0);
+        result = 31 * result + (description != null ? description.hashCode() : 0);
+        result = 31 * result + (groupType != null ? groupType.hashCode() : 0);
+        result = 31 * result + (createdTime != null ? createdTime.hashCode() : 0);
+        result = 31 * result + (updatedTime != null ? updatedTime.hashCode() : 0);
+        return result;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/AbstractRepository.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/AbstractRepository.java b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/AbstractRepository.java
new file mode 100644
index 0000000..1a95b97
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/AbstractRepository.java
@@ -0,0 +1,134 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.sharing.registry.db.repositories;
+
+import org.apache.airavata.sharing.registry.db.utils.DBConstants;
+import org.apache.airavata.sharing.registry.db.utils.JPAUtils;
+import org.apache.airavata.sharing.registry.db.utils.ObjectMapperSingleton;
+import org.apache.airavata.sharing.registry.models.GovRegistryException;
+import org.dozer.Mapper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+public abstract class AbstractRepository<T, E, Id> {
+    private final static Logger logger = LoggerFactory.getLogger(AbstractRepository.class);
+
+    private Class<T> thriftGenericClass;
+    private Class<E> dbEntityGenericClass;
+
+    public AbstractRepository(Class<T> thriftGenericClass, Class<E> dbEntityGenericClass){
+        this.thriftGenericClass = thriftGenericClass;
+        this.dbEntityGenericClass = dbEntityGenericClass;
+    }
+
+    public T create(T t) throws GovRegistryException {
+        return update(t);
+    }
+
+    public List<T> create(List<T> tList) throws GovRegistryException {
+        return update(tList);
+    }
+
+    public  T update(T t) throws GovRegistryException {
+        Mapper mapper = ObjectMapperSingleton.getInstance();
+        E entity = mapper.map(t, dbEntityGenericClass);
+        E persistedCopy = JPAUtils.execute(entityManager -> entityManager.merge(entity));
+        return mapper.map(persistedCopy, thriftGenericClass);
+    }
+
+    public  List<T> update(List<T> tList) throws GovRegistryException {
+        List<T> returnList = new ArrayList<>();
+        for(T temp : tList)
+            returnList.add(update(temp));
+        return returnList;
+    }
+
+    public boolean delete(Id id) throws GovRegistryException {
+        JPAUtils.execute(entityManager -> {
+            E entity = entityManager.find(dbEntityGenericClass, id);
+            entityManager.remove(entity);
+            return entity;
+        });
+        return true;
+    }
+
+    public boolean delete(List<Id> idList) throws GovRegistryException {
+        for(Id id : idList)
+            delete(id);
+        return true;
+    }
+
+    public T get(Id id) throws GovRegistryException {
+        E entity = JPAUtils.execute(entityManager -> entityManager
+                .find(dbEntityGenericClass, id));
+        Mapper mapper = ObjectMapperSingleton.getInstance();
+        if(entity == null)
+            return null;
+        return mapper.map(entity, thriftGenericClass);
+    }
+
+    public List<T> get(List<Id> idList) throws GovRegistryException {
+        List<T> returnList = new ArrayList<>();
+        for(Id id : idList)
+            returnList.add(get(id));
+        return returnList;
+    }
+
+    public List<T> select(Map<String, String> filters, int offset, int limit) throws GovRegistryException {
+        String queryString = getSelectQuery(filters);
+        int newLimit = limit < 0 ? DBConstants.SELECT_MAX_ROWS: limit;
+        List resultSet = JPAUtils.execute(entityManager -> entityManager.createQuery(queryString).setFirstResult(offset)
+                .setMaxResults(newLimit).getResultList());
+        Mapper mapper = ObjectMapperSingleton.getInstance();
+        List<T> gatewayList = new ArrayList<>();
+        resultSet.stream().forEach(rs -> gatewayList.add(mapper.map(rs, thriftGenericClass)));
+        return gatewayList;
+    }
+
+    public List<T> select(String queryString, int offset, int limit) throws GovRegistryException {
+        int newLimit = limit < 0 ? DBConstants.SELECT_MAX_ROWS: limit;
+        List resultSet = JPAUtils.execute(entityManager -> entityManager.createQuery(queryString).setFirstResult(offset)
+                .setMaxResults(newLimit).getResultList());
+        Mapper mapper = ObjectMapperSingleton.getInstance();
+        List<T> gatewayList = new ArrayList<>();
+        resultSet.stream().forEach(rs -> gatewayList.add(mapper.map(rs, thriftGenericClass)));
+        return gatewayList;
+    }
+
+    private String getSelectQuery(Map<String, String> filters){
+        String query = "SELECT p from " + dbEntityGenericClass.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.createdTime DESC";
+
+        return query;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/DomainRepository.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/DomainRepository.java b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/DomainRepository.java
new file mode 100644
index 0000000..8cd44ef
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/DomainRepository.java
@@ -0,0 +1,34 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.sharing.registry.db.repositories;
+
+import org.apache.airavata.sharing.registry.db.entities.DomainEntity;
+import org.apache.airavata.sharing.registry.models.Domain;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class DomainRepository extends AbstractRepository<Domain, DomainEntity, String> {
+    private final static Logger logger = LoggerFactory.getLogger(DomainRepository.class);
+
+    public DomainRepository(){
+        super(Domain.class, DomainEntity.class);
+    }
+}
\ No newline at end of file


[05/17] airavata git commit: renaming directory names

Posted by sc...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/GovRegistryException.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/GovRegistryException.java b/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/GovRegistryException.java
new file mode 100644
index 0000000..7df20a7
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/GovRegistryException.java
@@ -0,0 +1,391 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.3)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.airavata.sharing.registry.models;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import javax.annotation.Generated;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-05")
+public class GovRegistryException extends TException implements org.apache.thrift.TBase<GovRegistryException, GovRegistryException._Fields>, java.io.Serializable, Cloneable, Comparable<GovRegistryException> {
+  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GovRegistryException");
+
+  private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1);
+
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new GovRegistryExceptionStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new GovRegistryExceptionTupleSchemeFactory());
+  }
+
+  public String message; // required
+
+  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    MESSAGE((short)1, "message");
+
+    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+    static {
+      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+        byName.put(field.getFieldName(), field);
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, or null if its not found.
+     */
+    public static _Fields findByThriftId(int fieldId) {
+      switch(fieldId) {
+        case 1: // MESSAGE
+          return MESSAGE;
+        default:
+          return null;
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, throwing an exception
+     * if it is not found.
+     */
+    public static _Fields findByThriftIdOrThrow(int fieldId) {
+      _Fields fields = findByThriftId(fieldId);
+      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      return fields;
+    }
+
+    /**
+     * Find the _Fields constant that matches name, or null if its not found.
+     */
+    public static _Fields findByName(String name) {
+      return byName.get(name);
+    }
+
+    private final short _thriftId;
+    private final String _fieldName;
+
+    _Fields(short thriftId, String fieldName) {
+      _thriftId = thriftId;
+      _fieldName = fieldName;
+    }
+
+    public short getThriftFieldId() {
+      return _thriftId;
+    }
+
+    public String getFieldName() {
+      return _fieldName;
+    }
+  }
+
+  // isset id assignments
+  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);
+    tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GovRegistryException.class, metaDataMap);
+  }
+
+  public GovRegistryException() {
+  }
+
+  public GovRegistryException(
+    String message)
+  {
+    this();
+    this.message = message;
+  }
+
+  /**
+   * Performs a deep copy on <i>other</i>.
+   */
+  public GovRegistryException(GovRegistryException other) {
+    if (other.isSetMessage()) {
+      this.message = other.message;
+    }
+  }
+
+  public GovRegistryException deepCopy() {
+    return new GovRegistryException(this);
+  }
+
+  @Override
+  public void clear() {
+    this.message = null;
+  }
+
+  public String getMessage() {
+    return this.message;
+  }
+
+  public GovRegistryException setMessage(String message) {
+    this.message = message;
+    return this;
+  }
+
+  public void unsetMessage() {
+    this.message = null;
+  }
+
+  /** Returns true if field message is set (has been assigned a value) and false otherwise */
+  public boolean isSetMessage() {
+    return this.message != null;
+  }
+
+  public void setMessageIsSet(boolean value) {
+    if (!value) {
+      this.message = null;
+    }
+  }
+
+  public void setFieldValue(_Fields field, Object value) {
+    switch (field) {
+    case MESSAGE:
+      if (value == null) {
+        unsetMessage();
+      } else {
+        setMessage((String)value);
+      }
+      break;
+
+    }
+  }
+
+  public Object getFieldValue(_Fields field) {
+    switch (field) {
+    case MESSAGE:
+      return getMessage();
+
+    }
+    throw new IllegalStateException();
+  }
+
+  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+  public boolean isSet(_Fields field) {
+    if (field == null) {
+      throw new IllegalArgumentException();
+    }
+
+    switch (field) {
+    case MESSAGE:
+      return isSetMessage();
+    }
+    throw new IllegalStateException();
+  }
+
+  @Override
+  public boolean equals(Object that) {
+    if (that == null)
+      return false;
+    if (that instanceof GovRegistryException)
+      return this.equals((GovRegistryException)that);
+    return false;
+  }
+
+  public boolean equals(GovRegistryException that) {
+    if (that == null)
+      return false;
+
+    boolean this_present_message = true && this.isSetMessage();
+    boolean that_present_message = true && that.isSetMessage();
+    if (this_present_message || that_present_message) {
+      if (!(this_present_message && that_present_message))
+        return false;
+      if (!this.message.equals(that.message))
+        return false;
+    }
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    List<Object> list = new ArrayList<Object>();
+
+    boolean present_message = true && (isSetMessage());
+    list.add(present_message);
+    if (present_message)
+      list.add(message);
+
+    return list.hashCode();
+  }
+
+  @Override
+  public int compareTo(GovRegistryException other) {
+    if (!getClass().equals(other.getClass())) {
+      return getClass().getName().compareTo(other.getClass().getName());
+    }
+
+    int lastComparison = 0;
+
+    lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetMessage()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    return 0;
+  }
+
+  public _Fields fieldForId(int fieldId) {
+    return _Fields.findByThriftId(fieldId);
+  }
+
+  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+  }
+
+  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+  }
+
+  @Override
+  public String toString() {
+    StringBuilder sb = new StringBuilder("GovRegistryException(");
+    boolean first = true;
+
+    sb.append("message:");
+    if (this.message == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.message);
+    }
+    first = false;
+    sb.append(")");
+    return sb.toString();
+  }
+
+  public void validate() throws org.apache.thrift.TException {
+    // check for required fields
+    if (message == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'message' was not present! Struct: " + toString());
+    }
+    // check for sub-struct validity
+  }
+
+  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+    try {
+      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+    try {
+      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private static class GovRegistryExceptionStandardSchemeFactory implements SchemeFactory {
+    public GovRegistryExceptionStandardScheme getScheme() {
+      return new GovRegistryExceptionStandardScheme();
+    }
+  }
+
+  private static class GovRegistryExceptionStandardScheme extends StandardScheme<GovRegistryException> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, GovRegistryException struct) throws org.apache.thrift.TException {
+      org.apache.thrift.protocol.TField schemeField;
+      iprot.readStructBegin();
+      while (true)
+      {
+        schemeField = iprot.readFieldBegin();
+        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+          break;
+        }
+        switch (schemeField.id) {
+          case 1: // MESSAGE
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.message = iprot.readString();
+              struct.setMessageIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          default:
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+        }
+        iprot.readFieldEnd();
+      }
+      iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      struct.validate();
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot, GovRegistryException struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.message != null) {
+        oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
+        oprot.writeString(struct.message);
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class GovRegistryExceptionTupleSchemeFactory implements SchemeFactory {
+    public GovRegistryExceptionTupleScheme getScheme() {
+      return new GovRegistryExceptionTupleScheme();
+    }
+  }
+
+  private static class GovRegistryExceptionTupleScheme extends TupleScheme<GovRegistryException> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, GovRegistryException struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      oprot.writeString(struct.message);
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, GovRegistryException struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      struct.message = iprot.readString();
+      struct.setMessageIsSet(true);
+    }
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/GroupChildType.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/GroupChildType.java b/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/GroupChildType.java
new file mode 100644
index 0000000..ba7b659
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/GroupChildType.java
@@ -0,0 +1,45 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.3)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.airavata.sharing.registry.models;
+
+
+import java.util.Map;
+import java.util.HashMap;
+import org.apache.thrift.TEnum;
+
+public enum GroupChildType implements org.apache.thrift.TEnum {
+  USER(0),
+  GROUP(1);
+
+  private final int value;
+
+  private GroupChildType(int value) {
+    this.value = value;
+  }
+
+  /**
+   * Get the integer value of this enum value, as defined in the Thrift IDL.
+   */
+  public int getValue() {
+    return value;
+  }
+
+  /**
+   * Find a the enum type by its integer value, as defined in the Thrift IDL.
+   * @return null if the value is not found.
+   */
+  public static GroupChildType findByValue(int value) { 
+    switch (value) {
+      case 0:
+        return USER;
+      case 1:
+        return GROUP;
+      default:
+        return null;
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/GroupMembership.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/GroupMembership.java b/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/GroupMembership.java
new file mode 100644
index 0000000..00843aa
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/GroupMembership.java
@@ -0,0 +1,830 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.3)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.airavata.sharing.registry.models;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import javax.annotation.Generated;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-05")
+public class GroupMembership implements org.apache.thrift.TBase<GroupMembership, GroupMembership._Fields>, java.io.Serializable, Cloneable, Comparable<GroupMembership> {
+  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GroupMembership");
+
+  private static final org.apache.thrift.protocol.TField PARENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("parentId", org.apache.thrift.protocol.TType.STRING, (short)1);
+  private static final org.apache.thrift.protocol.TField CHILD_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("childId", org.apache.thrift.protocol.TType.STRING, (short)2);
+  private static final org.apache.thrift.protocol.TField CHILD_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("childType", org.apache.thrift.protocol.TType.I32, (short)3);
+  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)4);
+  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)5);
+
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new GroupMembershipStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new GroupMembershipTupleSchemeFactory());
+  }
+
+  public String parentId; // optional
+  public String childId; // optional
+  /**
+   * 
+   * @see GroupChildType
+   */
+  public GroupChildType childType; // optional
+  public long createdTime; // optional
+  public long updatedTime; // optional
+
+  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    PARENT_ID((short)1, "parentId"),
+    CHILD_ID((short)2, "childId"),
+    /**
+     * 
+     * @see GroupChildType
+     */
+    CHILD_TYPE((short)3, "childType"),
+    CREATED_TIME((short)4, "createdTime"),
+    UPDATED_TIME((short)5, "updatedTime");
+
+    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+    static {
+      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+        byName.put(field.getFieldName(), field);
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, or null if its not found.
+     */
+    public static _Fields findByThriftId(int fieldId) {
+      switch(fieldId) {
+        case 1: // PARENT_ID
+          return PARENT_ID;
+        case 2: // CHILD_ID
+          return CHILD_ID;
+        case 3: // CHILD_TYPE
+          return CHILD_TYPE;
+        case 4: // CREATED_TIME
+          return CREATED_TIME;
+        case 5: // UPDATED_TIME
+          return UPDATED_TIME;
+        default:
+          return null;
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, throwing an exception
+     * if it is not found.
+     */
+    public static _Fields findByThriftIdOrThrow(int fieldId) {
+      _Fields fields = findByThriftId(fieldId);
+      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      return fields;
+    }
+
+    /**
+     * Find the _Fields constant that matches name, or null if its not found.
+     */
+    public static _Fields findByName(String name) {
+      return byName.get(name);
+    }
+
+    private final short _thriftId;
+    private final String _fieldName;
+
+    _Fields(short thriftId, String fieldName) {
+      _thriftId = thriftId;
+      _fieldName = fieldName;
+    }
+
+    public short getThriftFieldId() {
+      return _thriftId;
+    }
+
+    public String getFieldName() {
+      return _fieldName;
+    }
+  }
+
+  // isset id assignments
+  private static final int __CREATEDTIME_ISSET_ID = 0;
+  private static final int __UPDATEDTIME_ISSET_ID = 1;
+  private byte __isset_bitfield = 0;
+  private static final _Fields optionals[] = {_Fields.PARENT_ID,_Fields.CHILD_ID,_Fields.CHILD_TYPE,_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);
+    tmpMap.put(_Fields.PARENT_ID, new org.apache.thrift.meta_data.FieldMetaData("parentId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.CHILD_ID, new org.apache.thrift.meta_data.FieldMetaData("childId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.CHILD_TYPE, new org.apache.thrift.meta_data.FieldMetaData("childType", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, GroupChildType.class)));
+    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, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
+    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GroupMembership.class, metaDataMap);
+  }
+
+  public GroupMembership() {
+  }
+
+  /**
+   * Performs a deep copy on <i>other</i>.
+   */
+  public GroupMembership(GroupMembership other) {
+    __isset_bitfield = other.__isset_bitfield;
+    if (other.isSetParentId()) {
+      this.parentId = other.parentId;
+    }
+    if (other.isSetChildId()) {
+      this.childId = other.childId;
+    }
+    if (other.isSetChildType()) {
+      this.childType = other.childType;
+    }
+    this.createdTime = other.createdTime;
+    this.updatedTime = other.updatedTime;
+  }
+
+  public GroupMembership deepCopy() {
+    return new GroupMembership(this);
+  }
+
+  @Override
+  public void clear() {
+    this.parentId = null;
+    this.childId = null;
+    this.childType = null;
+    setCreatedTimeIsSet(false);
+    this.createdTime = 0;
+    setUpdatedTimeIsSet(false);
+    this.updatedTime = 0;
+  }
+
+  public String getParentId() {
+    return this.parentId;
+  }
+
+  public GroupMembership setParentId(String parentId) {
+    this.parentId = parentId;
+    return this;
+  }
+
+  public void unsetParentId() {
+    this.parentId = null;
+  }
+
+  /** Returns true if field parentId is set (has been assigned a value) and false otherwise */
+  public boolean isSetParentId() {
+    return this.parentId != null;
+  }
+
+  public void setParentIdIsSet(boolean value) {
+    if (!value) {
+      this.parentId = null;
+    }
+  }
+
+  public String getChildId() {
+    return this.childId;
+  }
+
+  public GroupMembership setChildId(String childId) {
+    this.childId = childId;
+    return this;
+  }
+
+  public void unsetChildId() {
+    this.childId = null;
+  }
+
+  /** Returns true if field childId is set (has been assigned a value) and false otherwise */
+  public boolean isSetChildId() {
+    return this.childId != null;
+  }
+
+  public void setChildIdIsSet(boolean value) {
+    if (!value) {
+      this.childId = null;
+    }
+  }
+
+  /**
+   * 
+   * @see GroupChildType
+   */
+  public GroupChildType getChildType() {
+    return this.childType;
+  }
+
+  /**
+   * 
+   * @see GroupChildType
+   */
+  public GroupMembership setChildType(GroupChildType childType) {
+    this.childType = childType;
+    return this;
+  }
+
+  public void unsetChildType() {
+    this.childType = null;
+  }
+
+  /** Returns true if field childType is set (has been assigned a value) and false otherwise */
+  public boolean isSetChildType() {
+    return this.childType != null;
+  }
+
+  public void setChildTypeIsSet(boolean value) {
+    if (!value) {
+      this.childType = null;
+    }
+  }
+
+  public long getCreatedTime() {
+    return this.createdTime;
+  }
+
+  public GroupMembership setCreatedTime(long createdTime) {
+    this.createdTime = createdTime;
+    setCreatedTimeIsSet(true);
+    return this;
+  }
+
+  public void unsetCreatedTime() {
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CREATEDTIME_ISSET_ID);
+  }
+
+  /** Returns true if field createdTime is set (has been assigned a value) and false otherwise */
+  public boolean isSetCreatedTime() {
+    return EncodingUtils.testBit(__isset_bitfield, __CREATEDTIME_ISSET_ID);
+  }
+
+  public void setCreatedTimeIsSet(boolean value) {
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CREATEDTIME_ISSET_ID, value);
+  }
+
+  public long getUpdatedTime() {
+    return this.updatedTime;
+  }
+
+  public GroupMembership setUpdatedTime(long updatedTime) {
+    this.updatedTime = updatedTime;
+    setUpdatedTimeIsSet(true);
+    return this;
+  }
+
+  public void unsetUpdatedTime() {
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID);
+  }
+
+  /** Returns true if field updatedTime is set (has been assigned a value) and false otherwise */
+  public boolean isSetUpdatedTime() {
+    return EncodingUtils.testBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID);
+  }
+
+  public void setUpdatedTimeIsSet(boolean value) {
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID, value);
+  }
+
+  public void setFieldValue(_Fields field, Object value) {
+    switch (field) {
+    case PARENT_ID:
+      if (value == null) {
+        unsetParentId();
+      } else {
+        setParentId((String)value);
+      }
+      break;
+
+    case CHILD_ID:
+      if (value == null) {
+        unsetChildId();
+      } else {
+        setChildId((String)value);
+      }
+      break;
+
+    case CHILD_TYPE:
+      if (value == null) {
+        unsetChildType();
+      } else {
+        setChildType((GroupChildType)value);
+      }
+      break;
+
+    case CREATED_TIME:
+      if (value == null) {
+        unsetCreatedTime();
+      } else {
+        setCreatedTime((Long)value);
+      }
+      break;
+
+    case UPDATED_TIME:
+      if (value == null) {
+        unsetUpdatedTime();
+      } else {
+        setUpdatedTime((Long)value);
+      }
+      break;
+
+    }
+  }
+
+  public Object getFieldValue(_Fields field) {
+    switch (field) {
+    case PARENT_ID:
+      return getParentId();
+
+    case CHILD_ID:
+      return getChildId();
+
+    case CHILD_TYPE:
+      return getChildType();
+
+    case CREATED_TIME:
+      return getCreatedTime();
+
+    case UPDATED_TIME:
+      return getUpdatedTime();
+
+    }
+    throw new IllegalStateException();
+  }
+
+  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+  public boolean isSet(_Fields field) {
+    if (field == null) {
+      throw new IllegalArgumentException();
+    }
+
+    switch (field) {
+    case PARENT_ID:
+      return isSetParentId();
+    case CHILD_ID:
+      return isSetChildId();
+    case CHILD_TYPE:
+      return isSetChildType();
+    case CREATED_TIME:
+      return isSetCreatedTime();
+    case UPDATED_TIME:
+      return isSetUpdatedTime();
+    }
+    throw new IllegalStateException();
+  }
+
+  @Override
+  public boolean equals(Object that) {
+    if (that == null)
+      return false;
+    if (that instanceof GroupMembership)
+      return this.equals((GroupMembership)that);
+    return false;
+  }
+
+  public boolean equals(GroupMembership that) {
+    if (that == null)
+      return false;
+
+    boolean this_present_parentId = true && this.isSetParentId();
+    boolean that_present_parentId = true && that.isSetParentId();
+    if (this_present_parentId || that_present_parentId) {
+      if (!(this_present_parentId && that_present_parentId))
+        return false;
+      if (!this.parentId.equals(that.parentId))
+        return false;
+    }
+
+    boolean this_present_childId = true && this.isSetChildId();
+    boolean that_present_childId = true && that.isSetChildId();
+    if (this_present_childId || that_present_childId) {
+      if (!(this_present_childId && that_present_childId))
+        return false;
+      if (!this.childId.equals(that.childId))
+        return false;
+    }
+
+    boolean this_present_childType = true && this.isSetChildType();
+    boolean that_present_childType = true && that.isSetChildType();
+    if (this_present_childType || that_present_childType) {
+      if (!(this_present_childType && that_present_childType))
+        return false;
+      if (!this.childType.equals(that.childType))
+        return false;
+    }
+
+    boolean this_present_createdTime = true && this.isSetCreatedTime();
+    boolean that_present_createdTime = true && that.isSetCreatedTime();
+    if (this_present_createdTime || that_present_createdTime) {
+      if (!(this_present_createdTime && that_present_createdTime))
+        return false;
+      if (this.createdTime != that.createdTime)
+        return false;
+    }
+
+    boolean this_present_updatedTime = true && this.isSetUpdatedTime();
+    boolean that_present_updatedTime = true && that.isSetUpdatedTime();
+    if (this_present_updatedTime || that_present_updatedTime) {
+      if (!(this_present_updatedTime && that_present_updatedTime))
+        return false;
+      if (this.updatedTime != that.updatedTime)
+        return false;
+    }
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    List<Object> list = new ArrayList<Object>();
+
+    boolean present_parentId = true && (isSetParentId());
+    list.add(present_parentId);
+    if (present_parentId)
+      list.add(parentId);
+
+    boolean present_childId = true && (isSetChildId());
+    list.add(present_childId);
+    if (present_childId)
+      list.add(childId);
+
+    boolean present_childType = true && (isSetChildType());
+    list.add(present_childType);
+    if (present_childType)
+      list.add(childType.getValue());
+
+    boolean present_createdTime = true && (isSetCreatedTime());
+    list.add(present_createdTime);
+    if (present_createdTime)
+      list.add(createdTime);
+
+    boolean present_updatedTime = true && (isSetUpdatedTime());
+    list.add(present_updatedTime);
+    if (present_updatedTime)
+      list.add(updatedTime);
+
+    return list.hashCode();
+  }
+
+  @Override
+  public int compareTo(GroupMembership other) {
+    if (!getClass().equals(other.getClass())) {
+      return getClass().getName().compareTo(other.getClass().getName());
+    }
+
+    int lastComparison = 0;
+
+    lastComparison = Boolean.valueOf(isSetParentId()).compareTo(other.isSetParentId());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetParentId()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parentId, other.parentId);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetChildId()).compareTo(other.isSetChildId());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetChildId()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.childId, other.childId);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetChildType()).compareTo(other.isSetChildType());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetChildType()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.childType, other.childType);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetCreatedTime()).compareTo(other.isSetCreatedTime());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetCreatedTime()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.createdTime, other.createdTime);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetUpdatedTime()).compareTo(other.isSetUpdatedTime());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetUpdatedTime()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updatedTime, other.updatedTime);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    return 0;
+  }
+
+  public _Fields fieldForId(int fieldId) {
+    return _Fields.findByThriftId(fieldId);
+  }
+
+  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+  }
+
+  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+  }
+
+  @Override
+  public String toString() {
+    StringBuilder sb = new StringBuilder("GroupMembership(");
+    boolean first = true;
+
+    if (isSetParentId()) {
+      sb.append("parentId:");
+      if (this.parentId == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.parentId);
+      }
+      first = false;
+    }
+    if (isSetChildId()) {
+      if (!first) sb.append(", ");
+      sb.append("childId:");
+      if (this.childId == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.childId);
+      }
+      first = false;
+    }
+    if (isSetChildType()) {
+      if (!first) sb.append(", ");
+      sb.append("childType:");
+      if (this.childType == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.childType);
+      }
+      first = false;
+    }
+    if (isSetCreatedTime()) {
+      if (!first) sb.append(", ");
+      sb.append("createdTime:");
+      sb.append(this.createdTime);
+      first = false;
+    }
+    if (isSetUpdatedTime()) {
+      if (!first) sb.append(", ");
+      sb.append("updatedTime:");
+      sb.append(this.updatedTime);
+      first = false;
+    }
+    sb.append(")");
+    return sb.toString();
+  }
+
+  public void validate() throws org.apache.thrift.TException {
+    // check for required fields
+    // check for sub-struct validity
+  }
+
+  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+    try {
+      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+    try {
+      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+      __isset_bitfield = 0;
+      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private static class GroupMembershipStandardSchemeFactory implements SchemeFactory {
+    public GroupMembershipStandardScheme getScheme() {
+      return new GroupMembershipStandardScheme();
+    }
+  }
+
+  private static class GroupMembershipStandardScheme extends StandardScheme<GroupMembership> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, GroupMembership struct) throws org.apache.thrift.TException {
+      org.apache.thrift.protocol.TField schemeField;
+      iprot.readStructBegin();
+      while (true)
+      {
+        schemeField = iprot.readFieldBegin();
+        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+          break;
+        }
+        switch (schemeField.id) {
+          case 1: // PARENT_ID
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.parentId = iprot.readString();
+              struct.setParentIdIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 2: // CHILD_ID
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.childId = iprot.readString();
+              struct.setChildIdIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 3: // CHILD_TYPE
+            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+              struct.childType = org.apache.airavata.sharing.registry.models.GroupChildType.findByValue(iprot.readI32());
+              struct.setChildTypeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 4: // CREATED_TIME
+            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+              struct.createdTime = iprot.readI64();
+              struct.setCreatedTimeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 5: // UPDATED_TIME
+            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+              struct.updatedTime = iprot.readI64();
+              struct.setUpdatedTimeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          default:
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+        }
+        iprot.readFieldEnd();
+      }
+      iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      struct.validate();
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot, GroupMembership struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.parentId != null) {
+        if (struct.isSetParentId()) {
+          oprot.writeFieldBegin(PARENT_ID_FIELD_DESC);
+          oprot.writeString(struct.parentId);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.childId != null) {
+        if (struct.isSetChildId()) {
+          oprot.writeFieldBegin(CHILD_ID_FIELD_DESC);
+          oprot.writeString(struct.childId);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.childType != null) {
+        if (struct.isSetChildType()) {
+          oprot.writeFieldBegin(CHILD_TYPE_FIELD_DESC);
+          oprot.writeI32(struct.childType.getValue());
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.isSetCreatedTime()) {
+        oprot.writeFieldBegin(CREATED_TIME_FIELD_DESC);
+        oprot.writeI64(struct.createdTime);
+        oprot.writeFieldEnd();
+      }
+      if (struct.isSetUpdatedTime()) {
+        oprot.writeFieldBegin(UPDATED_TIME_FIELD_DESC);
+        oprot.writeI64(struct.updatedTime);
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class GroupMembershipTupleSchemeFactory implements SchemeFactory {
+    public GroupMembershipTupleScheme getScheme() {
+      return new GroupMembershipTupleScheme();
+    }
+  }
+
+  private static class GroupMembershipTupleScheme extends TupleScheme<GroupMembership> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, GroupMembership struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      BitSet optionals = new BitSet();
+      if (struct.isSetParentId()) {
+        optionals.set(0);
+      }
+      if (struct.isSetChildId()) {
+        optionals.set(1);
+      }
+      if (struct.isSetChildType()) {
+        optionals.set(2);
+      }
+      if (struct.isSetCreatedTime()) {
+        optionals.set(3);
+      }
+      if (struct.isSetUpdatedTime()) {
+        optionals.set(4);
+      }
+      oprot.writeBitSet(optionals, 5);
+      if (struct.isSetParentId()) {
+        oprot.writeString(struct.parentId);
+      }
+      if (struct.isSetChildId()) {
+        oprot.writeString(struct.childId);
+      }
+      if (struct.isSetChildType()) {
+        oprot.writeI32(struct.childType.getValue());
+      }
+      if (struct.isSetCreatedTime()) {
+        oprot.writeI64(struct.createdTime);
+      }
+      if (struct.isSetUpdatedTime()) {
+        oprot.writeI64(struct.updatedTime);
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, GroupMembership struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      BitSet incoming = iprot.readBitSet(5);
+      if (incoming.get(0)) {
+        struct.parentId = iprot.readString();
+        struct.setParentIdIsSet(true);
+      }
+      if (incoming.get(1)) {
+        struct.childId = iprot.readString();
+        struct.setChildIdIsSet(true);
+      }
+      if (incoming.get(2)) {
+        struct.childType = org.apache.airavata.sharing.registry.models.GroupChildType.findByValue(iprot.readI32());
+        struct.setChildTypeIsSet(true);
+      }
+      if (incoming.get(3)) {
+        struct.createdTime = iprot.readI64();
+        struct.setCreatedTimeIsSet(true);
+      }
+      if (incoming.get(4)) {
+        struct.updatedTime = iprot.readI64();
+        struct.setUpdatedTimeIsSet(true);
+      }
+    }
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/GroupType.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/GroupType.java b/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/GroupType.java
new file mode 100644
index 0000000..5727f83
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/GroupType.java
@@ -0,0 +1,45 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.3)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.airavata.sharing.registry.models;
+
+
+import java.util.Map;
+import java.util.HashMap;
+import org.apache.thrift.TEnum;
+
+public enum GroupType implements org.apache.thrift.TEnum {
+  SINGLE_USER(0),
+  MULTI_USER(1);
+
+  private final int value;
+
+  private GroupType(int value) {
+    this.value = value;
+  }
+
+  /**
+   * Get the integer value of this enum value, as defined in the Thrift IDL.
+   */
+  public int getValue() {
+    return value;
+  }
+
+  /**
+   * Find a the enum type by its integer value, as defined in the Thrift IDL.
+   * @return null if the value is not found.
+   */
+  public static GroupType findByValue(int value) { 
+    switch (value) {
+      case 0:
+        return SINGLE_USER;
+      case 1:
+        return MULTI_USER;
+      default:
+        return null;
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/PermissionType.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/PermissionType.java b/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/PermissionType.java
new file mode 100644
index 0000000..91645ce
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/PermissionType.java
@@ -0,0 +1,924 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.3)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.airavata.sharing.registry.models;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import javax.annotation.Generated;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-05")
+public class PermissionType implements org.apache.thrift.TBase<PermissionType, PermissionType._Fields>, java.io.Serializable, Cloneable, Comparable<PermissionType> {
+  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("PermissionType");
+
+  private static final org.apache.thrift.protocol.TField PERMISSION_TYPE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("permissionTypeId", org.apache.thrift.protocol.TType.STRING, (short)1);
+  private static final org.apache.thrift.protocol.TField DOMAIN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("domainId", org.apache.thrift.protocol.TType.STRING, (short)2);
+  private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)3);
+  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)4);
+  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)5);
+  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)6);
+
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new PermissionTypeStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new PermissionTypeTupleSchemeFactory());
+  }
+
+  public String permissionTypeId; // optional
+  public String domainId; // optional
+  public String name; // optional
+  public String description; // optional
+  public long createdTime; // optional
+  public long updatedTime; // optional
+
+  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    PERMISSION_TYPE_ID((short)1, "permissionTypeId"),
+    DOMAIN_ID((short)2, "domainId"),
+    NAME((short)3, "name"),
+    DESCRIPTION((short)4, "description"),
+    CREATED_TIME((short)5, "createdTime"),
+    UPDATED_TIME((short)6, "updatedTime");
+
+    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+    static {
+      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+        byName.put(field.getFieldName(), field);
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, or null if its not found.
+     */
+    public static _Fields findByThriftId(int fieldId) {
+      switch(fieldId) {
+        case 1: // PERMISSION_TYPE_ID
+          return PERMISSION_TYPE_ID;
+        case 2: // DOMAIN_ID
+          return DOMAIN_ID;
+        case 3: // NAME
+          return NAME;
+        case 4: // DESCRIPTION
+          return DESCRIPTION;
+        case 5: // CREATED_TIME
+          return CREATED_TIME;
+        case 6: // UPDATED_TIME
+          return UPDATED_TIME;
+        default:
+          return null;
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, throwing an exception
+     * if it is not found.
+     */
+    public static _Fields findByThriftIdOrThrow(int fieldId) {
+      _Fields fields = findByThriftId(fieldId);
+      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      return fields;
+    }
+
+    /**
+     * Find the _Fields constant that matches name, or null if its not found.
+     */
+    public static _Fields findByName(String name) {
+      return byName.get(name);
+    }
+
+    private final short _thriftId;
+    private final String _fieldName;
+
+    _Fields(short thriftId, String fieldName) {
+      _thriftId = thriftId;
+      _fieldName = fieldName;
+    }
+
+    public short getThriftFieldId() {
+      return _thriftId;
+    }
+
+    public String getFieldName() {
+      return _fieldName;
+    }
+  }
+
+  // isset id assignments
+  private static final int __CREATEDTIME_ISSET_ID = 0;
+  private static final int __UPDATEDTIME_ISSET_ID = 1;
+  private byte __isset_bitfield = 0;
+  private static final _Fields optionals[] = {_Fields.PERMISSION_TYPE_ID,_Fields.DOMAIN_ID,_Fields.NAME,_Fields.DESCRIPTION,_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);
+    tmpMap.put(_Fields.PERMISSION_TYPE_ID, new org.apache.thrift.meta_data.FieldMetaData("permissionTypeId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.DOMAIN_ID, new org.apache.thrift.meta_data.FieldMetaData("domainId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("description", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    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, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
+    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PermissionType.class, metaDataMap);
+  }
+
+  public PermissionType() {
+    this.permissionTypeId = "DO_NOT_SET_AT_CLIENTS_ID";
+
+  }
+
+  /**
+   * Performs a deep copy on <i>other</i>.
+   */
+  public PermissionType(PermissionType other) {
+    __isset_bitfield = other.__isset_bitfield;
+    if (other.isSetPermissionTypeId()) {
+      this.permissionTypeId = other.permissionTypeId;
+    }
+    if (other.isSetDomainId()) {
+      this.domainId = other.domainId;
+    }
+    if (other.isSetName()) {
+      this.name = other.name;
+    }
+    if (other.isSetDescription()) {
+      this.description = other.description;
+    }
+    this.createdTime = other.createdTime;
+    this.updatedTime = other.updatedTime;
+  }
+
+  public PermissionType deepCopy() {
+    return new PermissionType(this);
+  }
+
+  @Override
+  public void clear() {
+    this.permissionTypeId = "DO_NOT_SET_AT_CLIENTS_ID";
+
+    this.domainId = null;
+    this.name = null;
+    this.description = null;
+    setCreatedTimeIsSet(false);
+    this.createdTime = 0;
+    setUpdatedTimeIsSet(false);
+    this.updatedTime = 0;
+  }
+
+  public String getPermissionTypeId() {
+    return this.permissionTypeId;
+  }
+
+  public PermissionType setPermissionTypeId(String permissionTypeId) {
+    this.permissionTypeId = permissionTypeId;
+    return this;
+  }
+
+  public void unsetPermissionTypeId() {
+    this.permissionTypeId = null;
+  }
+
+  /** Returns true if field permissionTypeId is set (has been assigned a value) and false otherwise */
+  public boolean isSetPermissionTypeId() {
+    return this.permissionTypeId != null;
+  }
+
+  public void setPermissionTypeIdIsSet(boolean value) {
+    if (!value) {
+      this.permissionTypeId = null;
+    }
+  }
+
+  public String getDomainId() {
+    return this.domainId;
+  }
+
+  public PermissionType setDomainId(String domainId) {
+    this.domainId = domainId;
+    return this;
+  }
+
+  public void unsetDomainId() {
+    this.domainId = null;
+  }
+
+  /** Returns true if field domainId is set (has been assigned a value) and false otherwise */
+  public boolean isSetDomainId() {
+    return this.domainId != null;
+  }
+
+  public void setDomainIdIsSet(boolean value) {
+    if (!value) {
+      this.domainId = null;
+    }
+  }
+
+  public String getName() {
+    return this.name;
+  }
+
+  public PermissionType setName(String name) {
+    this.name = name;
+    return this;
+  }
+
+  public void unsetName() {
+    this.name = null;
+  }
+
+  /** Returns true if field name is set (has been assigned a value) and false otherwise */
+  public boolean isSetName() {
+    return this.name != null;
+  }
+
+  public void setNameIsSet(boolean value) {
+    if (!value) {
+      this.name = null;
+    }
+  }
+
+  public String getDescription() {
+    return this.description;
+  }
+
+  public PermissionType setDescription(String description) {
+    this.description = description;
+    return this;
+  }
+
+  public void unsetDescription() {
+    this.description = null;
+  }
+
+  /** Returns true if field description is set (has been assigned a value) and false otherwise */
+  public boolean isSetDescription() {
+    return this.description != null;
+  }
+
+  public void setDescriptionIsSet(boolean value) {
+    if (!value) {
+      this.description = null;
+    }
+  }
+
+  public long getCreatedTime() {
+    return this.createdTime;
+  }
+
+  public PermissionType setCreatedTime(long createdTime) {
+    this.createdTime = createdTime;
+    setCreatedTimeIsSet(true);
+    return this;
+  }
+
+  public void unsetCreatedTime() {
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CREATEDTIME_ISSET_ID);
+  }
+
+  /** Returns true if field createdTime is set (has been assigned a value) and false otherwise */
+  public boolean isSetCreatedTime() {
+    return EncodingUtils.testBit(__isset_bitfield, __CREATEDTIME_ISSET_ID);
+  }
+
+  public void setCreatedTimeIsSet(boolean value) {
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CREATEDTIME_ISSET_ID, value);
+  }
+
+  public long getUpdatedTime() {
+    return this.updatedTime;
+  }
+
+  public PermissionType setUpdatedTime(long updatedTime) {
+    this.updatedTime = updatedTime;
+    setUpdatedTimeIsSet(true);
+    return this;
+  }
+
+  public void unsetUpdatedTime() {
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID);
+  }
+
+  /** Returns true if field updatedTime is set (has been assigned a value) and false otherwise */
+  public boolean isSetUpdatedTime() {
+    return EncodingUtils.testBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID);
+  }
+
+  public void setUpdatedTimeIsSet(boolean value) {
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID, value);
+  }
+
+  public void setFieldValue(_Fields field, Object value) {
+    switch (field) {
+    case PERMISSION_TYPE_ID:
+      if (value == null) {
+        unsetPermissionTypeId();
+      } else {
+        setPermissionTypeId((String)value);
+      }
+      break;
+
+    case DOMAIN_ID:
+      if (value == null) {
+        unsetDomainId();
+      } else {
+        setDomainId((String)value);
+      }
+      break;
+
+    case NAME:
+      if (value == null) {
+        unsetName();
+      } else {
+        setName((String)value);
+      }
+      break;
+
+    case DESCRIPTION:
+      if (value == null) {
+        unsetDescription();
+      } else {
+        setDescription((String)value);
+      }
+      break;
+
+    case CREATED_TIME:
+      if (value == null) {
+        unsetCreatedTime();
+      } else {
+        setCreatedTime((Long)value);
+      }
+      break;
+
+    case UPDATED_TIME:
+      if (value == null) {
+        unsetUpdatedTime();
+      } else {
+        setUpdatedTime((Long)value);
+      }
+      break;
+
+    }
+  }
+
+  public Object getFieldValue(_Fields field) {
+    switch (field) {
+    case PERMISSION_TYPE_ID:
+      return getPermissionTypeId();
+
+    case DOMAIN_ID:
+      return getDomainId();
+
+    case NAME:
+      return getName();
+
+    case DESCRIPTION:
+      return getDescription();
+
+    case CREATED_TIME:
+      return getCreatedTime();
+
+    case UPDATED_TIME:
+      return getUpdatedTime();
+
+    }
+    throw new IllegalStateException();
+  }
+
+  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+  public boolean isSet(_Fields field) {
+    if (field == null) {
+      throw new IllegalArgumentException();
+    }
+
+    switch (field) {
+    case PERMISSION_TYPE_ID:
+      return isSetPermissionTypeId();
+    case DOMAIN_ID:
+      return isSetDomainId();
+    case NAME:
+      return isSetName();
+    case DESCRIPTION:
+      return isSetDescription();
+    case CREATED_TIME:
+      return isSetCreatedTime();
+    case UPDATED_TIME:
+      return isSetUpdatedTime();
+    }
+    throw new IllegalStateException();
+  }
+
+  @Override
+  public boolean equals(Object that) {
+    if (that == null)
+      return false;
+    if (that instanceof PermissionType)
+      return this.equals((PermissionType)that);
+    return false;
+  }
+
+  public boolean equals(PermissionType that) {
+    if (that == null)
+      return false;
+
+    boolean this_present_permissionTypeId = true && this.isSetPermissionTypeId();
+    boolean that_present_permissionTypeId = true && that.isSetPermissionTypeId();
+    if (this_present_permissionTypeId || that_present_permissionTypeId) {
+      if (!(this_present_permissionTypeId && that_present_permissionTypeId))
+        return false;
+      if (!this.permissionTypeId.equals(that.permissionTypeId))
+        return false;
+    }
+
+    boolean this_present_domainId = true && this.isSetDomainId();
+    boolean that_present_domainId = true && that.isSetDomainId();
+    if (this_present_domainId || that_present_domainId) {
+      if (!(this_present_domainId && that_present_domainId))
+        return false;
+      if (!this.domainId.equals(that.domainId))
+        return false;
+    }
+
+    boolean this_present_name = true && this.isSetName();
+    boolean that_present_name = true && that.isSetName();
+    if (this_present_name || that_present_name) {
+      if (!(this_present_name && that_present_name))
+        return false;
+      if (!this.name.equals(that.name))
+        return false;
+    }
+
+    boolean this_present_description = true && this.isSetDescription();
+    boolean that_present_description = true && that.isSetDescription();
+    if (this_present_description || that_present_description) {
+      if (!(this_present_description && that_present_description))
+        return false;
+      if (!this.description.equals(that.description))
+        return false;
+    }
+
+    boolean this_present_createdTime = true && this.isSetCreatedTime();
+    boolean that_present_createdTime = true && that.isSetCreatedTime();
+    if (this_present_createdTime || that_present_createdTime) {
+      if (!(this_present_createdTime && that_present_createdTime))
+        return false;
+      if (this.createdTime != that.createdTime)
+        return false;
+    }
+
+    boolean this_present_updatedTime = true && this.isSetUpdatedTime();
+    boolean that_present_updatedTime = true && that.isSetUpdatedTime();
+    if (this_present_updatedTime || that_present_updatedTime) {
+      if (!(this_present_updatedTime && that_present_updatedTime))
+        return false;
+      if (this.updatedTime != that.updatedTime)
+        return false;
+    }
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    List<Object> list = new ArrayList<Object>();
+
+    boolean present_permissionTypeId = true && (isSetPermissionTypeId());
+    list.add(present_permissionTypeId);
+    if (present_permissionTypeId)
+      list.add(permissionTypeId);
+
+    boolean present_domainId = true && (isSetDomainId());
+    list.add(present_domainId);
+    if (present_domainId)
+      list.add(domainId);
+
+    boolean present_name = true && (isSetName());
+    list.add(present_name);
+    if (present_name)
+      list.add(name);
+
+    boolean present_description = true && (isSetDescription());
+    list.add(present_description);
+    if (present_description)
+      list.add(description);
+
+    boolean present_createdTime = true && (isSetCreatedTime());
+    list.add(present_createdTime);
+    if (present_createdTime)
+      list.add(createdTime);
+
+    boolean present_updatedTime = true && (isSetUpdatedTime());
+    list.add(present_updatedTime);
+    if (present_updatedTime)
+      list.add(updatedTime);
+
+    return list.hashCode();
+  }
+
+  @Override
+  public int compareTo(PermissionType other) {
+    if (!getClass().equals(other.getClass())) {
+      return getClass().getName().compareTo(other.getClass().getName());
+    }
+
+    int lastComparison = 0;
+
+    lastComparison = Boolean.valueOf(isSetPermissionTypeId()).compareTo(other.isSetPermissionTypeId());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetPermissionTypeId()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.permissionTypeId, other.permissionTypeId);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetDomainId()).compareTo(other.isSetDomainId());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetDomainId()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domainId, other.domainId);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetName()).compareTo(other.isSetName());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetName()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetDescription()).compareTo(other.isSetDescription());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetDescription()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.description, other.description);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetCreatedTime()).compareTo(other.isSetCreatedTime());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetCreatedTime()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.createdTime, other.createdTime);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetUpdatedTime()).compareTo(other.isSetUpdatedTime());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetUpdatedTime()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updatedTime, other.updatedTime);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    return 0;
+  }
+
+  public _Fields fieldForId(int fieldId) {
+    return _Fields.findByThriftId(fieldId);
+  }
+
+  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+  }
+
+  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+  }
+
+  @Override
+  public String toString() {
+    StringBuilder sb = new StringBuilder("PermissionType(");
+    boolean first = true;
+
+    if (isSetPermissionTypeId()) {
+      sb.append("permissionTypeId:");
+      if (this.permissionTypeId == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.permissionTypeId);
+      }
+      first = false;
+    }
+    if (isSetDomainId()) {
+      if (!first) sb.append(", ");
+      sb.append("domainId:");
+      if (this.domainId == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.domainId);
+      }
+      first = false;
+    }
+    if (isSetName()) {
+      if (!first) sb.append(", ");
+      sb.append("name:");
+      if (this.name == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.name);
+      }
+      first = false;
+    }
+    if (isSetDescription()) {
+      if (!first) sb.append(", ");
+      sb.append("description:");
+      if (this.description == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.description);
+      }
+      first = false;
+    }
+    if (isSetCreatedTime()) {
+      if (!first) sb.append(", ");
+      sb.append("createdTime:");
+      sb.append(this.createdTime);
+      first = false;
+    }
+    if (isSetUpdatedTime()) {
+      if (!first) sb.append(", ");
+      sb.append("updatedTime:");
+      sb.append(this.updatedTime);
+      first = false;
+    }
+    sb.append(")");
+    return sb.toString();
+  }
+
+  public void validate() throws org.apache.thrift.TException {
+    // check for required fields
+    // check for sub-struct validity
+  }
+
+  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+    try {
+      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+    try {
+      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+      __isset_bitfield = 0;
+      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private static class PermissionTypeStandardSchemeFactory implements SchemeFactory {
+    public PermissionTypeStandardScheme getScheme() {
+      return new PermissionTypeStandardScheme();
+    }
+  }
+
+  private static class PermissionTypeStandardScheme extends StandardScheme<PermissionType> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, PermissionType struct) throws org.apache.thrift.TException {
+      org.apache.thrift.protocol.TField schemeField;
+      iprot.readStructBegin();
+      while (true)
+      {
+        schemeField = iprot.readFieldBegin();
+        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+          break;
+        }
+        switch (schemeField.id) {
+          case 1: // PERMISSION_TYPE_ID
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.permissionTypeId = iprot.readString();
+              struct.setPermissionTypeIdIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 2: // DOMAIN_ID
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.domainId = iprot.readString();
+              struct.setDomainIdIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 3: // NAME
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.name = iprot.readString();
+              struct.setNameIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 4: // DESCRIPTION
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.description = iprot.readString();
+              struct.setDescriptionIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 5: // CREATED_TIME
+            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+              struct.createdTime = iprot.readI64();
+              struct.setCreatedTimeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 6: // UPDATED_TIME
+            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+              struct.updatedTime = iprot.readI64();
+              struct.setUpdatedTimeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          default:
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+        }
+        iprot.readFieldEnd();
+      }
+      iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      struct.validate();
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot, PermissionType struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.permissionTypeId != null) {
+        if (struct.isSetPermissionTypeId()) {
+          oprot.writeFieldBegin(PERMISSION_TYPE_ID_FIELD_DESC);
+          oprot.writeString(struct.permissionTypeId);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.domainId != null) {
+        if (struct.isSetDomainId()) {
+          oprot.writeFieldBegin(DOMAIN_ID_FIELD_DESC);
+          oprot.writeString(struct.domainId);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.name != null) {
+        if (struct.isSetName()) {
+          oprot.writeFieldBegin(NAME_FIELD_DESC);
+          oprot.writeString(struct.name);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.description != null) {
+        if (struct.isSetDescription()) {
+          oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC);
+          oprot.writeString(struct.description);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.isSetCreatedTime()) {
+        oprot.writeFieldBegin(CREATED_TIME_FIELD_DESC);
+        oprot.writeI64(struct.createdTime);
+        oprot.writeFieldEnd();
+      }
+      if (struct.isSetUpdatedTime()) {
+        oprot.writeFieldBegin(UPDATED_TIME_FIELD_DESC);
+        oprot.writeI64(struct.updatedTime);
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class PermissionTypeTupleSchemeFactory implements SchemeFactory {
+    public PermissionTypeTupleScheme getScheme() {
+      return new PermissionTypeTupleScheme();
+    }
+  }
+
+  private static class PermissionTypeTupleScheme extends TupleScheme<PermissionType> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, PermissionType struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      BitSet optionals = new BitSet();
+      if (struct.isSetPermissionTypeId()) {
+        optionals.set(0);
+      }
+      if (struct.isSetDomainId()) {
+        optionals.set(1);
+      }
+      if (struct.isSetName()) {
+        optionals.set(2);
+      }
+      if (struct.isSetDescription()) {
+        optionals.set(3);
+      }
+      if (struct.isSetCreatedTime()) {
+        optionals.set(4);
+      }
+      if (struct.isSetUpdatedTime()) {
+        optionals.set(5);
+      }
+      oprot.writeBitSet(optionals, 6);
+      if (struct.isSetPermissionTypeId()) {
+        oprot.writeString(struct.permissionTypeId);
+      }
+      if (struct.isSetDomainId()) {
+        oprot.writeString(struct.domainId);
+      }
+      if (struct.isSetName()) {
+        oprot.writeString(struct.name);
+      }
+      if (struct.isSetDescription()) {
+        oprot.writeString(struct.description);
+      }
+      if (struct.isSetCreatedTime()) {
+        oprot.writeI64(struct.createdTime);
+      }
+      if (struct.isSetUpdatedTime()) {
+        oprot.writeI64(struct.updatedTime);
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, PermissionType struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      BitSet incoming = iprot.readBitSet(6);
+      if (incoming.get(0)) {
+        struct.permissionTypeId = iprot.readString();
+        struct.setPermissionTypeIdIsSet(true);
+      }
+      if (incoming.get(1)) {
+        struct.domainId = iprot.readString();
+        struct.setDomainIdIsSet(true);
+      }
+      if (incoming.get(2)) {
+        struct.name = iprot.readString();
+        struct.setNameIsSet(true);
+      }
+      if (incoming.get(3)) {
+        struct.description = iprot.readString();
+        struct.setDescriptionIsSet(true);
+      }
+      if (incoming.get(4)) {
+        struct.createdTime = iprot.readI64();
+        struct.setCreatedTimeIsSet(true);
+      }
+      if (incoming.get(5)) {
+        struct.updatedTime = iprot.readI64();
+        struct.setUpdatedTimeIsSet(true);
+      }
+    }
+  }
+
+}
+


[07/17] airavata git commit: renaming directory names

Posted by sc...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/server/SharingRegistryServerHandler.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/server/SharingRegistryServerHandler.java b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/server/SharingRegistryServerHandler.java
new file mode 100644
index 0000000..7ae1c64
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/server/SharingRegistryServerHandler.java
@@ -0,0 +1,585 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.sharing.registry.server;
+
+import org.apache.airavata.sharing.registry.db.entities.GroupMembershipEntityPK;
+import org.apache.airavata.sharing.registry.db.entities.SharingEntityPK;
+import org.apache.airavata.sharing.registry.db.repositories.*;
+import org.apache.airavata.sharing.registry.db.utils.DBConstants;
+import org.apache.airavata.sharing.registry.models.*;
+import org.apache.airavata.sharing.registry.service.cpi.GovRegistryService;
+import org.apache.thrift.TException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.lang.reflect.Field;
+import java.util.*;
+
+public class SharingRegistryServerHandler implements GovRegistryService.Iface{
+    private final static Logger logger = LoggerFactory.getLogger(SharingRegistryServerHandler.class);
+
+    public static String GLOBAL_PERMISSION_NAME = "GLOBAL";
+
+    private DomainRepository domainRepository;
+    private UserRepository userRepository;
+    private UserGroupRepository userGroupRepository;
+    private GroupMembershipRepository groupMembershipRepository;
+    private EntityTypeRepository entityTypeRepository;
+    private PermissionTypeRepository permissionTypeRepository;
+    private EntityRepository entityRepository;
+    private SharingRepository sharingRepository;
+
+    public SharingRegistryServerHandler(){
+        this.domainRepository = new DomainRepository();
+        this.userRepository = new UserRepository();
+        this.userGroupRepository = new UserGroupRepository();
+        this.groupMembershipRepository = new GroupMembershipRepository();
+        this.entityTypeRepository = new EntityTypeRepository();
+        this.permissionTypeRepository = new PermissionTypeRepository();
+        this.entityRepository = new EntityRepository();
+        this.sharingRepository = new SharingRepository();
+    }
+
+    /**
+     * * Domain Operations
+     * *
+     */
+    @Override
+    public String createDomain(Domain domain) throws GovRegistryException, TException {
+        if(domainRepository.get(domain.domainId) != null)
+            throw new GovRegistryException("There exist domain with given domain id");
+
+        domain.setCreatedTime(System.currentTimeMillis());
+        domain.setUpdatedTime(System.currentTimeMillis());
+        domainRepository.create(domain);
+
+        //create the global permission for the domain
+        PermissionType permissionType = new PermissionType();
+        permissionType.setPermissionTypeId(domain.domainId+":"+GLOBAL_PERMISSION_NAME);
+        permissionType.setDomainId(domain.domainId);
+        permissionType.setName(GLOBAL_PERMISSION_NAME);
+        permissionType.setDescription("GLOBAL permission to " + domain.domainId);
+        permissionType.setCreatedTime(System.currentTimeMillis());
+        permissionType.setUpdatedTime(System.currentTimeMillis());
+        permissionTypeRepository.create(permissionType);
+
+        return domain.domainId;
+    }
+
+    @Override
+    public boolean updateDomain(Domain domain) throws GovRegistryException, TException {
+        Domain oldDomain = domainRepository.get(domain.domainId);
+        domain.setCreatedTime(oldDomain.createdTime);
+        domain.setUpdatedTime(System.currentTimeMillis());
+        domain = getUpdatedObject(oldDomain, domain);
+        domainRepository.update(domain);
+        return true;
+    }
+
+    @Override
+    public boolean deleteDomain(String domainId) throws GovRegistryException, TException {
+        domainRepository.delete(domainId);
+        return true;
+    }
+
+    @Override
+    public Domain getDomain(String domainId) throws GovRegistryException, TException {
+        return domainRepository.get(domainId);
+    }
+
+    @Override
+    public List<Domain> getDomains(int offset, int limit) throws TException {
+        return domainRepository.select(new HashMap<>(), offset, limit);
+    }
+
+    /**
+     * * User Operations
+     * *
+     */
+    @Override
+    public String createUser(User user) throws GovRegistryException, TException {
+        if(userRepository.get(user.userId) != null)
+            throw new GovRegistryException("There exist user with given user id");
+
+        user.setCreatedTime(System.currentTimeMillis());
+        user.setUpdatedTime(System.currentTimeMillis());
+        userRepository.create(user);
+
+        UserGroup userGroup = new UserGroup();
+        userGroup.setGroupId(user.userId);
+        userGroup.setDomainId(user.domainId);
+        userGroup.setName(user.userName);
+        userGroup.setDescription("user " + user.userName + " group");
+        userGroup.setOwnerId(user.userId);
+        userGroup.setGroupType(GroupType.SINGLE_USER);
+        createGroup(userGroup);
+
+        return user.userId;
+    }
+
+    @Override
+    public boolean updatedUser(User user) throws GovRegistryException, TException {
+        User oldUser = userRepository.get(user.userId);
+        user.setCreatedTime(oldUser.createdTime);
+        user.setUpdatedTime(System.currentTimeMillis());
+        user = getUpdatedObject(oldUser, user);
+        userRepository.update(user);
+
+        UserGroup userGroup = userGroupRepository.get(user.userId);
+        userGroup.setName(user.userName);
+        userGroup.setDescription("user " + user.userName + " group");
+        updateGroup(userGroup);
+        return true;
+    }
+
+    @Override
+    public boolean deleteUser(String userId) throws GovRegistryException, TException {
+        userRepository.delete(userId);
+        userGroupRepository.delete(userId);
+        return true;
+    }
+
+    @Override
+    public User getUser(String userId) throws GovRegistryException, TException {
+        return userRepository.get(userId);
+    }
+
+    @Override
+    public List<User> getUsers(String domain, int offset, int limit) throws  GovRegistryException, TException {
+        HashMap<String, String> filters = new HashMap<>();
+        filters.put(DBConstants.UserTable.DOMAIN_ID, domain);
+        return userRepository.select(filters, offset, limit);
+    }
+
+    /**
+     * * Group Operations
+     * *
+     */
+    @Override
+    public String createGroup(UserGroup group) throws GovRegistryException, TException {
+        if(userGroupRepository.get(group.groupId) != null)
+            throw new GovRegistryException("There exist group with given group id");
+
+        group.setCreatedTime(System.currentTimeMillis());
+        group.setUpdatedTime(System.currentTimeMillis());
+        userGroupRepository.create(group);
+        return group.groupId;
+    }
+
+    @Override
+    public boolean updateGroup(UserGroup group) throws GovRegistryException, TException {
+        group.setUpdatedTime(System.currentTimeMillis());
+        UserGroup oldGroup = userGroupRepository.get(group.groupId);
+        group.setCreatedTime(oldGroup.createdTime);
+        group = getUpdatedObject(oldGroup, group);
+        userGroupRepository.update(group);
+        return true;
+    }
+
+    @Override
+    public boolean deleteGroup(String groupId) throws GovRegistryException, TException {
+        userGroupRepository.delete(groupId);
+        return true;
+    }
+
+    @Override
+    public UserGroup getGroup(String groupId) throws GovRegistryException, TException {
+        return userGroupRepository.get(groupId);
+    }
+
+    @Override
+    public List<UserGroup> getGroups(String domain, int offset, int limit) throws TException {
+        HashMap<String, String> filters = new HashMap<>();
+        filters.put(DBConstants.UserTable.DOMAIN_ID, domain);
+        return userGroupRepository.select(filters, offset, limit);
+    }
+
+    @Override
+    public boolean addUsersToGroup(List<String> userIds, String groupId) throws GovRegistryException, TException {
+        for(int i=0; i < userIds.size(); i++){
+            GroupMembership groupMembership = new GroupMembership();
+            groupMembership.setParentId(groupId);
+            groupMembership.setChildId(userIds.get(i));
+            groupMembership.setChildType(GroupChildType.USER);
+            groupMembership.setCreatedTime(System.currentTimeMillis());
+            groupMembership.setUpdatedTime(System.currentTimeMillis());
+            groupMembershipRepository.create(groupMembership);
+        }
+        return true;
+    }
+
+    @Override
+    public boolean removeUsersFromGroup(List<String> userIds, String groupId) throws GovRegistryException, TException {
+        for(int i=0; i < userIds.size(); i++){
+            GroupMembershipEntityPK groupMembershipEntityPK = new GroupMembershipEntityPK();
+            groupMembershipEntityPK.setParentId(groupId);
+            groupMembershipEntityPK.setChildId(userIds.get(i));
+            groupMembershipRepository.delete(groupMembershipEntityPK);
+        }
+        return true;
+    }
+
+    @Override
+    public Map<String, GroupChildType> getGroupMembers(String groupId, int offset, int limit) throws  GovRegistryException, TException {
+        HashMap<String, GroupChildType> groupMembers = new HashMap<>();
+        HashMap<String, String> filters = new HashMap<>();
+        filters.put(DBConstants.GroupMembershipTable.PARENT_ID, groupId);
+        List<GroupMembership> groupMembershipList = groupMembershipRepository.select(filters, 0, -1);
+        groupMembershipList.stream().forEach(gm->{groupMembers.put(gm.getChildId(), gm.getChildType());});
+        return groupMembers;
+    }
+
+    @Override
+    public boolean addChildGroupToParentGroup(String childId, String groupId) throws GovRegistryException, TException {
+        //Todo check for cyclic dependencies
+        GroupMembership groupMembership = new GroupMembership();
+        groupMembership.setParentId(groupId);
+        groupMembership.setChildId(childId);
+        groupMembership.setChildType(GroupChildType.GROUP);
+        groupMembership.setCreatedTime(System.currentTimeMillis());
+        groupMembership.setUpdatedTime(System.currentTimeMillis());
+        groupMembershipRepository.create(groupMembership);
+        return true;
+    }
+
+    @Override
+    public boolean removeChildGroupFromParentGroup(String childId, String groupId) throws GovRegistryException, TException {
+        GroupMembershipEntityPK groupMembershipEntityPK = new GroupMembershipEntityPK();
+        groupMembershipEntityPK.setParentId(groupId);
+        groupMembershipEntityPK.setChildId(childId);
+        groupMembershipRepository.delete(groupMembershipEntityPK);
+        return true;
+    }
+
+    /**
+     * * EntityType Operations
+     * *
+     */
+    @Override
+    public String createEntityType(EntityType entityType) throws GovRegistryException, TException {
+        if(entityTypeRepository.get(entityType.entityTypeId) != null)
+            throw new GovRegistryException("There exist EntityType with given EntityType id");
+
+        entityType.setCreatedTime(System.currentTimeMillis());
+        entityType.setUpdatedTime(System.currentTimeMillis());
+        entityTypeRepository.create(entityType);
+        return entityType.entityTypeId;
+    }
+
+    @Override
+    public boolean updateEntityType(EntityType entityType) throws GovRegistryException, TException {
+        entityType.setUpdatedTime(System.currentTimeMillis());
+        EntityType oldEntityType = entityTypeRepository.get(entityType.entityTypeId);
+        entityType.setCreatedTime(oldEntityType.createdTime);
+        entityType = getUpdatedObject(oldEntityType, entityType);
+        entityTypeRepository.update(entityType);
+        return true;
+    }
+
+    @Override
+    public boolean deleteEntityType(String entityTypeId) throws GovRegistryException, TException {
+        entityTypeRepository.delete(entityTypeId);
+        return true;
+    }
+
+    @Override
+    public EntityType getEntityType(String entityTypeId) throws GovRegistryException, TException {
+        return entityTypeRepository.get(entityTypeId);
+    }
+
+    @Override
+    public List<EntityType> getEntityTypes(String domain, int offset, int limit) throws TException {
+        HashMap<String, String> filters = new HashMap<>();
+        filters.put(DBConstants.EntityTypeTable.DOMAIN_ID, domain);
+        return entityTypeRepository.select(domain, offset, limit);
+    }
+
+    /**
+     * * Permission Operations
+     * *
+     */
+    @Override
+    public String createPermissionType(PermissionType permissionType) throws GovRegistryException, TException {
+        if(permissionTypeRepository.get(permissionType.permissionTypeId) != null)
+            throw new GovRegistryException("There exist PermissionType with given PermissionType id");
+        permissionType.setCreatedTime(System.currentTimeMillis());
+        permissionType.setUpdatedTime(System.currentTimeMillis());
+        permissionTypeRepository.create(permissionType);
+        return permissionType.permissionTypeId;
+    }
+
+    @Override
+    public boolean updatePermissionType(PermissionType permissionType) throws GovRegistryException, TException {
+        permissionType.setUpdatedTime(System.currentTimeMillis());
+        PermissionType oldPermissionType = permissionTypeRepository.get(permissionType.permissionTypeId);
+        permissionType = getUpdatedObject(oldPermissionType, permissionType);
+        permissionTypeRepository.update(permissionType);
+        return true;
+    }
+
+    @Override
+    public boolean deletePermissionType(String entityTypeId) throws GovRegistryException, TException {
+        permissionTypeRepository.delete(entityTypeId);
+        return true;
+    }
+
+    @Override
+    public PermissionType getPermissionType(String permissionTypeId) throws GovRegistryException, TException {
+        return permissionTypeRepository.get(permissionTypeId);
+    }
+
+    @Override
+    public List<PermissionType> getPermissionTypes(String domain, int offset, int limit) throws GovRegistryException, TException {
+        HashMap<String, String> filters = new HashMap<>();
+        filters.put(DBConstants.PermissionTypeTable.DOMAIN_ID, domain);
+        return permissionTypeRepository.select(filters, offset, limit);
+    }
+
+    /**
+     * * Entity Operations
+     * *
+     */
+    @Override
+    public String createEntity(Entity entity) throws GovRegistryException, TException {
+        if(entityRepository.get(entity.entityId) != null)
+            throw new GovRegistryException("There exist Entity with given Entity id");
+
+        entity.setCreatedTime(System.currentTimeMillis());
+        entity.setUpdatedTime(System.currentTimeMillis());
+        entityRepository.create(entity);
+
+        //Assigning global permission for the owner
+        Sharing newSharing = new Sharing();
+        newSharing.setPermissionTypeId(permissionTypeRepository.getGlobalPermissionTypeIdForDomain(entity.domainId));
+        newSharing.setEntityId(entity.entityId);
+        newSharing.setGroupId(entity.ownerId);
+        newSharing.setGroupType(GroupType.SINGLE_USER);
+        newSharing.setSharingType(SharingType.DIRECT);
+        newSharing.setCreatedTime(System.currentTimeMillis());
+        newSharing.setUpdatedTime(System.currentTimeMillis());
+
+        sharingRepository.create(newSharing);
+
+        //creating records for inherited permissions
+        if(entity.getParentEntityId() != null && entity.getParentEntityId() != ""){
+            List<Sharing> sharings = sharingRepository.getPermissionsForEntity(entity.parentEntityId);
+            for(Sharing sharing : sharings){
+                newSharing = new Sharing();
+                newSharing.setPermissionTypeId(sharing.permissionTypeId);
+                newSharing.setEntityId(entity.entityId);
+                newSharing.setGroupId(sharing.groupId);
+                newSharing.setGroupType(sharing.groupType);
+                newSharing.setSharingType(SharingType.INHERITED);
+                newSharing.setCreatedTime(System.currentTimeMillis());
+                newSharing.setUpdatedTime(System.currentTimeMillis());
+
+                sharingRepository.create(newSharing);
+            }
+        }
+
+        return entity.entityId;
+    }
+
+    @Override
+    public boolean updateEntity(Entity entity) throws GovRegistryException, TException {
+        //TODO Check for permission changes
+        entity.setUpdatedTime(System.currentTimeMillis());
+        Entity oldEntity = entityRepository.get(entity.getEntityId());
+        entity.setCreatedTime(oldEntity.createdTime);
+        entity = getUpdatedObject(oldEntity, entity);
+        entityRepository.update(entity);
+        return true;
+    }
+
+    @Override
+    public boolean deleteEntity(String entityId) throws GovRegistryException, TException {
+        //TODO Check for permission changes
+        entityRepository.delete(entityId);
+        return true;
+    }
+
+    @Override
+    public Entity getEntity(String entityId) throws GovRegistryException, TException {
+        return entityRepository.get(entityId);
+    }
+
+    @Override
+    public List<Entity> searchEntities(String userId, String entityTypeId, Map<EntitySearchFields, String> filters,
+                                       int offset, int limit) throws GovRegistryException, TException {
+        List<String> groupIds = new ArrayList<>();
+        groupIds.add(userId);
+        groupMembershipRepository.getAllParentMembershipsForChild(userId).stream().forEach(gm->groupIds.add(gm.parentId));
+        return entityRepository.searchEntities(groupIds, entityTypeId, filters, offset, limit);
+    }
+
+    /**
+     * * Sharing Entity with Users and Groups
+     * *
+     *
+     * @param entityId
+     * @param userList
+     * @param permissionType
+     */
+    @Override
+    public boolean shareEntityWithUsers(String entityId, List<String> userList, String permissionTypeId) throws GovRegistryException, TException {
+        return shareEntity(entityId, userList, permissionTypeId, GroupType.SINGLE_USER);
+    }
+
+    @Override
+    public boolean shareEntityWithGroups(String entityId, List<String> groupList, String permissionTypeId) throws GovRegistryException, TException {
+        return shareEntity(entityId, groupList, permissionTypeId, GroupType.MULTI_USER);
+    }
+
+    private boolean shareEntity(String entityId, List<String> groupOrUserList, String permissionTypeId, GroupType groupType)  throws GovRegistryException, TException {
+        //Adding permission for the specified users/groups for the specified entity
+        LinkedList<Entity> temp = new LinkedList<>();
+        for(String userId : groupOrUserList){
+            Sharing sharing = new Sharing();
+            sharing.setPermissionTypeId(permissionTypeId);
+            sharing.setEntityId(entityId);
+            sharing.setGroupId(userId);
+            sharing.setGroupType(groupType);
+            sharing.setSharingType(SharingType.DIRECT);
+            sharing.setCreatedTime(System.currentTimeMillis());
+            sharing.setUpdatedTime(System.currentTimeMillis());
+
+            sharingRepository.create(sharing);
+        }
+
+        //Adding permission for the specified users/groups for all child entities
+        entityRepository.getChildEntities(entityId).stream().forEach(e-> temp.addLast(e));
+        while(temp.size() > 0){
+            Entity entity = temp.pop();
+            String childEntityId = entity.entityId;
+            String parentEntityId = entity.parentEntityId;
+            for(String userId : groupOrUserList){
+                Sharing sharing = new Sharing();
+                sharing.setPermissionTypeId(permissionTypeId);
+                sharing.setEntityId(childEntityId);
+                sharing.setGroupId(userId);
+                sharing.setGroupType(groupType);
+                sharing.setSharingType(SharingType.INHERITED);
+                sharing.setInheritedParentId(parentEntityId);
+                sharing.setCreatedTime(System.currentTimeMillis());
+                sharing.setUpdatedTime(System.currentTimeMillis());
+                sharingRepository.create(sharing);
+                entityRepository.getChildEntities(childEntityId).stream().forEach(e-> temp.addLast(e));
+            }
+        }
+        return true;
+    }
+
+    @Override
+    public boolean revokeEntitySharingFromUsers(String entityId, List<String> userList, String permissionTypeId) throws GovRegistryException, TException {
+        return revokeEntitySharing(entityId, userList, permissionTypeId);
+    }
+
+
+    @Override
+    public boolean revokeEntitySharingFromGroups(String entityId, List<String> groupList, String permissionTypeId) throws GovRegistryException, TException {
+        return revokeEntitySharing(entityId, groupList, permissionTypeId);
+    }
+
+    @Override
+    public boolean userHasAccess(String domainId, String userId, String entityId, String permissionTypeId) throws GovRegistryException, TException {
+        //check whether the user has permission directly or indirectly
+        List<GroupMembership> parentMemberships = groupMembershipRepository.getAllParentMembershipsForChild(userId);
+        List<String> groupIds = new ArrayList<>();
+        parentMemberships.stream().forEach(pm->groupIds.add(pm.parentId));
+        groupIds.add(userId);
+        return sharingRepository.hasAccess(entityId, groupIds, Arrays.asList(permissionTypeId,
+                permissionTypeRepository.getGlobalPermissionTypeIdForDomain(domainId)));
+    }
+
+    public boolean revokeEntitySharing(String entityId, List<String> groupOrUserList, String permissionTypeId) throws GovRegistryException {
+        //revoking permission for the entity
+        LinkedList<Sharing> temp = new LinkedList<>();
+        sharingRepository.getIndirectSharedChildren(entityId, permissionTypeId).stream().forEach(s->temp.addLast(s));
+        for(String groupId : groupOrUserList){
+            SharingEntityPK sharingEntityPK = new SharingEntityPK();
+            sharingEntityPK.setEntityId(entityId);
+            sharingEntityPK.setGroupId(groupId);
+            sharingEntityPK.setPermissionTypeId(permissionTypeId);
+
+            sharingRepository.delete(sharingEntityPK);
+        }
+
+        //revoking permission from inheritance
+        while(temp.size() > 0){
+            Sharing sharing = temp.pop();
+            String childEntityId = sharing.entityId;
+            sharingRepository.getIndirectSharedChildren(sharing.entityId, permissionTypeId).stream().forEach(s->temp.addLast(s));
+            for(String groupId : groupOrUserList){
+                SharingEntityPK sharingEntityPK = new SharingEntityPK();
+                sharingEntityPK.setEntityId(childEntityId);
+                sharingEntityPK.setGroupId(groupId);
+                sharingEntityPK.setPermissionTypeId(permissionTypeId);
+
+                sharingRepository.delete(sharingEntityPK);
+            }
+        }
+        return true;
+    }
+
+
+
+    private <T> T getUpdatedObject(T oldEntity, T newEntity) throws GovRegistryException {
+        Field[] newEntityFields = newEntity.getClass().getDeclaredFields();
+        Hashtable newHT = fieldsToHT(newEntityFields, newEntity);
+
+        Class oldEntityClass = oldEntity.getClass();
+        Field[] oldEntityFields = oldEntityClass.getDeclaredFields();
+
+        for (Field field : oldEntityFields){
+            field.setAccessible(true);
+            Object o = newHT.get(field.getName());
+            if (o != null){
+                Field f = null;
+                try {
+                    f = oldEntityClass.getDeclaredField(field.getName());
+                    f.setAccessible(true);
+                    logger.debug("setting " + f.getName());
+                    f.set(oldEntity, o);
+                } catch (Exception e) {
+                    throw new GovRegistryException(e.getMessage());
+                }
+            }
+        }
+        return oldEntity;
+    }
+
+    private static Hashtable<String, Object> fieldsToHT(Field[] fields, Object obj){
+        Hashtable<String,Object> hashtable = new Hashtable<>();
+        for (Field field: fields){
+            field.setAccessible(true);
+            try {
+                Object retrievedObject = field.get(obj);
+                if (retrievedObject != null){
+                    logger.debug("scanning " + field.getName());
+                    hashtable.put(field.getName(), field.get(obj));
+                }
+            } catch (IllegalAccessException e) {
+                e.printStackTrace();
+            }
+        }
+        return hashtable;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-core/src/main/resources/META-INF/persistence.xml
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-core/src/main/resources/META-INF/persistence.xml b/modules/sharing-registry/sharing-registry-core/src/main/resources/META-INF/persistence.xml
new file mode 100644
index 0000000..a9f808c
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-core/src/main/resources/META-INF/persistence.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0">
+
+    <persistence-unit name="airavata-sharing-registry">
+        <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
+        <class>org.apache.airavata.sharing.registry.db.entities.DomainEntity</class>
+        <class>org.apache.airavata.sharing.registry.db.entities.EntityEntity</class>
+        <class>org.apache.airavata.sharing.registry.db.entities.EntityTypeEntity</class>
+        <class>org.apache.airavata.sharing.registry.db.entities.GroupMembershipEntity</class>
+        <class>org.apache.airavata.sharing.registry.db.entities.PermissionTypeEntity</class>
+        <class>org.apache.airavata.sharing.registry.db.entities.SharingEntity</class>
+        <class>org.apache.airavata.sharing.registry.db.entities.UserEntity</class>
+        <class>org.apache.airavata.sharing.registry.db.entities.UserGroupEntity</class>
+    </persistence-unit>
+</persistence>

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-core/src/main/resources/sharing-registry-derby.sql
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-core/src/main/resources/sharing-registry-derby.sql b/modules/sharing-registry/sharing-registry-core/src/main/resources/sharing-registry-derby.sql
new file mode 100644
index 0000000..4b046ce
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-core/src/main/resources/sharing-registry-derby.sql
@@ -0,0 +1,139 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+CREATE TABLE DOMAIN (
+  DOMAIN_ID VARCHAR(255) NOT NULL,
+  NAME VARCHAR(255) NOT NULL,
+  DESCRIPTION VARCHAR(255),
+  CREATED_TIME BIGINT NOT NULL,
+  UPDATED_TIME BIGINT NOT NULL,
+  PRIMARY KEY (DOMAIN_ID)
+);
+
+CREATE TABLE USER (
+  USER_ID VARCHAR(255) NOT NULL,
+  DOMAIN_ID VARCHAR(255) NOT NULL,
+  USER_NAME VARCHAR(255) NOT NULL,
+  CREATED_TIME BIGINT NOT NULL,
+  UPDATED_TIME BIGINT NOT NULL,
+  PRIMARY KEY (USER_ID),
+  FOREIGN KEY (DOMAIN_ID) REFERENCES DOMAIN(DOMAIN_ID) ON DELETE CASCADE ON UPDATE CASCADE
+);
+
+CREATE TABLE USER_GROUP (
+  GROUP_ID VARCHAR(255) NOT NULL,
+  DOMAIN_ID VARCHAR(255) NOT NULL,
+  NAME VARCHAR(255) NOT NULL,
+  DESCRIPTION VARCHAR(255),
+  OWNER_ID VARCHAR(255) NOT NULL,
+  GROUP_TYPE VARCHAR(255) NOT NULL,
+  CREATED_TIME BIGINT NOT NULL,
+  UPDATED_TIME BIGINT NOT NULL,
+  PRIMARY KEY (GROUP_ID),
+  FOREIGN KEY (DOMAIN_ID) REFERENCES DOMAIN(DOMAIN_ID) ON DELETE CASCADE ON UPDATE CASCADE,
+  FOREIGN KEY (OWNER_ID) REFERENCES USER(USER_ID) ON DELETE CASCADE ON UPDATE CASCADE
+);
+
+
+CREATE TABLE GROUP_MEMBERSHIP (
+  PARENT_ID VARCHAR(255) NOT NULL,
+  CHILD_ID VARCHAR(255) NOT NULL,
+  CHILD_TYPE VARCHAR(255) NOT NULL,
+  CREATED_TIME BIGINT NOT NULL,
+  UPDATED_TIME BIGINT NOT NULL,
+  PRIMARY KEY (PARENT_ID, CHILD_ID),
+  FOREIGN KEY (PARENT_ID) REFERENCES USER_GROUP(GROUP_ID) ON DELETE CASCADE ON UPDATE CASCADE,
+  FOREIGN KEY (CHILD_ID) REFERENCES USER_GROUP(GROUP_ID) ON DELETE CASCADE ON UPDATE CASCADE
+);
+
+CREATE TABLE ENTITY_TYPE (
+  ENTITY_TYPE_ID VARCHAR(255) NOT NULL,
+  DOMAIN_ID VARCHAR(255) NOT NULL,
+  NAME VARCHAR(255) NOT NULL,
+  DESCRIPTION VARCHAR(255),
+  CREATED_TIME BIGINT NOT NULL,
+  UPDATED_TIME BIGINT NOT NULL,
+  PRIMARY KEY (ENTITY_TYPE_ID),
+  FOREIGN KEY (DOMAIN_ID) REFERENCES DOMAIN(DOMAIN_ID) ON DELETE CASCADE ON UPDATE CASCADE
+);
+
+CREATE TABLE PERMISSION_TYPE (
+  PERMISSION_TYPE_ID VARCHAR(255) NOT NULL,
+  DOMAIN_ID VARCHAR(255) NOT NULL,
+  NAME VARCHAR(255) NOT NULL,
+  DESCRIPTION VARCHAR(255),
+  CREATED_TIME BIGINT NOT NULL,
+  UPDATED_TIME BIGINT NOT NULL,
+  PRIMARY KEY (PERMISSION_TYPE_ID),
+  FOREIGN KEY (DOMAIN_ID) REFERENCES DOMAIN(DOMAIN_ID) ON DELETE CASCADE ON UPDATE CASCADE
+);
+
+CREATE TABLE ENTITY (
+  ENTITY_ID VARCHAR(255) NOT NULL,
+  DOMAIN_ID VARCHAR(255) NOT NULL,
+  ENTITY_TYPE_ID VARCHAR(255) NOT NULL,
+  OWNER_ID VARCHAR(255) NOT NULL,
+  PARENT_ENTITY_ID VARCHAR(255),
+  NAME VARCHAR(255) NOT NULL,
+  DESCRIPTION VARCHAR(255),
+  FULL_TEXT TEXT,
+  CREATED_TIME BIGINT NOT NULL,
+  UPDATED_TIME BIGINT NOT NULL,
+  PRIMARY KEY (ENTITY_ID),
+  FOREIGN KEY (DOMAIN_ID) REFERENCES DOMAIN(DOMAIN_ID) ON DELETE CASCADE ON UPDATE CASCADE,
+  FOREIGN KEY (ENTITY_TYPE_ID) REFERENCES ENTITY_TYPE(ENTITY_TYPE_ID) ON DELETE CASCADE ON UPDATE CASCADE,
+  FOREIGN KEY (OWNER_ID) REFERENCES USER(USER_ID) ON DELETE CASCADE ON UPDATE CASCADE,
+  FOREIGN KEY (PARENT_ENTITY_ID) REFERENCES ENTITY(ENTITY_ID) ON DELETE CASCADE ON UPDATE CASCADE
+);
+
+ALTER TABLE ENTITY ADD FULLTEXT FULL_TEXT_INDEX(FULL_TEXT);
+
+CREATE TABLE ENTITY_METADATA (
+  ENTITY_ID VARCHAR (255) NOT NULL,
+  META_KEY VARCHAR (255) NOT NULL,
+  META_VALUE VARCHAR (255) NOT NULL,
+  PRIMARY KEY (ENTITY_ID, META_KEY),
+  FOREIGN KEY (ENTITY_ID) REFERENCES ENTITY(ENTITY_ID) ON DELETE CASCADE ON UPDATE CASCADE
+);
+
+CREATE TABLE SHARING (
+  PERMISSION_TYPE_ID VARCHAR(255) NOT NULL,
+  ENTITY_ID VARCHAR(255) NOT NULL,
+  GROUP_ID VARCHAR(255) NOT NULL,
+  GROUP_TYPE VARCHAR(255) NOT NULL,
+  SHARING_TYPE VARCHAR(255) NOT NULL,
+  INHERITED_PARENT_ID VARCHAR(255),
+  CREATED_TIME BIGINT NOT NULL,
+  UPDATED_TIME BIGINT NOT NULL,
+  PRIMARY KEY (PERMISSION_TYPE_ID, ENTITY_ID, GROUP_ID),
+  FOREIGN KEY (PERMISSION_TYPE_ID) REFERENCES PERMISSION_TYPE(PERMISSION_TYPE_ID) ON DELETE CASCADE ON UPDATE CASCADE,
+  FOREIGN KEY (INHERITED_PARENT_ID) REFERENCES ENTITY(ENTITY_ID) ON DELETE CASCADE ON UPDATE CASCADE,
+  FOREIGN KEY (GROUP_ID) REFERENCES USER_GROUP(GROUP_ID) ON DELETE CASCADE ON UPDATE CASCADE
+);
+
+CREATE TABLE CONFIGURATION
+(
+  CONFIG_KEY VARCHAR(255) NOT NULL,
+  CONFIG_VALUE VARCHAR(255) NOT NULL,
+  PRIMARY KEY(CONFIG_KEY, CONFIG_VALUE)
+);
+
+INSERT INTO CONFIGURATION (CONFIG_KEY, CONFIG_VALUE) VALUES('sharing_reg_version', '0.17');
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-core/src/main/resources/sharing-registry-mysql.sql
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-core/src/main/resources/sharing-registry-mysql.sql b/modules/sharing-registry/sharing-registry-core/src/main/resources/sharing-registry-mysql.sql
new file mode 100644
index 0000000..4b046ce
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-core/src/main/resources/sharing-registry-mysql.sql
@@ -0,0 +1,139 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+CREATE TABLE DOMAIN (
+  DOMAIN_ID VARCHAR(255) NOT NULL,
+  NAME VARCHAR(255) NOT NULL,
+  DESCRIPTION VARCHAR(255),
+  CREATED_TIME BIGINT NOT NULL,
+  UPDATED_TIME BIGINT NOT NULL,
+  PRIMARY KEY (DOMAIN_ID)
+);
+
+CREATE TABLE USER (
+  USER_ID VARCHAR(255) NOT NULL,
+  DOMAIN_ID VARCHAR(255) NOT NULL,
+  USER_NAME VARCHAR(255) NOT NULL,
+  CREATED_TIME BIGINT NOT NULL,
+  UPDATED_TIME BIGINT NOT NULL,
+  PRIMARY KEY (USER_ID),
+  FOREIGN KEY (DOMAIN_ID) REFERENCES DOMAIN(DOMAIN_ID) ON DELETE CASCADE ON UPDATE CASCADE
+);
+
+CREATE TABLE USER_GROUP (
+  GROUP_ID VARCHAR(255) NOT NULL,
+  DOMAIN_ID VARCHAR(255) NOT NULL,
+  NAME VARCHAR(255) NOT NULL,
+  DESCRIPTION VARCHAR(255),
+  OWNER_ID VARCHAR(255) NOT NULL,
+  GROUP_TYPE VARCHAR(255) NOT NULL,
+  CREATED_TIME BIGINT NOT NULL,
+  UPDATED_TIME BIGINT NOT NULL,
+  PRIMARY KEY (GROUP_ID),
+  FOREIGN KEY (DOMAIN_ID) REFERENCES DOMAIN(DOMAIN_ID) ON DELETE CASCADE ON UPDATE CASCADE,
+  FOREIGN KEY (OWNER_ID) REFERENCES USER(USER_ID) ON DELETE CASCADE ON UPDATE CASCADE
+);
+
+
+CREATE TABLE GROUP_MEMBERSHIP (
+  PARENT_ID VARCHAR(255) NOT NULL,
+  CHILD_ID VARCHAR(255) NOT NULL,
+  CHILD_TYPE VARCHAR(255) NOT NULL,
+  CREATED_TIME BIGINT NOT NULL,
+  UPDATED_TIME BIGINT NOT NULL,
+  PRIMARY KEY (PARENT_ID, CHILD_ID),
+  FOREIGN KEY (PARENT_ID) REFERENCES USER_GROUP(GROUP_ID) ON DELETE CASCADE ON UPDATE CASCADE,
+  FOREIGN KEY (CHILD_ID) REFERENCES USER_GROUP(GROUP_ID) ON DELETE CASCADE ON UPDATE CASCADE
+);
+
+CREATE TABLE ENTITY_TYPE (
+  ENTITY_TYPE_ID VARCHAR(255) NOT NULL,
+  DOMAIN_ID VARCHAR(255) NOT NULL,
+  NAME VARCHAR(255) NOT NULL,
+  DESCRIPTION VARCHAR(255),
+  CREATED_TIME BIGINT NOT NULL,
+  UPDATED_TIME BIGINT NOT NULL,
+  PRIMARY KEY (ENTITY_TYPE_ID),
+  FOREIGN KEY (DOMAIN_ID) REFERENCES DOMAIN(DOMAIN_ID) ON DELETE CASCADE ON UPDATE CASCADE
+);
+
+CREATE TABLE PERMISSION_TYPE (
+  PERMISSION_TYPE_ID VARCHAR(255) NOT NULL,
+  DOMAIN_ID VARCHAR(255) NOT NULL,
+  NAME VARCHAR(255) NOT NULL,
+  DESCRIPTION VARCHAR(255),
+  CREATED_TIME BIGINT NOT NULL,
+  UPDATED_TIME BIGINT NOT NULL,
+  PRIMARY KEY (PERMISSION_TYPE_ID),
+  FOREIGN KEY (DOMAIN_ID) REFERENCES DOMAIN(DOMAIN_ID) ON DELETE CASCADE ON UPDATE CASCADE
+);
+
+CREATE TABLE ENTITY (
+  ENTITY_ID VARCHAR(255) NOT NULL,
+  DOMAIN_ID VARCHAR(255) NOT NULL,
+  ENTITY_TYPE_ID VARCHAR(255) NOT NULL,
+  OWNER_ID VARCHAR(255) NOT NULL,
+  PARENT_ENTITY_ID VARCHAR(255),
+  NAME VARCHAR(255) NOT NULL,
+  DESCRIPTION VARCHAR(255),
+  FULL_TEXT TEXT,
+  CREATED_TIME BIGINT NOT NULL,
+  UPDATED_TIME BIGINT NOT NULL,
+  PRIMARY KEY (ENTITY_ID),
+  FOREIGN KEY (DOMAIN_ID) REFERENCES DOMAIN(DOMAIN_ID) ON DELETE CASCADE ON UPDATE CASCADE,
+  FOREIGN KEY (ENTITY_TYPE_ID) REFERENCES ENTITY_TYPE(ENTITY_TYPE_ID) ON DELETE CASCADE ON UPDATE CASCADE,
+  FOREIGN KEY (OWNER_ID) REFERENCES USER(USER_ID) ON DELETE CASCADE ON UPDATE CASCADE,
+  FOREIGN KEY (PARENT_ENTITY_ID) REFERENCES ENTITY(ENTITY_ID) ON DELETE CASCADE ON UPDATE CASCADE
+);
+
+ALTER TABLE ENTITY ADD FULLTEXT FULL_TEXT_INDEX(FULL_TEXT);
+
+CREATE TABLE ENTITY_METADATA (
+  ENTITY_ID VARCHAR (255) NOT NULL,
+  META_KEY VARCHAR (255) NOT NULL,
+  META_VALUE VARCHAR (255) NOT NULL,
+  PRIMARY KEY (ENTITY_ID, META_KEY),
+  FOREIGN KEY (ENTITY_ID) REFERENCES ENTITY(ENTITY_ID) ON DELETE CASCADE ON UPDATE CASCADE
+);
+
+CREATE TABLE SHARING (
+  PERMISSION_TYPE_ID VARCHAR(255) NOT NULL,
+  ENTITY_ID VARCHAR(255) NOT NULL,
+  GROUP_ID VARCHAR(255) NOT NULL,
+  GROUP_TYPE VARCHAR(255) NOT NULL,
+  SHARING_TYPE VARCHAR(255) NOT NULL,
+  INHERITED_PARENT_ID VARCHAR(255),
+  CREATED_TIME BIGINT NOT NULL,
+  UPDATED_TIME BIGINT NOT NULL,
+  PRIMARY KEY (PERMISSION_TYPE_ID, ENTITY_ID, GROUP_ID),
+  FOREIGN KEY (PERMISSION_TYPE_ID) REFERENCES PERMISSION_TYPE(PERMISSION_TYPE_ID) ON DELETE CASCADE ON UPDATE CASCADE,
+  FOREIGN KEY (INHERITED_PARENT_ID) REFERENCES ENTITY(ENTITY_ID) ON DELETE CASCADE ON UPDATE CASCADE,
+  FOREIGN KEY (GROUP_ID) REFERENCES USER_GROUP(GROUP_ID) ON DELETE CASCADE ON UPDATE CASCADE
+);
+
+CREATE TABLE CONFIGURATION
+(
+  CONFIG_KEY VARCHAR(255) NOT NULL,
+  CONFIG_VALUE VARCHAR(255) NOT NULL,
+  PRIMARY KEY(CONFIG_KEY, CONFIG_VALUE)
+);
+
+INSERT INTO CONFIGURATION (CONFIG_KEY, CONFIG_VALUE) VALUES('sharing_reg_version', '0.17');
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-core/src/test/java/org/apache/airavata/sharing/registry/GovRegistryServerHandlerTest.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-core/src/test/java/org/apache/airavata/sharing/registry/GovRegistryServerHandlerTest.java b/modules/sharing-registry/sharing-registry-core/src/test/java/org/apache/airavata/sharing/registry/GovRegistryServerHandlerTest.java
new file mode 100644
index 0000000..688117c
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-core/src/test/java/org/apache/airavata/sharing/registry/GovRegistryServerHandlerTest.java
@@ -0,0 +1,272 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.sharing.registry;
+
+import junit.framework.Assert;
+import org.apache.airavata.sharing.registry.models.*;
+import org.apache.airavata.sharing.registry.server.SharingRegistryServerHandler;
+import org.apache.thrift.TException;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+public class GovRegistryServerHandlerTest {
+    private final static Logger logger = LoggerFactory.getLogger(GovRegistryServerHandlerTest.class);
+
+    @Test
+    public void test() throws TException {
+        SharingRegistryServerHandler govRegistryServerHandler = new SharingRegistryServerHandler();
+
+        //Creating domain
+        Domain domain = new Domain();
+        String domainId = "test-domain."+System.currentTimeMillis();
+        domain.setDomainId(domainId);
+        domain.setName(domainId);
+        domain.setDescription("test domain description");
+        domain.setCreatedTime(System.currentTimeMillis());
+        domain.setUpdatedTime(System.currentTimeMillis());
+
+        Assert.assertNotNull(govRegistryServerHandler.createDomain(domain));
+        Assert.assertTrue(govRegistryServerHandler.getDomains(0, 10).size() > 0);
+
+
+        //Creating users
+        User user1 = new User();
+        String userName1 = "test-user-1." + System.currentTimeMillis();
+        String userId1 = domainId + ":" + userName1;
+        user1.setUserId(userId1);
+        user1.setUserName(userName1);
+        user1.setDomainId(domainId);
+        user1.setCreatedTime(System.currentTimeMillis());
+        user1.setUpdatedTime(System.currentTimeMillis());
+
+        Assert.assertNotNull(govRegistryServerHandler.createUser(user1));
+
+        User user2 = new User();
+        String userName2 = "test-user-2." + System.currentTimeMillis();
+        String userId2 = domainId + ":" + userName2;
+        user2.setUserId(userId2);
+        user2.setUserName(userName2);
+        user2.setDomainId(domainId);
+        user2.setCreatedTime(System.currentTimeMillis());
+        user2.setUpdatedTime(System.currentTimeMillis());
+
+        Assert.assertNotNull(govRegistryServerHandler.createUser(user2));
+
+        User user3 = new User();
+        String userName3 = "test-user-3." + System.currentTimeMillis();
+        String userId3 = domainId + ":" + userName3;
+        user3.setUserId(userId3);
+        user3.setUserName(userName3);
+        user3.setDomainId(domainId);
+        user3.setCreatedTime(System.currentTimeMillis());
+        user3.setUpdatedTime(System.currentTimeMillis());
+
+        Assert.assertNotNull(govRegistryServerHandler.createUser(user3));
+
+        Assert.assertTrue(govRegistryServerHandler.getUsers(domainId, 0, 10).size() > 0);
+
+        // Creating user groups
+        UserGroup userGroup1 = new UserGroup();
+        String groupName1 = "test-group-1." + System.currentTimeMillis();
+        String groupId1 = domainId + ":" + groupName1;
+        userGroup1.setGroupId(groupId1);
+        userGroup1.setDomainId(domainId);
+        userGroup1.setName(groupName1);
+        userGroup1.setDescription("test group description");
+        userGroup1.setOwnerId(userId1);
+        userGroup1.setGroupType(GroupType.MULTI_USER);
+        userGroup1.setCreatedTime(System.currentTimeMillis());
+        userGroup1.setUpdatedTime(System.currentTimeMillis());
+
+        Assert.assertNotNull(govRegistryServerHandler.createGroup(userGroup1));
+
+        UserGroup userGroup2 = new UserGroup();
+        String groupName2 = "test-group-2." + System.currentTimeMillis();
+        String groupId2 = domainId + ":" + groupName2;
+        userGroup2.setGroupId(groupId2);
+        userGroup2.setDomainId(domainId);
+        userGroup2.setName(groupName2);
+        userGroup2.setDescription("test group description");
+        userGroup2.setOwnerId(userId2);
+        userGroup2.setGroupType(GroupType.MULTI_USER);
+        userGroup2.setCreatedTime(System.currentTimeMillis());
+        userGroup2.setUpdatedTime(System.currentTimeMillis());
+
+        Assert.assertNotNull(govRegistryServerHandler.createGroup(userGroup2));
+
+        govRegistryServerHandler.addUsersToGroup(Arrays.asList(userId1), groupId1);
+        govRegistryServerHandler.addUsersToGroup(Arrays.asList(userId2, userId3), groupId2);
+        govRegistryServerHandler.addChildGroupToParentGroup(groupId2, groupId1);
+
+        Assert.assertTrue(govRegistryServerHandler.getGroupMembers(groupId1, 0, 10).size() == 2);
+        Assert.assertTrue(govRegistryServerHandler.getGroupMembers(groupId2, 0, 10).size() == 2);
+
+
+        //Creating permission types
+        PermissionType permissionType1 = new PermissionType();
+        String permissionName1 = "READ";
+        permissionType1.setPermissionTypeId(domainId+":"+permissionName1);
+        permissionType1.setDomainId(domainId);
+        permissionType1.setName(permissionName1);
+        permissionType1.setDescription("READ description");
+        permissionType1.setCreatedTime(System.currentTimeMillis());
+        permissionType1.setUpdatedTime(System.currentTimeMillis());
+        String permissionTypeId1 = govRegistryServerHandler.createPermissionType(permissionType1);
+        Assert.assertNotNull(permissionTypeId1);
+
+        PermissionType permissionType2 = new PermissionType();
+        String permissionName2 = "WRITE";
+        permissionType2.setPermissionTypeId(domainId+":"+permissionName2);
+        permissionType2.setDomainId(domainId);
+        permissionType2.setName(permissionName2);
+        permissionType2.setDescription("WRITE description");
+        permissionType2.setCreatedTime(System.currentTimeMillis());
+        permissionType2.setUpdatedTime(System.currentTimeMillis());
+        String permissionTypeId2 = govRegistryServerHandler.createPermissionType(permissionType2);
+        Assert.assertNotNull(permissionTypeId2);
+
+        //Creating entity types
+        EntityType entityType1 = new EntityType();
+        String entityType1Name = "Project";
+        entityType1.setEntityTypeId(domainId+":"+entityType1Name);
+        entityType1.setDomainId(domainId);
+        entityType1.setName(entityType1Name);
+        entityType1.setDescription("test entity type");
+        entityType1.setCreatedTime(System.currentTimeMillis());
+        entityType1.setUpdatedTime(System.currentTimeMillis());
+        String entityTypeId1 = govRegistryServerHandler.createEntityType(entityType1);
+        Assert.assertNotNull(entityTypeId1);
+
+        EntityType entityType2 = new EntityType();
+        String entityType2Name = "Experiment";
+        entityType2.setEntityTypeId(domainId+":"+entityType2Name);
+        entityType2.setDomainId(domainId);
+        entityType2.setName(entityType2Name);
+        entityType2.setDescription("test entity type");
+        entityType2.setCreatedTime(System.currentTimeMillis());
+        entityType2.setUpdatedTime(System.currentTimeMillis());
+        String entityTypeId2 = govRegistryServerHandler.createEntityType(entityType2);
+        Assert.assertNotNull(entityTypeId2);
+
+        EntityType entityType3 = new EntityType();
+        String entityType3Name = "FileInput";
+        entityType3.setEntityTypeId(domainId+":"+entityType3Name);
+        entityType3.setDomainId(domainId);
+        entityType3.setName(entityType3Name);
+        entityType3.setDescription("file input type");
+        entityType3.setCreatedTime(System.currentTimeMillis());
+        entityType3.setUpdatedTime(System.currentTimeMillis());
+        String entityTypeId3 = govRegistryServerHandler.createEntityType(entityType3);
+        Assert.assertNotNull(entityTypeId3);
+
+        //Creating Entities
+        Entity entity1 = new Entity();
+        entity1.setEntityId(domainId+":Entity1");
+        entity1.setDomainId(domainId);
+        entity1.setEntityTypeId(entityTypeId1);
+        entity1.setOwnerId(userId1);
+        entity1.setName("Project name 1");
+        entity1.setDescription("Project description");
+        Map<String, String> metadataMap = new HashMap<>();
+        metadataMap.put("key", "val");
+        entity1.setMetadata(metadataMap);
+        entity1.setFullText("Project name project description");
+        entity1.setCreatedTime(System.currentTimeMillis());
+        entity1.setUpdatedTime(System.currentTimeMillis());
+
+        String entityId1 = govRegistryServerHandler.createEntity(entity1);
+        Assert.assertNotNull(entityId1);
+
+        Entity entity2 = new Entity();
+        entity2.setEntityId(domainId+":Entity2");
+        entity2.setDomainId(domainId);
+        entity2.setEntityTypeId(entityTypeId2);
+        entity2.setOwnerId(userId1);
+        entity2.setName("Experiment name");
+        entity2.setDescription("Experiment description");
+        entity2.setParentEntityId(entityId1);
+        metadataMap = new HashMap<>();
+        metadataMap.put("key", "val");
+        entity2.setMetadata(metadataMap);
+        entity2.setFullText("Project name project description");
+        entity2.setCreatedTime(System.currentTimeMillis());
+        entity2.setUpdatedTime(System.currentTimeMillis());
+
+        String entityId2 = govRegistryServerHandler.createEntity(entity2);
+        Assert.assertNotNull(entityId2);
+
+        Entity entity3 = new Entity();
+        entity3.setEntityId(domainId+":Entity3");
+        entity3.setDomainId(domainId);
+        entity3.setEntityTypeId(entityTypeId2);
+        entity3.setOwnerId(userId1);
+        entity3.setName("Experiment name");
+        entity3.setDescription("Experiment description");
+        entity3.setParentEntityId(entityId1);
+        metadataMap = new HashMap<>();
+        metadataMap.put("key", "val");
+        entity3.setMetadata(metadataMap);
+        entity3.setFullText("Project name project description");
+        entity3.setCreatedTime(System.currentTimeMillis());
+        entity3.setUpdatedTime(System.currentTimeMillis());
+
+        String entityId3 = govRegistryServerHandler.createEntity(entity3);
+        Assert.assertNotNull(entityId3);
+
+        govRegistryServerHandler.shareEntityWithUsers(entityId1, Arrays.asList(userId2), permissionTypeId1);
+        govRegistryServerHandler.shareEntityWithGroups(entityId3, Arrays.asList(groupId2), permissionTypeId1);
+
+        Entity entity4 = new Entity();
+        entity4.setEntityId(domainId+":Entity4");
+        entity4.setDomainId(domainId);
+        entity4.setEntityTypeId(entityTypeId3);
+        entity4.setOwnerId(userId3);
+        entity4.setName("Input name");
+        entity4.setDescription("Input file description");
+        entity4.setParentEntityId(entityId3);
+        metadataMap = new HashMap<>();
+        metadataMap.put("key", "val");
+        entity4.setMetadata(metadataMap);
+        entity4.setFullText("Input File");
+        entity4.setCreatedTime(System.currentTimeMillis());
+        entity4.setUpdatedTime(System.currentTimeMillis());
+
+        String entityId4 = govRegistryServerHandler.createEntity(entity4);
+        Assert.assertNotNull(entityId4);
+
+        Assert.assertTrue(govRegistryServerHandler.userHasAccess(domainId, userId3, entityId4, permissionTypeId1));
+        Assert.assertTrue(govRegistryServerHandler.userHasAccess(domainId, userId2, entityId4, permissionTypeId1));
+        Assert.assertTrue(govRegistryServerHandler.userHasAccess(domainId, userId1, entityId4, permissionTypeId1));
+        Assert.assertFalse(govRegistryServerHandler.userHasAccess(domainId, userId3, entityId1, permissionTypeId1));
+
+        HashMap<EntitySearchFields, String> filters = new HashMap<>();
+        filters.put(EntitySearchFields.NAME, "Input");
+        Assert.assertTrue(govRegistryServerHandler.searchEntities(userId1, entityTypeId3, filters, 0, -1).size() > 0);
+
+//        govRegistryServerHandler.revokeEntitySharingFromUsers(entityId1, Arrays.asList(userId2), permissionTypeId1);
+//        govRegistryServerHandler.revokeEntitySharingFromGroups(entityId3, Arrays.asList(groupId2), permissionTypeId1);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-stubs/pom.xml
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-stubs/pom.xml b/modules/sharing-registry/sharing-registry-stubs/pom.xml
new file mode 100644
index 0000000..ff0334c
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-stubs/pom.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>airavata-sharing-registry</artifactId>
+        <groupId>org.apache.airavata</groupId>
+        <relativePath>../pom.xml</relativePath>
+        <version>${global.version}</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>airavata-sharing-registry-stubs</artifactId>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.thrift</groupId>
+            <artifactId>libthrift</artifactId>
+            <version>0.9.3</version>
+        </dependency>
+    </dependencies>
+
+
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/Domain.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/Domain.java b/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/Domain.java
new file mode 100644
index 0000000..367e04f
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/Domain.java
@@ -0,0 +1,817 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.3)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.airavata.sharing.registry.models;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import javax.annotation.Generated;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-05")
+public class Domain implements org.apache.thrift.TBase<Domain, Domain._Fields>, java.io.Serializable, Cloneable, Comparable<Domain> {
+  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Domain");
+
+  private static final org.apache.thrift.protocol.TField DOMAIN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("domainId", org.apache.thrift.protocol.TType.STRING, (short)1);
+  private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)2);
+  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)3);
+  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)4);
+  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)5);
+
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new DomainStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new DomainTupleSchemeFactory());
+  }
+
+  public String domainId; // optional
+  public String name; // optional
+  public String description; // optional
+  public long createdTime; // optional
+  public long updatedTime; // optional
+
+  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    DOMAIN_ID((short)1, "domainId"),
+    NAME((short)2, "name"),
+    DESCRIPTION((short)3, "description"),
+    CREATED_TIME((short)4, "createdTime"),
+    UPDATED_TIME((short)5, "updatedTime");
+
+    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+    static {
+      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+        byName.put(field.getFieldName(), field);
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, or null if its not found.
+     */
+    public static _Fields findByThriftId(int fieldId) {
+      switch(fieldId) {
+        case 1: // DOMAIN_ID
+          return DOMAIN_ID;
+        case 2: // NAME
+          return NAME;
+        case 3: // DESCRIPTION
+          return DESCRIPTION;
+        case 4: // CREATED_TIME
+          return CREATED_TIME;
+        case 5: // UPDATED_TIME
+          return UPDATED_TIME;
+        default:
+          return null;
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, throwing an exception
+     * if it is not found.
+     */
+    public static _Fields findByThriftIdOrThrow(int fieldId) {
+      _Fields fields = findByThriftId(fieldId);
+      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      return fields;
+    }
+
+    /**
+     * Find the _Fields constant that matches name, or null if its not found.
+     */
+    public static _Fields findByName(String name) {
+      return byName.get(name);
+    }
+
+    private final short _thriftId;
+    private final String _fieldName;
+
+    _Fields(short thriftId, String fieldName) {
+      _thriftId = thriftId;
+      _fieldName = fieldName;
+    }
+
+    public short getThriftFieldId() {
+      return _thriftId;
+    }
+
+    public String getFieldName() {
+      return _fieldName;
+    }
+  }
+
+  // isset id assignments
+  private static final int __CREATEDTIME_ISSET_ID = 0;
+  private static final int __UPDATEDTIME_ISSET_ID = 1;
+  private byte __isset_bitfield = 0;
+  private static final _Fields optionals[] = {_Fields.DOMAIN_ID,_Fields.NAME,_Fields.DESCRIPTION,_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);
+    tmpMap.put(_Fields.DOMAIN_ID, new org.apache.thrift.meta_data.FieldMetaData("domainId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("description", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    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, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
+    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Domain.class, metaDataMap);
+  }
+
+  public Domain() {
+    this.domainId = "DO_NOT_SET_AT_CLIENTS_ID";
+
+  }
+
+  /**
+   * Performs a deep copy on <i>other</i>.
+   */
+  public Domain(Domain other) {
+    __isset_bitfield = other.__isset_bitfield;
+    if (other.isSetDomainId()) {
+      this.domainId = other.domainId;
+    }
+    if (other.isSetName()) {
+      this.name = other.name;
+    }
+    if (other.isSetDescription()) {
+      this.description = other.description;
+    }
+    this.createdTime = other.createdTime;
+    this.updatedTime = other.updatedTime;
+  }
+
+  public Domain deepCopy() {
+    return new Domain(this);
+  }
+
+  @Override
+  public void clear() {
+    this.domainId = "DO_NOT_SET_AT_CLIENTS_ID";
+
+    this.name = null;
+    this.description = null;
+    setCreatedTimeIsSet(false);
+    this.createdTime = 0;
+    setUpdatedTimeIsSet(false);
+    this.updatedTime = 0;
+  }
+
+  public String getDomainId() {
+    return this.domainId;
+  }
+
+  public Domain setDomainId(String domainId) {
+    this.domainId = domainId;
+    return this;
+  }
+
+  public void unsetDomainId() {
+    this.domainId = null;
+  }
+
+  /** Returns true if field domainId is set (has been assigned a value) and false otherwise */
+  public boolean isSetDomainId() {
+    return this.domainId != null;
+  }
+
+  public void setDomainIdIsSet(boolean value) {
+    if (!value) {
+      this.domainId = null;
+    }
+  }
+
+  public String getName() {
+    return this.name;
+  }
+
+  public Domain setName(String name) {
+    this.name = name;
+    return this;
+  }
+
+  public void unsetName() {
+    this.name = null;
+  }
+
+  /** Returns true if field name is set (has been assigned a value) and false otherwise */
+  public boolean isSetName() {
+    return this.name != null;
+  }
+
+  public void setNameIsSet(boolean value) {
+    if (!value) {
+      this.name = null;
+    }
+  }
+
+  public String getDescription() {
+    return this.description;
+  }
+
+  public Domain setDescription(String description) {
+    this.description = description;
+    return this;
+  }
+
+  public void unsetDescription() {
+    this.description = null;
+  }
+
+  /** Returns true if field description is set (has been assigned a value) and false otherwise */
+  public boolean isSetDescription() {
+    return this.description != null;
+  }
+
+  public void setDescriptionIsSet(boolean value) {
+    if (!value) {
+      this.description = null;
+    }
+  }
+
+  public long getCreatedTime() {
+    return this.createdTime;
+  }
+
+  public Domain setCreatedTime(long createdTime) {
+    this.createdTime = createdTime;
+    setCreatedTimeIsSet(true);
+    return this;
+  }
+
+  public void unsetCreatedTime() {
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CREATEDTIME_ISSET_ID);
+  }
+
+  /** Returns true if field createdTime is set (has been assigned a value) and false otherwise */
+  public boolean isSetCreatedTime() {
+    return EncodingUtils.testBit(__isset_bitfield, __CREATEDTIME_ISSET_ID);
+  }
+
+  public void setCreatedTimeIsSet(boolean value) {
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CREATEDTIME_ISSET_ID, value);
+  }
+
+  public long getUpdatedTime() {
+    return this.updatedTime;
+  }
+
+  public Domain setUpdatedTime(long updatedTime) {
+    this.updatedTime = updatedTime;
+    setUpdatedTimeIsSet(true);
+    return this;
+  }
+
+  public void unsetUpdatedTime() {
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID);
+  }
+
+  /** Returns true if field updatedTime is set (has been assigned a value) and false otherwise */
+  public boolean isSetUpdatedTime() {
+    return EncodingUtils.testBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID);
+  }
+
+  public void setUpdatedTimeIsSet(boolean value) {
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID, value);
+  }
+
+  public void setFieldValue(_Fields field, Object value) {
+    switch (field) {
+    case DOMAIN_ID:
+      if (value == null) {
+        unsetDomainId();
+      } else {
+        setDomainId((String)value);
+      }
+      break;
+
+    case NAME:
+      if (value == null) {
+        unsetName();
+      } else {
+        setName((String)value);
+      }
+      break;
+
+    case DESCRIPTION:
+      if (value == null) {
+        unsetDescription();
+      } else {
+        setDescription((String)value);
+      }
+      break;
+
+    case CREATED_TIME:
+      if (value == null) {
+        unsetCreatedTime();
+      } else {
+        setCreatedTime((Long)value);
+      }
+      break;
+
+    case UPDATED_TIME:
+      if (value == null) {
+        unsetUpdatedTime();
+      } else {
+        setUpdatedTime((Long)value);
+      }
+      break;
+
+    }
+  }
+
+  public Object getFieldValue(_Fields field) {
+    switch (field) {
+    case DOMAIN_ID:
+      return getDomainId();
+
+    case NAME:
+      return getName();
+
+    case DESCRIPTION:
+      return getDescription();
+
+    case CREATED_TIME:
+      return getCreatedTime();
+
+    case UPDATED_TIME:
+      return getUpdatedTime();
+
+    }
+    throw new IllegalStateException();
+  }
+
+  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+  public boolean isSet(_Fields field) {
+    if (field == null) {
+      throw new IllegalArgumentException();
+    }
+
+    switch (field) {
+    case DOMAIN_ID:
+      return isSetDomainId();
+    case NAME:
+      return isSetName();
+    case DESCRIPTION:
+      return isSetDescription();
+    case CREATED_TIME:
+      return isSetCreatedTime();
+    case UPDATED_TIME:
+      return isSetUpdatedTime();
+    }
+    throw new IllegalStateException();
+  }
+
+  @Override
+  public boolean equals(Object that) {
+    if (that == null)
+      return false;
+    if (that instanceof Domain)
+      return this.equals((Domain)that);
+    return false;
+  }
+
+  public boolean equals(Domain that) {
+    if (that == null)
+      return false;
+
+    boolean this_present_domainId = true && this.isSetDomainId();
+    boolean that_present_domainId = true && that.isSetDomainId();
+    if (this_present_domainId || that_present_domainId) {
+      if (!(this_present_domainId && that_present_domainId))
+        return false;
+      if (!this.domainId.equals(that.domainId))
+        return false;
+    }
+
+    boolean this_present_name = true && this.isSetName();
+    boolean that_present_name = true && that.isSetName();
+    if (this_present_name || that_present_name) {
+      if (!(this_present_name && that_present_name))
+        return false;
+      if (!this.name.equals(that.name))
+        return false;
+    }
+
+    boolean this_present_description = true && this.isSetDescription();
+    boolean that_present_description = true && that.isSetDescription();
+    if (this_present_description || that_present_description) {
+      if (!(this_present_description && that_present_description))
+        return false;
+      if (!this.description.equals(that.description))
+        return false;
+    }
+
+    boolean this_present_createdTime = true && this.isSetCreatedTime();
+    boolean that_present_createdTime = true && that.isSetCreatedTime();
+    if (this_present_createdTime || that_present_createdTime) {
+      if (!(this_present_createdTime && that_present_createdTime))
+        return false;
+      if (this.createdTime != that.createdTime)
+        return false;
+    }
+
+    boolean this_present_updatedTime = true && this.isSetUpdatedTime();
+    boolean that_present_updatedTime = true && that.isSetUpdatedTime();
+    if (this_present_updatedTime || that_present_updatedTime) {
+      if (!(this_present_updatedTime && that_present_updatedTime))
+        return false;
+      if (this.updatedTime != that.updatedTime)
+        return false;
+    }
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    List<Object> list = new ArrayList<Object>();
+
+    boolean present_domainId = true && (isSetDomainId());
+    list.add(present_domainId);
+    if (present_domainId)
+      list.add(domainId);
+
+    boolean present_name = true && (isSetName());
+    list.add(present_name);
+    if (present_name)
+      list.add(name);
+
+    boolean present_description = true && (isSetDescription());
+    list.add(present_description);
+    if (present_description)
+      list.add(description);
+
+    boolean present_createdTime = true && (isSetCreatedTime());
+    list.add(present_createdTime);
+    if (present_createdTime)
+      list.add(createdTime);
+
+    boolean present_updatedTime = true && (isSetUpdatedTime());
+    list.add(present_updatedTime);
+    if (present_updatedTime)
+      list.add(updatedTime);
+
+    return list.hashCode();
+  }
+
+  @Override
+  public int compareTo(Domain other) {
+    if (!getClass().equals(other.getClass())) {
+      return getClass().getName().compareTo(other.getClass().getName());
+    }
+
+    int lastComparison = 0;
+
+    lastComparison = Boolean.valueOf(isSetDomainId()).compareTo(other.isSetDomainId());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetDomainId()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domainId, other.domainId);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetName()).compareTo(other.isSetName());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetName()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetDescription()).compareTo(other.isSetDescription());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetDescription()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.description, other.description);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetCreatedTime()).compareTo(other.isSetCreatedTime());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetCreatedTime()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.createdTime, other.createdTime);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetUpdatedTime()).compareTo(other.isSetUpdatedTime());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetUpdatedTime()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updatedTime, other.updatedTime);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    return 0;
+  }
+
+  public _Fields fieldForId(int fieldId) {
+    return _Fields.findByThriftId(fieldId);
+  }
+
+  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+  }
+
+  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+  }
+
+  @Override
+  public String toString() {
+    StringBuilder sb = new StringBuilder("Domain(");
+    boolean first = true;
+
+    if (isSetDomainId()) {
+      sb.append("domainId:");
+      if (this.domainId == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.domainId);
+      }
+      first = false;
+    }
+    if (isSetName()) {
+      if (!first) sb.append(", ");
+      sb.append("name:");
+      if (this.name == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.name);
+      }
+      first = false;
+    }
+    if (isSetDescription()) {
+      if (!first) sb.append(", ");
+      sb.append("description:");
+      if (this.description == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.description);
+      }
+      first = false;
+    }
+    if (isSetCreatedTime()) {
+      if (!first) sb.append(", ");
+      sb.append("createdTime:");
+      sb.append(this.createdTime);
+      first = false;
+    }
+    if (isSetUpdatedTime()) {
+      if (!first) sb.append(", ");
+      sb.append("updatedTime:");
+      sb.append(this.updatedTime);
+      first = false;
+    }
+    sb.append(")");
+    return sb.toString();
+  }
+
+  public void validate() throws org.apache.thrift.TException {
+    // check for required fields
+    // check for sub-struct validity
+  }
+
+  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+    try {
+      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+    try {
+      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+      __isset_bitfield = 0;
+      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private static class DomainStandardSchemeFactory implements SchemeFactory {
+    public DomainStandardScheme getScheme() {
+      return new DomainStandardScheme();
+    }
+  }
+
+  private static class DomainStandardScheme extends StandardScheme<Domain> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, Domain struct) throws org.apache.thrift.TException {
+      org.apache.thrift.protocol.TField schemeField;
+      iprot.readStructBegin();
+      while (true)
+      {
+        schemeField = iprot.readFieldBegin();
+        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+          break;
+        }
+        switch (schemeField.id) {
+          case 1: // DOMAIN_ID
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.domainId = iprot.readString();
+              struct.setDomainIdIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 2: // NAME
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.name = iprot.readString();
+              struct.setNameIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 3: // DESCRIPTION
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.description = iprot.readString();
+              struct.setDescriptionIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 4: // CREATED_TIME
+            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+              struct.createdTime = iprot.readI64();
+              struct.setCreatedTimeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 5: // UPDATED_TIME
+            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+              struct.updatedTime = iprot.readI64();
+              struct.setUpdatedTimeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          default:
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+        }
+        iprot.readFieldEnd();
+      }
+      iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      struct.validate();
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot, Domain struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.domainId != null) {
+        if (struct.isSetDomainId()) {
+          oprot.writeFieldBegin(DOMAIN_ID_FIELD_DESC);
+          oprot.writeString(struct.domainId);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.name != null) {
+        if (struct.isSetName()) {
+          oprot.writeFieldBegin(NAME_FIELD_DESC);
+          oprot.writeString(struct.name);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.description != null) {
+        if (struct.isSetDescription()) {
+          oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC);
+          oprot.writeString(struct.description);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.isSetCreatedTime()) {
+        oprot.writeFieldBegin(CREATED_TIME_FIELD_DESC);
+        oprot.writeI64(struct.createdTime);
+        oprot.writeFieldEnd();
+      }
+      if (struct.isSetUpdatedTime()) {
+        oprot.writeFieldBegin(UPDATED_TIME_FIELD_DESC);
+        oprot.writeI64(struct.updatedTime);
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class DomainTupleSchemeFactory implements SchemeFactory {
+    public DomainTupleScheme getScheme() {
+      return new DomainTupleScheme();
+    }
+  }
+
+  private static class DomainTupleScheme extends TupleScheme<Domain> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, Domain struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      BitSet optionals = new BitSet();
+      if (struct.isSetDomainId()) {
+        optionals.set(0);
+      }
+      if (struct.isSetName()) {
+        optionals.set(1);
+      }
+      if (struct.isSetDescription()) {
+        optionals.set(2);
+      }
+      if (struct.isSetCreatedTime()) {
+        optionals.set(3);
+      }
+      if (struct.isSetUpdatedTime()) {
+        optionals.set(4);
+      }
+      oprot.writeBitSet(optionals, 5);
+      if (struct.isSetDomainId()) {
+        oprot.writeString(struct.domainId);
+      }
+      if (struct.isSetName()) {
+        oprot.writeString(struct.name);
+      }
+      if (struct.isSetDescription()) {
+        oprot.writeString(struct.description);
+      }
+      if (struct.isSetCreatedTime()) {
+        oprot.writeI64(struct.createdTime);
+      }
+      if (struct.isSetUpdatedTime()) {
+        oprot.writeI64(struct.updatedTime);
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, Domain struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      BitSet incoming = iprot.readBitSet(5);
+      if (incoming.get(0)) {
+        struct.domainId = iprot.readString();
+        struct.setDomainIdIsSet(true);
+      }
+      if (incoming.get(1)) {
+        struct.name = iprot.readString();
+        struct.setNameIsSet(true);
+      }
+      if (incoming.get(2)) {
+        struct.description = iprot.readString();
+        struct.setDescriptionIsSet(true);
+      }
+      if (incoming.get(3)) {
+        struct.createdTime = iprot.readI64();
+        struct.setCreatedTimeIsSet(true);
+      }
+      if (incoming.get(4)) {
+        struct.updatedTime = iprot.readI64();
+        struct.setUpdatedTimeIsSet(true);
+      }
+    }
+  }
+
+}
+


[02/17] airavata git commit: renaming directory names

Posted by sc...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/service/cpi/GovRegistryService.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/service/cpi/GovRegistryService.java b/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/service/cpi/GovRegistryService.java
new file mode 100644
index 0000000..efcbab5
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/service/cpi/GovRegistryService.java
@@ -0,0 +1,42708 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.3)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.airavata.sharing.registry.service.cpi;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import javax.annotation.Generated;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-05")
+public class GovRegistryService {
+
+  public interface Iface {
+
+    /**
+     *  * Domain Operations
+     * *
+     * 
+     * @param domain
+     */
+    public String createDomain(org.apache.airavata.sharing.registry.models.Domain domain) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+    public boolean updateDomain(org.apache.airavata.sharing.registry.models.Domain domain) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+    public boolean deleteDomain(String domainId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+    public org.apache.airavata.sharing.registry.models.Domain getDomain(String domainId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+    public List<org.apache.airavata.sharing.registry.models.Domain> getDomains(int offset, int limit) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+    /**
+     *  * User Operations
+     * *
+     * 
+     * @param user
+     */
+    public String createUser(org.apache.airavata.sharing.registry.models.User user) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+    public boolean updatedUser(org.apache.airavata.sharing.registry.models.User user) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+    public boolean deleteUser(String userId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+    public org.apache.airavata.sharing.registry.models.User getUser(String userId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+    public List<org.apache.airavata.sharing.registry.models.User> getUsers(String domain, int offset, int limit) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+    /**
+     *  * Group Operations
+     * *
+     * 
+     * @param group
+     */
+    public String createGroup(org.apache.airavata.sharing.registry.models.UserGroup group) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+    public boolean updateGroup(org.apache.airavata.sharing.registry.models.UserGroup group) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+    public boolean deleteGroup(String groupId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+    public org.apache.airavata.sharing.registry.models.UserGroup getGroup(String groupId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+    public List<org.apache.airavata.sharing.registry.models.UserGroup> getGroups(String domain, int offset, int limit) throws org.apache.thrift.TException;
+
+    public boolean addUsersToGroup(List<String> userIds, String groupId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+    public boolean removeUsersFromGroup(List<String> userIds, String groupId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+    public Map<String,org.apache.airavata.sharing.registry.models.GroupChildType> getGroupMembers(String groupId, int offset, int limit) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+    public boolean addChildGroupToParentGroup(String childId, String groupId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+    public boolean removeChildGroupFromParentGroup(String childId, String groupId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+    /**
+     *  * EntityType Operations
+     * *
+     * 
+     * @param entityType
+     */
+    public String createEntityType(org.apache.airavata.sharing.registry.models.EntityType entityType) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+    public boolean updateEntityType(org.apache.airavata.sharing.registry.models.EntityType entityType) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+    public boolean deleteEntityType(String entityTypeId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+    public org.apache.airavata.sharing.registry.models.EntityType getEntityType(String entityTypeId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+    public List<org.apache.airavata.sharing.registry.models.EntityType> getEntityTypes(String domain, int offset, int limit) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+    /**
+     *  * Entity Operations
+     * *
+     * 
+     * @param entity
+     */
+    public String createEntity(org.apache.airavata.sharing.registry.models.Entity entity) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+    public boolean updateEntity(org.apache.airavata.sharing.registry.models.Entity entity) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+    public boolean deleteEntity(String entityId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+    public org.apache.airavata.sharing.registry.models.Entity getEntity(String entityId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+    public List<org.apache.airavata.sharing.registry.models.Entity> searchEntities(String userId, String entityTypeId, Map<org.apache.airavata.sharing.registry.models.EntitySearchFields,String> filters, int offset, int limit) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+    /**
+     *  * Permission Operations
+     * *
+     * 
+     * @param permissionType
+     */
+    public String createPermissionType(org.apache.airavata.sharing.registry.models.PermissionType permissionType) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+    public boolean updatePermissionType(org.apache.airavata.sharing.registry.models.PermissionType permissionType) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+    public boolean deletePermissionType(String entityTypeId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+    public org.apache.airavata.sharing.registry.models.PermissionType getPermissionType(String permissionTypeId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+    public List<org.apache.airavata.sharing.registry.models.PermissionType> getPermissionTypes(String domain, int offset, int limit) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+    /**
+     *  * Sharing Entity with Users and Groups
+     * *
+     * 
+     * @param entityId
+     * @param userList
+     * @param perssionTypeId
+     */
+    public boolean shareEntityWithUsers(String entityId, List<String> userList, String perssionTypeId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+    public boolean revokeEntitySharingFromUsers(String entityId, List<String> userList, String perssionTypeId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+    public boolean shareEntityWithGroups(String entityId, List<String> groupList, String perssionTypeId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+    public boolean revokeEntitySharingFromGroups(String entityId, List<String> groupList, String perssionTypeId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+    public boolean userHasAccess(String domainId, String userId, String entityId, String permissionTypeId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
+
+  }
+
+  public interface AsyncIface {
+
+    public void createDomain(org.apache.airavata.sharing.registry.models.Domain domain, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void updateDomain(org.apache.airavata.sharing.registry.models.Domain domain, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void deleteDomain(String domainId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void getDomain(String domainId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void getDomains(int offset, int limit, 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;
+
+    public void deleteUser(String userId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void getUser(String userId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void getUsers(String domain, int offset, int limit, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void createGroup(org.apache.airavata.sharing.registry.models.UserGroup group, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void updateGroup(org.apache.airavata.sharing.registry.models.UserGroup group, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void deleteGroup(String groupId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void getGroup(String groupId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void getGroups(String domain, int offset, int limit, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void addUsersToGroup(List<String> userIds, String groupId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void removeUsersFromGroup(List<String> userIds, String groupId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void getGroupMembers(String groupId, int offset, int limit, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void addChildGroupToParentGroup(String childId, String groupId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void removeChildGroupFromParentGroup(String childId, String groupId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void createEntityType(org.apache.airavata.sharing.registry.models.EntityType entityType, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void updateEntityType(org.apache.airavata.sharing.registry.models.EntityType entityType, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void deleteEntityType(String entityTypeId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void getEntityType(String entityTypeId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void getEntityTypes(String domain, int offset, int limit, 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;
+
+    public void deleteEntity(String entityId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void getEntity(String entityId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void searchEntities(String userId, String entityTypeId, Map<org.apache.airavata.sharing.registry.models.EntitySearchFields,String> filters, int offset, int limit, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void createPermissionType(org.apache.airavata.sharing.registry.models.PermissionType permissionType, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void updatePermissionType(org.apache.airavata.sharing.registry.models.PermissionType permissionType, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void deletePermissionType(String entityTypeId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void getPermissionType(String permissionTypeId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void getPermissionTypes(String domain, int offset, int limit, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void shareEntityWithUsers(String entityId, List<String> userList, String perssionTypeId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void revokeEntitySharingFromUsers(String entityId, List<String> userList, String perssionTypeId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void shareEntityWithGroups(String entityId, List<String> groupList, String perssionTypeId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void revokeEntitySharingFromGroups(String entityId, List<String> groupList, String perssionTypeId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void userHasAccess(String domainId, String userId, String entityId, String permissionTypeId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+  }
+
+  public static class Client extends org.apache.thrift.TServiceClient implements Iface {
+    public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
+      public Factory() {}
+      public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
+        return new Client(prot);
+      }
+      public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
+        return new Client(iprot, oprot);
+      }
+    }
+
+    public Client(org.apache.thrift.protocol.TProtocol prot)
+    {
+      super(prot, prot);
+    }
+
+    public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
+      super(iprot, oprot);
+    }
+
+    public String createDomain(org.apache.airavata.sharing.registry.models.Domain domain) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      send_createDomain(domain);
+      return recv_createDomain();
+    }
+
+    public void send_createDomain(org.apache.airavata.sharing.registry.models.Domain domain) throws org.apache.thrift.TException
+    {
+      createDomain_args args = new createDomain_args();
+      args.setDomain(domain);
+      sendBase("createDomain", args);
+    }
+
+    public String recv_createDomain() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      createDomain_result result = new createDomain_result();
+      receiveBase(result, "createDomain");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createDomain failed: unknown result");
+    }
+
+    public boolean updateDomain(org.apache.airavata.sharing.registry.models.Domain domain) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      send_updateDomain(domain);
+      return recv_updateDomain();
+    }
+
+    public void send_updateDomain(org.apache.airavata.sharing.registry.models.Domain domain) throws org.apache.thrift.TException
+    {
+      updateDomain_args args = new updateDomain_args();
+      args.setDomain(domain);
+      sendBase("updateDomain", args);
+    }
+
+    public boolean recv_updateDomain() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      updateDomain_result result = new updateDomain_result();
+      receiveBase(result, "updateDomain");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "updateDomain failed: unknown result");
+    }
+
+    public boolean deleteDomain(String domainId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      send_deleteDomain(domainId);
+      return recv_deleteDomain();
+    }
+
+    public void send_deleteDomain(String domainId) throws org.apache.thrift.TException
+    {
+      deleteDomain_args args = new deleteDomain_args();
+      args.setDomainId(domainId);
+      sendBase("deleteDomain", args);
+    }
+
+    public boolean recv_deleteDomain() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      deleteDomain_result result = new deleteDomain_result();
+      receiveBase(result, "deleteDomain");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deleteDomain failed: unknown result");
+    }
+
+    public org.apache.airavata.sharing.registry.models.Domain getDomain(String domainId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      send_getDomain(domainId);
+      return recv_getDomain();
+    }
+
+    public void send_getDomain(String domainId) throws org.apache.thrift.TException
+    {
+      getDomain_args args = new getDomain_args();
+      args.setDomainId(domainId);
+      sendBase("getDomain", args);
+    }
+
+    public org.apache.airavata.sharing.registry.models.Domain recv_getDomain() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      getDomain_result result = new getDomain_result();
+      receiveBase(result, "getDomain");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getDomain failed: unknown result");
+    }
+
+    public List<org.apache.airavata.sharing.registry.models.Domain> getDomains(int offset, int limit) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      send_getDomains(offset, limit);
+      return recv_getDomains();
+    }
+
+    public void send_getDomains(int offset, int limit) throws org.apache.thrift.TException
+    {
+      getDomains_args args = new getDomains_args();
+      args.setOffset(offset);
+      args.setLimit(limit);
+      sendBase("getDomains", args);
+    }
+
+    public List<org.apache.airavata.sharing.registry.models.Domain> recv_getDomains() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      getDomains_result result = new getDomains_result();
+      receiveBase(result, "getDomains");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getDomains failed: unknown result");
+    }
+
+    public String createUser(org.apache.airavata.sharing.registry.models.User user) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      send_createUser(user);
+      return recv_createUser();
+    }
+
+    public void send_createUser(org.apache.airavata.sharing.registry.models.User user) throws org.apache.thrift.TException
+    {
+      createUser_args args = new createUser_args();
+      args.setUser(user);
+      sendBase("createUser", args);
+    }
+
+    public String recv_createUser() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      createUser_result result = new createUser_result();
+      receiveBase(result, "createUser");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      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.GovRegistryException, org.apache.thrift.TException
+    {
+      send_updatedUser(user);
+      return recv_updatedUser();
+    }
+
+    public void send_updatedUser(org.apache.airavata.sharing.registry.models.User user) throws org.apache.thrift.TException
+    {
+      updatedUser_args args = new updatedUser_args();
+      args.setUser(user);
+      sendBase("updatedUser", args);
+    }
+
+    public boolean recv_updatedUser() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      updatedUser_result result = new updatedUser_result();
+      receiveBase(result, "updatedUser");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "updatedUser failed: unknown result");
+    }
+
+    public boolean deleteUser(String userId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      send_deleteUser(userId);
+      return recv_deleteUser();
+    }
+
+    public void send_deleteUser(String userId) throws org.apache.thrift.TException
+    {
+      deleteUser_args args = new deleteUser_args();
+      args.setUserId(userId);
+      sendBase("deleteUser", args);
+    }
+
+    public boolean recv_deleteUser() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      deleteUser_result result = new deleteUser_result();
+      receiveBase(result, "deleteUser");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deleteUser failed: unknown result");
+    }
+
+    public org.apache.airavata.sharing.registry.models.User getUser(String userId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      send_getUser(userId);
+      return recv_getUser();
+    }
+
+    public void send_getUser(String userId) throws org.apache.thrift.TException
+    {
+      getUser_args args = new getUser_args();
+      args.setUserId(userId);
+      sendBase("getUser", args);
+    }
+
+    public org.apache.airavata.sharing.registry.models.User recv_getUser() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      getUser_result result = new getUser_result();
+      receiveBase(result, "getUser");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getUser failed: unknown result");
+    }
+
+    public List<org.apache.airavata.sharing.registry.models.User> getUsers(String domain, int offset, int limit) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      send_getUsers(domain, offset, limit);
+      return recv_getUsers();
+    }
+
+    public void send_getUsers(String domain, int offset, int limit) throws org.apache.thrift.TException
+    {
+      getUsers_args args = new getUsers_args();
+      args.setDomain(domain);
+      args.setOffset(offset);
+      args.setLimit(limit);
+      sendBase("getUsers", args);
+    }
+
+    public List<org.apache.airavata.sharing.registry.models.User> recv_getUsers() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      getUsers_result result = new getUsers_result();
+      receiveBase(result, "getUsers");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getUsers failed: unknown result");
+    }
+
+    public String createGroup(org.apache.airavata.sharing.registry.models.UserGroup group) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      send_createGroup(group);
+      return recv_createGroup();
+    }
+
+    public void send_createGroup(org.apache.airavata.sharing.registry.models.UserGroup group) throws org.apache.thrift.TException
+    {
+      createGroup_args args = new createGroup_args();
+      args.setGroup(group);
+      sendBase("createGroup", args);
+    }
+
+    public String recv_createGroup() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      createGroup_result result = new createGroup_result();
+      receiveBase(result, "createGroup");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createGroup failed: unknown result");
+    }
+
+    public boolean updateGroup(org.apache.airavata.sharing.registry.models.UserGroup group) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      send_updateGroup(group);
+      return recv_updateGroup();
+    }
+
+    public void send_updateGroup(org.apache.airavata.sharing.registry.models.UserGroup group) throws org.apache.thrift.TException
+    {
+      updateGroup_args args = new updateGroup_args();
+      args.setGroup(group);
+      sendBase("updateGroup", args);
+    }
+
+    public boolean recv_updateGroup() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      updateGroup_result result = new updateGroup_result();
+      receiveBase(result, "updateGroup");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "updateGroup failed: unknown result");
+    }
+
+    public boolean deleteGroup(String groupId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      send_deleteGroup(groupId);
+      return recv_deleteGroup();
+    }
+
+    public void send_deleteGroup(String groupId) throws org.apache.thrift.TException
+    {
+      deleteGroup_args args = new deleteGroup_args();
+      args.setGroupId(groupId);
+      sendBase("deleteGroup", args);
+    }
+
+    public boolean recv_deleteGroup() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      deleteGroup_result result = new deleteGroup_result();
+      receiveBase(result, "deleteGroup");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deleteGroup failed: unknown result");
+    }
+
+    public org.apache.airavata.sharing.registry.models.UserGroup getGroup(String groupId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      send_getGroup(groupId);
+      return recv_getGroup();
+    }
+
+    public void send_getGroup(String groupId) throws org.apache.thrift.TException
+    {
+      getGroup_args args = new getGroup_args();
+      args.setGroupId(groupId);
+      sendBase("getGroup", args);
+    }
+
+    public org.apache.airavata.sharing.registry.models.UserGroup recv_getGroup() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      getGroup_result result = new getGroup_result();
+      receiveBase(result, "getGroup");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getGroup failed: unknown result");
+    }
+
+    public List<org.apache.airavata.sharing.registry.models.UserGroup> getGroups(String domain, int offset, int limit) throws org.apache.thrift.TException
+    {
+      send_getGroups(domain, offset, limit);
+      return recv_getGroups();
+    }
+
+    public void send_getGroups(String domain, int offset, int limit) throws org.apache.thrift.TException
+    {
+      getGroups_args args = new getGroups_args();
+      args.setDomain(domain);
+      args.setOffset(offset);
+      args.setLimit(limit);
+      sendBase("getGroups", args);
+    }
+
+    public List<org.apache.airavata.sharing.registry.models.UserGroup> recv_getGroups() throws org.apache.thrift.TException
+    {
+      getGroups_result result = new getGroups_result();
+      receiveBase(result, "getGroups");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getGroups failed: unknown result");
+    }
+
+    public boolean addUsersToGroup(List<String> userIds, String groupId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      send_addUsersToGroup(userIds, groupId);
+      return recv_addUsersToGroup();
+    }
+
+    public void send_addUsersToGroup(List<String> userIds, String groupId) throws org.apache.thrift.TException
+    {
+      addUsersToGroup_args args = new addUsersToGroup_args();
+      args.setUserIds(userIds);
+      args.setGroupId(groupId);
+      sendBase("addUsersToGroup", args);
+    }
+
+    public boolean recv_addUsersToGroup() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      addUsersToGroup_result result = new addUsersToGroup_result();
+      receiveBase(result, "addUsersToGroup");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "addUsersToGroup failed: unknown result");
+    }
+
+    public boolean removeUsersFromGroup(List<String> userIds, String groupId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      send_removeUsersFromGroup(userIds, groupId);
+      return recv_removeUsersFromGroup();
+    }
+
+    public void send_removeUsersFromGroup(List<String> userIds, String groupId) throws org.apache.thrift.TException
+    {
+      removeUsersFromGroup_args args = new removeUsersFromGroup_args();
+      args.setUserIds(userIds);
+      args.setGroupId(groupId);
+      sendBase("removeUsersFromGroup", args);
+    }
+
+    public boolean recv_removeUsersFromGroup() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      removeUsersFromGroup_result result = new removeUsersFromGroup_result();
+      receiveBase(result, "removeUsersFromGroup");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "removeUsersFromGroup failed: unknown result");
+    }
+
+    public Map<String,org.apache.airavata.sharing.registry.models.GroupChildType> getGroupMembers(String groupId, int offset, int limit) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      send_getGroupMembers(groupId, offset, limit);
+      return recv_getGroupMembers();
+    }
+
+    public void send_getGroupMembers(String groupId, int offset, int limit) throws org.apache.thrift.TException
+    {
+      getGroupMembers_args args = new getGroupMembers_args();
+      args.setGroupId(groupId);
+      args.setOffset(offset);
+      args.setLimit(limit);
+      sendBase("getGroupMembers", args);
+    }
+
+    public Map<String,org.apache.airavata.sharing.registry.models.GroupChildType> recv_getGroupMembers() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      getGroupMembers_result result = new getGroupMembers_result();
+      receiveBase(result, "getGroupMembers");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getGroupMembers failed: unknown result");
+    }
+
+    public boolean addChildGroupToParentGroup(String childId, String groupId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      send_addChildGroupToParentGroup(childId, groupId);
+      return recv_addChildGroupToParentGroup();
+    }
+
+    public void send_addChildGroupToParentGroup(String childId, String groupId) throws org.apache.thrift.TException
+    {
+      addChildGroupToParentGroup_args args = new addChildGroupToParentGroup_args();
+      args.setChildId(childId);
+      args.setGroupId(groupId);
+      sendBase("addChildGroupToParentGroup", args);
+    }
+
+    public boolean recv_addChildGroupToParentGroup() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      addChildGroupToParentGroup_result result = new addChildGroupToParentGroup_result();
+      receiveBase(result, "addChildGroupToParentGroup");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "addChildGroupToParentGroup failed: unknown result");
+    }
+
+    public boolean removeChildGroupFromParentGroup(String childId, String groupId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      send_removeChildGroupFromParentGroup(childId, groupId);
+      return recv_removeChildGroupFromParentGroup();
+    }
+
+    public void send_removeChildGroupFromParentGroup(String childId, String groupId) throws org.apache.thrift.TException
+    {
+      removeChildGroupFromParentGroup_args args = new removeChildGroupFromParentGroup_args();
+      args.setChildId(childId);
+      args.setGroupId(groupId);
+      sendBase("removeChildGroupFromParentGroup", args);
+    }
+
+    public boolean recv_removeChildGroupFromParentGroup() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      removeChildGroupFromParentGroup_result result = new removeChildGroupFromParentGroup_result();
+      receiveBase(result, "removeChildGroupFromParentGroup");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "removeChildGroupFromParentGroup failed: unknown result");
+    }
+
+    public String createEntityType(org.apache.airavata.sharing.registry.models.EntityType entityType) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      send_createEntityType(entityType);
+      return recv_createEntityType();
+    }
+
+    public void send_createEntityType(org.apache.airavata.sharing.registry.models.EntityType entityType) throws org.apache.thrift.TException
+    {
+      createEntityType_args args = new createEntityType_args();
+      args.setEntityType(entityType);
+      sendBase("createEntityType", args);
+    }
+
+    public String recv_createEntityType() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      createEntityType_result result = new createEntityType_result();
+      receiveBase(result, "createEntityType");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createEntityType failed: unknown result");
+    }
+
+    public boolean updateEntityType(org.apache.airavata.sharing.registry.models.EntityType entityType) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      send_updateEntityType(entityType);
+      return recv_updateEntityType();
+    }
+
+    public void send_updateEntityType(org.apache.airavata.sharing.registry.models.EntityType entityType) throws org.apache.thrift.TException
+    {
+      updateEntityType_args args = new updateEntityType_args();
+      args.setEntityType(entityType);
+      sendBase("updateEntityType", args);
+    }
+
+    public boolean recv_updateEntityType() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      updateEntityType_result result = new updateEntityType_result();
+      receiveBase(result, "updateEntityType");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "updateEntityType failed: unknown result");
+    }
+
+    public boolean deleteEntityType(String entityTypeId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      send_deleteEntityType(entityTypeId);
+      return recv_deleteEntityType();
+    }
+
+    public void send_deleteEntityType(String entityTypeId) throws org.apache.thrift.TException
+    {
+      deleteEntityType_args args = new deleteEntityType_args();
+      args.setEntityTypeId(entityTypeId);
+      sendBase("deleteEntityType", args);
+    }
+
+    public boolean recv_deleteEntityType() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      deleteEntityType_result result = new deleteEntityType_result();
+      receiveBase(result, "deleteEntityType");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deleteEntityType failed: unknown result");
+    }
+
+    public org.apache.airavata.sharing.registry.models.EntityType getEntityType(String entityTypeId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      send_getEntityType(entityTypeId);
+      return recv_getEntityType();
+    }
+
+    public void send_getEntityType(String entityTypeId) throws org.apache.thrift.TException
+    {
+      getEntityType_args args = new getEntityType_args();
+      args.setEntityTypeId(entityTypeId);
+      sendBase("getEntityType", args);
+    }
+
+    public org.apache.airavata.sharing.registry.models.EntityType recv_getEntityType() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      getEntityType_result result = new getEntityType_result();
+      receiveBase(result, "getEntityType");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getEntityType failed: unknown result");
+    }
+
+    public List<org.apache.airavata.sharing.registry.models.EntityType> getEntityTypes(String domain, int offset, int limit) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      send_getEntityTypes(domain, offset, limit);
+      return recv_getEntityTypes();
+    }
+
+    public void send_getEntityTypes(String domain, int offset, int limit) throws org.apache.thrift.TException
+    {
+      getEntityTypes_args args = new getEntityTypes_args();
+      args.setDomain(domain);
+      args.setOffset(offset);
+      args.setLimit(limit);
+      sendBase("getEntityTypes", args);
+    }
+
+    public List<org.apache.airavata.sharing.registry.models.EntityType> recv_getEntityTypes() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      getEntityTypes_result result = new getEntityTypes_result();
+      receiveBase(result, "getEntityTypes");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getEntityTypes failed: unknown result");
+    }
+
+    public String createEntity(org.apache.airavata.sharing.registry.models.Entity entity) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      send_createEntity(entity);
+      return recv_createEntity();
+    }
+
+    public void send_createEntity(org.apache.airavata.sharing.registry.models.Entity entity) throws org.apache.thrift.TException
+    {
+      createEntity_args args = new createEntity_args();
+      args.setEntity(entity);
+      sendBase("createEntity", args);
+    }
+
+    public String recv_createEntity() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      createEntity_result result = new createEntity_result();
+      receiveBase(result, "createEntity");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      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.GovRegistryException, org.apache.thrift.TException
+    {
+      send_updateEntity(entity);
+      return recv_updateEntity();
+    }
+
+    public void send_updateEntity(org.apache.airavata.sharing.registry.models.Entity entity) throws org.apache.thrift.TException
+    {
+      updateEntity_args args = new updateEntity_args();
+      args.setEntity(entity);
+      sendBase("updateEntity", args);
+    }
+
+    public boolean recv_updateEntity() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      updateEntity_result result = new updateEntity_result();
+      receiveBase(result, "updateEntity");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "updateEntity failed: unknown result");
+    }
+
+    public boolean deleteEntity(String entityId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      send_deleteEntity(entityId);
+      return recv_deleteEntity();
+    }
+
+    public void send_deleteEntity(String entityId) throws org.apache.thrift.TException
+    {
+      deleteEntity_args args = new deleteEntity_args();
+      args.setEntityId(entityId);
+      sendBase("deleteEntity", args);
+    }
+
+    public boolean recv_deleteEntity() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      deleteEntity_result result = new deleteEntity_result();
+      receiveBase(result, "deleteEntity");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deleteEntity failed: unknown result");
+    }
+
+    public org.apache.airavata.sharing.registry.models.Entity getEntity(String entityId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      send_getEntity(entityId);
+      return recv_getEntity();
+    }
+
+    public void send_getEntity(String entityId) throws org.apache.thrift.TException
+    {
+      getEntity_args args = new getEntity_args();
+      args.setEntityId(entityId);
+      sendBase("getEntity", args);
+    }
+
+    public org.apache.airavata.sharing.registry.models.Entity recv_getEntity() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      getEntity_result result = new getEntity_result();
+      receiveBase(result, "getEntity");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getEntity failed: unknown result");
+    }
+
+    public List<org.apache.airavata.sharing.registry.models.Entity> searchEntities(String userId, String entityTypeId, Map<org.apache.airavata.sharing.registry.models.EntitySearchFields,String> filters, int offset, int limit) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      send_searchEntities(userId, entityTypeId, filters, offset, limit);
+      return recv_searchEntities();
+    }
+
+    public void send_searchEntities(String userId, String entityTypeId, Map<org.apache.airavata.sharing.registry.models.EntitySearchFields,String> filters, int offset, int limit) throws org.apache.thrift.TException
+    {
+      searchEntities_args args = new searchEntities_args();
+      args.setUserId(userId);
+      args.setEntityTypeId(entityTypeId);
+      args.setFilters(filters);
+      args.setOffset(offset);
+      args.setLimit(limit);
+      sendBase("searchEntities", args);
+    }
+
+    public List<org.apache.airavata.sharing.registry.models.Entity> recv_searchEntities() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      searchEntities_result result = new searchEntities_result();
+      receiveBase(result, "searchEntities");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "searchEntities failed: unknown result");
+    }
+
+    public String createPermissionType(org.apache.airavata.sharing.registry.models.PermissionType permissionType) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      send_createPermissionType(permissionType);
+      return recv_createPermissionType();
+    }
+
+    public void send_createPermissionType(org.apache.airavata.sharing.registry.models.PermissionType permissionType) throws org.apache.thrift.TException
+    {
+      createPermissionType_args args = new createPermissionType_args();
+      args.setPermissionType(permissionType);
+      sendBase("createPermissionType", args);
+    }
+
+    public String recv_createPermissionType() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      createPermissionType_result result = new createPermissionType_result();
+      receiveBase(result, "createPermissionType");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createPermissionType failed: unknown result");
+    }
+
+    public boolean updatePermissionType(org.apache.airavata.sharing.registry.models.PermissionType permissionType) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      send_updatePermissionType(permissionType);
+      return recv_updatePermissionType();
+    }
+
+    public void send_updatePermissionType(org.apache.airavata.sharing.registry.models.PermissionType permissionType) throws org.apache.thrift.TException
+    {
+      updatePermissionType_args args = new updatePermissionType_args();
+      args.setPermissionType(permissionType);
+      sendBase("updatePermissionType", args);
+    }
+
+    public boolean recv_updatePermissionType() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      updatePermissionType_result result = new updatePermissionType_result();
+      receiveBase(result, "updatePermissionType");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "updatePermissionType failed: unknown result");
+    }
+
+    public boolean deletePermissionType(String entityTypeId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      send_deletePermissionType(entityTypeId);
+      return recv_deletePermissionType();
+    }
+
+    public void send_deletePermissionType(String entityTypeId) throws org.apache.thrift.TException
+    {
+      deletePermissionType_args args = new deletePermissionType_args();
+      args.setEntityTypeId(entityTypeId);
+      sendBase("deletePermissionType", args);
+    }
+
+    public boolean recv_deletePermissionType() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      deletePermissionType_result result = new deletePermissionType_result();
+      receiveBase(result, "deletePermissionType");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deletePermissionType failed: unknown result");
+    }
+
+    public org.apache.airavata.sharing.registry.models.PermissionType getPermissionType(String permissionTypeId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      send_getPermissionType(permissionTypeId);
+      return recv_getPermissionType();
+    }
+
+    public void send_getPermissionType(String permissionTypeId) throws org.apache.thrift.TException
+    {
+      getPermissionType_args args = new getPermissionType_args();
+      args.setPermissionTypeId(permissionTypeId);
+      sendBase("getPermissionType", args);
+    }
+
+    public org.apache.airavata.sharing.registry.models.PermissionType recv_getPermissionType() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      getPermissionType_result result = new getPermissionType_result();
+      receiveBase(result, "getPermissionType");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPermissionType failed: unknown result");
+    }
+
+    public List<org.apache.airavata.sharing.registry.models.PermissionType> getPermissionTypes(String domain, int offset, int limit) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      send_getPermissionTypes(domain, offset, limit);
+      return recv_getPermissionTypes();
+    }
+
+    public void send_getPermissionTypes(String domain, int offset, int limit) throws org.apache.thrift.TException
+    {
+      getPermissionTypes_args args = new getPermissionTypes_args();
+      args.setDomain(domain);
+      args.setOffset(offset);
+      args.setLimit(limit);
+      sendBase("getPermissionTypes", args);
+    }
+
+    public List<org.apache.airavata.sharing.registry.models.PermissionType> recv_getPermissionTypes() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      getPermissionTypes_result result = new getPermissionTypes_result();
+      receiveBase(result, "getPermissionTypes");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPermissionTypes failed: unknown result");
+    }
+
+    public boolean shareEntityWithUsers(String entityId, List<String> userList, String perssionTypeId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      send_shareEntityWithUsers(entityId, userList, perssionTypeId);
+      return recv_shareEntityWithUsers();
+    }
+
+    public void send_shareEntityWithUsers(String entityId, List<String> userList, String perssionTypeId) throws org.apache.thrift.TException
+    {
+      shareEntityWithUsers_args args = new shareEntityWithUsers_args();
+      args.setEntityId(entityId);
+      args.setUserList(userList);
+      args.setPerssionTypeId(perssionTypeId);
+      sendBase("shareEntityWithUsers", args);
+    }
+
+    public boolean recv_shareEntityWithUsers() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      shareEntityWithUsers_result result = new shareEntityWithUsers_result();
+      receiveBase(result, "shareEntityWithUsers");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "shareEntityWithUsers failed: unknown result");
+    }
+
+    public boolean revokeEntitySharingFromUsers(String entityId, List<String> userList, String perssionTypeId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      send_revokeEntitySharingFromUsers(entityId, userList, perssionTypeId);
+      return recv_revokeEntitySharingFromUsers();
+    }
+
+    public void send_revokeEntitySharingFromUsers(String entityId, List<String> userList, String perssionTypeId) throws org.apache.thrift.TException
+    {
+      revokeEntitySharingFromUsers_args args = new revokeEntitySharingFromUsers_args();
+      args.setEntityId(entityId);
+      args.setUserList(userList);
+      args.setPerssionTypeId(perssionTypeId);
+      sendBase("revokeEntitySharingFromUsers", args);
+    }
+
+    public boolean recv_revokeEntitySharingFromUsers() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      revokeEntitySharingFromUsers_result result = new revokeEntitySharingFromUsers_result();
+      receiveBase(result, "revokeEntitySharingFromUsers");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "revokeEntitySharingFromUsers failed: unknown result");
+    }
+
+    public boolean shareEntityWithGroups(String entityId, List<String> groupList, String perssionTypeId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      send_shareEntityWithGroups(entityId, groupList, perssionTypeId);
+      return recv_shareEntityWithGroups();
+    }
+
+    public void send_shareEntityWithGroups(String entityId, List<String> groupList, String perssionTypeId) throws org.apache.thrift.TException
+    {
+      shareEntityWithGroups_args args = new shareEntityWithGroups_args();
+      args.setEntityId(entityId);
+      args.setGroupList(groupList);
+      args.setPerssionTypeId(perssionTypeId);
+      sendBase("shareEntityWithGroups", args);
+    }
+
+    public boolean recv_shareEntityWithGroups() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      shareEntityWithGroups_result result = new shareEntityWithGroups_result();
+      receiveBase(result, "shareEntityWithGroups");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "shareEntityWithGroups failed: unknown result");
+    }
+
+    public boolean revokeEntitySharingFromGroups(String entityId, List<String> groupList, String perssionTypeId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      send_revokeEntitySharingFromGroups(entityId, groupList, perssionTypeId);
+      return recv_revokeEntitySharingFromGroups();
+    }
+
+    public void send_revokeEntitySharingFromGroups(String entityId, List<String> groupList, String perssionTypeId) throws org.apache.thrift.TException
+    {
+      revokeEntitySharingFromGroups_args args = new revokeEntitySharingFromGroups_args();
+      args.setEntityId(entityId);
+      args.setGroupList(groupList);
+      args.setPerssionTypeId(perssionTypeId);
+      sendBase("revokeEntitySharingFromGroups", args);
+    }
+
+    public boolean recv_revokeEntitySharingFromGroups() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      revokeEntitySharingFromGroups_result result = new revokeEntitySharingFromGroups_result();
+      receiveBase(result, "revokeEntitySharingFromGroups");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "revokeEntitySharingFromGroups failed: unknown result");
+    }
+
+    public boolean userHasAccess(String domainId, String userId, String entityId, String permissionTypeId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      send_userHasAccess(domainId, userId, entityId, permissionTypeId);
+      return recv_userHasAccess();
+    }
+
+    public void send_userHasAccess(String domainId, String userId, String entityId, String permissionTypeId) throws org.apache.thrift.TException
+    {
+      userHasAccess_args args = new userHasAccess_args();
+      args.setDomainId(domainId);
+      args.setUserId(userId);
+      args.setEntityId(entityId);
+      args.setPermissionTypeId(permissionTypeId);
+      sendBase("userHasAccess", args);
+    }
+
+    public boolean recv_userHasAccess() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
+    {
+      userHasAccess_result result = new userHasAccess_result();
+      receiveBase(result, "userHasAccess");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.gre != null) {
+        throw result.gre;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "userHasAccess failed: unknown result");
+    }
+
+  }
+  public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface {
+    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
+      private org.apache.thrift.async.TAsyncClientManager clientManager;
+      private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
+      public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
+        this.clientManager = clientManager;
+        this.protocolFactory = protocolFactory;
+      }
+      public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
+        return new AsyncClient(protocolFactory, clientManager, transport);
+      }
+    }
+
+    public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
+      super(protocolFactory, clientManager, transport);
+    }
+
+    public void createDomain(org.apache.airavata.sharing.registry.models.Domain domain, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      createDomain_call method_call = new createDomain_call(domain, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class createDomain_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private org.apache.airavata.sharing.registry.models.Domain domain;
+      public createDomain_call(org.apache.airavata.sharing.registry.models.Domain domain, 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.domain = domain;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createDomain", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        createDomain_args args = new createDomain_args();
+        args.setDomain(domain);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public String getResult() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException {
+        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        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_createDomain();
+      }
+    }
+
+    public void updateDomain(org.apache.airavata.sharing.registry.models.Domain domain, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      updateDomain_call method_call = new updateDomain_call(domain, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class updateDomain_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private org.apache.airavata.sharing.registry.models.Domain domain;
+      public updateDomain_call(org.apache.airavata.sharing.registry.models.Domain domain, 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.domain = domain;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("updateDomain", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        updateDomain_args args = new updateDomain_args();
+        args.setDomain(domain);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public boolean getResult() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException {
+        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        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_updateDomain();
+      }
+    }
+
+    public void deleteDomain(String domainId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      deleteDomain_call method_call = new deleteDomain_call(domainId, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class deleteDomain_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private String domainId;
+      public deleteDomain_call(String domainId, 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.domainId = domainId;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteDomain", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        deleteDomain_args args = new deleteDomain_args();
+        args.setDomainId(domainId);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public boolean getResult() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException {
+        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        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_deleteDomain();
+      }
+    }
+
+    public void getDomain(String domainId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      getDomain_call method_call = new getDomain_call(domainId, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class getDomain_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private String domainId;
+      public getDomain_call(String domainId, 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.domainId = domainId;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getDomain", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        getDomain_args args = new getDomain_args();
+        args.setDomainId(domainId);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public org.apache.airavata.sharing.registry.models.Domain getResult() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException {
+        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        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_getDomain();
+      }
+    }
+
+    public void getDomains(int offset, int limit, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      getDomains_call method_call = new getDomains_call(offset, limit, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class getDomains_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private int offset;
+      private int limit;
+      public getDomains_call(int offset, int limit, 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.offset = offset;
+        this.limit = limit;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getDomains", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        getDomains_args args = new getDomains_args();
+        args.setOffset(offset);
+        args.setLimit(limit);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public List<org.apache.airavata.sharing.registry.models.Domain> getResult() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException {
+        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        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_getDomains();
+      }
+    }
+
+    public void createUser(org.apache.airavata.sharing.registry.models.User user, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      createUser_call method_call = new createUser_call(user, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class createUser_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private org.apache.airavata.sharing.registry.models.User user;
+      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("createUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        createUser_args args = new createUser_args();
+        args.setUser(user);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public String getResult() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException {
+        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        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_createUser();
+      }
+    }
+
+    public void updatedUser(org.apache.airavata.sharing.registry.models.User user, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      updatedUser_call method_call = new updatedUser_call(user, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class updatedUser_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private org.apache.airavata.sharing.registry.models.User user;
+      public updatedUser_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("updatedUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        updatedUser_args args = new updatedUser_args();
+        args.setUser(user);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public boolean getResult() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException {
+        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        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_updatedUser();
+      }
+    }
+
+    public void deleteUser(String userId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      deleteUser_call method_call = new deleteUser_call(userId, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class deleteUser_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private String userId;
+      public deleteUser_call(String userId, 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.userId = userId;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        deleteUser_args args = new deleteUser_args();
+        args.setUserId(userId);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public boolean getResult() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException {
+        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        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_deleteUser();
+      }
+    }
+
+    public void getUser(String userId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      getUser_call method_call = new getUser_call(userId, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class getUser_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private String userId;
+      public getUser_call(String userId, 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.userId = userId;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        getUser_args args = new getUser_args();
+        args.setUserId(userId);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public org.apache.airavata.sharing.registry.models.User getResult() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException {
+        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        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_getUser();
+      }
+    }
+
+    public void getUsers(String domain, int offset, int limit, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      getUsers_call method_call = new getUsers_call(domain, offset, limit, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class getUsers_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private String domain;
+      private int offset;
+      private int limit;
+      public getUsers_call(String domain, int offset, int limit, 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.domain = domain;
+        this.offset = offset;
+        this.limit = limit;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getUsers", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        getUsers_args args = new getUsers_args();
+        args.setDomain(domain);
+        args.setOffset(offset);
+        args.setLimit(limit);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public List<org.apache.airavata.sharing.registry.models.User> getResult() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException {
+        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        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_getUsers();
+      }
+    }
+
+    public void createGroup(org.apache.airavata.sharing.registry.models.UserGroup group, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      createGroup_call method_call = new createGroup_call(group, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class createGroup_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private org.apache.airavata.sharing.registry.models.UserGroup group;
+      public createGroup_call(org.apache.airavata.sharing.registry.models.UserGroup group, 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.group = group;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createGroup", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        createGroup_args args = new createGroup_args()

<TRUNCATED>

[03/17] airavata git commit: renaming directory names

Posted by sc...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/UserGroup.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/UserGroup.java b/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/UserGroup.java
new file mode 100644
index 0000000..0c481bb
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/UserGroup.java
@@ -0,0 +1,1154 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.3)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.airavata.sharing.registry.models;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import javax.annotation.Generated;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-05")
+public class UserGroup implements org.apache.thrift.TBase<UserGroup, UserGroup._Fields>, java.io.Serializable, Cloneable, Comparable<UserGroup> {
+  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("UserGroup");
+
+  private static final org.apache.thrift.protocol.TField GROUP_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("groupId", org.apache.thrift.protocol.TType.STRING, (short)1);
+  private static final org.apache.thrift.protocol.TField DOMAIN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("domainId", org.apache.thrift.protocol.TType.STRING, (short)2);
+  private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)3);
+  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)6);
+  private static final org.apache.thrift.protocol.TField OWNER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("ownerId", org.apache.thrift.protocol.TType.STRING, (short)7);
+  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)8);
+  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)9);
+  private static final org.apache.thrift.protocol.TField GROUP_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("groupType", org.apache.thrift.protocol.TType.I32, (short)10);
+
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new UserGroupStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new UserGroupTupleSchemeFactory());
+  }
+
+  public String groupId; // optional
+  public String domainId; // optional
+  public String name; // optional
+  public String description; // optional
+  public String ownerId; // optional
+  public long createdTime; // optional
+  public long updatedTime; // optional
+  /**
+   * 
+   * @see GroupType
+   */
+  public GroupType groupType; // optional
+
+  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    GROUP_ID((short)1, "groupId"),
+    DOMAIN_ID((short)2, "domainId"),
+    NAME((short)3, "name"),
+    DESCRIPTION((short)6, "description"),
+    OWNER_ID((short)7, "ownerId"),
+    CREATED_TIME((short)8, "createdTime"),
+    UPDATED_TIME((short)9, "updatedTime"),
+    /**
+     * 
+     * @see GroupType
+     */
+    GROUP_TYPE((short)10, "groupType");
+
+    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+    static {
+      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+        byName.put(field.getFieldName(), field);
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, or null if its not found.
+     */
+    public static _Fields findByThriftId(int fieldId) {
+      switch(fieldId) {
+        case 1: // GROUP_ID
+          return GROUP_ID;
+        case 2: // DOMAIN_ID
+          return DOMAIN_ID;
+        case 3: // NAME
+          return NAME;
+        case 6: // DESCRIPTION
+          return DESCRIPTION;
+        case 7: // OWNER_ID
+          return OWNER_ID;
+        case 8: // CREATED_TIME
+          return CREATED_TIME;
+        case 9: // UPDATED_TIME
+          return UPDATED_TIME;
+        case 10: // GROUP_TYPE
+          return GROUP_TYPE;
+        default:
+          return null;
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, throwing an exception
+     * if it is not found.
+     */
+    public static _Fields findByThriftIdOrThrow(int fieldId) {
+      _Fields fields = findByThriftId(fieldId);
+      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      return fields;
+    }
+
+    /**
+     * Find the _Fields constant that matches name, or null if its not found.
+     */
+    public static _Fields findByName(String name) {
+      return byName.get(name);
+    }
+
+    private final short _thriftId;
+    private final String _fieldName;
+
+    _Fields(short thriftId, String fieldName) {
+      _thriftId = thriftId;
+      _fieldName = fieldName;
+    }
+
+    public short getThriftFieldId() {
+      return _thriftId;
+    }
+
+    public String getFieldName() {
+      return _fieldName;
+    }
+  }
+
+  // isset id assignments
+  private static final int __CREATEDTIME_ISSET_ID = 0;
+  private static final int __UPDATEDTIME_ISSET_ID = 1;
+  private byte __isset_bitfield = 0;
+  private static final _Fields optionals[] = {_Fields.GROUP_ID,_Fields.DOMAIN_ID,_Fields.NAME,_Fields.DESCRIPTION,_Fields.OWNER_ID,_Fields.CREATED_TIME,_Fields.UPDATED_TIME,_Fields.GROUP_TYPE};
+  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);
+    tmpMap.put(_Fields.GROUP_ID, new org.apache.thrift.meta_data.FieldMetaData("groupId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.DOMAIN_ID, new org.apache.thrift.meta_data.FieldMetaData("domainId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("description", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.OWNER_ID, new org.apache.thrift.meta_data.FieldMetaData("ownerId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    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, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
+    tmpMap.put(_Fields.GROUP_TYPE, new org.apache.thrift.meta_data.FieldMetaData("groupType", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, GroupType.class)));
+    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(UserGroup.class, metaDataMap);
+  }
+
+  public UserGroup() {
+    this.groupId = "DO_NOT_SET_AT_CLIENTS_ID";
+
+  }
+
+  /**
+   * Performs a deep copy on <i>other</i>.
+   */
+  public UserGroup(UserGroup other) {
+    __isset_bitfield = other.__isset_bitfield;
+    if (other.isSetGroupId()) {
+      this.groupId = other.groupId;
+    }
+    if (other.isSetDomainId()) {
+      this.domainId = other.domainId;
+    }
+    if (other.isSetName()) {
+      this.name = other.name;
+    }
+    if (other.isSetDescription()) {
+      this.description = other.description;
+    }
+    if (other.isSetOwnerId()) {
+      this.ownerId = other.ownerId;
+    }
+    this.createdTime = other.createdTime;
+    this.updatedTime = other.updatedTime;
+    if (other.isSetGroupType()) {
+      this.groupType = other.groupType;
+    }
+  }
+
+  public UserGroup deepCopy() {
+    return new UserGroup(this);
+  }
+
+  @Override
+  public void clear() {
+    this.groupId = "DO_NOT_SET_AT_CLIENTS_ID";
+
+    this.domainId = null;
+    this.name = null;
+    this.description = null;
+    this.ownerId = null;
+    setCreatedTimeIsSet(false);
+    this.createdTime = 0;
+    setUpdatedTimeIsSet(false);
+    this.updatedTime = 0;
+    this.groupType = null;
+  }
+
+  public String getGroupId() {
+    return this.groupId;
+  }
+
+  public UserGroup setGroupId(String groupId) {
+    this.groupId = groupId;
+    return this;
+  }
+
+  public void unsetGroupId() {
+    this.groupId = null;
+  }
+
+  /** Returns true if field groupId is set (has been assigned a value) and false otherwise */
+  public boolean isSetGroupId() {
+    return this.groupId != null;
+  }
+
+  public void setGroupIdIsSet(boolean value) {
+    if (!value) {
+      this.groupId = null;
+    }
+  }
+
+  public String getDomainId() {
+    return this.domainId;
+  }
+
+  public UserGroup setDomainId(String domainId) {
+    this.domainId = domainId;
+    return this;
+  }
+
+  public void unsetDomainId() {
+    this.domainId = null;
+  }
+
+  /** Returns true if field domainId is set (has been assigned a value) and false otherwise */
+  public boolean isSetDomainId() {
+    return this.domainId != null;
+  }
+
+  public void setDomainIdIsSet(boolean value) {
+    if (!value) {
+      this.domainId = null;
+    }
+  }
+
+  public String getName() {
+    return this.name;
+  }
+
+  public UserGroup setName(String name) {
+    this.name = name;
+    return this;
+  }
+
+  public void unsetName() {
+    this.name = null;
+  }
+
+  /** Returns true if field name is set (has been assigned a value) and false otherwise */
+  public boolean isSetName() {
+    return this.name != null;
+  }
+
+  public void setNameIsSet(boolean value) {
+    if (!value) {
+      this.name = null;
+    }
+  }
+
+  public String getDescription() {
+    return this.description;
+  }
+
+  public UserGroup setDescription(String description) {
+    this.description = description;
+    return this;
+  }
+
+  public void unsetDescription() {
+    this.description = null;
+  }
+
+  /** Returns true if field description is set (has been assigned a value) and false otherwise */
+  public boolean isSetDescription() {
+    return this.description != null;
+  }
+
+  public void setDescriptionIsSet(boolean value) {
+    if (!value) {
+      this.description = null;
+    }
+  }
+
+  public String getOwnerId() {
+    return this.ownerId;
+  }
+
+  public UserGroup setOwnerId(String ownerId) {
+    this.ownerId = ownerId;
+    return this;
+  }
+
+  public void unsetOwnerId() {
+    this.ownerId = null;
+  }
+
+  /** Returns true if field ownerId is set (has been assigned a value) and false otherwise */
+  public boolean isSetOwnerId() {
+    return this.ownerId != null;
+  }
+
+  public void setOwnerIdIsSet(boolean value) {
+    if (!value) {
+      this.ownerId = null;
+    }
+  }
+
+  public long getCreatedTime() {
+    return this.createdTime;
+  }
+
+  public UserGroup setCreatedTime(long createdTime) {
+    this.createdTime = createdTime;
+    setCreatedTimeIsSet(true);
+    return this;
+  }
+
+  public void unsetCreatedTime() {
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CREATEDTIME_ISSET_ID);
+  }
+
+  /** Returns true if field createdTime is set (has been assigned a value) and false otherwise */
+  public boolean isSetCreatedTime() {
+    return EncodingUtils.testBit(__isset_bitfield, __CREATEDTIME_ISSET_ID);
+  }
+
+  public void setCreatedTimeIsSet(boolean value) {
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CREATEDTIME_ISSET_ID, value);
+  }
+
+  public long getUpdatedTime() {
+    return this.updatedTime;
+  }
+
+  public UserGroup setUpdatedTime(long updatedTime) {
+    this.updatedTime = updatedTime;
+    setUpdatedTimeIsSet(true);
+    return this;
+  }
+
+  public void unsetUpdatedTime() {
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID);
+  }
+
+  /** Returns true if field updatedTime is set (has been assigned a value) and false otherwise */
+  public boolean isSetUpdatedTime() {
+    return EncodingUtils.testBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID);
+  }
+
+  public void setUpdatedTimeIsSet(boolean value) {
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID, value);
+  }
+
+  /**
+   * 
+   * @see GroupType
+   */
+  public GroupType getGroupType() {
+    return this.groupType;
+  }
+
+  /**
+   * 
+   * @see GroupType
+   */
+  public UserGroup setGroupType(GroupType groupType) {
+    this.groupType = groupType;
+    return this;
+  }
+
+  public void unsetGroupType() {
+    this.groupType = null;
+  }
+
+  /** Returns true if field groupType is set (has been assigned a value) and false otherwise */
+  public boolean isSetGroupType() {
+    return this.groupType != null;
+  }
+
+  public void setGroupTypeIsSet(boolean value) {
+    if (!value) {
+      this.groupType = null;
+    }
+  }
+
+  public void setFieldValue(_Fields field, Object value) {
+    switch (field) {
+    case GROUP_ID:
+      if (value == null) {
+        unsetGroupId();
+      } else {
+        setGroupId((String)value);
+      }
+      break;
+
+    case DOMAIN_ID:
+      if (value == null) {
+        unsetDomainId();
+      } else {
+        setDomainId((String)value);
+      }
+      break;
+
+    case NAME:
+      if (value == null) {
+        unsetName();
+      } else {
+        setName((String)value);
+      }
+      break;
+
+    case DESCRIPTION:
+      if (value == null) {
+        unsetDescription();
+      } else {
+        setDescription((String)value);
+      }
+      break;
+
+    case OWNER_ID:
+      if (value == null) {
+        unsetOwnerId();
+      } else {
+        setOwnerId((String)value);
+      }
+      break;
+
+    case CREATED_TIME:
+      if (value == null) {
+        unsetCreatedTime();
+      } else {
+        setCreatedTime((Long)value);
+      }
+      break;
+
+    case UPDATED_TIME:
+      if (value == null) {
+        unsetUpdatedTime();
+      } else {
+        setUpdatedTime((Long)value);
+      }
+      break;
+
+    case GROUP_TYPE:
+      if (value == null) {
+        unsetGroupType();
+      } else {
+        setGroupType((GroupType)value);
+      }
+      break;
+
+    }
+  }
+
+  public Object getFieldValue(_Fields field) {
+    switch (field) {
+    case GROUP_ID:
+      return getGroupId();
+
+    case DOMAIN_ID:
+      return getDomainId();
+
+    case NAME:
+      return getName();
+
+    case DESCRIPTION:
+      return getDescription();
+
+    case OWNER_ID:
+      return getOwnerId();
+
+    case CREATED_TIME:
+      return getCreatedTime();
+
+    case UPDATED_TIME:
+      return getUpdatedTime();
+
+    case GROUP_TYPE:
+      return getGroupType();
+
+    }
+    throw new IllegalStateException();
+  }
+
+  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+  public boolean isSet(_Fields field) {
+    if (field == null) {
+      throw new IllegalArgumentException();
+    }
+
+    switch (field) {
+    case GROUP_ID:
+      return isSetGroupId();
+    case DOMAIN_ID:
+      return isSetDomainId();
+    case NAME:
+      return isSetName();
+    case DESCRIPTION:
+      return isSetDescription();
+    case OWNER_ID:
+      return isSetOwnerId();
+    case CREATED_TIME:
+      return isSetCreatedTime();
+    case UPDATED_TIME:
+      return isSetUpdatedTime();
+    case GROUP_TYPE:
+      return isSetGroupType();
+    }
+    throw new IllegalStateException();
+  }
+
+  @Override
+  public boolean equals(Object that) {
+    if (that == null)
+      return false;
+    if (that instanceof UserGroup)
+      return this.equals((UserGroup)that);
+    return false;
+  }
+
+  public boolean equals(UserGroup that) {
+    if (that == null)
+      return false;
+
+    boolean this_present_groupId = true && this.isSetGroupId();
+    boolean that_present_groupId = true && that.isSetGroupId();
+    if (this_present_groupId || that_present_groupId) {
+      if (!(this_present_groupId && that_present_groupId))
+        return false;
+      if (!this.groupId.equals(that.groupId))
+        return false;
+    }
+
+    boolean this_present_domainId = true && this.isSetDomainId();
+    boolean that_present_domainId = true && that.isSetDomainId();
+    if (this_present_domainId || that_present_domainId) {
+      if (!(this_present_domainId && that_present_domainId))
+        return false;
+      if (!this.domainId.equals(that.domainId))
+        return false;
+    }
+
+    boolean this_present_name = true && this.isSetName();
+    boolean that_present_name = true && that.isSetName();
+    if (this_present_name || that_present_name) {
+      if (!(this_present_name && that_present_name))
+        return false;
+      if (!this.name.equals(that.name))
+        return false;
+    }
+
+    boolean this_present_description = true && this.isSetDescription();
+    boolean that_present_description = true && that.isSetDescription();
+    if (this_present_description || that_present_description) {
+      if (!(this_present_description && that_present_description))
+        return false;
+      if (!this.description.equals(that.description))
+        return false;
+    }
+
+    boolean this_present_ownerId = true && this.isSetOwnerId();
+    boolean that_present_ownerId = true && that.isSetOwnerId();
+    if (this_present_ownerId || that_present_ownerId) {
+      if (!(this_present_ownerId && that_present_ownerId))
+        return false;
+      if (!this.ownerId.equals(that.ownerId))
+        return false;
+    }
+
+    boolean this_present_createdTime = true && this.isSetCreatedTime();
+    boolean that_present_createdTime = true && that.isSetCreatedTime();
+    if (this_present_createdTime || that_present_createdTime) {
+      if (!(this_present_createdTime && that_present_createdTime))
+        return false;
+      if (this.createdTime != that.createdTime)
+        return false;
+    }
+
+    boolean this_present_updatedTime = true && this.isSetUpdatedTime();
+    boolean that_present_updatedTime = true && that.isSetUpdatedTime();
+    if (this_present_updatedTime || that_present_updatedTime) {
+      if (!(this_present_updatedTime && that_present_updatedTime))
+        return false;
+      if (this.updatedTime != that.updatedTime)
+        return false;
+    }
+
+    boolean this_present_groupType = true && this.isSetGroupType();
+    boolean that_present_groupType = true && that.isSetGroupType();
+    if (this_present_groupType || that_present_groupType) {
+      if (!(this_present_groupType && that_present_groupType))
+        return false;
+      if (!this.groupType.equals(that.groupType))
+        return false;
+    }
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    List<Object> list = new ArrayList<Object>();
+
+    boolean present_groupId = true && (isSetGroupId());
+    list.add(present_groupId);
+    if (present_groupId)
+      list.add(groupId);
+
+    boolean present_domainId = true && (isSetDomainId());
+    list.add(present_domainId);
+    if (present_domainId)
+      list.add(domainId);
+
+    boolean present_name = true && (isSetName());
+    list.add(present_name);
+    if (present_name)
+      list.add(name);
+
+    boolean present_description = true && (isSetDescription());
+    list.add(present_description);
+    if (present_description)
+      list.add(description);
+
+    boolean present_ownerId = true && (isSetOwnerId());
+    list.add(present_ownerId);
+    if (present_ownerId)
+      list.add(ownerId);
+
+    boolean present_createdTime = true && (isSetCreatedTime());
+    list.add(present_createdTime);
+    if (present_createdTime)
+      list.add(createdTime);
+
+    boolean present_updatedTime = true && (isSetUpdatedTime());
+    list.add(present_updatedTime);
+    if (present_updatedTime)
+      list.add(updatedTime);
+
+    boolean present_groupType = true && (isSetGroupType());
+    list.add(present_groupType);
+    if (present_groupType)
+      list.add(groupType.getValue());
+
+    return list.hashCode();
+  }
+
+  @Override
+  public int compareTo(UserGroup other) {
+    if (!getClass().equals(other.getClass())) {
+      return getClass().getName().compareTo(other.getClass().getName());
+    }
+
+    int lastComparison = 0;
+
+    lastComparison = Boolean.valueOf(isSetGroupId()).compareTo(other.isSetGroupId());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetGroupId()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.groupId, other.groupId);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetDomainId()).compareTo(other.isSetDomainId());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetDomainId()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domainId, other.domainId);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetName()).compareTo(other.isSetName());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetName()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetDescription()).compareTo(other.isSetDescription());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetDescription()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.description, other.description);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetOwnerId()).compareTo(other.isSetOwnerId());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetOwnerId()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ownerId, other.ownerId);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetCreatedTime()).compareTo(other.isSetCreatedTime());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetCreatedTime()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.createdTime, other.createdTime);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetUpdatedTime()).compareTo(other.isSetUpdatedTime());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetUpdatedTime()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updatedTime, other.updatedTime);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetGroupType()).compareTo(other.isSetGroupType());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetGroupType()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.groupType, other.groupType);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    return 0;
+  }
+
+  public _Fields fieldForId(int fieldId) {
+    return _Fields.findByThriftId(fieldId);
+  }
+
+  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+  }
+
+  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+  }
+
+  @Override
+  public String toString() {
+    StringBuilder sb = new StringBuilder("UserGroup(");
+    boolean first = true;
+
+    if (isSetGroupId()) {
+      sb.append("groupId:");
+      if (this.groupId == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.groupId);
+      }
+      first = false;
+    }
+    if (isSetDomainId()) {
+      if (!first) sb.append(", ");
+      sb.append("domainId:");
+      if (this.domainId == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.domainId);
+      }
+      first = false;
+    }
+    if (isSetName()) {
+      if (!first) sb.append(", ");
+      sb.append("name:");
+      if (this.name == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.name);
+      }
+      first = false;
+    }
+    if (isSetDescription()) {
+      if (!first) sb.append(", ");
+      sb.append("description:");
+      if (this.description == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.description);
+      }
+      first = false;
+    }
+    if (isSetOwnerId()) {
+      if (!first) sb.append(", ");
+      sb.append("ownerId:");
+      if (this.ownerId == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.ownerId);
+      }
+      first = false;
+    }
+    if (isSetCreatedTime()) {
+      if (!first) sb.append(", ");
+      sb.append("createdTime:");
+      sb.append(this.createdTime);
+      first = false;
+    }
+    if (isSetUpdatedTime()) {
+      if (!first) sb.append(", ");
+      sb.append("updatedTime:");
+      sb.append(this.updatedTime);
+      first = false;
+    }
+    if (isSetGroupType()) {
+      if (!first) sb.append(", ");
+      sb.append("groupType:");
+      if (this.groupType == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.groupType);
+      }
+      first = false;
+    }
+    sb.append(")");
+    return sb.toString();
+  }
+
+  public void validate() throws org.apache.thrift.TException {
+    // check for required fields
+    // check for sub-struct validity
+  }
+
+  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+    try {
+      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+    try {
+      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+      __isset_bitfield = 0;
+      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private static class UserGroupStandardSchemeFactory implements SchemeFactory {
+    public UserGroupStandardScheme getScheme() {
+      return new UserGroupStandardScheme();
+    }
+  }
+
+  private static class UserGroupStandardScheme extends StandardScheme<UserGroup> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, UserGroup struct) throws org.apache.thrift.TException {
+      org.apache.thrift.protocol.TField schemeField;
+      iprot.readStructBegin();
+      while (true)
+      {
+        schemeField = iprot.readFieldBegin();
+        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+          break;
+        }
+        switch (schemeField.id) {
+          case 1: // GROUP_ID
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.groupId = iprot.readString();
+              struct.setGroupIdIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 2: // DOMAIN_ID
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.domainId = iprot.readString();
+              struct.setDomainIdIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 3: // NAME
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.name = iprot.readString();
+              struct.setNameIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 6: // DESCRIPTION
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.description = iprot.readString();
+              struct.setDescriptionIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 7: // OWNER_ID
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.ownerId = iprot.readString();
+              struct.setOwnerIdIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 8: // CREATED_TIME
+            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+              struct.createdTime = iprot.readI64();
+              struct.setCreatedTimeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 9: // UPDATED_TIME
+            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+              struct.updatedTime = iprot.readI64();
+              struct.setUpdatedTimeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 10: // GROUP_TYPE
+            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+              struct.groupType = org.apache.airavata.sharing.registry.models.GroupType.findByValue(iprot.readI32());
+              struct.setGroupTypeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          default:
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+        }
+        iprot.readFieldEnd();
+      }
+      iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      struct.validate();
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot, UserGroup struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.groupId != null) {
+        if (struct.isSetGroupId()) {
+          oprot.writeFieldBegin(GROUP_ID_FIELD_DESC);
+          oprot.writeString(struct.groupId);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.domainId != null) {
+        if (struct.isSetDomainId()) {
+          oprot.writeFieldBegin(DOMAIN_ID_FIELD_DESC);
+          oprot.writeString(struct.domainId);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.name != null) {
+        if (struct.isSetName()) {
+          oprot.writeFieldBegin(NAME_FIELD_DESC);
+          oprot.writeString(struct.name);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.description != null) {
+        if (struct.isSetDescription()) {
+          oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC);
+          oprot.writeString(struct.description);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.ownerId != null) {
+        if (struct.isSetOwnerId()) {
+          oprot.writeFieldBegin(OWNER_ID_FIELD_DESC);
+          oprot.writeString(struct.ownerId);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.isSetCreatedTime()) {
+        oprot.writeFieldBegin(CREATED_TIME_FIELD_DESC);
+        oprot.writeI64(struct.createdTime);
+        oprot.writeFieldEnd();
+      }
+      if (struct.isSetUpdatedTime()) {
+        oprot.writeFieldBegin(UPDATED_TIME_FIELD_DESC);
+        oprot.writeI64(struct.updatedTime);
+        oprot.writeFieldEnd();
+      }
+      if (struct.groupType != null) {
+        if (struct.isSetGroupType()) {
+          oprot.writeFieldBegin(GROUP_TYPE_FIELD_DESC);
+          oprot.writeI32(struct.groupType.getValue());
+          oprot.writeFieldEnd();
+        }
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class UserGroupTupleSchemeFactory implements SchemeFactory {
+    public UserGroupTupleScheme getScheme() {
+      return new UserGroupTupleScheme();
+    }
+  }
+
+  private static class UserGroupTupleScheme extends TupleScheme<UserGroup> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, UserGroup struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      BitSet optionals = new BitSet();
+      if (struct.isSetGroupId()) {
+        optionals.set(0);
+      }
+      if (struct.isSetDomainId()) {
+        optionals.set(1);
+      }
+      if (struct.isSetName()) {
+        optionals.set(2);
+      }
+      if (struct.isSetDescription()) {
+        optionals.set(3);
+      }
+      if (struct.isSetOwnerId()) {
+        optionals.set(4);
+      }
+      if (struct.isSetCreatedTime()) {
+        optionals.set(5);
+      }
+      if (struct.isSetUpdatedTime()) {
+        optionals.set(6);
+      }
+      if (struct.isSetGroupType()) {
+        optionals.set(7);
+      }
+      oprot.writeBitSet(optionals, 8);
+      if (struct.isSetGroupId()) {
+        oprot.writeString(struct.groupId);
+      }
+      if (struct.isSetDomainId()) {
+        oprot.writeString(struct.domainId);
+      }
+      if (struct.isSetName()) {
+        oprot.writeString(struct.name);
+      }
+      if (struct.isSetDescription()) {
+        oprot.writeString(struct.description);
+      }
+      if (struct.isSetOwnerId()) {
+        oprot.writeString(struct.ownerId);
+      }
+      if (struct.isSetCreatedTime()) {
+        oprot.writeI64(struct.createdTime);
+      }
+      if (struct.isSetUpdatedTime()) {
+        oprot.writeI64(struct.updatedTime);
+      }
+      if (struct.isSetGroupType()) {
+        oprot.writeI32(struct.groupType.getValue());
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, UserGroup struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      BitSet incoming = iprot.readBitSet(8);
+      if (incoming.get(0)) {
+        struct.groupId = iprot.readString();
+        struct.setGroupIdIsSet(true);
+      }
+      if (incoming.get(1)) {
+        struct.domainId = iprot.readString();
+        struct.setDomainIdIsSet(true);
+      }
+      if (incoming.get(2)) {
+        struct.name = iprot.readString();
+        struct.setNameIsSet(true);
+      }
+      if (incoming.get(3)) {
+        struct.description = iprot.readString();
+        struct.setDescriptionIsSet(true);
+      }
+      if (incoming.get(4)) {
+        struct.ownerId = iprot.readString();
+        struct.setOwnerIdIsSet(true);
+      }
+      if (incoming.get(5)) {
+        struct.createdTime = iprot.readI64();
+        struct.setCreatedTimeIsSet(true);
+      }
+      if (incoming.get(6)) {
+        struct.updatedTime = iprot.readI64();
+        struct.setUpdatedTimeIsSet(true);
+      }
+      if (incoming.get(7)) {
+        struct.groupType = org.apache.airavata.sharing.registry.models.GroupType.findByValue(iprot.readI32());
+        struct.setGroupTypeIsSet(true);
+      }
+    }
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/sharing_modelsConstants.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/sharing_modelsConstants.java b/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/sharing_modelsConstants.java
new file mode 100644
index 0000000..07fc3c7
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/sharing_modelsConstants.java
@@ -0,0 +1,41 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.3)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.airavata.sharing.registry.models;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import javax.annotation.Generated;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
+public class sharing_modelsConstants {
+
+  public static final String DO_NOT_SET_AT_CLIENTS_ID = "DO_NOT_SET_AT_CLIENTS_ID";
+
+}


[06/17] airavata git commit: renaming directory names

Posted by sc...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/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
new file mode 100644
index 0000000..462d892
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/Entity.java
@@ -0,0 +1,1511 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.3)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.airavata.sharing.registry.models;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import javax.annotation.Generated;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-05")
+public class Entity implements org.apache.thrift.TBase<Entity, Entity._Fields>, java.io.Serializable, Cloneable, Comparable<Entity> {
+  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Entity");
+
+  private static final org.apache.thrift.protocol.TField ENTITY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("entityId", org.apache.thrift.protocol.TType.STRING, (short)1);
+  private static final org.apache.thrift.protocol.TField DOMAIN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("domainId", org.apache.thrift.protocol.TType.STRING, (short)2);
+  private static final org.apache.thrift.protocol.TField ENTITY_TYPE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("entityTypeId", org.apache.thrift.protocol.TType.STRING, (short)3);
+  private static final org.apache.thrift.protocol.TField OWNER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("ownerId", org.apache.thrift.protocol.TType.STRING, (short)4);
+  private static final org.apache.thrift.protocol.TField PARENT_ENTITY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("parentEntityId", org.apache.thrift.protocol.TType.STRING, (short)5);
+  private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)6);
+  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 METADATA_FIELD_DESC = new org.apache.thrift.protocol.TField("metadata", org.apache.thrift.protocol.TType.MAP, (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 Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new EntityStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new EntityTupleSchemeFactory());
+  }
+
+  public String entityId; // optional
+  public String domainId; // optional
+  public String entityTypeId; // optional
+  public String ownerId; // optional
+  public String parentEntityId; // optional
+  public String name; // optional
+  public String description; // optional
+  public Map<String,String> metadata; // optional
+  public String fullText; // optional
+  public long createdTime; // optional
+  public long updatedTime; // optional
+
+  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    ENTITY_ID((short)1, "entityId"),
+    DOMAIN_ID((short)2, "domainId"),
+    ENTITY_TYPE_ID((short)3, "entityTypeId"),
+    OWNER_ID((short)4, "ownerId"),
+    PARENT_ENTITY_ID((short)5, "parentEntityId"),
+    NAME((short)6, "name"),
+    DESCRIPTION((short)7, "description"),
+    METADATA((short)8, "metadata"),
+    FULL_TEXT((short)9, "fullText"),
+    CREATED_TIME((short)10, "createdTime"),
+    UPDATED_TIME((short)11, "updatedTime");
+
+    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+    static {
+      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+        byName.put(field.getFieldName(), field);
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, or null if its not found.
+     */
+    public static _Fields findByThriftId(int fieldId) {
+      switch(fieldId) {
+        case 1: // ENTITY_ID
+          return ENTITY_ID;
+        case 2: // DOMAIN_ID
+          return DOMAIN_ID;
+        case 3: // ENTITY_TYPE_ID
+          return ENTITY_TYPE_ID;
+        case 4: // OWNER_ID
+          return OWNER_ID;
+        case 5: // PARENT_ENTITY_ID
+          return PARENT_ENTITY_ID;
+        case 6: // NAME
+          return NAME;
+        case 7: // DESCRIPTION
+          return DESCRIPTION;
+        case 8: // METADATA
+          return METADATA;
+        case 9: // FULL_TEXT
+          return FULL_TEXT;
+        case 10: // CREATED_TIME
+          return CREATED_TIME;
+        case 11: // UPDATED_TIME
+          return UPDATED_TIME;
+        default:
+          return null;
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, throwing an exception
+     * if it is not found.
+     */
+    public static _Fields findByThriftIdOrThrow(int fieldId) {
+      _Fields fields = findByThriftId(fieldId);
+      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      return fields;
+    }
+
+    /**
+     * Find the _Fields constant that matches name, or null if its not found.
+     */
+    public static _Fields findByName(String name) {
+      return byName.get(name);
+    }
+
+    private final short _thriftId;
+    private final String _fieldName;
+
+    _Fields(short thriftId, String fieldName) {
+      _thriftId = thriftId;
+      _fieldName = fieldName;
+    }
+
+    public short getThriftFieldId() {
+      return _thriftId;
+    }
+
+    public String getFieldName() {
+      return _fieldName;
+    }
+  }
+
+  // isset id assignments
+  private static final int __CREATEDTIME_ISSET_ID = 0;
+  private static final int __UPDATEDTIME_ISSET_ID = 1;
+  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.METADATA,_Fields.FULL_TEXT,_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);
+    tmpMap.put(_Fields.ENTITY_ID, new org.apache.thrift.meta_data.FieldMetaData("entityId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.DOMAIN_ID, new org.apache.thrift.meta_data.FieldMetaData("domainId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.ENTITY_TYPE_ID, new org.apache.thrift.meta_data.FieldMetaData("entityTypeId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.OWNER_ID, new org.apache.thrift.meta_data.FieldMetaData("ownerId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.PARENT_ENTITY_ID, new org.apache.thrift.meta_data.FieldMetaData("parentEntityId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("description", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.METADATA, new org.apache.thrift.meta_data.FieldMetaData("metadata", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
+            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), 
+            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
+    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.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, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
+    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Entity.class, metaDataMap);
+  }
+
+  public Entity() {
+    this.entityId = "DO_NOT_SET_AT_CLIENTS_ID";
+
+  }
+
+  /**
+   * Performs a deep copy on <i>other</i>.
+   */
+  public Entity(Entity other) {
+    __isset_bitfield = other.__isset_bitfield;
+    if (other.isSetEntityId()) {
+      this.entityId = other.entityId;
+    }
+    if (other.isSetDomainId()) {
+      this.domainId = other.domainId;
+    }
+    if (other.isSetEntityTypeId()) {
+      this.entityTypeId = other.entityTypeId;
+    }
+    if (other.isSetOwnerId()) {
+      this.ownerId = other.ownerId;
+    }
+    if (other.isSetParentEntityId()) {
+      this.parentEntityId = other.parentEntityId;
+    }
+    if (other.isSetName()) {
+      this.name = other.name;
+    }
+    if (other.isSetDescription()) {
+      this.description = other.description;
+    }
+    if (other.isSetMetadata()) {
+      Map<String,String> __this__metadata = new HashMap<String,String>(other.metadata);
+      this.metadata = __this__metadata;
+    }
+    if (other.isSetFullText()) {
+      this.fullText = other.fullText;
+    }
+    this.createdTime = other.createdTime;
+    this.updatedTime = other.updatedTime;
+  }
+
+  public Entity deepCopy() {
+    return new Entity(this);
+  }
+
+  @Override
+  public void clear() {
+    this.entityId = "DO_NOT_SET_AT_CLIENTS_ID";
+
+    this.domainId = null;
+    this.entityTypeId = null;
+    this.ownerId = null;
+    this.parentEntityId = null;
+    this.name = null;
+    this.description = null;
+    this.metadata = null;
+    this.fullText = null;
+    setCreatedTimeIsSet(false);
+    this.createdTime = 0;
+    setUpdatedTimeIsSet(false);
+    this.updatedTime = 0;
+  }
+
+  public String getEntityId() {
+    return this.entityId;
+  }
+
+  public Entity setEntityId(String entityId) {
+    this.entityId = entityId;
+    return this;
+  }
+
+  public void unsetEntityId() {
+    this.entityId = null;
+  }
+
+  /** Returns true if field entityId is set (has been assigned a value) and false otherwise */
+  public boolean isSetEntityId() {
+    return this.entityId != null;
+  }
+
+  public void setEntityIdIsSet(boolean value) {
+    if (!value) {
+      this.entityId = null;
+    }
+  }
+
+  public String getDomainId() {
+    return this.domainId;
+  }
+
+  public Entity setDomainId(String domainId) {
+    this.domainId = domainId;
+    return this;
+  }
+
+  public void unsetDomainId() {
+    this.domainId = null;
+  }
+
+  /** Returns true if field domainId is set (has been assigned a value) and false otherwise */
+  public boolean isSetDomainId() {
+    return this.domainId != null;
+  }
+
+  public void setDomainIdIsSet(boolean value) {
+    if (!value) {
+      this.domainId = null;
+    }
+  }
+
+  public String getEntityTypeId() {
+    return this.entityTypeId;
+  }
+
+  public Entity setEntityTypeId(String entityTypeId) {
+    this.entityTypeId = entityTypeId;
+    return this;
+  }
+
+  public void unsetEntityTypeId() {
+    this.entityTypeId = null;
+  }
+
+  /** Returns true if field entityTypeId is set (has been assigned a value) and false otherwise */
+  public boolean isSetEntityTypeId() {
+    return this.entityTypeId != null;
+  }
+
+  public void setEntityTypeIdIsSet(boolean value) {
+    if (!value) {
+      this.entityTypeId = null;
+    }
+  }
+
+  public String getOwnerId() {
+    return this.ownerId;
+  }
+
+  public Entity setOwnerId(String ownerId) {
+    this.ownerId = ownerId;
+    return this;
+  }
+
+  public void unsetOwnerId() {
+    this.ownerId = null;
+  }
+
+  /** Returns true if field ownerId is set (has been assigned a value) and false otherwise */
+  public boolean isSetOwnerId() {
+    return this.ownerId != null;
+  }
+
+  public void setOwnerIdIsSet(boolean value) {
+    if (!value) {
+      this.ownerId = null;
+    }
+  }
+
+  public String getParentEntityId() {
+    return this.parentEntityId;
+  }
+
+  public Entity setParentEntityId(String parentEntityId) {
+    this.parentEntityId = parentEntityId;
+    return this;
+  }
+
+  public void unsetParentEntityId() {
+    this.parentEntityId = null;
+  }
+
+  /** Returns true if field parentEntityId is set (has been assigned a value) and false otherwise */
+  public boolean isSetParentEntityId() {
+    return this.parentEntityId != null;
+  }
+
+  public void setParentEntityIdIsSet(boolean value) {
+    if (!value) {
+      this.parentEntityId = null;
+    }
+  }
+
+  public String getName() {
+    return this.name;
+  }
+
+  public Entity setName(String name) {
+    this.name = name;
+    return this;
+  }
+
+  public void unsetName() {
+    this.name = null;
+  }
+
+  /** Returns true if field name is set (has been assigned a value) and false otherwise */
+  public boolean isSetName() {
+    return this.name != null;
+  }
+
+  public void setNameIsSet(boolean value) {
+    if (!value) {
+      this.name = null;
+    }
+  }
+
+  public String getDescription() {
+    return this.description;
+  }
+
+  public Entity setDescription(String description) {
+    this.description = description;
+    return this;
+  }
+
+  public void unsetDescription() {
+    this.description = null;
+  }
+
+  /** Returns true if field description is set (has been assigned a value) and false otherwise */
+  public boolean isSetDescription() {
+    return this.description != null;
+  }
+
+  public void setDescriptionIsSet(boolean value) {
+    if (!value) {
+      this.description = null;
+    }
+  }
+
+  public int getMetadataSize() {
+    return (this.metadata == null) ? 0 : this.metadata.size();
+  }
+
+  public void putToMetadata(String key, String val) {
+    if (this.metadata == null) {
+      this.metadata = new HashMap<String,String>();
+    }
+    this.metadata.put(key, val);
+  }
+
+  public Map<String,String> getMetadata() {
+    return this.metadata;
+  }
+
+  public Entity setMetadata(Map<String,String> metadata) {
+    this.metadata = metadata;
+    return this;
+  }
+
+  public void unsetMetadata() {
+    this.metadata = null;
+  }
+
+  /** Returns true if field metadata is set (has been assigned a value) and false otherwise */
+  public boolean isSetMetadata() {
+    return this.metadata != null;
+  }
+
+  public void setMetadataIsSet(boolean value) {
+    if (!value) {
+      this.metadata = null;
+    }
+  }
+
+  public String getFullText() {
+    return this.fullText;
+  }
+
+  public Entity setFullText(String fullText) {
+    this.fullText = fullText;
+    return this;
+  }
+
+  public void unsetFullText() {
+    this.fullText = null;
+  }
+
+  /** Returns true if field fullText is set (has been assigned a value) and false otherwise */
+  public boolean isSetFullText() {
+    return this.fullText != null;
+  }
+
+  public void setFullTextIsSet(boolean value) {
+    if (!value) {
+      this.fullText = null;
+    }
+  }
+
+  public long getCreatedTime() {
+    return this.createdTime;
+  }
+
+  public Entity setCreatedTime(long createdTime) {
+    this.createdTime = createdTime;
+    setCreatedTimeIsSet(true);
+    return this;
+  }
+
+  public void unsetCreatedTime() {
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CREATEDTIME_ISSET_ID);
+  }
+
+  /** Returns true if field createdTime is set (has been assigned a value) and false otherwise */
+  public boolean isSetCreatedTime() {
+    return EncodingUtils.testBit(__isset_bitfield, __CREATEDTIME_ISSET_ID);
+  }
+
+  public void setCreatedTimeIsSet(boolean value) {
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CREATEDTIME_ISSET_ID, value);
+  }
+
+  public long getUpdatedTime() {
+    return this.updatedTime;
+  }
+
+  public Entity setUpdatedTime(long updatedTime) {
+    this.updatedTime = updatedTime;
+    setUpdatedTimeIsSet(true);
+    return this;
+  }
+
+  public void unsetUpdatedTime() {
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID);
+  }
+
+  /** Returns true if field updatedTime is set (has been assigned a value) and false otherwise */
+  public boolean isSetUpdatedTime() {
+    return EncodingUtils.testBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID);
+  }
+
+  public void setUpdatedTimeIsSet(boolean value) {
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID, value);
+  }
+
+  public void setFieldValue(_Fields field, Object value) {
+    switch (field) {
+    case ENTITY_ID:
+      if (value == null) {
+        unsetEntityId();
+      } else {
+        setEntityId((String)value);
+      }
+      break;
+
+    case DOMAIN_ID:
+      if (value == null) {
+        unsetDomainId();
+      } else {
+        setDomainId((String)value);
+      }
+      break;
+
+    case ENTITY_TYPE_ID:
+      if (value == null) {
+        unsetEntityTypeId();
+      } else {
+        setEntityTypeId((String)value);
+      }
+      break;
+
+    case OWNER_ID:
+      if (value == null) {
+        unsetOwnerId();
+      } else {
+        setOwnerId((String)value);
+      }
+      break;
+
+    case PARENT_ENTITY_ID:
+      if (value == null) {
+        unsetParentEntityId();
+      } else {
+        setParentEntityId((String)value);
+      }
+      break;
+
+    case NAME:
+      if (value == null) {
+        unsetName();
+      } else {
+        setName((String)value);
+      }
+      break;
+
+    case DESCRIPTION:
+      if (value == null) {
+        unsetDescription();
+      } else {
+        setDescription((String)value);
+      }
+      break;
+
+    case METADATA:
+      if (value == null) {
+        unsetMetadata();
+      } else {
+        setMetadata((Map<String,String>)value);
+      }
+      break;
+
+    case FULL_TEXT:
+      if (value == null) {
+        unsetFullText();
+      } else {
+        setFullText((String)value);
+      }
+      break;
+
+    case CREATED_TIME:
+      if (value == null) {
+        unsetCreatedTime();
+      } else {
+        setCreatedTime((Long)value);
+      }
+      break;
+
+    case UPDATED_TIME:
+      if (value == null) {
+        unsetUpdatedTime();
+      } else {
+        setUpdatedTime((Long)value);
+      }
+      break;
+
+    }
+  }
+
+  public Object getFieldValue(_Fields field) {
+    switch (field) {
+    case ENTITY_ID:
+      return getEntityId();
+
+    case DOMAIN_ID:
+      return getDomainId();
+
+    case ENTITY_TYPE_ID:
+      return getEntityTypeId();
+
+    case OWNER_ID:
+      return getOwnerId();
+
+    case PARENT_ENTITY_ID:
+      return getParentEntityId();
+
+    case NAME:
+      return getName();
+
+    case DESCRIPTION:
+      return getDescription();
+
+    case METADATA:
+      return getMetadata();
+
+    case FULL_TEXT:
+      return getFullText();
+
+    case CREATED_TIME:
+      return getCreatedTime();
+
+    case UPDATED_TIME:
+      return getUpdatedTime();
+
+    }
+    throw new IllegalStateException();
+  }
+
+  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+  public boolean isSet(_Fields field) {
+    if (field == null) {
+      throw new IllegalArgumentException();
+    }
+
+    switch (field) {
+    case ENTITY_ID:
+      return isSetEntityId();
+    case DOMAIN_ID:
+      return isSetDomainId();
+    case ENTITY_TYPE_ID:
+      return isSetEntityTypeId();
+    case OWNER_ID:
+      return isSetOwnerId();
+    case PARENT_ENTITY_ID:
+      return isSetParentEntityId();
+    case NAME:
+      return isSetName();
+    case DESCRIPTION:
+      return isSetDescription();
+    case METADATA:
+      return isSetMetadata();
+    case FULL_TEXT:
+      return isSetFullText();
+    case CREATED_TIME:
+      return isSetCreatedTime();
+    case UPDATED_TIME:
+      return isSetUpdatedTime();
+    }
+    throw new IllegalStateException();
+  }
+
+  @Override
+  public boolean equals(Object that) {
+    if (that == null)
+      return false;
+    if (that instanceof Entity)
+      return this.equals((Entity)that);
+    return false;
+  }
+
+  public boolean equals(Entity that) {
+    if (that == null)
+      return false;
+
+    boolean this_present_entityId = true && this.isSetEntityId();
+    boolean that_present_entityId = true && that.isSetEntityId();
+    if (this_present_entityId || that_present_entityId) {
+      if (!(this_present_entityId && that_present_entityId))
+        return false;
+      if (!this.entityId.equals(that.entityId))
+        return false;
+    }
+
+    boolean this_present_domainId = true && this.isSetDomainId();
+    boolean that_present_domainId = true && that.isSetDomainId();
+    if (this_present_domainId || that_present_domainId) {
+      if (!(this_present_domainId && that_present_domainId))
+        return false;
+      if (!this.domainId.equals(that.domainId))
+        return false;
+    }
+
+    boolean this_present_entityTypeId = true && this.isSetEntityTypeId();
+    boolean that_present_entityTypeId = true && that.isSetEntityTypeId();
+    if (this_present_entityTypeId || that_present_entityTypeId) {
+      if (!(this_present_entityTypeId && that_present_entityTypeId))
+        return false;
+      if (!this.entityTypeId.equals(that.entityTypeId))
+        return false;
+    }
+
+    boolean this_present_ownerId = true && this.isSetOwnerId();
+    boolean that_present_ownerId = true && that.isSetOwnerId();
+    if (this_present_ownerId || that_present_ownerId) {
+      if (!(this_present_ownerId && that_present_ownerId))
+        return false;
+      if (!this.ownerId.equals(that.ownerId))
+        return false;
+    }
+
+    boolean this_present_parentEntityId = true && this.isSetParentEntityId();
+    boolean that_present_parentEntityId = true && that.isSetParentEntityId();
+    if (this_present_parentEntityId || that_present_parentEntityId) {
+      if (!(this_present_parentEntityId && that_present_parentEntityId))
+        return false;
+      if (!this.parentEntityId.equals(that.parentEntityId))
+        return false;
+    }
+
+    boolean this_present_name = true && this.isSetName();
+    boolean that_present_name = true && that.isSetName();
+    if (this_present_name || that_present_name) {
+      if (!(this_present_name && that_present_name))
+        return false;
+      if (!this.name.equals(that.name))
+        return false;
+    }
+
+    boolean this_present_description = true && this.isSetDescription();
+    boolean that_present_description = true && that.isSetDescription();
+    if (this_present_description || that_present_description) {
+      if (!(this_present_description && that_present_description))
+        return false;
+      if (!this.description.equals(that.description))
+        return false;
+    }
+
+    boolean this_present_metadata = true && this.isSetMetadata();
+    boolean that_present_metadata = true && that.isSetMetadata();
+    if (this_present_metadata || that_present_metadata) {
+      if (!(this_present_metadata && that_present_metadata))
+        return false;
+      if (!this.metadata.equals(that.metadata))
+        return false;
+    }
+
+    boolean this_present_fullText = true && this.isSetFullText();
+    boolean that_present_fullText = true && that.isSetFullText();
+    if (this_present_fullText || that_present_fullText) {
+      if (!(this_present_fullText && that_present_fullText))
+        return false;
+      if (!this.fullText.equals(that.fullText))
+        return false;
+    }
+
+    boolean this_present_createdTime = true && this.isSetCreatedTime();
+    boolean that_present_createdTime = true && that.isSetCreatedTime();
+    if (this_present_createdTime || that_present_createdTime) {
+      if (!(this_present_createdTime && that_present_createdTime))
+        return false;
+      if (this.createdTime != that.createdTime)
+        return false;
+    }
+
+    boolean this_present_updatedTime = true && this.isSetUpdatedTime();
+    boolean that_present_updatedTime = true && that.isSetUpdatedTime();
+    if (this_present_updatedTime || that_present_updatedTime) {
+      if (!(this_present_updatedTime && that_present_updatedTime))
+        return false;
+      if (this.updatedTime != that.updatedTime)
+        return false;
+    }
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    List<Object> list = new ArrayList<Object>();
+
+    boolean present_entityId = true && (isSetEntityId());
+    list.add(present_entityId);
+    if (present_entityId)
+      list.add(entityId);
+
+    boolean present_domainId = true && (isSetDomainId());
+    list.add(present_domainId);
+    if (present_domainId)
+      list.add(domainId);
+
+    boolean present_entityTypeId = true && (isSetEntityTypeId());
+    list.add(present_entityTypeId);
+    if (present_entityTypeId)
+      list.add(entityTypeId);
+
+    boolean present_ownerId = true && (isSetOwnerId());
+    list.add(present_ownerId);
+    if (present_ownerId)
+      list.add(ownerId);
+
+    boolean present_parentEntityId = true && (isSetParentEntityId());
+    list.add(present_parentEntityId);
+    if (present_parentEntityId)
+      list.add(parentEntityId);
+
+    boolean present_name = true && (isSetName());
+    list.add(present_name);
+    if (present_name)
+      list.add(name);
+
+    boolean present_description = true && (isSetDescription());
+    list.add(present_description);
+    if (present_description)
+      list.add(description);
+
+    boolean present_metadata = true && (isSetMetadata());
+    list.add(present_metadata);
+    if (present_metadata)
+      list.add(metadata);
+
+    boolean present_fullText = true && (isSetFullText());
+    list.add(present_fullText);
+    if (present_fullText)
+      list.add(fullText);
+
+    boolean present_createdTime = true && (isSetCreatedTime());
+    list.add(present_createdTime);
+    if (present_createdTime)
+      list.add(createdTime);
+
+    boolean present_updatedTime = true && (isSetUpdatedTime());
+    list.add(present_updatedTime);
+    if (present_updatedTime)
+      list.add(updatedTime);
+
+    return list.hashCode();
+  }
+
+  @Override
+  public int compareTo(Entity other) {
+    if (!getClass().equals(other.getClass())) {
+      return getClass().getName().compareTo(other.getClass().getName());
+    }
+
+    int lastComparison = 0;
+
+    lastComparison = Boolean.valueOf(isSetEntityId()).compareTo(other.isSetEntityId());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetEntityId()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityId, other.entityId);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetDomainId()).compareTo(other.isSetDomainId());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetDomainId()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domainId, other.domainId);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetEntityTypeId()).compareTo(other.isSetEntityTypeId());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetEntityTypeId()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityTypeId, other.entityTypeId);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetOwnerId()).compareTo(other.isSetOwnerId());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetOwnerId()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ownerId, other.ownerId);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetParentEntityId()).compareTo(other.isSetParentEntityId());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetParentEntityId()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parentEntityId, other.parentEntityId);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetName()).compareTo(other.isSetName());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetName()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetDescription()).compareTo(other.isSetDescription());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetDescription()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.description, other.description);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetMetadata()).compareTo(other.isSetMetadata());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetMetadata()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.metadata, other.metadata);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetFullText()).compareTo(other.isSetFullText());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetFullText()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fullText, other.fullText);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetCreatedTime()).compareTo(other.isSetCreatedTime());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetCreatedTime()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.createdTime, other.createdTime);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetUpdatedTime()).compareTo(other.isSetUpdatedTime());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetUpdatedTime()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updatedTime, other.updatedTime);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    return 0;
+  }
+
+  public _Fields fieldForId(int fieldId) {
+    return _Fields.findByThriftId(fieldId);
+  }
+
+  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+  }
+
+  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+  }
+
+  @Override
+  public String toString() {
+    StringBuilder sb = new StringBuilder("Entity(");
+    boolean first = true;
+
+    if (isSetEntityId()) {
+      sb.append("entityId:");
+      if (this.entityId == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.entityId);
+      }
+      first = false;
+    }
+    if (isSetDomainId()) {
+      if (!first) sb.append(", ");
+      sb.append("domainId:");
+      if (this.domainId == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.domainId);
+      }
+      first = false;
+    }
+    if (isSetEntityTypeId()) {
+      if (!first) sb.append(", ");
+      sb.append("entityTypeId:");
+      if (this.entityTypeId == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.entityTypeId);
+      }
+      first = false;
+    }
+    if (isSetOwnerId()) {
+      if (!first) sb.append(", ");
+      sb.append("ownerId:");
+      if (this.ownerId == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.ownerId);
+      }
+      first = false;
+    }
+    if (isSetParentEntityId()) {
+      if (!first) sb.append(", ");
+      sb.append("parentEntityId:");
+      if (this.parentEntityId == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.parentEntityId);
+      }
+      first = false;
+    }
+    if (isSetName()) {
+      if (!first) sb.append(", ");
+      sb.append("name:");
+      if (this.name == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.name);
+      }
+      first = false;
+    }
+    if (isSetDescription()) {
+      if (!first) sb.append(", ");
+      sb.append("description:");
+      if (this.description == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.description);
+      }
+      first = false;
+    }
+    if (isSetMetadata()) {
+      if (!first) sb.append(", ");
+      sb.append("metadata:");
+      if (this.metadata == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.metadata);
+      }
+      first = false;
+    }
+    if (isSetFullText()) {
+      if (!first) sb.append(", ");
+      sb.append("fullText:");
+      if (this.fullText == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.fullText);
+      }
+      first = false;
+    }
+    if (isSetCreatedTime()) {
+      if (!first) sb.append(", ");
+      sb.append("createdTime:");
+      sb.append(this.createdTime);
+      first = false;
+    }
+    if (isSetUpdatedTime()) {
+      if (!first) sb.append(", ");
+      sb.append("updatedTime:");
+      sb.append(this.updatedTime);
+      first = false;
+    }
+    sb.append(")");
+    return sb.toString();
+  }
+
+  public void validate() throws org.apache.thrift.TException {
+    // check for required fields
+    // check for sub-struct validity
+  }
+
+  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+    try {
+      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+    try {
+      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+      __isset_bitfield = 0;
+      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private static class EntityStandardSchemeFactory implements SchemeFactory {
+    public EntityStandardScheme getScheme() {
+      return new EntityStandardScheme();
+    }
+  }
+
+  private static class EntityStandardScheme extends StandardScheme<Entity> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, Entity struct) throws org.apache.thrift.TException {
+      org.apache.thrift.protocol.TField schemeField;
+      iprot.readStructBegin();
+      while (true)
+      {
+        schemeField = iprot.readFieldBegin();
+        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+          break;
+        }
+        switch (schemeField.id) {
+          case 1: // ENTITY_ID
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.entityId = iprot.readString();
+              struct.setEntityIdIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 2: // DOMAIN_ID
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.domainId = iprot.readString();
+              struct.setDomainIdIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 3: // ENTITY_TYPE_ID
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.entityTypeId = iprot.readString();
+              struct.setEntityTypeIdIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 4: // OWNER_ID
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.ownerId = iprot.readString();
+              struct.setOwnerIdIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 5: // PARENT_ENTITY_ID
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.parentEntityId = iprot.readString();
+              struct.setParentEntityIdIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 6: // NAME
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.name = iprot.readString();
+              struct.setNameIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 7: // DESCRIPTION
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.description = iprot.readString();
+              struct.setDescriptionIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 8: // METADATA
+            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
+              {
+                org.apache.thrift.protocol.TMap _map0 = iprot.readMapBegin();
+                struct.metadata = new HashMap<String,String>(2*_map0.size);
+                String _key1;
+                String _val2;
+                for (int _i3 = 0; _i3 < _map0.size; ++_i3)
+                {
+                  _key1 = iprot.readString();
+                  _val2 = iprot.readString();
+                  struct.metadata.put(_key1, _val2);
+                }
+                iprot.readMapEnd();
+              }
+              struct.setMetadataIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 9: // FULL_TEXT
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.fullText = iprot.readString();
+              struct.setFullTextIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 10: // CREATED_TIME
+            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+              struct.createdTime = iprot.readI64();
+              struct.setCreatedTimeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 11: // UPDATED_TIME
+            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+              struct.updatedTime = iprot.readI64();
+              struct.setUpdatedTimeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          default:
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+        }
+        iprot.readFieldEnd();
+      }
+      iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      struct.validate();
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot, Entity struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.entityId != null) {
+        if (struct.isSetEntityId()) {
+          oprot.writeFieldBegin(ENTITY_ID_FIELD_DESC);
+          oprot.writeString(struct.entityId);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.domainId != null) {
+        if (struct.isSetDomainId()) {
+          oprot.writeFieldBegin(DOMAIN_ID_FIELD_DESC);
+          oprot.writeString(struct.domainId);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.entityTypeId != null) {
+        if (struct.isSetEntityTypeId()) {
+          oprot.writeFieldBegin(ENTITY_TYPE_ID_FIELD_DESC);
+          oprot.writeString(struct.entityTypeId);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.ownerId != null) {
+        if (struct.isSetOwnerId()) {
+          oprot.writeFieldBegin(OWNER_ID_FIELD_DESC);
+          oprot.writeString(struct.ownerId);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.parentEntityId != null) {
+        if (struct.isSetParentEntityId()) {
+          oprot.writeFieldBegin(PARENT_ENTITY_ID_FIELD_DESC);
+          oprot.writeString(struct.parentEntityId);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.name != null) {
+        if (struct.isSetName()) {
+          oprot.writeFieldBegin(NAME_FIELD_DESC);
+          oprot.writeString(struct.name);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.description != null) {
+        if (struct.isSetDescription()) {
+          oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC);
+          oprot.writeString(struct.description);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.metadata != null) {
+        if (struct.isSetMetadata()) {
+          oprot.writeFieldBegin(METADATA_FIELD_DESC);
+          {
+            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.metadata.size()));
+            for (Map.Entry<String, String> _iter4 : struct.metadata.entrySet())
+            {
+              oprot.writeString(_iter4.getKey());
+              oprot.writeString(_iter4.getValue());
+            }
+            oprot.writeMapEnd();
+          }
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.fullText != null) {
+        if (struct.isSetFullText()) {
+          oprot.writeFieldBegin(FULL_TEXT_FIELD_DESC);
+          oprot.writeString(struct.fullText);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.isSetCreatedTime()) {
+        oprot.writeFieldBegin(CREATED_TIME_FIELD_DESC);
+        oprot.writeI64(struct.createdTime);
+        oprot.writeFieldEnd();
+      }
+      if (struct.isSetUpdatedTime()) {
+        oprot.writeFieldBegin(UPDATED_TIME_FIELD_DESC);
+        oprot.writeI64(struct.updatedTime);
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class EntityTupleSchemeFactory implements SchemeFactory {
+    public EntityTupleScheme getScheme() {
+      return new EntityTupleScheme();
+    }
+  }
+
+  private static class EntityTupleScheme extends TupleScheme<Entity> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, Entity struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      BitSet optionals = new BitSet();
+      if (struct.isSetEntityId()) {
+        optionals.set(0);
+      }
+      if (struct.isSetDomainId()) {
+        optionals.set(1);
+      }
+      if (struct.isSetEntityTypeId()) {
+        optionals.set(2);
+      }
+      if (struct.isSetOwnerId()) {
+        optionals.set(3);
+      }
+      if (struct.isSetParentEntityId()) {
+        optionals.set(4);
+      }
+      if (struct.isSetName()) {
+        optionals.set(5);
+      }
+      if (struct.isSetDescription()) {
+        optionals.set(6);
+      }
+      if (struct.isSetMetadata()) {
+        optionals.set(7);
+      }
+      if (struct.isSetFullText()) {
+        optionals.set(8);
+      }
+      if (struct.isSetCreatedTime()) {
+        optionals.set(9);
+      }
+      if (struct.isSetUpdatedTime()) {
+        optionals.set(10);
+      }
+      oprot.writeBitSet(optionals, 11);
+      if (struct.isSetEntityId()) {
+        oprot.writeString(struct.entityId);
+      }
+      if (struct.isSetDomainId()) {
+        oprot.writeString(struct.domainId);
+      }
+      if (struct.isSetEntityTypeId()) {
+        oprot.writeString(struct.entityTypeId);
+      }
+      if (struct.isSetOwnerId()) {
+        oprot.writeString(struct.ownerId);
+      }
+      if (struct.isSetParentEntityId()) {
+        oprot.writeString(struct.parentEntityId);
+      }
+      if (struct.isSetName()) {
+        oprot.writeString(struct.name);
+      }
+      if (struct.isSetDescription()) {
+        oprot.writeString(struct.description);
+      }
+      if (struct.isSetMetadata()) {
+        {
+          oprot.writeI32(struct.metadata.size());
+          for (Map.Entry<String, String> _iter5 : struct.metadata.entrySet())
+          {
+            oprot.writeString(_iter5.getKey());
+            oprot.writeString(_iter5.getValue());
+          }
+        }
+      }
+      if (struct.isSetFullText()) {
+        oprot.writeString(struct.fullText);
+      }
+      if (struct.isSetCreatedTime()) {
+        oprot.writeI64(struct.createdTime);
+      }
+      if (struct.isSetUpdatedTime()) {
+        oprot.writeI64(struct.updatedTime);
+      }
+    }
+
+    @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);
+      if (incoming.get(0)) {
+        struct.entityId = iprot.readString();
+        struct.setEntityIdIsSet(true);
+      }
+      if (incoming.get(1)) {
+        struct.domainId = iprot.readString();
+        struct.setDomainIdIsSet(true);
+      }
+      if (incoming.get(2)) {
+        struct.entityTypeId = iprot.readString();
+        struct.setEntityTypeIdIsSet(true);
+      }
+      if (incoming.get(3)) {
+        struct.ownerId = iprot.readString();
+        struct.setOwnerIdIsSet(true);
+      }
+      if (incoming.get(4)) {
+        struct.parentEntityId = iprot.readString();
+        struct.setParentEntityIdIsSet(true);
+      }
+      if (incoming.get(5)) {
+        struct.name = iprot.readString();
+        struct.setNameIsSet(true);
+      }
+      if (incoming.get(6)) {
+        struct.description = iprot.readString();
+        struct.setDescriptionIsSet(true);
+      }
+      if (incoming.get(7)) {
+        {
+          org.apache.thrift.protocol.TMap _map6 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
+          struct.metadata = new HashMap<String,String>(2*_map6.size);
+          String _key7;
+          String _val8;
+          for (int _i9 = 0; _i9 < _map6.size; ++_i9)
+          {
+            _key7 = iprot.readString();
+            _val8 = iprot.readString();
+            struct.metadata.put(_key7, _val8);
+          }
+        }
+        struct.setMetadataIsSet(true);
+      }
+      if (incoming.get(8)) {
+        struct.fullText = iprot.readString();
+        struct.setFullTextIsSet(true);
+      }
+      if (incoming.get(9)) {
+        struct.createdTime = iprot.readI64();
+        struct.setCreatedTimeIsSet(true);
+      }
+      if (incoming.get(10)) {
+        struct.updatedTime = iprot.readI64();
+        struct.setUpdatedTimeIsSet(true);
+      }
+    }
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/EntityType.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/EntityType.java b/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/EntityType.java
new file mode 100644
index 0000000..d2ddffa
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/EntityType.java
@@ -0,0 +1,924 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.3)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.airavata.sharing.registry.models;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import javax.annotation.Generated;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-05")
+public class EntityType implements org.apache.thrift.TBase<EntityType, EntityType._Fields>, java.io.Serializable, Cloneable, Comparable<EntityType> {
+  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("EntityType");
+
+  private static final org.apache.thrift.protocol.TField ENTITY_TYPE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("entityTypeId", org.apache.thrift.protocol.TType.STRING, (short)1);
+  private static final org.apache.thrift.protocol.TField DOMAIN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("domainId", org.apache.thrift.protocol.TType.STRING, (short)2);
+  private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)3);
+  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)4);
+  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)5);
+  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)6);
+
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new EntityTypeStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new EntityTypeTupleSchemeFactory());
+  }
+
+  public String entityTypeId; // optional
+  public String domainId; // optional
+  public String name; // optional
+  public String description; // optional
+  public long createdTime; // optional
+  public long updatedTime; // optional
+
+  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    ENTITY_TYPE_ID((short)1, "entityTypeId"),
+    DOMAIN_ID((short)2, "domainId"),
+    NAME((short)3, "name"),
+    DESCRIPTION((short)4, "description"),
+    CREATED_TIME((short)5, "createdTime"),
+    UPDATED_TIME((short)6, "updatedTime");
+
+    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+    static {
+      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+        byName.put(field.getFieldName(), field);
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, or null if its not found.
+     */
+    public static _Fields findByThriftId(int fieldId) {
+      switch(fieldId) {
+        case 1: // ENTITY_TYPE_ID
+          return ENTITY_TYPE_ID;
+        case 2: // DOMAIN_ID
+          return DOMAIN_ID;
+        case 3: // NAME
+          return NAME;
+        case 4: // DESCRIPTION
+          return DESCRIPTION;
+        case 5: // CREATED_TIME
+          return CREATED_TIME;
+        case 6: // UPDATED_TIME
+          return UPDATED_TIME;
+        default:
+          return null;
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, throwing an exception
+     * if it is not found.
+     */
+    public static _Fields findByThriftIdOrThrow(int fieldId) {
+      _Fields fields = findByThriftId(fieldId);
+      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      return fields;
+    }
+
+    /**
+     * Find the _Fields constant that matches name, or null if its not found.
+     */
+    public static _Fields findByName(String name) {
+      return byName.get(name);
+    }
+
+    private final short _thriftId;
+    private final String _fieldName;
+
+    _Fields(short thriftId, String fieldName) {
+      _thriftId = thriftId;
+      _fieldName = fieldName;
+    }
+
+    public short getThriftFieldId() {
+      return _thriftId;
+    }
+
+    public String getFieldName() {
+      return _fieldName;
+    }
+  }
+
+  // isset id assignments
+  private static final int __CREATEDTIME_ISSET_ID = 0;
+  private static final int __UPDATEDTIME_ISSET_ID = 1;
+  private byte __isset_bitfield = 0;
+  private static final _Fields optionals[] = {_Fields.ENTITY_TYPE_ID,_Fields.DOMAIN_ID,_Fields.NAME,_Fields.DESCRIPTION,_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);
+    tmpMap.put(_Fields.ENTITY_TYPE_ID, new org.apache.thrift.meta_data.FieldMetaData("entityTypeId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.DOMAIN_ID, new org.apache.thrift.meta_data.FieldMetaData("domainId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("description", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    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, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
+    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(EntityType.class, metaDataMap);
+  }
+
+  public EntityType() {
+    this.entityTypeId = "DO_NOT_SET_AT_CLIENTS_ID";
+
+  }
+
+  /**
+   * Performs a deep copy on <i>other</i>.
+   */
+  public EntityType(EntityType other) {
+    __isset_bitfield = other.__isset_bitfield;
+    if (other.isSetEntityTypeId()) {
+      this.entityTypeId = other.entityTypeId;
+    }
+    if (other.isSetDomainId()) {
+      this.domainId = other.domainId;
+    }
+    if (other.isSetName()) {
+      this.name = other.name;
+    }
+    if (other.isSetDescription()) {
+      this.description = other.description;
+    }
+    this.createdTime = other.createdTime;
+    this.updatedTime = other.updatedTime;
+  }
+
+  public EntityType deepCopy() {
+    return new EntityType(this);
+  }
+
+  @Override
+  public void clear() {
+    this.entityTypeId = "DO_NOT_SET_AT_CLIENTS_ID";
+
+    this.domainId = null;
+    this.name = null;
+    this.description = null;
+    setCreatedTimeIsSet(false);
+    this.createdTime = 0;
+    setUpdatedTimeIsSet(false);
+    this.updatedTime = 0;
+  }
+
+  public String getEntityTypeId() {
+    return this.entityTypeId;
+  }
+
+  public EntityType setEntityTypeId(String entityTypeId) {
+    this.entityTypeId = entityTypeId;
+    return this;
+  }
+
+  public void unsetEntityTypeId() {
+    this.entityTypeId = null;
+  }
+
+  /** Returns true if field entityTypeId is set (has been assigned a value) and false otherwise */
+  public boolean isSetEntityTypeId() {
+    return this.entityTypeId != null;
+  }
+
+  public void setEntityTypeIdIsSet(boolean value) {
+    if (!value) {
+      this.entityTypeId = null;
+    }
+  }
+
+  public String getDomainId() {
+    return this.domainId;
+  }
+
+  public EntityType setDomainId(String domainId) {
+    this.domainId = domainId;
+    return this;
+  }
+
+  public void unsetDomainId() {
+    this.domainId = null;
+  }
+
+  /** Returns true if field domainId is set (has been assigned a value) and false otherwise */
+  public boolean isSetDomainId() {
+    return this.domainId != null;
+  }
+
+  public void setDomainIdIsSet(boolean value) {
+    if (!value) {
+      this.domainId = null;
+    }
+  }
+
+  public String getName() {
+    return this.name;
+  }
+
+  public EntityType setName(String name) {
+    this.name = name;
+    return this;
+  }
+
+  public void unsetName() {
+    this.name = null;
+  }
+
+  /** Returns true if field name is set (has been assigned a value) and false otherwise */
+  public boolean isSetName() {
+    return this.name != null;
+  }
+
+  public void setNameIsSet(boolean value) {
+    if (!value) {
+      this.name = null;
+    }
+  }
+
+  public String getDescription() {
+    return this.description;
+  }
+
+  public EntityType setDescription(String description) {
+    this.description = description;
+    return this;
+  }
+
+  public void unsetDescription() {
+    this.description = null;
+  }
+
+  /** Returns true if field description is set (has been assigned a value) and false otherwise */
+  public boolean isSetDescription() {
+    return this.description != null;
+  }
+
+  public void setDescriptionIsSet(boolean value) {
+    if (!value) {
+      this.description = null;
+    }
+  }
+
+  public long getCreatedTime() {
+    return this.createdTime;
+  }
+
+  public EntityType setCreatedTime(long createdTime) {
+    this.createdTime = createdTime;
+    setCreatedTimeIsSet(true);
+    return this;
+  }
+
+  public void unsetCreatedTime() {
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CREATEDTIME_ISSET_ID);
+  }
+
+  /** Returns true if field createdTime is set (has been assigned a value) and false otherwise */
+  public boolean isSetCreatedTime() {
+    return EncodingUtils.testBit(__isset_bitfield, __CREATEDTIME_ISSET_ID);
+  }
+
+  public void setCreatedTimeIsSet(boolean value) {
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CREATEDTIME_ISSET_ID, value);
+  }
+
+  public long getUpdatedTime() {
+    return this.updatedTime;
+  }
+
+  public EntityType setUpdatedTime(long updatedTime) {
+    this.updatedTime = updatedTime;
+    setUpdatedTimeIsSet(true);
+    return this;
+  }
+
+  public void unsetUpdatedTime() {
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID);
+  }
+
+  /** Returns true if field updatedTime is set (has been assigned a value) and false otherwise */
+  public boolean isSetUpdatedTime() {
+    return EncodingUtils.testBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID);
+  }
+
+  public void setUpdatedTimeIsSet(boolean value) {
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID, value);
+  }
+
+  public void setFieldValue(_Fields field, Object value) {
+    switch (field) {
+    case ENTITY_TYPE_ID:
+      if (value == null) {
+        unsetEntityTypeId();
+      } else {
+        setEntityTypeId((String)value);
+      }
+      break;
+
+    case DOMAIN_ID:
+      if (value == null) {
+        unsetDomainId();
+      } else {
+        setDomainId((String)value);
+      }
+      break;
+
+    case NAME:
+      if (value == null) {
+        unsetName();
+      } else {
+        setName((String)value);
+      }
+      break;
+
+    case DESCRIPTION:
+      if (value == null) {
+        unsetDescription();
+      } else {
+        setDescription((String)value);
+      }
+      break;
+
+    case CREATED_TIME:
+      if (value == null) {
+        unsetCreatedTime();
+      } else {
+        setCreatedTime((Long)value);
+      }
+      break;
+
+    case UPDATED_TIME:
+      if (value == null) {
+        unsetUpdatedTime();
+      } else {
+        setUpdatedTime((Long)value);
+      }
+      break;
+
+    }
+  }
+
+  public Object getFieldValue(_Fields field) {
+    switch (field) {
+    case ENTITY_TYPE_ID:
+      return getEntityTypeId();
+
+    case DOMAIN_ID:
+      return getDomainId();
+
+    case NAME:
+      return getName();
+
+    case DESCRIPTION:
+      return getDescription();
+
+    case CREATED_TIME:
+      return getCreatedTime();
+
+    case UPDATED_TIME:
+      return getUpdatedTime();
+
+    }
+    throw new IllegalStateException();
+  }
+
+  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+  public boolean isSet(_Fields field) {
+    if (field == null) {
+      throw new IllegalArgumentException();
+    }
+
+    switch (field) {
+    case ENTITY_TYPE_ID:
+      return isSetEntityTypeId();
+    case DOMAIN_ID:
+      return isSetDomainId();
+    case NAME:
+      return isSetName();
+    case DESCRIPTION:
+      return isSetDescription();
+    case CREATED_TIME:
+      return isSetCreatedTime();
+    case UPDATED_TIME:
+      return isSetUpdatedTime();
+    }
+    throw new IllegalStateException();
+  }
+
+  @Override
+  public boolean equals(Object that) {
+    if (that == null)
+      return false;
+    if (that instanceof EntityType)
+      return this.equals((EntityType)that);
+    return false;
+  }
+
+  public boolean equals(EntityType that) {
+    if (that == null)
+      return false;
+
+    boolean this_present_entityTypeId = true && this.isSetEntityTypeId();
+    boolean that_present_entityTypeId = true && that.isSetEntityTypeId();
+    if (this_present_entityTypeId || that_present_entityTypeId) {
+      if (!(this_present_entityTypeId && that_present_entityTypeId))
+        return false;
+      if (!this.entityTypeId.equals(that.entityTypeId))
+        return false;
+    }
+
+    boolean this_present_domainId = true && this.isSetDomainId();
+    boolean that_present_domainId = true && that.isSetDomainId();
+    if (this_present_domainId || that_present_domainId) {
+      if (!(this_present_domainId && that_present_domainId))
+        return false;
+      if (!this.domainId.equals(that.domainId))
+        return false;
+    }
+
+    boolean this_present_name = true && this.isSetName();
+    boolean that_present_name = true && that.isSetName();
+    if (this_present_name || that_present_name) {
+      if (!(this_present_name && that_present_name))
+        return false;
+      if (!this.name.equals(that.name))
+        return false;
+    }
+
+    boolean this_present_description = true && this.isSetDescription();
+    boolean that_present_description = true && that.isSetDescription();
+    if (this_present_description || that_present_description) {
+      if (!(this_present_description && that_present_description))
+        return false;
+      if (!this.description.equals(that.description))
+        return false;
+    }
+
+    boolean this_present_createdTime = true && this.isSetCreatedTime();
+    boolean that_present_createdTime = true && that.isSetCreatedTime();
+    if (this_present_createdTime || that_present_createdTime) {
+      if (!(this_present_createdTime && that_present_createdTime))
+        return false;
+      if (this.createdTime != that.createdTime)
+        return false;
+    }
+
+    boolean this_present_updatedTime = true && this.isSetUpdatedTime();
+    boolean that_present_updatedTime = true && that.isSetUpdatedTime();
+    if (this_present_updatedTime || that_present_updatedTime) {
+      if (!(this_present_updatedTime && that_present_updatedTime))
+        return false;
+      if (this.updatedTime != that.updatedTime)
+        return false;
+    }
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    List<Object> list = new ArrayList<Object>();
+
+    boolean present_entityTypeId = true && (isSetEntityTypeId());
+    list.add(present_entityTypeId);
+    if (present_entityTypeId)
+      list.add(entityTypeId);
+
+    boolean present_domainId = true && (isSetDomainId());
+    list.add(present_domainId);
+    if (present_domainId)
+      list.add(domainId);
+
+    boolean present_name = true && (isSetName());
+    list.add(present_name);
+    if (present_name)
+      list.add(name);
+
+    boolean present_description = true && (isSetDescription());
+    list.add(present_description);
+    if (present_description)
+      list.add(description);
+
+    boolean present_createdTime = true && (isSetCreatedTime());
+    list.add(present_createdTime);
+    if (present_createdTime)
+      list.add(createdTime);
+
+    boolean present_updatedTime = true && (isSetUpdatedTime());
+    list.add(present_updatedTime);
+    if (present_updatedTime)
+      list.add(updatedTime);
+
+    return list.hashCode();
+  }
+
+  @Override
+  public int compareTo(EntityType other) {
+    if (!getClass().equals(other.getClass())) {
+      return getClass().getName().compareTo(other.getClass().getName());
+    }
+
+    int lastComparison = 0;
+
+    lastComparison = Boolean.valueOf(isSetEntityTypeId()).compareTo(other.isSetEntityTypeId());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetEntityTypeId()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityTypeId, other.entityTypeId);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetDomainId()).compareTo(other.isSetDomainId());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetDomainId()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domainId, other.domainId);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetName()).compareTo(other.isSetName());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetName()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetDescription()).compareTo(other.isSetDescription());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetDescription()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.description, other.description);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetCreatedTime()).compareTo(other.isSetCreatedTime());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetCreatedTime()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.createdTime, other.createdTime);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetUpdatedTime()).compareTo(other.isSetUpdatedTime());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetUpdatedTime()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updatedTime, other.updatedTime);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    return 0;
+  }
+
+  public _Fields fieldForId(int fieldId) {
+    return _Fields.findByThriftId(fieldId);
+  }
+
+  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+  }
+
+  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+  }
+
+  @Override
+  public String toString() {
+    StringBuilder sb = new StringBuilder("EntityType(");
+    boolean first = true;
+
+    if (isSetEntityTypeId()) {
+      sb.append("entityTypeId:");
+      if (this.entityTypeId == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.entityTypeId);
+      }
+      first = false;
+    }
+    if (isSetDomainId()) {
+      if (!first) sb.append(", ");
+      sb.append("domainId:");
+      if (this.domainId == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.domainId);
+      }
+      first = false;
+    }
+    if (isSetName()) {
+      if (!first) sb.append(", ");
+      sb.append("name:");
+      if (this.name == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.name);
+      }
+      first = false;
+    }
+    if (isSetDescription()) {
+      if (!first) sb.append(", ");
+      sb.append("description:");
+      if (this.description == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.description);
+      }
+      first = false;
+    }
+    if (isSetCreatedTime()) {
+      if (!first) sb.append(", ");
+      sb.append("createdTime:");
+      sb.append(this.createdTime);
+      first = false;
+    }
+    if (isSetUpdatedTime()) {
+      if (!first) sb.append(", ");
+      sb.append("updatedTime:");
+      sb.append(this.updatedTime);
+      first = false;
+    }
+    sb.append(")");
+    return sb.toString();
+  }
+
+  public void validate() throws org.apache.thrift.TException {
+    // check for required fields
+    // check for sub-struct validity
+  }
+
+  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+    try {
+      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+    try {
+      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+      __isset_bitfield = 0;
+      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private static class EntityTypeStandardSchemeFactory implements SchemeFactory {
+    public EntityTypeStandardScheme getScheme() {
+      return new EntityTypeStandardScheme();
+    }
+  }
+
+  private static class EntityTypeStandardScheme extends StandardScheme<EntityType> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, EntityType struct) throws org.apache.thrift.TException {
+      org.apache.thrift.protocol.TField schemeField;
+      iprot.readStructBegin();
+      while (true)
+      {
+        schemeField = iprot.readFieldBegin();
+        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+          break;
+        }
+        switch (schemeField.id) {
+          case 1: // ENTITY_TYPE_ID
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.entityTypeId = iprot.readString();
+              struct.setEntityTypeIdIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 2: // DOMAIN_ID
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.domainId = iprot.readString();
+              struct.setDomainIdIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 3: // NAME
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.name = iprot.readString();
+              struct.setNameIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 4: // DESCRIPTION
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.description = iprot.readString();
+              struct.setDescriptionIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 5: // CREATED_TIME
+            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+              struct.createdTime = iprot.readI64();
+              struct.setCreatedTimeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 6: // UPDATED_TIME
+            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+              struct.updatedTime = iprot.readI64();
+              struct.setUpdatedTimeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          default:
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+        }
+        iprot.readFieldEnd();
+      }
+      iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      struct.validate();
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot, EntityType struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.entityTypeId != null) {
+        if (struct.isSetEntityTypeId()) {
+          oprot.writeFieldBegin(ENTITY_TYPE_ID_FIELD_DESC);
+          oprot.writeString(struct.entityTypeId);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.domainId != null) {
+        if (struct.isSetDomainId()) {
+          oprot.writeFieldBegin(DOMAIN_ID_FIELD_DESC);
+          oprot.writeString(struct.domainId);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.name != null) {
+        if (struct.isSetName()) {
+          oprot.writeFieldBegin(NAME_FIELD_DESC);
+          oprot.writeString(struct.name);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.description != null) {
+        if (struct.isSetDescription()) {
+          oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC);
+          oprot.writeString(struct.description);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.isSetCreatedTime()) {
+        oprot.writeFieldBegin(CREATED_TIME_FIELD_DESC);
+        oprot.writeI64(struct.createdTime);
+        oprot.writeFieldEnd();
+      }
+      if (struct.isSetUpdatedTime()) {
+        oprot.writeFieldBegin(UPDATED_TIME_FIELD_DESC);
+        oprot.writeI64(struct.updatedTime);
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class EntityTypeTupleSchemeFactory implements SchemeFactory {
+    public EntityTypeTupleScheme getScheme() {
+      return new EntityTypeTupleScheme();
+    }
+  }
+
+  private static class EntityTypeTupleScheme extends TupleScheme<EntityType> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, EntityType struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      BitSet optionals = new BitSet();
+      if (struct.isSetEntityTypeId()) {
+        optionals.set(0);
+      }
+      if (struct.isSetDomainId()) {
+        optionals.set(1);
+      }
+      if (struct.isSetName()) {
+        optionals.set(2);
+      }
+      if (struct.isSetDescription()) {
+        optionals.set(3);
+      }
+      if (struct.isSetCreatedTime()) {
+        optionals.set(4);
+      }
+      if (struct.isSetUpdatedTime()) {
+        optionals.set(5);
+      }
+      oprot.writeBitSet(optionals, 6);
+      if (struct.isSetEntityTypeId()) {
+        oprot.writeString(struct.entityTypeId);
+      }
+      if (struct.isSetDomainId()) {
+        oprot.writeString(struct.domainId);
+      }
+      if (struct.isSetName()) {
+        oprot.writeString(struct.name);
+      }
+      if (struct.isSetDescription()) {
+        oprot.writeString(struct.description);
+      }
+      if (struct.isSetCreatedTime()) {
+        oprot.writeI64(struct.createdTime);
+      }
+      if (struct.isSetUpdatedTime()) {
+        oprot.writeI64(struct.updatedTime);
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, EntityType struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      BitSet incoming = iprot.readBitSet(6);
+      if (incoming.get(0)) {
+        struct.entityTypeId = iprot.readString();
+        struct.setEntityTypeIdIsSet(true);
+      }
+      if (incoming.get(1)) {
+        struct.domainId = iprot.readString();
+        struct.setDomainIdIsSet(true);
+      }
+      if (incoming.get(2)) {
+        struct.name = iprot.readString();
+        struct.setNameIsSet(true);
+      }
+      if (incoming.get(3)) {
+        struct.description = iprot.readString();
+        struct.setDescriptionIsSet(true);
+      }
+      if (incoming.get(4)) {
+        struct.createdTime = iprot.readI64();
+        struct.setCreatedTimeIsSet(true);
+      }
+      if (incoming.get(5)) {
+        struct.updatedTime = iprot.readI64();
+        struct.setUpdatedTimeIsSet(true);
+      }
+    }
+  }
+
+}
+


[17/17] airavata git commit: renaming directory names

Posted by sc...@apache.org.
renaming directory names


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

Branch: refs/heads/airavata-gov-registry
Commit: 43f228fc2b087b32577890529beb216cb0d3d822
Parents: a3f9b19
Author: scnakandala <su...@gmail.com>
Authored: Wed Oct 5 04:20:46 2016 -0400
Committer: scnakandala <su...@gmail.com>
Committed: Wed Oct 5 04:20:47 2016 -0400

----------------------------------------------------------------------
 modules/airavata-sharing-registry/README.md     |     3 -
 .../airavata-sharing-data-migrator/pom.xml      |    21 -
 .../sharing/registry/ConnectionFactory.java     |    59 -
 .../airavata/sharing/registry/DataMigrator.java |   165 -
 .../airavata-sharing-registry-core/pom.xml      |    93 -
 .../registry/db/entities/DomainEntity.java      |   113 -
 .../registry/db/entities/EntityEntity.java      |   192 -
 .../registry/db/entities/EntityTypeEntity.java  |   125 -
 .../db/entities/GroupMembershipEntity.java      |   112 -
 .../db/entities/GroupMembershipEntityPK.java    |    74 -
 .../db/entities/PermissionTypeEntity.java       |   125 -
 .../registry/db/entities/SharingEntity.java     |   146 -
 .../registry/db/entities/SharingEntityPK.java   |   113 -
 .../registry/db/entities/UserEntity.java        |   112 -
 .../registry/db/entities/UserGroupEntity.java   |   150 -
 .../db/repositories/AbstractRepository.java     |   134 -
 .../db/repositories/DomainRepository.java       |    34 -
 .../db/repositories/EntityRepository.java       |    75 -
 .../db/repositories/EntityTypeRepository.java   |    34 -
 .../repositories/GroupMembershipRepository.java |    98 -
 .../repositories/PermissionTypeRepository.java  |    52 -
 .../db/repositories/SharingRepository.java      |    74 -
 .../db/repositories/UserGroupRepository.java    |    34 -
 .../db/repositories/UserRepository.java         |    35 -
 .../sharing/registry/db/utils/Committer.java    |    27 -
 .../registry/db/utils/ConnectionPool.java       |   382 -
 .../sharing/registry/db/utils/DBConstants.java  |    85 -
 .../registry/db/utils/DatabaseCreator.java      |   353 -
 .../sharing/registry/db/utils/JPAUtils.java     |   230 -
 .../sharing/registry/db/utils/JdbcStorage.java  |   175 -
 .../db/utils/ObjectMapperSingleton.java         |    39 -
 .../registry/server/SharingRegistryServer.java  |    28 -
 .../server/SharingRegistryServerHandler.java    |   585 -
 .../src/main/resources/META-INF/persistence.xml |    15 -
 .../main/resources/sharing-registry-derby.sql   |   139 -
 .../main/resources/sharing-registry-mysql.sql   |   139 -
 .../registry/GovRegistryServerHandlerTest.java  |   272 -
 .../airavata-sharing-registry-stubs/pom.xml     |    23 -
 .../sharing/registry/models/Domain.java         |   817 -
 .../sharing/registry/models/Entity.java         |  1511 -
 .../sharing/registry/models/EntityType.java     |   924 -
 .../registry/models/GovRegistryException.java   |   391 -
 .../sharing/registry/models/GroupChildType.java |    45 -
 .../registry/models/GroupMembership.java        |   830 -
 .../sharing/registry/models/GroupType.java      |    45 -
 .../sharing/registry/models/PermissionType.java |   924 -
 .../sharing/registry/models/Sharing.java        |  1167 -
 .../sharing/registry/models/SharingType.java    |    45 -
 .../airavata/sharing/registry/models/User.java  |   817 -
 .../sharing/registry/models/UserGroup.java      |  1154 -
 .../models/sharing_modelsConstants.java         |    41 -
 .../service/cpi/GovRegistryService.java         | 42708 -----------------
 modules/airavata-sharing-registry/pom.xml       |    28 -
 .../thrift_models/sharing_cpi.thrift            |    96 -
 .../thrift_models/sharing_models.thrift         |   129 -
 .../thrift_models/thrift-gen.sh                 |    16 -
 modules/sharing-registry/README.md              |     3 +
 modules/sharing-registry/pom.xml                |    28 +
 .../sharing-data-migrator/pom.xml               |    21 +
 .../sharing/registry/ConnectionFactory.java     |    59 +
 .../airavata/sharing/registry/DataMigrator.java |   165 +
 .../sharing-registry-core/pom.xml               |    93 +
 .../registry/db/entities/DomainEntity.java      |   113 +
 .../registry/db/entities/EntityEntity.java      |   192 +
 .../registry/db/entities/EntityTypeEntity.java  |   125 +
 .../db/entities/GroupMembershipEntity.java      |   112 +
 .../db/entities/GroupMembershipEntityPK.java    |    74 +
 .../db/entities/PermissionTypeEntity.java       |   125 +
 .../registry/db/entities/SharingEntity.java     |   146 +
 .../registry/db/entities/SharingEntityPK.java   |   113 +
 .../registry/db/entities/UserEntity.java        |   112 +
 .../registry/db/entities/UserGroupEntity.java   |   150 +
 .../db/repositories/AbstractRepository.java     |   134 +
 .../db/repositories/DomainRepository.java       |    34 +
 .../db/repositories/EntityRepository.java       |    75 +
 .../db/repositories/EntityTypeRepository.java   |    34 +
 .../repositories/GroupMembershipRepository.java |    98 +
 .../repositories/PermissionTypeRepository.java  |    52 +
 .../db/repositories/SharingRepository.java      |    74 +
 .../db/repositories/UserGroupRepository.java    |    34 +
 .../db/repositories/UserRepository.java         |    35 +
 .../sharing/registry/db/utils/Committer.java    |    27 +
 .../registry/db/utils/ConnectionPool.java       |   382 +
 .../sharing/registry/db/utils/DBConstants.java  |    85 +
 .../registry/db/utils/DatabaseCreator.java      |   353 +
 .../sharing/registry/db/utils/JPAUtils.java     |   230 +
 .../sharing/registry/db/utils/JdbcStorage.java  |   175 +
 .../db/utils/ObjectMapperSingleton.java         |    39 +
 .../registry/server/SharingRegistryServer.java  |    28 +
 .../server/SharingRegistryServerHandler.java    |   585 +
 .../src/main/resources/META-INF/persistence.xml |    15 +
 .../main/resources/sharing-registry-derby.sql   |   139 +
 .../main/resources/sharing-registry-mysql.sql   |   139 +
 .../registry/GovRegistryServerHandlerTest.java  |   272 +
 .../sharing-registry-stubs/pom.xml              |    23 +
 .../sharing/registry/models/Domain.java         |   817 +
 .../sharing/registry/models/Entity.java         |  1511 +
 .../sharing/registry/models/EntityType.java     |   924 +
 .../registry/models/GovRegistryException.java   |   391 +
 .../sharing/registry/models/GroupChildType.java |    45 +
 .../registry/models/GroupMembership.java        |   830 +
 .../sharing/registry/models/GroupType.java      |    45 +
 .../sharing/registry/models/PermissionType.java |   924 +
 .../sharing/registry/models/Sharing.java        |  1167 +
 .../sharing/registry/models/SharingType.java    |    45 +
 .../airavata/sharing/registry/models/User.java  |   817 +
 .../sharing/registry/models/UserGroup.java      |  1154 +
 .../models/sharing_modelsConstants.java         |    41 +
 .../service/cpi/GovRegistryService.java         | 42708 +++++++++++++++++
 .../thrift_models/sharing_cpi.thrift            |    96 +
 .../thrift_models/sharing_models.thrift         |   129 +
 .../thrift_models/thrift-gen.sh                 |    16 +
 112 files changed, 56353 insertions(+), 56353 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/README.md
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/README.md b/modules/airavata-sharing-registry/README.md
deleted file mode 100644
index 299e7b4..0000000
--- a/modules/airavata-sharing-registry/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-## Airavata Governance Registry
-
-* This module implements a generic service for access controlling to resources and to provide group based resource sharing
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-data-migrator/pom.xml
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-data-migrator/pom.xml b/modules/airavata-sharing-registry/airavata-sharing-data-migrator/pom.xml
deleted file mode 100644
index 472b0a2..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-data-migrator/pom.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <artifactId>airavata-sharing-registry</artifactId>
-        <groupId>org.apache.airavata</groupId>
-        <version>${global.version}</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>airavata-sharing-data-migrator</artifactId>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-sharing-registry-core</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-    </dependencies>
-</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-data-migrator/src/main/java/org/apache/airavata/sharing/registry/ConnectionFactory.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-data-migrator/src/main/java/org/apache/airavata/sharing/registry/ConnectionFactory.java b/modules/airavata-sharing-registry/airavata-sharing-data-migrator/src/main/java/org/apache/airavata/sharing/registry/ConnectionFactory.java
deleted file mode 100644
index d501b96..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-data-migrator/src/main/java/org/apache/airavata/sharing/registry/ConnectionFactory.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.sharing.registry;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.SQLException;
-
-public class ConnectionFactory {
-    private final static Logger logger = LoggerFactory.getLogger(ConnectionFactory.class);
-
-    //static reference to itself
-    private static ConnectionFactory instance;
-
-    public static final String EXPCAT_URL = "jdbc:mysql://localhost/airavata_exp_catalog";
-    public static final String EXPCAT_USER = "root";
-    public static final String EXPCAT_PASSWORD = "";
-    public static final String DRIVER_CLASS = "com.mysql.jdbc.Driver";
-
-    private static Connection expCatConnection, sharingCatConnection;
-
-    //private constructor
-    private ConnectionFactory() throws ClassNotFoundException, SQLException {
-        Class.forName(DRIVER_CLASS);
-        expCatConnection = DriverManager.getConnection(EXPCAT_URL, EXPCAT_USER, EXPCAT_PASSWORD);
-    }
-
-    public static ConnectionFactory getInstance() throws SQLException, ClassNotFoundException {
-        if(instance == null)
-            instance = new ConnectionFactory();
-        return instance;
-    }
-
-    public Connection getExpCatConnection() throws SQLException {
-        return expCatConnection;
-    }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-data-migrator/src/main/java/org/apache/airavata/sharing/registry/DataMigrator.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-data-migrator/src/main/java/org/apache/airavata/sharing/registry/DataMigrator.java b/modules/airavata-sharing-registry/airavata-sharing-data-migrator/src/main/java/org/apache/airavata/sharing/registry/DataMigrator.java
deleted file mode 100644
index 5e747dc..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-data-migrator/src/main/java/org/apache/airavata/sharing/registry/DataMigrator.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.sharing.registry;
-
-import org.apache.airavata.sharing.registry.models.*;
-import org.apache.airavata.sharing.registry.server.SharingRegistryServerHandler;
-import org.apache.thrift.TException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.HashMap;
-import java.util.Map;
-
-public class DataMigrator {
-    private final static Logger logger = LoggerFactory.getLogger(DataMigrator.class);
-
-    public static void main(String[] args) throws SQLException, ClassNotFoundException, TException {
-        Connection expCatConnection = ConnectionFactory.getInstance().getExpCatConnection();
-
-        SharingRegistryServerHandler govRegistryServerHandler = new SharingRegistryServerHandler();
-
-        String query = "SELECT * FROM GATEWAY";
-        Statement statement = expCatConnection.createStatement();
-        ResultSet rs = statement.executeQuery(query);
-
-        while (rs.next()) {
-            //Creating domain entries
-            Domain domain = new Domain();
-            domain.setDomainId(rs.getString("GATEWAY_ID"));
-            if(rs.getString("GATEWAY_NAME") != null)
-                domain.setName(rs.getString("GATEWAY_NAME"));
-            else
-                domain.setName(rs.getString("GATEWAY_ID"));
-            domain.setDescription("Domain entry for " + domain.name);
-
-            govRegistryServerHandler.createDomain(domain);
-
-            //Creating Entity Types for each domain
-            EntityType entityType = new EntityType();
-            entityType.setEntityTypeId(domain.domainId+":PROJECT");
-            entityType.setDomainId(domain.domainId);
-            entityType.setName("PROJECT");
-            entityType.setDescription("Project entity type");
-            govRegistryServerHandler.createEntityType(entityType);
-
-            entityType = new EntityType();
-            entityType.setEntityTypeId(domain.domainId+":EXPERIMENT");
-            entityType.setDomainId(domain.domainId);
-            entityType.setName("EXPERIMENT");
-            entityType.setDescription("Experiment entity type");
-            govRegistryServerHandler.createEntityType(entityType);
-
-            entityType = new EntityType();
-            entityType.setEntityTypeId(domain.domainId+":FILE");
-            entityType.setDomainId(domain.domainId);
-            entityType.setName("FILE");
-            entityType.setDescription("File entity type");
-            govRegistryServerHandler.createEntityType(entityType);
-
-            //Creating Permission Types for each domain
-            PermissionType permissionType = new PermissionType();
-            permissionType.setPermissionTypeId(domain.domainId+":READ");
-            permissionType.setDomainId(domain.domainId);
-            permissionType.setName("READ");
-            permissionType.setDescription("Read permission type");
-            govRegistryServerHandler.createPermissionType(permissionType);
-
-            permissionType = new PermissionType();
-            permissionType.setPermissionTypeId(domain.domainId+":WRITE");
-            permissionType.setDomainId(domain.domainId);
-            permissionType.setName("WRITE");
-            permissionType.setDescription("Write permission type");
-            govRegistryServerHandler.createPermissionType(permissionType);
-        }
-
-        //Creating user entries
-        query = "SELECT * FROM USERS";
-        statement = expCatConnection.createStatement();
-        rs = statement.executeQuery(query);
-        while(rs.next()){
-            User user = new User();
-            user.setUserId(rs.getString("AIRAVATA_INTERNAL_USER_ID"));
-            user.setDomainId(rs.getString("GATEWAY_ID"));
-            user.setUserName(rs.getString("USER_NAME"));
-
-            govRegistryServerHandler.createUser(user);
-        }
-
-        //Creating project entries
-        query = "SELECT * FROM PROJECT";
-        statement = expCatConnection.createStatement();
-        rs = statement.executeQuery(query);
-        while(rs.next()){
-            Entity entity = new Entity();
-            entity.setEntityId(rs.getString("PROJECT_ID"));
-            entity.setDomainId(rs.getString("GATEWAY_ID"));
-            entity.setEntityTypeId(rs.getString("GATEWAY_ID") + ":PROJECT");
-            entity.setOwnerId(rs.getString("USER_NAME") + "@" + rs.getString("GATEWAY_ID"));
-            entity.setName(rs.getString("PROJECT_NAME"));
-            entity.setDescription(rs.getString("DESCRIPTION"));
-            if(entity.getDescription() == null)
-                entity.setFullText(entity.getName());
-            else
-                entity.setFullText(entity.getName() + " " + entity.getDescription());
-            Map<String, String> metadata = new HashMap<>();
-            metadata.put("CREATION_TIME", rs.getDate("CREATION_TIME").toString());
-
-            govRegistryServerHandler.createEntity(entity);
-        }
-
-        //Creating experiment entries
-        query = "SELECT * FROM EXPERIMENT";
-        statement = expCatConnection.createStatement();
-        rs = statement.executeQuery(query);
-        while(rs.next()){
-            Entity entity = new Entity();
-            entity.setEntityId(rs.getString("EXPERIMENT_ID"));
-            entity.setDomainId(rs.getString("GATEWAY_ID"));
-            entity.setEntityTypeId(rs.getString("GATEWAY_ID") + ":EXPERIMENT");
-            entity.setOwnerId(rs.getString("USER_NAME") + "@" + rs.getString("GATEWAY_ID"));
-            entity.setParentEntityId(rs.getString("PROJECT_ID"));
-            entity.setName(rs.getString("EXPERIMENT_NAME"));
-            entity.setDescription(rs.getString("DESCRIPTION"));
-            if(entity.getDescription() == null)
-                entity.setFullText(entity.getName());
-            else
-                entity.setFullText(entity.getName() + " " + entity.getDescription());
-            Map<String, String> metadata = new HashMap<>();
-            metadata.put("CREATION_TIME", rs.getDate("CREATION_TIME").toString());
-            metadata.put("EXPERIMENT_TYPE", rs.getString("EXPERIMENT_TYPE"));
-            metadata.put("EXECUTION_ID", rs.getString("EXECUTION_ID"));
-            metadata.put("GATEWAY_EXECUTION_ID", rs.getString("GATEWAY_EXECUTION_ID"));
-            metadata.put("ENABLE_EMAIL_NOTIFICATION", rs.getString("ENABLE_EMAIL_NOTIFICATION"));
-            metadata.put("EMAIL_ADDRESSES", rs.getString("EMAIL_ADDRESSES"));
-            metadata.put("GATEWAY_INSTANCE_ID", rs.getString("GATEWAY_INSTANCE_ID"));
-            metadata.put("ARCHIVE", rs.getString("ARCHIVE"));
-
-            govRegistryServerHandler.createEntity(entity);
-        }
-
-        expCatConnection.close();
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-core/pom.xml b/modules/airavata-sharing-registry/airavata-sharing-registry-core/pom.xml
deleted file mode 100644
index f43f77c..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-core/pom.xml
+++ /dev/null
@@ -1,93 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <artifactId>airavata-sharing-registry</artifactId>
-        <groupId>org.apache.airavata</groupId>
-        <relativePath>../pom.xml</relativePath>
-        <version>${global.version}</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>airavata-sharing-registry-core</artifactId>
-    <dependencies>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-            <version>1.7.10</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.thrift</groupId>
-            <artifactId>libthrift</artifactId>
-            <version>0.9.3</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-sharing-registry-stubs</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-commons</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>net.sf.dozer</groupId>
-            <artifactId>dozer</artifactId>
-            <version>5.4.0</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.openjpa</groupId>
-            <artifactId>openjpa-all</artifactId>
-            <version>2.2.0</version>
-        </dependency>
-        <dependency>
-            <groupId>mysql</groupId>
-            <artifactId>mysql-connector-java</artifactId>
-            <version>5.1.34</version>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <version>3.5.1</version>
-                <configuration>
-                    <source>1.8</source>
-                    <target>1.8</target>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.openjpa</groupId>
-                <artifactId>openjpa-maven-plugin</artifactId>
-                <version>2.2.0</version>
-                <configuration>
-                    <includes>**/entities/*.class</includes>
-                    <excludes>**/entities/XML*.class</excludes>
-                    <addDefaultConstructor>true</addDefaultConstructor>
-                    <enforcePropertyRestrictions>true</enforcePropertyRestrictions>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>enhancer</id>
-                        <phase>process-classes</phase>
-                        <goals>
-                            <goal>enhance</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <dependencies>
-                    <dependency>
-                        <groupId>org.apache.openjpa</groupId>
-                        <artifactId>openjpa</artifactId>
-                        <version>2.2.0</version>
-                    </dependency>
-                </dependencies>
-            </plugin>
-        </plugins>
-    </build>
-
-</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/DomainEntity.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/DomainEntity.java b/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/DomainEntity.java
deleted file mode 100644
index 48b5314..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/DomainEntity.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.sharing.registry.db.entities;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "DOMAIN", schema = "" )
-public class DomainEntity {
-    private final static Logger logger = LoggerFactory.getLogger(DomainEntity.class);
-    private String domainId;
-    private String name;
-    private String description;
-    private Long createdTime;
-    private Long updatedTime;
-
-    @Id
-    @Column(name = "DOMAIN_ID")
-    public String getDomainId() {
-        return domainId;
-    }
-
-    public void setDomainId(String domainId) {
-        this.domainId = domainId;
-    }
-
-    @Basic
-    @Column(name = "NAME")
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    @Basic
-    @Column(name = "DESCRIPTION")
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    @Basic
-    @Column(name = "CREATED_TIME")
-    public Long getCreatedTime() {
-        return createdTime;
-    }
-
-    public void setCreatedTime(Long createdTime) {
-        this.createdTime = createdTime;
-    }
-
-    @Basic
-    @Column(name = "UPDATED_TIME")
-    public Long getUpdatedTime() {
-        return updatedTime;
-    }
-
-    public void setUpdatedTime(Long updatedTime) {
-        this.updatedTime = updatedTime;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-
-        DomainEntity that = (DomainEntity) o;
-
-        if (domainId != null ? !domainId.equals(that.domainId) : that.domainId != null) return false;
-        if (name != null ? !name.equals(that.name) : that.name != null) return false;
-        if (description != null ? !description.equals(that.description) : that.description != 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;
-
-        return true;
-    }
-
-    @Override
-    public int hashCode() {
-        int result = domainId != null ? domainId.hashCode() : 0;
-        result = 31 * result + (name != null ? name.hashCode() : 0);
-        result = 31 * result + (description != null ? description.hashCode() : 0);
-        result = 31 * result + (createdTime != null ? createdTime.hashCode() : 0);
-        result = 31 * result + (updatedTime != null ? updatedTime.hashCode() : 0);
-        return result;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/EntityEntity.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/EntityEntity.java b/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/EntityEntity.java
deleted file mode 100644
index de8abf4..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/EntityEntity.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.sharing.registry.db.entities;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.persistence.*;
-import java.util.Map;
-
-@Entity
-@Table(name = "ENTITY", schema = "")
-public class EntityEntity {
-    private final static Logger logger = LoggerFactory.getLogger(EntityEntity.class);
-    private String entityId;
-    private String domainId;
-    private String entityTypeId;
-    private String ownerId;
-    private String parentEntityId;
-    private String name;
-    private String description;
-    private Map<String, String> metadata;
-    private String fullText;
-    private Long createdTime;
-    private Long updatedTime;
-
-    @Id
-    @Column(name = "ENTITY_ID")
-    public String getEntityId() {
-        return entityId;
-    }
-
-    public void setEntityId(String entityId) {
-        this.entityId = entityId;
-    }
-
-    @Basic
-    @Column(name = "DOMAIN_ID")
-    public String getDomainId() {
-        return domainId;
-    }
-
-    public void setDomainId(String domainId) {
-        this.domainId = domainId;
-    }
-
-    @Basic
-    @Column(name = "ENTITY_TYPE_ID")
-    public String getEntityTypeId() {
-        return entityTypeId;
-    }
-
-    public void setEntityTypeId(String entityTypeId) {
-        this.entityTypeId = entityTypeId;
-    }
-
-    @Basic
-    @Column(name = "OWNER_ID")
-    public String getOwnerId() {
-        return ownerId;
-    }
-
-    public void setOwnerId(String ownerId) {
-        this.ownerId = ownerId;
-    }
-
-    @Basic
-    @Column(name = "PARENT_ENTITY_ID")
-    public String getParentEntityId() {
-        return parentEntityId;
-    }
-
-    public void setParentEntityId(String parentEntityId) {
-        this.parentEntityId = parentEntityId;
-    }
-
-    @Basic
-    @Column(name = "NAME")
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    @Basic
-    @Column(name = "DESCRIPTION")
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    @ElementCollection
-    @CollectionTable(
-            name="ENTITY_METADATA",
-            joinColumns=@JoinColumn(name="ENTITY_ID")
-    )
-    @MapKeyColumn(name="META_KEY")
-    @Column(name="META_VALUE")
-    public Map<String, String> getMetadata() {
-        return metadata;
-    }
-
-    public void setMetadata(Map<String, String> metadata) {
-        this.metadata = metadata;
-    }
-
-    @Lob
-    @Column(name = "FULL_TEXT")
-    public String getFullText() {
-        return fullText;
-    }
-
-    public void setFullText(String fullText) {
-        this.fullText = fullText;
-    }
-
-    @Basic
-    @Column(name = "CREATED_TIME")
-    public Long getCreatedTime() {
-        return createdTime;
-    }
-
-    public void setCreatedTime(Long createdTime) {
-        this.createdTime = createdTime;
-    }
-
-    @Basic
-    @Column(name = "UPDATED_TIME")
-    public Long getUpdatedTime() {
-        return updatedTime;
-    }
-
-    public void setUpdatedTime(Long updatedTime) {
-        this.updatedTime = updatedTime;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-
-        EntityEntity that = (EntityEntity) o;
-
-        if (entityId != null ? !entityId.equals(that.entityId) : that.entityId != null) return false;
-        if (domainId != null ? !domainId.equals(that.domainId) : that.domainId != null) return false;
-        if (parentEntityId != null ? !parentEntityId.equals(that.parentEntityId) : that.parentEntityId != null) return false;
-        if (name != null ? !name.equals(that.name) : that.name != null) return false;
-        if (description != null ? !description.equals(that.description) : that.description != null) return false;
-        if (metadata.equals(that.metadata)) return false;
-        if (fullText != null ? !fullText.equals(that.fullText) : that.fullText != 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;
-
-        return true;
-    }
-
-    @Override
-    public int hashCode() {
-        int result = entityId != null ? entityId.hashCode() : 0;
-        result = 31 * result + (name != null ? name.hashCode() : 0);
-        result = 31 * result + (description != null ? description.hashCode() : 0);
-        result = 31 * result + (metadata != null ? metadata.hashCode() : 0);
-        result = 31 * result + (fullText != null ? fullText.hashCode() : 0);
-        result = 31 * result + (createdTime != null ? createdTime.hashCode() : 0);
-        result = 31 * result + (updatedTime != null ? updatedTime.hashCode() : 0);
-        return result;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/EntityTypeEntity.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/EntityTypeEntity.java b/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/EntityTypeEntity.java
deleted file mode 100644
index 0b789ed..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/EntityTypeEntity.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.sharing.registry.db.entities;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "ENTITY_TYPE", schema = "")
-public class EntityTypeEntity {
-    private final static Logger logger = LoggerFactory.getLogger(EntityTypeEntity.class);
-    private String entityTypeId;
-    private String domainId;
-    private String name;
-    private String description;
-    private Long createdTime;
-    private Long updatedTime;
-
-    @Id
-    @Column(name = "ENTITY_TYPE_ID")
-    public String getEntityTypeId() {
-        return entityTypeId;
-    }
-
-    public void setEntityTypeId(String entityTypeId) {
-        this.entityTypeId = entityTypeId;
-    }
-
-    @Basic
-    @Column(name = "DOMAIN_ID")
-    public String getDomainId() {
-        return domainId;
-    }
-
-    public void setDomainId(String domainId) {
-        this.domainId = domainId;
-    }
-
-    @Basic
-    @Column(name = "NAME")
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    @Basic
-    @Column(name = "DESCRIPTION")
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    @Basic
-    @Column(name = "CREATED_TIME")
-    public Long getCreatedTime() {
-        return createdTime;
-    }
-
-    public void setCreatedTime(Long createdTime) {
-        this.createdTime = createdTime;
-    }
-
-    @Basic
-    @Column(name = "UPDATED_TIME")
-    public Long getUpdatedTime() {
-        return updatedTime;
-    }
-
-    public void setUpdatedTime(Long updatedTime) {
-        this.updatedTime = updatedTime;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-
-        EntityTypeEntity that = (EntityTypeEntity) o;
-
-        if (entityTypeId != null ? !entityTypeId.equals(that.entityTypeId) : that.entityTypeId != null) return false;
-        if (domainId != null ? !domainId.equals(that.domainId) : that.domainId != null) return false;
-        if (name != null ? !name.equals(that.name) : that.name != null) return false;
-        if (description != null ? !description.equals(that.description) : that.description != 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;
-
-        return true;
-    }
-
-    @Override
-    public int hashCode() {
-        int result = entityTypeId != null ? entityTypeId.hashCode() : 0;
-        result = 31 * result + (name != null ? name.hashCode() : 0);
-        result = 31 * result + (description != null ? description.hashCode() : 0);
-        result = 31 * result + (createdTime != null ? createdTime.hashCode() : 0);
-        result = 31 * result + (updatedTime != null ? updatedTime.hashCode() : 0);
-        return result;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/GroupMembershipEntity.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/GroupMembershipEntity.java b/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/GroupMembershipEntity.java
deleted file mode 100644
index c62a52d..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/GroupMembershipEntity.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.sharing.registry.db.entities;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "GROUP_MEMBERSHIP", schema = "")
-@IdClass(GroupMembershipEntityPK.class)
-public class GroupMembershipEntity {
-    private final static Logger logger = LoggerFactory.getLogger(GroupMembershipEntity.class);
-    private String parentId;
-    private String childId;
-    private String childType;
-    private Long createdTime;
-    private Long updatedTime;
-
-    @Id
-    @Column(name = "PARENT_ID")
-    public String getParentId() {
-        return parentId;
-    }
-
-    public void setParentId(String parentId) {
-        this.parentId = parentId;
-    }
-
-    @Id
-    @Column(name = "CHILD_ID")
-    public String getChildId() {
-        return childId;
-    }
-
-    public void setChildId(String childId) {
-        this.childId = childId;
-    }
-
-    @Basic
-    @Column(name = "CHILD_TYPE")
-    public String getChildType() {
-        return childType;
-    }
-
-    public void setChildType(String childType) {
-        this.childType = childType;
-    }
-
-    @Basic
-    @Column(name = "CREATED_TIME")
-    public Long getCreatedTime() {
-        return createdTime;
-    }
-
-    public void setCreatedTime(Long createdTime) {
-        this.createdTime = createdTime;
-    }
-
-    @Basic
-    @Column(name = "UPDATED_TIME")
-    public Long getUpdatedTime() {
-        return updatedTime;
-    }
-
-    public void setUpdatedTime(Long updatedTime) {
-        this.updatedTime = updatedTime;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-
-        GroupMembershipEntity that = (GroupMembershipEntity) o;
-
-        if (parentId != null ? !parentId.equals(that.parentId) : that.parentId != null) return false;
-        if (childId != null ? !childId.equals(that.childId) : that.childId != null) return false;
-        if (childType != null ? !childType.equals(that.childType) : that.childType != 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;
-
-        return true;
-    }
-
-    @Override
-    public int hashCode() {
-        int result = parentId != null ? parentId.hashCode() : 0;
-        result = 31 * result + (childId != null ? childId.hashCode() : 0);
-        result = 31 * result + (childType != null ? childType.hashCode() : 0);
-        return result;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/GroupMembershipEntityPK.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/GroupMembershipEntityPK.java b/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/GroupMembershipEntityPK.java
deleted file mode 100644
index be3b1f9..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/GroupMembershipEntityPK.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.sharing.registry.db.entities;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.persistence.Column;
-import javax.persistence.Id;
-import java.io.Serializable;
-
-public class GroupMembershipEntityPK implements Serializable {
-    private final static Logger logger = LoggerFactory.getLogger(GroupMembershipEntityPK.class);
-    private String parentId;
-    private String childId;
-
-    @Column(name = "PARENT_ID")
-    @Id
-    public String getParentId() {
-        return parentId;
-    }
-
-    public void setParentId(String parentId) {
-        this.parentId = parentId;
-    }
-
-    @Column(name = "CHILD_ID")
-    @Id
-    public String getChildId() {
-        return childId;
-    }
-
-    public void setChildId(String childId) {
-        this.childId = childId;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-
-        GroupMembershipEntityPK that = (GroupMembershipEntityPK) o;
-
-        if (parentId != null ? !parentId.equals(that.parentId) : that.parentId != null) return false;
-        if (childId != null ? !childId.equals(that.childId) : that.childId != null) return false;
-
-        return true;
-    }
-
-    @Override
-    public int hashCode() {
-        int result = parentId != null ? parentId.hashCode() : 0;
-        result = 31 * result + (childId != null ? childId.hashCode() : 0);
-        return result;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/PermissionTypeEntity.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/PermissionTypeEntity.java b/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/PermissionTypeEntity.java
deleted file mode 100644
index c145cbe..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/PermissionTypeEntity.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.sharing.registry.db.entities;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "PERMISSION_TYPE", schema = "")
-public class PermissionTypeEntity {
-    private final static Logger logger = LoggerFactory.getLogger(PermissionTypeEntity.class);
-    private String permissionTypeId;
-    private String domainId;
-    private String name;
-    private String description;
-    private Long createdTime;
-    private Long updatedTime;
-
-    @Id
-    @Column(name = "PERMISSION_TYPE_ID")
-    public String getPermissionTypeId() {
-        return permissionTypeId;
-    }
-
-    public void setPermissionTypeId(String permissionTypeId) {
-        this.permissionTypeId = permissionTypeId;
-    }
-
-    @Basic
-    @Column(name = "DOMAIN_ID")
-    public String getDomainId() {
-        return domainId;
-    }
-
-    public void setDomainId(String domainId) {
-        this.domainId = domainId;
-    }
-
-    @Basic
-    @Column(name = "NAME")
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-
-    @Basic
-    @Column(name = "DESCRIPTION")
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    @Basic
-    @Column(name = "CREATED_TIME")
-    public Long getCreatedTime() {
-        return createdTime;
-    }
-
-    public void setCreatedTime(Long createdTime) {
-        this.createdTime = createdTime;
-    }
-
-    @Basic
-    @Column(name = "UPDATED_TIME")
-    public Long getUpdatedTime() {
-        return updatedTime;
-    }
-
-    public void setUpdatedTime(Long updatedTime) {
-        this.updatedTime = updatedTime;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-
-        PermissionTypeEntity that = (PermissionTypeEntity) o;
-
-        if (permissionTypeId != null ? !permissionTypeId.equals(that.permissionTypeId) : that.permissionTypeId != null)
-            return false;
-        if (domainId != null ? !domainId.equals(that.domainId) : that.domainId != null) return false;
-        if (name != null ? !name.equals(that.name) : that.name != 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;
-
-        return true;
-    }
-
-    @Override
-    public int hashCode() {
-        int result = permissionTypeId != null ? permissionTypeId.hashCode() : 0;
-        result = 31 * result + (name != null ? name.hashCode() : 0);
-        result = 31 * result + (createdTime != null ? createdTime.hashCode() : 0);
-        result = 31 * result + (updatedTime != null ? updatedTime.hashCode() : 0);
-        return result;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/SharingEntity.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/SharingEntity.java b/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/SharingEntity.java
deleted file mode 100644
index 077d7cf..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/SharingEntity.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.sharing.registry.db.entities;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "SHARING", schema = "")
-@IdClass(SharingEntityPK.class)
-public class SharingEntity {
-    private final static Logger logger = LoggerFactory.getLogger(SharingEntity.class);
-    private String permissionTypeId;
-    private String entityId;
-    private String groupId;
-    private String groupType;
-    private String sharingType;
-    private String inheritedParentId;
-    private Long createdTime;
-    private Long updatedTime;
-
-    @Id
-    @Column(name = "PERMISSION_TYPE_ID")
-    public String getPermissionTypeId() {
-        return permissionTypeId;
-    }
-
-    public void setPermissionTypeId(String permissionTypeId) {
-        this.permissionTypeId = permissionTypeId;
-    }
-
-    @Id
-    @Column(name = "ENTITY_ID")
-    public String getEntityId() {
-        return entityId;
-    }
-
-    public void setEntityId(String entityId) {
-        this.entityId = entityId;
-    }
-
-    @Id
-    @Column(name = "GROUP_ID")
-    public String getGroupId() {
-        return groupId;
-    }
-
-    public void setGroupId(String groupId) {
-        this.groupId = groupId;
-    }
-
-    @Basic
-    @Column(name = "GROUP_TYPE")
-    public String getGroupType() {
-        return groupType;
-    }
-
-    public void setGroupType(String groupType) {
-        this.groupType = groupType;
-    }
-
-    @Basic
-    @Column(name = "SHARING_TYPE")
-    public String getSharingType() {
-        return sharingType;
-    }
-
-    public void setSharingType(String sharingType) {
-        this.sharingType = sharingType;
-    }
-
-    @Basic
-    @Column(name = "INHERITED_PARENT_ID")
-    public String getInheritedParentId() {
-        return inheritedParentId;
-    }
-
-    public void setInheritedParentId(String inheritedParentId) {
-        this.inheritedParentId = inheritedParentId;
-    }
-
-    @Basic
-    @Column(name = "CREATED_TIME")
-    public Long getCreatedTime() {
-        return createdTime;
-    }
-
-    public void setCreatedTime(Long createdTime) {
-        this.createdTime = createdTime;
-    }
-
-    @Basic
-    @Column(name = "UPDATED_TIME")
-    public Long getUpdatedTime() {
-        return updatedTime;
-    }
-
-    public void setUpdatedTime(Long updatedTime) {
-        this.updatedTime = updatedTime;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-
-        SharingEntity that = (SharingEntity) o;
-
-        if (permissionTypeId != null ? !permissionTypeId.equals(that.permissionTypeId) : that.permissionTypeId != null)
-            return false;
-        if (entityId != null ? !entityId.equals(that.entityId) : that.entityId != null) return false;
-        if (groupId != null ? !groupId.equals(that.groupId) : that.groupId != 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;
-
-        return true;
-    }
-
-    @Override
-    public int hashCode() {
-        int result = permissionTypeId != null ? permissionTypeId.hashCode() : 0;
-        result = 31 * result + (entityId != null ? entityId.hashCode() : 0);
-        result = 31 * result + (groupId != null ? groupId.hashCode() : 0);
-        return result;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/SharingEntityPK.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/SharingEntityPK.java b/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/SharingEntityPK.java
deleted file mode 100644
index fe6ebaf..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/SharingEntityPK.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.sharing.registry.db.entities;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.persistence.Basic;
-import javax.persistence.Column;
-import javax.persistence.Id;
-import java.io.Serializable;
-
-public class SharingEntityPK implements Serializable {
-    private final static Logger logger = LoggerFactory.getLogger(SharingEntityPK.class);
-    private String permissionTypeId;
-    private String entityId;
-    private String groupId;
-    private Long createdTime;
-    private Long updatedTime;
-
-    @Column(name = "PERMISSION_TYPE_ID")
-    @Id
-    public String getPermissionTypeId() {
-        return permissionTypeId;
-    }
-
-    public void setPermissionTypeId(String permissionTypeId) {
-        this.permissionTypeId = permissionTypeId;
-    }
-
-    @Column(name = "ENTITY_ID")
-    @Id
-    public String getEntityId() {
-        return entityId;
-    }
-
-    public void setEntityId(String entityId) {
-        this.entityId = entityId;
-    }
-
-    @Column(name = "GROUP_ID")
-    @Id
-    public String getGroupId() {
-        return groupId;
-    }
-
-    public void setGroupId(String groupId) {
-        this.groupId = groupId;
-    }
-
-    @Basic
-    @Column(name = "CREATED_TIME")
-    public Long getCreatedTime() {
-        return createdTime;
-    }
-
-    public void setCreatedTime(Long createdTime) {
-        this.createdTime = createdTime;
-    }
-
-    @Basic
-    @Column(name = "UPDATED_TIME")
-    public Long getUpdatedTime() {
-        return updatedTime;
-    }
-
-    public void setUpdatedTime(Long updatedTime) {
-        this.updatedTime = updatedTime;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-
-        SharingEntityPK that = (SharingEntityPK) o;
-
-        if (permissionTypeId != null ? !permissionTypeId.equals(that.permissionTypeId) : that.permissionTypeId != null)
-            return false;
-        if (entityId != null ? !entityId.equals(that.entityId) : that.entityId != null) return false;
-        if (groupId != null ? !groupId.equals(that.groupId) : that.groupId != 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;
-
-        return true;
-    }
-
-    @Override
-    public int hashCode() {
-        int result = permissionTypeId != null ? permissionTypeId.hashCode() : 0;
-        result = 31 * result + (entityId != null ? entityId.hashCode() : 0);
-        result = 31 * result + (groupId != null ? groupId.hashCode() : 0);
-        return result;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/UserEntity.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/UserEntity.java b/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/UserEntity.java
deleted file mode 100644
index 256d2e7..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/UserEntity.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.sharing.registry.db.entities;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "USER", schema = "")
-public class UserEntity {
-    private final static Logger logger = LoggerFactory.getLogger(UserEntity.class);
-    private String userId;
-    private String domainId;
-    private String userName;
-    private Long createdTime;
-    private Long updatedTime;
-
-    @Id
-    @Column(name = "USER_ID")
-    public String getUserId() {
-        return userId;
-    }
-
-    public void setUserId(String userId) {
-        this.userId = userId;
-    }
-
-    @Basic
-    @Column(name = "DOMAIN_ID")
-    public String getDomainId() {
-        return domainId;
-    }
-
-    public void setDomainId(String domainId) {
-        this.domainId = domainId;
-    }
-
-    @Basic
-    @Column(name = "USER_NAME")
-    public String getUserName() {
-        return userName;
-    }
-
-    public void setUserName(String userName) {
-        this.userName = userName;
-    }
-
-    @Basic
-    @Column(name = "CREATED_TIME")
-    public Long getCreatedTime() {
-        return createdTime;
-    }
-
-    public void setCreatedTime(Long createdTime) {
-        this.createdTime = createdTime;
-    }
-
-    @Basic
-    @Column(name = "UPDATED_TIME")
-    public Long getUpdatedTime() {
-        return updatedTime;
-    }
-
-    public void setUpdatedTime(Long updatedTime) {
-        this.updatedTime = updatedTime;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-
-        UserEntity that = (UserEntity) o;
-
-        if (userId != null ? !userId.equals(that.userId) : that.userId != null) return false;
-        if (domainId != null ? !domainId.equals(that.domainId) : that.domainId != null) return false;
-        if (userName != null ? !userName.equals(that.userName) : that.userName != 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;
-
-        return true;
-    }
-
-    @Override
-    public int hashCode() {
-        int result = userId != null ? userId.hashCode() : 0;
-        result = 31 * result + (userName != null ? userName.hashCode() : 0);
-        result = 31 * result + (createdTime != null ? createdTime.hashCode() : 0);
-        result = 31 * result + (updatedTime != null ? updatedTime.hashCode() : 0);
-        return result;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/UserGroupEntity.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/UserGroupEntity.java b/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/UserGroupEntity.java
deleted file mode 100644
index 10d901a..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/entities/UserGroupEntity.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.sharing.registry.db.entities;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "USER_GROUP", schema = "")
-public class UserGroupEntity {
-    private final static Logger logger = LoggerFactory.getLogger(UserGroupEntity.class);
-    private String groupId;
-    private String domainId;
-    private String name;
-    private String description;
-    private String ownerId;
-    private String groupType;
-    private Long createdTime;
-    private Long updatedTime;
-
-    @Id
-    @Column(name = "GROUP_ID")
-    public String getGroupId() {
-        return groupId;
-    }
-
-    public void setGroupId(String groupId) {
-        this.groupId = groupId;
-    }
-
-    @Basic
-    @Column(name = "DOMAIN_ID")
-    public String getDomainId() {
-        return domainId;
-    }
-
-    public void setDomainId(String domainId) {
-        this.domainId = domainId;
-    }
-
-    @Basic
-    @Column(name = "OWNER_ID")
-    public String getOwnerId() {
-        return ownerId;
-    }
-
-    public void setOwnerId(String ownerId) {
-        this.ownerId = ownerId;
-    }
-
-    @Basic
-    @Column(name = "NAME")
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    @Basic
-    @Column(name = "DESCRIPTION")
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    @Basic
-    @Column(name = "GROUP_TYPE")
-    public String getGroupType() {
-        return groupType;
-    }
-
-    public void setGroupType(String type) {
-        this.groupType = type;
-    }
-
-    @Basic
-    @Column(name = "CREATED_TIME")
-    public Long getCreatedTime() {
-        return createdTime;
-    }
-
-    public void setCreatedTime(Long createdTime) {
-        this.createdTime = createdTime;
-    }
-
-    @Basic
-    @Column(name = "UPDATED_TIME")
-    public Long getUpdatedTime() {
-        return updatedTime;
-    }
-
-    public void setUpdatedTime(Long updatedTime) {
-        this.updatedTime = updatedTime;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-
-        UserGroupEntity that = (UserGroupEntity) o;
-
-        if (groupId != null ? !groupId.equals(that.groupId) : that.groupId != null) return false;
-        if (domainId != null ? !domainId.equals(that.domainId) : that.domainId != null) return false;
-        if (ownerId != null ? !ownerId.equals(that.ownerId) : that.ownerId != null) return false;
-        if (name != null ? !name.equals(that.name) : that.name != null) return false;
-        if (description != null ? !description.equals(that.description) : that.description != null) return false;
-        if (groupType != null ? !groupType.equals(that.groupType) : that.groupType != 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;
-
-        return true;
-    }
-
-    @Override
-    public int hashCode() {
-        int result = groupId != null ? groupId.hashCode() : 0;
-        result = 31 * result + (name != null ? name.hashCode() : 0);
-        result = 31 * result + (description != null ? description.hashCode() : 0);
-        result = 31 * result + (groupType != null ? groupType.hashCode() : 0);
-        result = 31 * result + (createdTime != null ? createdTime.hashCode() : 0);
-        result = 31 * result + (updatedTime != null ? updatedTime.hashCode() : 0);
-        return result;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/AbstractRepository.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/AbstractRepository.java b/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/AbstractRepository.java
deleted file mode 100644
index 1a95b97..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/AbstractRepository.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.sharing.registry.db.repositories;
-
-import org.apache.airavata.sharing.registry.db.utils.DBConstants;
-import org.apache.airavata.sharing.registry.db.utils.JPAUtils;
-import org.apache.airavata.sharing.registry.db.utils.ObjectMapperSingleton;
-import org.apache.airavata.sharing.registry.models.GovRegistryException;
-import org.dozer.Mapper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-public abstract class AbstractRepository<T, E, Id> {
-    private final static Logger logger = LoggerFactory.getLogger(AbstractRepository.class);
-
-    private Class<T> thriftGenericClass;
-    private Class<E> dbEntityGenericClass;
-
-    public AbstractRepository(Class<T> thriftGenericClass, Class<E> dbEntityGenericClass){
-        this.thriftGenericClass = thriftGenericClass;
-        this.dbEntityGenericClass = dbEntityGenericClass;
-    }
-
-    public T create(T t) throws GovRegistryException {
-        return update(t);
-    }
-
-    public List<T> create(List<T> tList) throws GovRegistryException {
-        return update(tList);
-    }
-
-    public  T update(T t) throws GovRegistryException {
-        Mapper mapper = ObjectMapperSingleton.getInstance();
-        E entity = mapper.map(t, dbEntityGenericClass);
-        E persistedCopy = JPAUtils.execute(entityManager -> entityManager.merge(entity));
-        return mapper.map(persistedCopy, thriftGenericClass);
-    }
-
-    public  List<T> update(List<T> tList) throws GovRegistryException {
-        List<T> returnList = new ArrayList<>();
-        for(T temp : tList)
-            returnList.add(update(temp));
-        return returnList;
-    }
-
-    public boolean delete(Id id) throws GovRegistryException {
-        JPAUtils.execute(entityManager -> {
-            E entity = entityManager.find(dbEntityGenericClass, id);
-            entityManager.remove(entity);
-            return entity;
-        });
-        return true;
-    }
-
-    public boolean delete(List<Id> idList) throws GovRegistryException {
-        for(Id id : idList)
-            delete(id);
-        return true;
-    }
-
-    public T get(Id id) throws GovRegistryException {
-        E entity = JPAUtils.execute(entityManager -> entityManager
-                .find(dbEntityGenericClass, id));
-        Mapper mapper = ObjectMapperSingleton.getInstance();
-        if(entity == null)
-            return null;
-        return mapper.map(entity, thriftGenericClass);
-    }
-
-    public List<T> get(List<Id> idList) throws GovRegistryException {
-        List<T> returnList = new ArrayList<>();
-        for(Id id : idList)
-            returnList.add(get(id));
-        return returnList;
-    }
-
-    public List<T> select(Map<String, String> filters, int offset, int limit) throws GovRegistryException {
-        String queryString = getSelectQuery(filters);
-        int newLimit = limit < 0 ? DBConstants.SELECT_MAX_ROWS: limit;
-        List resultSet = JPAUtils.execute(entityManager -> entityManager.createQuery(queryString).setFirstResult(offset)
-                .setMaxResults(newLimit).getResultList());
-        Mapper mapper = ObjectMapperSingleton.getInstance();
-        List<T> gatewayList = new ArrayList<>();
-        resultSet.stream().forEach(rs -> gatewayList.add(mapper.map(rs, thriftGenericClass)));
-        return gatewayList;
-    }
-
-    public List<T> select(String queryString, int offset, int limit) throws GovRegistryException {
-        int newLimit = limit < 0 ? DBConstants.SELECT_MAX_ROWS: limit;
-        List resultSet = JPAUtils.execute(entityManager -> entityManager.createQuery(queryString).setFirstResult(offset)
-                .setMaxResults(newLimit).getResultList());
-        Mapper mapper = ObjectMapperSingleton.getInstance();
-        List<T> gatewayList = new ArrayList<>();
-        resultSet.stream().forEach(rs -> gatewayList.add(mapper.map(rs, thriftGenericClass)));
-        return gatewayList;
-    }
-
-    private String getSelectQuery(Map<String, String> filters){
-        String query = "SELECT p from " + dbEntityGenericClass.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.createdTime DESC";
-
-        return query;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/DomainRepository.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/DomainRepository.java b/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/DomainRepository.java
deleted file mode 100644
index 8cd44ef..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/DomainRepository.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.sharing.registry.db.repositories;
-
-import org.apache.airavata.sharing.registry.db.entities.DomainEntity;
-import org.apache.airavata.sharing.registry.models.Domain;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class DomainRepository extends AbstractRepository<Domain, DomainEntity, String> {
-    private final static Logger logger = LoggerFactory.getLogger(DomainRepository.class);
-
-    public DomainRepository(){
-        super(Domain.class, DomainEntity.class);
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/EntityRepository.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/EntityRepository.java b/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/EntityRepository.java
deleted file mode 100644
index 20e0fd9..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/EntityRepository.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.sharing.registry.db.repositories;
-
-import org.apache.airavata.sharing.registry.db.entities.EntityEntity;
-import org.apache.airavata.sharing.registry.db.entities.SharingEntity;
-import org.apache.airavata.sharing.registry.db.utils.DBConstants;
-import org.apache.airavata.sharing.registry.models.Entity;
-import org.apache.airavata.sharing.registry.models.EntitySearchFields;
-import org.apache.airavata.sharing.registry.models.GovRegistryException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class EntityRepository extends AbstractRepository<Entity, EntityEntity, String> {
-    private final static Logger logger = LoggerFactory.getLogger(EntityRepository.class);
-
-    public EntityRepository() {
-        super(Entity.class, EntityEntity.class);
-    }
-
-    public List<Entity> getChildEntities(String parentId) throws GovRegistryException {
-        HashMap<String, String> filters = new HashMap<>();
-        filters.put(DBConstants.EntityTable.PARENT_ENTITY_ID, parentId);
-        return select(filters, 0, -1);
-    }
-
-    public List<Entity> searchEntities(List<String> groupIds, String entityTypeId, Map<EntitySearchFields, String> filters,
-                                       int offset, int limit) throws GovRegistryException {
-        String groupIdString = "'";
-        for(String groupId : groupIds)
-            groupIdString += groupId + "','";
-        groupIdString = groupIdString.substring(0, groupIdString.length()-2);
-
-        String query = "SELECT E FROM " + EntityEntity.class.getSimpleName() + " E, " + SharingEntity.class.getSimpleName() + " S WHERE " +
-                "E." + DBConstants.EntityTable.ENTITY_ID + " = S." + DBConstants.SharingTable.ENTITY_ID + " AND " +
-                "S." + DBConstants.SharingTable.GROUP_ID + " IN(" + groupIdString + ") AND E." + DBConstants.EntityTable.ENTITY_TYPE_ID + "='" +
-                entityTypeId + "' AND ";
-
-        for(Map.Entry<EntitySearchFields, String> mapEntry : filters.entrySet()){
-            if(mapEntry.getKey().equals(EntitySearchFields.NAME)){
-                query += "E." + DBConstants.EntityTable.NAME + " LIKE '%" + mapEntry.getValue() + "%' AND ";
-            }else if(mapEntry.getKey().equals(EntitySearchFields.DESCRIPTION)){
-                query += "E." + DBConstants.EntityTable.DESCRIPTION + " LIKE '%" + mapEntry.getValue() + "%' AND ";
-            }else if(mapEntry.getKey().equals(EntitySearchFields.FULL_TEXT)){
-                query += "E." + DBConstants.EntityTable.FULL_TEXT + " LIKE '%" + mapEntry.getValue() + "%' AND ";
-            }
-        }
-
-        query = query.substring(0, query.length() - 5);
-        return select(query, offset, limit);
-
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/EntityTypeRepository.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/EntityTypeRepository.java b/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/EntityTypeRepository.java
deleted file mode 100644
index ed2a7e9..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/EntityTypeRepository.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.sharing.registry.db.repositories;
-
-import org.apache.airavata.sharing.registry.db.entities.EntityTypeEntity;
-import org.apache.airavata.sharing.registry.models.EntityType;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class EntityTypeRepository extends AbstractRepository<EntityType, EntityTypeEntity, String> {
-    private final static Logger logger = LoggerFactory.getLogger(EntityTypeRepository.class);
-
-    public EntityTypeRepository() {
-        super(EntityType.class, EntityTypeEntity.class);
-    }
-}
\ No newline at end of file


[08/17] airavata git commit: renaming directory names

Posted by sc...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/EntityRepository.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/EntityRepository.java b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/EntityRepository.java
new file mode 100644
index 0000000..20e0fd9
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/EntityRepository.java
@@ -0,0 +1,75 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.sharing.registry.db.repositories;
+
+import org.apache.airavata.sharing.registry.db.entities.EntityEntity;
+import org.apache.airavata.sharing.registry.db.entities.SharingEntity;
+import org.apache.airavata.sharing.registry.db.utils.DBConstants;
+import org.apache.airavata.sharing.registry.models.Entity;
+import org.apache.airavata.sharing.registry.models.EntitySearchFields;
+import org.apache.airavata.sharing.registry.models.GovRegistryException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class EntityRepository extends AbstractRepository<Entity, EntityEntity, String> {
+    private final static Logger logger = LoggerFactory.getLogger(EntityRepository.class);
+
+    public EntityRepository() {
+        super(Entity.class, EntityEntity.class);
+    }
+
+    public List<Entity> getChildEntities(String parentId) throws GovRegistryException {
+        HashMap<String, String> filters = new HashMap<>();
+        filters.put(DBConstants.EntityTable.PARENT_ENTITY_ID, parentId);
+        return select(filters, 0, -1);
+    }
+
+    public List<Entity> searchEntities(List<String> groupIds, String entityTypeId, Map<EntitySearchFields, String> filters,
+                                       int offset, int limit) throws GovRegistryException {
+        String groupIdString = "'";
+        for(String groupId : groupIds)
+            groupIdString += groupId + "','";
+        groupIdString = groupIdString.substring(0, groupIdString.length()-2);
+
+        String query = "SELECT E FROM " + EntityEntity.class.getSimpleName() + " E, " + SharingEntity.class.getSimpleName() + " S WHERE " +
+                "E." + DBConstants.EntityTable.ENTITY_ID + " = S." + DBConstants.SharingTable.ENTITY_ID + " AND " +
+                "S." + DBConstants.SharingTable.GROUP_ID + " IN(" + groupIdString + ") AND E." + DBConstants.EntityTable.ENTITY_TYPE_ID + "='" +
+                entityTypeId + "' AND ";
+
+        for(Map.Entry<EntitySearchFields, String> mapEntry : filters.entrySet()){
+            if(mapEntry.getKey().equals(EntitySearchFields.NAME)){
+                query += "E." + DBConstants.EntityTable.NAME + " LIKE '%" + mapEntry.getValue() + "%' AND ";
+            }else if(mapEntry.getKey().equals(EntitySearchFields.DESCRIPTION)){
+                query += "E." + DBConstants.EntityTable.DESCRIPTION + " LIKE '%" + mapEntry.getValue() + "%' AND ";
+            }else if(mapEntry.getKey().equals(EntitySearchFields.FULL_TEXT)){
+                query += "E." + DBConstants.EntityTable.FULL_TEXT + " LIKE '%" + mapEntry.getValue() + "%' AND ";
+            }
+        }
+
+        query = query.substring(0, query.length() - 5);
+        return select(query, offset, limit);
+
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/EntityTypeRepository.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/EntityTypeRepository.java b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/EntityTypeRepository.java
new file mode 100644
index 0000000..ed2a7e9
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/EntityTypeRepository.java
@@ -0,0 +1,34 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.sharing.registry.db.repositories;
+
+import org.apache.airavata.sharing.registry.db.entities.EntityTypeEntity;
+import org.apache.airavata.sharing.registry.models.EntityType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class EntityTypeRepository extends AbstractRepository<EntityType, EntityTypeEntity, String> {
+    private final static Logger logger = LoggerFactory.getLogger(EntityTypeRepository.class);
+
+    public EntityTypeRepository() {
+        super(EntityType.class, EntityTypeEntity.class);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/GroupMembershipRepository.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/GroupMembershipRepository.java b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/GroupMembershipRepository.java
new file mode 100644
index 0000000..259e22c
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/GroupMembershipRepository.java
@@ -0,0 +1,98 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.sharing.registry.db.repositories;
+
+import org.apache.airavata.sharing.registry.db.entities.GroupMembershipEntity;
+import org.apache.airavata.sharing.registry.db.entities.GroupMembershipEntityPK;
+import org.apache.airavata.sharing.registry.db.entities.UserEntity;
+import org.apache.airavata.sharing.registry.db.entities.UserGroupEntity;
+import org.apache.airavata.sharing.registry.db.utils.DBConstants;
+import org.apache.airavata.sharing.registry.models.*;
+
+import java.util.*;
+
+public class GroupMembershipRepository extends AbstractRepository<GroupMembership, GroupMembershipEntity, GroupMembershipEntityPK> {
+
+    public GroupMembershipRepository() {
+        super(GroupMembership.class, GroupMembershipEntity.class);
+    }
+
+    public List<GroupMembership> getChildMembershipsOfGroup(String parentId) throws GovRegistryException {
+        Map<String, String> filters = new HashMap<>();
+        filters.put(DBConstants.GroupMembershipTable.PARENT_ID, parentId);
+        return select(filters, 0, -1);
+    }
+
+    public List<User> getAllChildUsers(String groupId) throws GovRegistryException {
+        String queryString = "SELECT 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.PARENT_ID+"='"+groupId + "' AND gm." + DBConstants.GroupMembershipTable.CHILD_TYPE
+                + "='" + GroupChildType.USER.toString() + "'";
+        UserRepository userRepository = new UserRepository();
+        List<User> users = userRepository.select(queryString, 0, -1);
+        return users;
+    }
+
+    public List<UserGroup> getAllChildGroups(String groupId) throws GovRegistryException {
+        String queryString = "SELECT 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.PARENT_ID+"='"+groupId + "' AND GM." + DBConstants.GroupMembershipTable.CHILD_TYPE
+                + "='" + GroupChildType.GROUP.toString() + "'";
+        UserGroupRepository userGroupRepository = new UserGroupRepository();
+        List<UserGroup> groups = userGroupRepository.select(queryString, 0, -1);
+        return groups;
+    }
+
+    public List<GroupMembership> getAllParentMembershipsForChild(String childId) throws GovRegistryException {
+        List<GroupMembership> finalParentGroups = new ArrayList<>();
+        Map<String, String> filters = new HashMap<>();
+        filters.put(DBConstants.GroupMembershipTable.CHILD_ID, childId);
+        LinkedList<GroupMembership> temp = new LinkedList<>();
+        select(filters, 0, -1).stream().forEach(m -> temp.addLast(m));
+        while (temp.size() > 0){
+            GroupMembership gm = temp.pop();
+            filters = new HashMap<>();
+            filters.put(DBConstants.GroupMembershipTable.CHILD_ID, gm.parentId);
+            select(filters, 0, -1).stream().forEach(m -> temp.addLast(m));
+            finalParentGroups.add(gm);
+        }
+        return finalParentGroups;
+    }
+
+    public List<UserGroup> getAllParentGroupsForChild(String childId) throws GovRegistryException {
+        List<UserGroup> finalParentGroups = new ArrayList<>();
+        Map<String, String> filters = new HashMap<>();
+        filters.put(DBConstants.GroupMembershipTable.CHILD_ID, childId);
+        LinkedList<GroupMembership> temp = new LinkedList<>();
+        select(filters, 0, -1).stream().forEach(m -> temp.addLast(m));
+        UserGroupRepository userGroupRepository = new UserGroupRepository();
+        while (temp.size() > 0){
+            GroupMembership gm = temp.pop();
+            filters = new HashMap<>();
+            filters.put(DBConstants.GroupMembershipTable.CHILD_ID, gm.parentId);
+            select(filters, 0, -1).stream().forEach(m -> temp.addLast(m));
+            finalParentGroups.add(userGroupRepository.get(gm.parentId));
+        }
+        return finalParentGroups;
+    }
+
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/PermissionTypeRepository.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/PermissionTypeRepository.java b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/PermissionTypeRepository.java
new file mode 100644
index 0000000..e61f1ec
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/PermissionTypeRepository.java
@@ -0,0 +1,52 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.sharing.registry.db.repositories;
+
+import org.apache.airavata.sharing.registry.db.entities.PermissionTypeEntity;
+import org.apache.airavata.sharing.registry.db.utils.DBConstants;
+import org.apache.airavata.sharing.registry.models.GovRegistryException;
+import org.apache.airavata.sharing.registry.models.PermissionType;
+import org.apache.airavata.sharing.registry.server.SharingRegistryServerHandler;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.HashMap;
+import java.util.List;
+
+public class PermissionTypeRepository extends AbstractRepository<PermissionType, PermissionTypeEntity, String> {
+    private final static Logger logger = LoggerFactory.getLogger(PermissionTypeRepository.class);
+
+    public PermissionTypeRepository() {
+        super(PermissionType.class, PermissionTypeEntity.class);
+    }
+
+    public String getGlobalPermissionTypeIdForDomain(String domainId) throws GovRegistryException {
+        HashMap<String, String> filters = new HashMap<>();
+        filters.put(DBConstants.PermissionTypeTable.DOMAIN_ID, domainId);
+        filters.put(DBConstants.PermissionTypeTable.NAME, SharingRegistryServerHandler.GLOBAL_PERMISSION_NAME);
+        List<PermissionType> permissionTypeList = select(filters, 0, -1);
+        if(permissionTypeList.size() != 1){
+            throw new GovRegistryException("GLOBAL Permission inconsistency. Found " + permissionTypeList.size()
+                    + " records with " + SharingRegistryServerHandler.GLOBAL_PERMISSION_NAME + " name");
+        }
+        return permissionTypeList.get(0).getPermissionTypeId();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/SharingRepository.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/SharingRepository.java b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/SharingRepository.java
new file mode 100644
index 0000000..27f9e0e
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/SharingRepository.java
@@ -0,0 +1,74 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.sharing.registry.db.repositories;
+
+import org.apache.airavata.sharing.registry.db.entities.SharingEntity;
+import org.apache.airavata.sharing.registry.db.entities.SharingEntityPK;
+import org.apache.airavata.sharing.registry.db.utils.DBConstants;
+import org.apache.airavata.sharing.registry.models.GovRegistryException;
+import org.apache.airavata.sharing.registry.models.Sharing;
+import org.apache.airavata.sharing.registry.models.SharingType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.HashMap;
+import java.util.List;
+
+public class SharingRepository extends AbstractRepository<Sharing, SharingEntity, SharingEntityPK> {
+    private final static Logger logger = LoggerFactory.getLogger(SharingRepository.class);
+
+    public SharingRepository() {
+        super(Sharing.class, SharingEntity.class);
+    }
+
+    public List<Sharing> getIndirectSharedChildren(String parentId, String permissionTypeId) throws GovRegistryException {
+        HashMap<String, String> filters = new HashMap<>();
+        filters.put(DBConstants.SharingTable.INHERITED_PARENT_ID, parentId);
+        filters.put(DBConstants.SharingTable.SHARING_TYPE, SharingType.INHERITED.toString());
+        filters.put(DBConstants.SharingTable.PERMISSION_TYPE_ID, permissionTypeId);
+
+        return select(filters, 0, -1);
+    }
+
+    public List<Sharing> getPermissionsForEntity(String entityId) throws GovRegistryException {
+        HashMap<String, String> filters = new HashMap<>();
+        filters.put(DBConstants.SharingTable.ENTITY_ID, entityId);
+        return select(filters, 0, -1);
+    }
+
+    public boolean hasAccess(String entityId, List<String> groupIds, List<String> permissionTypeIds) throws GovRegistryException {
+        String query = "SELECT p from " + SharingEntity.class.getSimpleName() + " as p";
+        query += " WHERE ";
+        query += "p." + DBConstants.SharingTable.ENTITY_ID + " = '" + entityId + "' AND ";
+        String permissionTypeIdString = "'";
+        for(String permissionId : permissionTypeIds)
+            permissionTypeIdString += permissionId + "','";
+        permissionTypeIdString = permissionTypeIdString.substring(0, permissionTypeIdString.length()-2);
+        query += "p." + DBConstants.SharingTable.PERMISSION_TYPE_ID + " IN(" + permissionTypeIdString + ") AND ";
+        String groupIdString = "'";
+        for(String groupId : groupIds)
+            groupIdString += groupId + "','";
+        groupIdString = groupIdString.substring(0, groupIdString.length()-2);
+        query += "p." + DBConstants.SharingTable.GROUP_ID + " IN(" + groupIdString + ") ";
+        query += " ORDER BY p.createdTime DESC";
+        return select(query, 0, -1).size() > 0;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/UserGroupRepository.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/UserGroupRepository.java b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/UserGroupRepository.java
new file mode 100644
index 0000000..170b1fd
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/UserGroupRepository.java
@@ -0,0 +1,34 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.sharing.registry.db.repositories;
+
+import org.apache.airavata.sharing.registry.db.entities.UserGroupEntity;
+import org.apache.airavata.sharing.registry.models.UserGroup;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class UserGroupRepository extends AbstractRepository<UserGroup, UserGroupEntity, String> {
+    private final static Logger logger = LoggerFactory.getLogger(UserGroupRepository.class);
+
+    public UserGroupRepository() {
+        super(UserGroup.class, UserGroupEntity.class);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/UserRepository.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/UserRepository.java b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/UserRepository.java
new file mode 100644
index 0000000..f4ec03f
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/repositories/UserRepository.java
@@ -0,0 +1,35 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.sharing.registry.db.repositories;
+
+
+import org.apache.airavata.sharing.registry.db.entities.UserEntity;
+import org.apache.airavata.sharing.registry.models.User;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class UserRepository extends AbstractRepository<User, UserEntity, String> {
+    private final static Logger logger = LoggerFactory.getLogger(UserRepository.class);
+
+    public UserRepository() {
+        super(User.class, UserEntity.class);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/Committer.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/Committer.java b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/Committer.java
new file mode 100644
index 0000000..ed8c9b3
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/Committer.java
@@ -0,0 +1,27 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.sharing.registry.db.utils;
+
+@FunctionalInterface
+public interface Committer<T, R>  {
+
+    R commit(T t);
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/ConnectionPool.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/ConnectionPool.java b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/ConnectionPool.java
new file mode 100644
index 0000000..02484f7
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/ConnectionPool.java
@@ -0,0 +1,382 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.sharing.registry.db.utils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.sql.DataSource;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Stack;
+import java.util.concurrent.Semaphore;
+
+
+/**
+ * A class for preallocating, recycling, and managing JDBC connections.
+ */
+public class ConnectionPool {
+    private static final Logger logger = LoggerFactory.getLogger(ConnectionPool.class);
+
+    private long MAX_IDLE_TIME = 5 * 60 * 1000; // 5 minutes
+
+    private String driver;
+    private String url;
+    private String username;
+    private String password;
+    private String jdbcUrl;
+
+    private int maxConnections;
+
+    private boolean autoCommit = true;
+    private boolean waitIfBusy;
+
+    private Semaphore needConnection = new Semaphore(0);
+    private boolean stop;
+
+    private Stack<Connection> availableConnections;
+    private Stack<Connection> busyConnections;
+
+    private HashMap<Connection, Long> lastAccessTimeRecord = new HashMap<Connection, Long>();
+
+    private String urlType = "";
+
+    private DataSource datasource;
+
+    private int transactionIsolation = Connection.TRANSACTION_NONE;
+
+    private Thread clenupThread;
+    private Thread producerThread;
+
+    public ConnectionPool(String driver, String url, String username, String password, int initialConnections,
+                          int maxConnections, boolean waitIfBusy) throws SQLException {
+        this.driver = driver;
+        this.url = url;
+        this.username = username;
+        this.password = password;
+        this.urlType = "speratedURL";
+        initialize(initialConnections, maxConnections, waitIfBusy);
+    }
+
+    public ConnectionPool(String driver, String jdbcUrl, int initialConnections, int maxConnections,
+                          boolean waitIfBusy, boolean autoCommit, int transactionIsolation) throws SQLException {
+        this.driver = driver;
+        this.jdbcUrl = jdbcUrl;
+        this.urlType = "simpleURL";
+        this.autoCommit = autoCommit;
+        this.transactionIsolation = transactionIsolation;
+        initialize(initialConnections, maxConnections, waitIfBusy);
+    }
+
+    public ConnectionPool(String driver, String jdbcUrl, int initialConnections, int maxConnections, boolean waitIfBusy)
+            throws SQLException {
+        this.driver = driver;
+        this.jdbcUrl = jdbcUrl;
+        this.urlType = "simpleURL";
+        initialize(initialConnections, maxConnections, waitIfBusy);
+    }
+
+    public ConnectionPool(DataSource dataSource, int initialConnections, int maxConnections, boolean waitIfBusy)
+            throws SQLException {
+        this.urlType = "dataSource";
+        this.datasource = dataSource;
+        initialize(initialConnections, maxConnections, waitIfBusy);
+    }
+
+    /**
+     * Check if this connection pool is auto commit or not
+     *
+     * @return
+     */
+    public boolean isAutoCommit() {
+        return this.autoCommit;
+    }
+
+    private void initialize(int initialConnections, int maxConnections, boolean waitIfBusy) throws SQLException {
+        this.maxConnections = maxConnections;
+        this.waitIfBusy = waitIfBusy;
+
+        int sizeOfConnections = (initialConnections > maxConnections) ? maxConnections : initialConnections;
+
+        availableConnections = new Stack<Connection>();
+        busyConnections = new Stack<Connection>();
+
+        for (int i = 0; i < sizeOfConnections; i++) {
+            Connection con = makeNewConnection();
+            setTimeStamp(con);
+            availableConnections.push(con);
+
+        }
+
+        producerThread = new Thread(new FillUpThread());
+        producerThread.start();
+
+        clenupThread = new Thread(new CleanUpThread());
+        clenupThread.start();
+    }
+
+    public synchronized Connection getConnection() throws SQLException {
+        if (!availableConnections.isEmpty()) {
+            Connection existingConnection = availableConnections.pop();
+
+            // If connection on available list is closed (e.g.,
+            // it timed out), then remove it from available list
+            // and race for a connection again.
+            if (existingConnection.isClosed()) {
+                lastAccessTimeRecord.remove(existingConnection);
+                // notifyAll for fairness
+                notifyAll();
+            } else {
+                busyConnections.push(existingConnection);
+                setTimeStamp(existingConnection);
+                return existingConnection;
+            }
+        } else if (!waitIfBusy && busyConnections.size() >= maxConnections) {
+            // You reached maxConnections limit and waitIfBusy flag is false.
+            // Throw SQLException in such a case.
+            throw new SQLException("Connection limit reached");
+        } else {
+
+            if (busyConnections.size() < maxConnections) {
+                // available connection is empty, but total number of connection
+                // doesn't reach maxConnection. Request for more connection
+                needConnection.release();
+            }
+
+            try {
+                // wait for free connection
+                wait();
+            } catch (InterruptedException ie) {
+            }
+        }
+        // always race for connection forever
+        return getConnection();
+    }
+
+    // This explicitly makes a new connection. Called in
+    // the foreground when initializing the ConnectionPool,
+    // and called in the background when running.
+    private Connection makeNewConnection() throws SQLException {
+        try {
+            // Load database driver if not already loaded
+            Class.forName(driver);
+            Connection connection;
+            // Establish network connection to database
+            if (urlType.equals("speratedURL")) {
+                connection = DriverManager.getConnection(url, username, password);
+            } else if (urlType.equals("simpleURL")) {
+                connection = DriverManager.getConnection(jdbcUrl);
+            } else { // if(urlType.equals("dataSource")){
+                connection = datasource.getConnection();
+            }
+            connection.setTransactionIsolation(this.transactionIsolation);
+            connection.setAutoCommit(this.autoCommit);
+            return connection;
+        } catch (ClassNotFoundException cnfe) {
+            // Simplify try/catch blocks of people using this by
+            // throwing only one exception type.
+            throw new SQLException("Can't find class for driver: " + driver);
+        }
+    }
+
+    private synchronized void fillUpConnection(Connection conn) {
+        setTimeStamp(conn);
+        availableConnections.push(conn);
+
+        // notify all since new connection is created
+        notifyAll();
+    }
+
+    private void setTimeStamp(Connection connection) {
+        lastAccessTimeRecord.put(connection, System.currentTimeMillis());
+    }
+
+    // The database connection cannot be left idle for too long, otherwise TCP
+    // connection will be broken.
+    /**
+     * From http://forums.mysql.com/read.php?39,28450,57460#msg-57460 Okay, then it looks like wait_timeout on the
+     * server is killing your connection (it is set to 8 hours of idle time by default). Either set that value higher on
+     * your server, or configure your connection pool to not hold connections idle that long (I prefer the latter). Most
+     * folks I know that run MySQL with a connection pool in high-load production environments only let connections sit
+     * idle for a matter of minutes, since it only takes a few milliseconds to open a connection, and the longer one
+     * sits idle the more chance it will go "bad" because of a network hiccup or the MySQL server being restarted.
+     *
+     * @throws java.sql.SQLException
+     */
+    private boolean isConnectionStale(Connection connection) {
+        long currentTime = System.currentTimeMillis();
+        long lastAccess = lastAccessTimeRecord.get(connection);
+        if (currentTime - lastAccess > MAX_IDLE_TIME) {
+            return true;
+        } else
+            return false;
+    }
+
+    private synchronized void closeStaleConnections() {
+        // close idle connections
+        Iterator<Connection> iter = availableConnections.iterator();
+        while (iter.hasNext()) {
+            Connection existingConnection = iter.next();
+            if (isConnectionStale(existingConnection)) {
+                try {
+                    existingConnection.close();
+                    iter.remove();
+                } catch (SQLException sql) {
+                    logger.error(sql.getMessage(), sql);
+                }
+            }
+        }
+        // close busy connections that have been checked out for too long.
+        // This should not happen since this means program has bug for not
+        // releasing connections .
+        iter = busyConnections.iterator();
+        while (iter.hasNext()) {
+            Connection busyConnection = iter.next();
+            if (isConnectionStale(busyConnection)) {
+                try {
+                    busyConnection.close();
+                    iter.remove();
+                    logger.warn("****Connection has checked out too long. Forced release. Check the program for calling release connection [free(Connection) method]");
+                } catch (SQLException sql) {
+                    logger.error(sql.getMessage(), sql);
+                }
+            }
+        }
+    }
+
+    public synchronized void free(Connection connection) {
+        busyConnections.removeElement(connection);
+        availableConnections.addElement(connection);
+        // Wake up threads that are waiting for a connection
+        notifyAll();
+    }
+
+    /**
+     * Close all the connections. Use with caution: be sure no connections are in use before calling. Note that you are
+     * not <I>required</I> to call this when done with a ConnectionPool, since connections are guaranteed to be closed
+     * when garbage collected. But this method gives more control regarding when the connections are closed.
+     */
+    public synchronized void dispose() {
+        logger.info("Connection Pool Shutting down");
+
+        // stop clean up thread
+        this.stop = true;
+        this.clenupThread.interrupt();
+
+        // stop producer up thread
+        this.producerThread.interrupt();
+
+        // close all connection
+        closeConnections(availableConnections);
+        availableConnections = new Stack<Connection>();
+        closeConnections(busyConnections);
+        busyConnections = new Stack<Connection>();
+        lastAccessTimeRecord.clear();
+
+        logger.info("All connection is closed");
+
+        try {
+            this.clenupThread.join();
+            this.producerThread.join();
+        } catch (Exception e) {
+            logger.error("Cannot shutdown cleanup thread", e);
+        }
+
+        logger.info("Connection Pool Shutdown");
+    }
+
+    private void closeConnections(Stack<Connection> connections) {
+        while (!connections.isEmpty()) {
+            Connection connection = connections.pop();
+            try {
+                if (!connection.isClosed()) {
+                    connection.close();
+                }
+            } catch (SQLException sqle) {
+                // Ignore errors; garbage collect anyhow
+                logger.warn(sqle.getMessage());
+            }
+        }
+    }
+
+    public synchronized String toString() {
+        String info = "ConnectionPool(" + url + "," + username + ")" + ", available=" + availableConnections.size()
+                + ", busy=" + busyConnections.size() + ", max=" + maxConnections;
+        return (info);
+    }
+
+    class CleanUpThread implements Runnable {
+        public void run() {
+            while (!stop) {
+                try {
+                    Thread.sleep(MAX_IDLE_TIME);
+                    closeStaleConnections();
+                } catch (InterruptedException e) {
+                    logger.info("Clean up thread is interrupted to close");
+                }
+            }
+        }
+    }
+
+    class FillUpThread implements Runnable {
+        public void run() {
+            while (!stop) {
+                try {
+                    // block until get
+                    needConnection.acquire();
+
+                    Connection conn = makeNewConnection();
+                    fillUpConnection(conn);
+                } catch (SQLException e) {
+                    // cannot create connection (increase semaphore value back)
+                    needConnection.release();
+                    logger.error(e.getMessage(), e);
+                } catch (InterruptedException e) {
+                    logger.info("Fill up thread is interrupted to close");
+                    break;
+                }
+            }
+        }
+    }
+
+    public void shutdown() throws SQLException{
+        for (Connection c : availableConnections) {
+            try {
+                c.close();
+            } catch (SQLException e) {
+                logger.error("Error while closing the connection", e);
+                throw new SQLException("Error while closing the connection", e);
+            }
+        }
+
+        for (Connection c : busyConnections) {
+            try {
+                c.close();
+            } catch (SQLException e) {
+                logger.error("Error while closing the connection", e);
+                throw new SQLException("Error while closing the connection", e);
+            }
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/DBConstants.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/DBConstants.java b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/DBConstants.java
new file mode 100644
index 0000000..f963de2
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/DBConstants.java
@@ -0,0 +1,85 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.sharing.registry.db.utils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class DBConstants {
+    private final static Logger logger = LoggerFactory.getLogger(DBConstants.class);
+
+    public static int SELECT_MAX_ROWS = 10000;
+
+    public static class DomainTable {
+        public static String DOMAIN_ID = "domainId";
+        public static String NAME = "name";
+        public static String DESCRIPTION = "description";
+    }
+
+    public static class UserTable {
+        public static String USER_ID = "userId";
+        public static String DOMAIN_ID = "domainId";
+        public static String USER_NAME = "userName";
+    }
+
+    public static class UserGroupTable {
+        public static String GROUP_ID = "groupId";
+        public static String DOMAIN_ID = "domainId";
+        public static String NAME = "name";
+        public static String DESCRIPTION = "description";
+        public static String OWNER_ID = "ownerId";
+        public static String GROUP_TYPE = "groupType";
+    }
+
+    public static class GroupMembershipTable {
+        public static String PARENT_ID = "parentId";
+        public static String CHILD_ID = "childId";
+        public static String CHILD_TYPE = "childType";
+    }
+
+    public static class EntityTypeTable {
+        public static String ENTITY_TYPE_ID = "entityTypeId";
+        public static String DOMAIN_ID = "domainId";
+    }
+
+    public static class PermissionTypeTable {
+        public static String ENTITY_TYPE_ID = "permissionTypeId";
+        public static String DOMAIN_ID = "domainId";
+        public static String NAME = "name";
+    }
+
+    public static class EntityTable {
+        public static String ENTITY_ID = "entityId";
+        public static String PARENT_ENTITY_ID = "parentEntityId";
+        public static String ENTITY_TYPE_ID = "entityTypeId";
+        public static String NAME = "name";
+        public static String DESCRIPTION = "description";
+        public static String FULL_TEXT = "fullText";
+    }
+
+    public static class SharingTable {
+        public static String PERMISSION_TYPE_ID = "permissionTypeId";
+        public static String ENTITY_ID = "entityId";
+        public static String GROUP_ID = "groupId";
+        public static String INHERITED_PARENT_ID = "inheritedParentId";
+        public static final String SHARING_TYPE = "sharingType";
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/DatabaseCreator.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/DatabaseCreator.java b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/DatabaseCreator.java
new file mode 100644
index 0000000..5aa423c
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/DatabaseCreator.java
@@ -0,0 +1,353 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.sharing.registry.db.utils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.sql.*;
+import java.util.StringTokenizer;
+
+/**
+ * This class creates the database tables required for airavata with default configuration this
+ * class creates derby database in server mode. User can specify required database in appropriate
+ * properties files.
+ */
+public class DatabaseCreator {
+    private final static Logger logger = LoggerFactory.getLogger(DatabaseCreator.class);
+
+    public enum DatabaseType {
+        derby("(?i).*derby.*"), mysql("(?i).*mysql.*"), other("");
+
+        private String pattern;
+
+        private DatabaseType(String matchingPattern) {
+            this.pattern = matchingPattern;
+        }
+
+        public String getMatchingPattern() {
+            return this.pattern;
+        }
+    }
+
+    private static DatabaseType[] supportedDatabase = new DatabaseType[] { DatabaseType.derby, DatabaseType.mysql };
+
+    private static Logger log = LoggerFactory.getLogger(DatabaseCreator.class);
+    private static final String delimiter = ";";
+
+    /**
+     * Creates database
+     *
+     * @throws Exception
+     */
+    public static void createRegistryDatabase(String prefix, Connection conn) throws Exception {
+        createDatabase(prefix, conn);
+    }
+
+
+
+    /**
+     * Checks whether database tables are created by using select * on given table name
+     *
+     * @param tableName
+     *            Table which should be existed
+     * @return <code>true</core> if checkSQL is success, else <code>false</code> .
+     */
+    public static boolean isDatabaseStructureCreated(String tableName, Connection conn) {
+        try {
+
+            log.debug("Running a query to test the database tables existence.");
+
+            // check whether the tables are already created with a query
+            Statement statement = null;
+            try {
+                statement = conn.createStatement();
+                ResultSet rs = statement.executeQuery("select * from " + tableName);
+                if (rs != null) {
+                    rs.close();
+                }
+            } finally {
+                try {
+                    if (statement != null) {
+                        statement.close();
+                    }
+                } catch (SQLException e) {
+                    return false;
+                }
+            }
+        } catch (SQLException e) {
+            return false;
+        }
+
+        return true;
+    }
+
+    /**
+     * executes given sql
+     *
+     * @param sql
+     * @throws Exception
+     */
+    private static void executeSQL(String sql, Connection conn) throws Exception {
+        // Check and ignore empty statements
+        if ("".equals(sql.trim())) {
+            return;
+        }
+
+        Statement statement = null;
+        try {
+            log.debug("SQL : " + sql);
+
+            boolean ret;
+            int updateCount = 0, updateCountTotal = 0;
+            statement = conn.createStatement();
+            ret = statement.execute(sql);
+            updateCount = statement.getUpdateCount();
+            do {
+                if (!ret) {
+                    if (updateCount != -1) {
+                        updateCountTotal += updateCount;
+                    }
+                }
+                ret = statement.getMoreResults();
+                if (ret) {
+                    updateCount = statement.getUpdateCount();
+                }
+            } while (ret);
+
+            log.debug(sql + " : " + updateCountTotal + " rows affected");
+
+            SQLWarning warning = conn.getWarnings();
+            while (warning != null) {
+                log.info(warning + " sql warning");
+                warning = warning.getNextWarning();
+            }
+            conn.clearWarnings();
+        } catch (SQLException e) {
+            if (e.getSQLState().equals("X0Y32")) {
+                // eliminating the table already exception for the derby
+                // database
+                log.info("Table Already Exists", e);
+            } else {
+                throw new Exception("Error occurred while executing : " + sql, e);
+            }
+        } finally {
+            if (statement != null) {
+                try {
+                    statement.close();
+                } catch (SQLException e) {
+                    log.error("Error occurred while closing result set.", e);
+                }
+            }
+        }
+    }
+
+    /**
+     * computes relatational database type using database name
+     *
+     * @return DatabaseType
+     * @throws Exception
+     *
+     */
+    public static DatabaseType getDatabaseType(Connection conn) throws Exception {
+        try {
+            if (conn != null && (!conn.isClosed())) {
+                DatabaseMetaData metaData = conn.getMetaData();
+                String databaseProductName = metaData.getDatabaseProductName();
+                return checkType(databaseProductName);
+            }
+        } catch (SQLException e) {
+            String msg = "Failed to create Airavata database." + e.getMessage();
+            log.error(msg, e);
+            throw new Exception(msg, e);
+        }
+        return DatabaseType.other;
+    }
+
+    /**
+     * Overloaded method with String input
+     *
+     * @return DatabaseType
+     * @throws Exception
+     *
+     */
+    public static DatabaseType getDatabaseType(String dbUrl) throws Exception {
+        return checkType(dbUrl);
+    }
+
+    private static DatabaseType checkType(String text) throws Exception {
+        try {
+            if (text != null) {
+                for (DatabaseType type : supportedDatabase) {
+                    if (text.matches(type.getMatchingPattern()))
+                        return type;
+                }
+            }
+            String msg = "Unsupported database: " + text
+                    + ". Database will not be created automatically by the Airavata. "
+                    + "Please create the database using appropriate database scripts for " + "the database.";
+            throw new Exception(msg);
+
+        } catch (SQLException e) {
+            String msg = "Failed to create Airavatadatabase." + e.getMessage();
+            log.error(msg, e);
+            throw new Exception(msg, e);
+        }
+    }
+
+    /**
+     * Get scripts location which is prefix + "-" + databaseType + ".sql"
+     *
+     * @param prefix
+     * @param databaseType
+     * @return script location
+     */
+    private static String getScriptLocation(String prefix, DatabaseType databaseType) {
+        String scriptName = prefix + "-" + databaseType + ".sql";
+        log.debug("Loading database script from :" + scriptName);
+        return  scriptName;
+    }
+
+    private static void createDatabase(String prefix, Connection conn) throws Exception {
+        Statement statement = null;
+        try {
+            conn.setAutoCommit(false);
+            statement = conn.createStatement();
+            executeSQLScript(getScriptLocation(prefix, DatabaseCreator.getDatabaseType(conn)), conn);
+            conn.commit();
+            log.debug("Tables are created successfully.");
+        } catch (SQLException e) {
+            String msg = "Failed to create database tables for Airavata resource store. " + e.getMessage();
+            log.error(msg, e);
+            conn.rollback();
+            throw new Exception(msg, e);
+        } finally {
+            conn.setAutoCommit(true);
+            try {
+                if (statement != null) {
+                    statement.close();
+                }
+            } catch (SQLException e) {
+                log.error("Failed to close statement.", e);
+            }
+        }
+    }
+
+    private static void executeSQLScript(String dbscriptName, Connection conn) throws Exception {
+        StringBuffer sql = new StringBuffer();
+        BufferedReader reader = null;
+
+        try {
+            InputStream is = DatabaseCreator.class.getClassLoader().getResourceAsStream(dbscriptName);
+            if(is == null) {
+                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");
+                }else if(databaseType.equals(DatabaseType.mysql)){
+                    is = DatabaseCreator.class.getClassLoader().getResourceAsStream("experiment-mysql.sql");
+                }
+            }
+            reader = new BufferedReader(new InputStreamReader(is));
+            String line;
+            while ((line = reader.readLine()) != null) {
+                line = line.trim();
+                if (line.startsWith("//")) {
+                    continue;
+                }
+                if (line.startsWith("--")) {
+                    continue;
+                }
+                StringTokenizer st = new StringTokenizer(line);
+                if (st.hasMoreTokens()) {
+                    String token = st.nextToken();
+                    if ("REM".equalsIgnoreCase(token)) {
+                        continue;
+                    }
+                }
+                sql.append(" ").append(line);
+
+                // SQL defines "--" as a comment to EOL
+                // and in Oracle it may contain a hint
+                // so we cannot just remove it, instead we must end it
+                if (line.indexOf("--") >= 0) {
+                    sql.append("\n");
+                }
+                if ((checkStringBufferEndsWith(sql, delimiter))) {
+                    executeSQL(sql.substring(0, sql.length() - delimiter.length()), conn);
+                    sql.replace(0, sql.length(), "");
+                }
+            }
+            // Catch any statements not followed by ;
+            if (sql.length() > 0) {
+                executeSQL(sql.toString(), conn);
+            }
+        } catch (IOException e) {
+            log.error("Error occurred while executing SQL script for creating Airavata database", e);
+            throw new Exception("Error occurred while executing SQL script for creating Airavata database", e);
+
+        } finally {
+            if (reader != null) {
+                reader.close();
+            }
+        }
+    }
+
+    /**
+     * Checks that a string buffer ends up with a given string. It may sound trivial with the existing JDK API but the
+     * various implementation among JDKs can make those methods extremely resource intensive and perform poorly due to
+     * massive memory allocation and copying. See
+     *
+     * @param buffer
+     *            the buffer to perform the check on
+     * @param suffix
+     *            the suffix
+     * @return <code>true</code> if the character sequence represented by the argument is a suffix of the character
+     *         sequence represented by the StringBuffer object; <code>false</code> otherwise. Note that the result will
+     *         be <code>true</code> if the argument is the empty string.
+     */
+    public static boolean checkStringBufferEndsWith(StringBuffer buffer, String suffix) {
+        if (suffix.length() > buffer.length()) {
+            return false;
+        }
+        // this loop is done on purpose to avoid memory allocation performance
+        // problems on various JDKs
+        // StringBuffer.lastIndexOf() was introduced in jdk 1.4 and
+        // implementation is ok though does allocation/copying
+        // StringBuffer.toString().endsWith() does massive memory
+        // allocation/copying on JDK 1.5
+        // See http://issues.apache.org/bugzilla/show_bug.cgi?id=37169
+        int endIndex = suffix.length() - 1;
+        int bufferIndex = buffer.length() - 1;
+        while (endIndex >= 0) {
+            if (buffer.charAt(bufferIndex) != suffix.charAt(endIndex)) {
+                return false;
+            }
+            bufferIndex--;
+            endIndex--;
+        }
+        return true;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/JPAUtils.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/JPAUtils.java b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/JPAUtils.java
new file mode 100644
index 0000000..f2f7c3a
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/JPAUtils.java
@@ -0,0 +1,230 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.sharing.registry.db.utils;
+
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.sharing.registry.models.GovRegistryException;
+import org.apache.derby.drda.NetworkServerControl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.*;
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.URI;
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.util.HashMap;
+import java.util.Map;
+
+public class JPAUtils {
+    private final static Logger logger = LoggerFactory.getLogger(JPAUtils.class);
+
+    private static final String PERSISTENCE_UNIT_NAME = "airavata-sharing-registry";
+    private static final String SHARING_REG_JDBC_DRIVER = "sharingcatalog.jdbc.driver";
+    private static final String SHARING_REG_JDBC_URL = "sharingcatalog.jdbc.url";
+    private static final String SHARING_REG_JDBC_USER = "sharingcatalog.jdbc.user";
+    private static final String SHARING_REG_JDBC_PWD = "sharingcatalog.jdbc.password";
+    private static final String SHARING_REG_VALIDATION_QUERY = "sharingcatalog.validationQuery";
+    private static final String JPA_CACHE_SIZE = "jpa.cache.size";
+    private static final String JPA_CACHE_ENABLED = "cache.enable";
+
+    public static final String CONFIGURATION = "CONFIGURATION";
+    public static final String START_DERBY_ENABLE = "start.derby.server.mode";
+    public static final String DERBY_SERVER_MODE_SYS_PROPERTY = "derby.drda.startNetworkServer";
+    private static NetworkServerControl server;
+    private static JdbcStorage db;
+    private static String jdbcURl;
+    private static String jdbcDriver;
+    private static String jdbcUser;
+    private static String jdbcPassword;
+
+
+    @PersistenceUnit(unitName = PERSISTENCE_UNIT_NAME)
+    protected static EntityManagerFactory factory;
+    @PersistenceContext(unitName = PERSISTENCE_UNIT_NAME)
+    private static EntityManager entityManager;
+
+    public static EntityManager getEntityManager() {
+        if (factory == null) {
+//            String connectionProperties = "DriverClassName=" + readServerProperties(SHARING_REG_JDBC_DRIVER) + "," +
+//                    "Url=" + readServerProperties(SHARING_REG_JDBC_URL) + "?autoReconnect=true," +
+//                    "Username=" + readServerProperties(SHARING_REG_JDBC_USER) + "," +
+//                    "Password=" + readServerProperties(SHARING_REG_JDBC_PWD) +
+//                    ",validationQuery=" + readServerProperties(SHARING_REG_VALIDATION_QUERY);
+//
+
+            String connectionProperties = "DriverClassName=com.mysql.jdbc.Driver," +
+                    "Url=jdbc:mysql://localhost:3306/airavata_sharing_catalog?autoReconnect=true," +
+                    "Username=root," +
+                    "Password=," +
+                    ",validationQuery=SELECT 1 FROM CONFIGURATION";
+
+            Map<String, String> properties = new HashMap<String, String>();
+            properties.put("openjpa.ConnectionDriverName", "org.apache.commons.dbcp.BasicDataSource");
+            properties.put("openjpa.ConnectionProperties", connectionProperties);
+            properties.put("openjpa.DynamicEnhancementAgent", "true");
+            properties.put("openjpa.RuntimeUnenhancedClasses", "unsupported");
+            // For app catalog, we don't need caching
+//            properties.put("openjpa.DataCache","" + readServerProperties(JPA_CACHE_ENABLED) + "(CacheSize=" + Integer.valueOf(readServerProperties(JPA_CACHE_SIZE)) + ", SoftReferenceSize=0)");
+//            properties.put("openjpa.QueryCache","" + readServerProperties(JPA_CACHE_ENABLED) + "(CacheSize=" + Integer.valueOf(readServerProperties(JPA_CACHE_SIZE)) + ", SoftReferenceSize=0)");
+            properties.put("openjpa.RemoteCommitProvider", "sjvm");
+            properties.put("openjpa.Log", "DefaultLevel=INFO, Runtime=INFO, Tool=INFO, SQL=INFO");
+            properties.put("openjpa.jdbc.SynchronizeMappings", "buildSchema(ForeignKeys=true)");
+            properties.put("openjpa.jdbc.QuerySQLCache", "false");
+            properties.put("openjpa.ConnectionFactoryProperties", "PrettyPrint=true, PrettyPrintLineLength=72," +
+                    " PrintParameters=true, MaxActive=10, MaxIdle=5, MinIdle=2, MaxWait=31536000,  autoReconnect=true");
+            properties.put("openjpa.RuntimeUnenhancedClasses", "warn");
+            factory = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME, properties);
+        }
+        entityManager = factory.createEntityManager();
+        return entityManager;
+    }
+
+    public static <R> R execute(Committer<EntityManager, R> committer) throws GovRegistryException {
+        EntityManager entityManager = JPAUtils.getEntityManager();
+        try {
+            entityManager.getTransaction().begin();
+            R r = committer.commit(entityManager);
+            entityManager.getTransaction().commit();
+            return  r;
+        }finally {
+            if (entityManager != null && entityManager.isOpen()) {
+                if (entityManager.getTransaction().isActive()) {
+                    entityManager.getTransaction().rollback();
+                }
+                entityManager.close();
+            }
+        }
+    }
+
+    public static void initializeDB() throws GovRegistryException {
+        jdbcDriver = readServerProperties(SHARING_REG_JDBC_DRIVER);
+        jdbcURl = readServerProperties(SHARING_REG_JDBC_URL);
+        jdbcUser = readServerProperties(SHARING_REG_JDBC_USER);
+        jdbcPassword = readServerProperties(SHARING_REG_JDBC_PWD);
+        jdbcURl = jdbcURl + "?" + "user=" + jdbcUser + "&" + "password=" + jdbcPassword;
+
+        if (getDBType(jdbcURl).equals("derby") && isDerbyStartEnabled()) {
+            startDerbyInServerMode();
+        }
+        db = new JdbcStorage(10, 50, jdbcURl, jdbcDriver, true);
+
+        Connection conn = null;
+        try {
+            conn = db.connect();
+            if (!DatabaseCreator.isDatabaseStructureCreated(CONFIGURATION, conn)) {
+                DatabaseCreator.createRegistryDatabase("database_scripts/sharing-registry", conn);
+                logger.info("New Database created for Sharing Catalog !!! ");
+            } else {
+                logger.info("Database already created for Sharing Catalog !!!");
+            }
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+            throw new RuntimeException("Database failure", e);
+        } finally {
+            db.closeConnection(conn);
+            try {
+                if(conn != null){
+                    if (!conn.getAutoCommit()) {
+                        conn.commit();
+                    }
+                    conn.close();
+                }
+            } catch (SQLException e) {
+                logger.error("Error while closing database connection...", e.getMessage(), e);
+            }
+        }
+    }
+
+    public static String getDBType(String jdbcUrl){
+        try{
+            String cleanURI = jdbcUrl.substring(5);
+            URI uri = URI.create(cleanURI);
+            return uri.getScheme();
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+            return null;
+        }
+    }
+
+    public static boolean isDerbyStartEnabled(){
+        try {
+            String s = ServerSettings.getSetting(START_DERBY_ENABLE);
+            if("true".equals(s)){
+                return true;
+            }
+        }  catch (ApplicationSettingsException e) {
+            logger.error("Unable to read airavata server properties", e.getMessage(), e);
+            return false;
+        }
+        return false;
+    }
+
+    public static void startDerbyInServerMode() {
+        try {
+            System.setProperty(DERBY_SERVER_MODE_SYS_PROPERTY, "true");
+            server = new NetworkServerControl(InetAddress.getByName("0.0.0.0"),
+                    getPort(jdbcURl),
+                    jdbcUser, jdbcPassword);
+            java.io.PrintWriter consoleWriter = new java.io.PrintWriter(System.out, true);
+            server.start(consoleWriter);
+        } catch (IOException e) {
+            logger.error("Unable to start Apache derby in the server mode! Check whether " +
+                    "specified port is available");
+        } catch (Exception e) {
+            logger.error("Unable to start Apache derby in the server mode! Check whether " +
+                    "specified port is available");
+        }
+    }
+
+    public static void stopDerbyInServerMode() {
+        System.setProperty(DERBY_SERVER_MODE_SYS_PROPERTY, "false");
+        if (server!=null){
+            try {
+                server.shutdown();
+            } catch (Exception e) {
+                logger.error("Error when stopping the derby server : "+e.getLocalizedMessage());
+            }
+        }
+    }
+
+    public static int getPort(String jdbcURL){
+        try{
+            String cleanURI = jdbcURL.substring(5);
+            URI uri = URI.create(cleanURI);
+            return uri.getPort();
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+            return -1;
+        }
+    }
+
+    private static String readServerProperties(String propertyName) throws GovRegistryException {
+        try {
+            return ServerSettings.getSetting(propertyName);
+        } catch (ApplicationSettingsException e) {
+            logger.error("Unable to read airavata-server.properties...", e);
+            throw new GovRegistryException("Unable to read airavata-server.properties...");
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/JdbcStorage.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/JdbcStorage.java b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/JdbcStorage.java
new file mode 100644
index 0000000..377c50b
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/JdbcStorage.java
@@ -0,0 +1,175 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.sharing.registry.db.utils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.sql.*;
+
+public class JdbcStorage {
+    private static Logger log = LoggerFactory.getLogger(JdbcStorage.class);
+
+    private ConnectionPool connectionPool;
+
+    public JdbcStorage(String jdbcUrl, String jdbcDriver) {
+        // default init connection and max connection
+        this(3, 50, jdbcUrl, jdbcDriver, true);
+    }
+
+    public JdbcStorage(int initCon, int maxCon, String url, String driver, boolean enableTransactions) {
+        try {
+            if (enableTransactions) {
+                connectionPool = new ConnectionPool(driver, url, initCon, maxCon, true, false,
+                        Connection.TRANSACTION_SERIALIZABLE);
+            } else {
+                connectionPool = new ConnectionPool(driver, url, initCon, maxCon, true);
+            }
+        } catch (Exception e) {
+            throw new RuntimeException("Failed to create database connection pool.", e);
+        }
+    }
+
+    /**
+     * Check if this connection pool is auto commit or not
+     *
+     * @return
+     */
+    public boolean isAutoCommit() {
+        return connectionPool.isAutoCommit();
+    }
+
+    public void commit(Connection conn) {
+        try {
+            if (conn != null && !conn.getAutoCommit()) {
+                conn.commit();
+            }
+        } catch (SQLException sqle) {
+            log.error("Cannot commit data", sqle);
+        }
+    }
+
+    public void commitAndFree(Connection conn) {
+        commit(conn);
+        closeConnection(conn);
+    }
+
+    public void rollback(Connection conn) {
+        try {
+            if (conn != null && !conn.getAutoCommit()) {
+                conn.rollback();
+            }
+        } catch (SQLException sqle) {
+            log.error("Cannot Rollback data", sqle);
+        }
+    }
+
+    public void rollbackAndFree(Connection conn) {
+        rollback(conn);
+        closeConnection(conn);
+    }
+
+    public Connection connect() {
+
+        Connection conn = null;
+        try {
+            conn = connectionPool.getConnection();
+        } catch (SQLException e) {
+            log.error(e.getMessage(), e);
+        }
+        return conn;
+    }
+
+    /**
+     * This method is provided so that you can have better control over the statement. For example: You can use
+     * stmt.setString to convert quotation mark automatically in an UPDATE statement
+     *
+     * NOTE: Statement is closed after execution
+     */
+    public int executeUpdateAndClose(PreparedStatement stmt) throws SQLException {
+        int rows = 0;
+        try {
+            rows = stmt.executeUpdate();
+            if (rows == 0) {
+                log.info("Problem: 0 rows affected by insert/update/delete statement.");
+            }
+        } finally {
+            stmt.close();
+        }
+        return rows;
+    }
+
+    public int countRow(String tableName, String columnName) throws SQLException {
+        String query = new String("SELECT COUNT(" + columnName + ") FROM " + tableName);
+        int count = -1;
+        Connection conn = null;
+        PreparedStatement stmt = null;
+        try {
+            conn = connectionPool.getConnection();
+            stmt = conn.prepareStatement(query);
+            ResultSet rs = stmt.executeQuery();
+            rs.next();
+            count = rs.getInt(1);
+            commit(conn);
+        } catch (SQLException sql) {
+            rollback(conn);
+            throw sql;
+        } finally {
+            try {
+                if (stmt != null && !stmt.isClosed()) {
+                    stmt.close();
+                }
+            } finally {
+                closeConnection(conn);
+            }
+        }
+        return count;
+    }
+
+    public void quietlyClose(Connection conn, Statement... stmts) {
+        if (stmts != null) {
+            for (Statement stmt : stmts) {
+                try {
+                    if (stmt != null && !stmt.isClosed()) {
+                        stmt.close();
+                    }
+                } catch (SQLException sql) {
+                    log.error(sql.getMessage(), sql);
+                }
+            }
+        }
+        closeConnection(conn);
+    }
+
+    public void closeConnection(Connection conn) {
+        if (conn != null) {
+            connectionPool.free(conn);
+        }
+    }
+
+    public void closeAllConnections() {
+        if (connectionPool != null)
+            connectionPool.dispose();
+    }
+
+    public void shutdown() throws SQLException {
+        connectionPool.shutdown();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/ObjectMapperSingleton.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/ObjectMapperSingleton.java b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/ObjectMapperSingleton.java
new file mode 100644
index 0000000..de6bea9
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/db/utils/ObjectMapperSingleton.java
@@ -0,0 +1,39 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.sharing.registry.db.utils;
+
+import org.dozer.DozerBeanMapper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ObjectMapperSingleton extends DozerBeanMapper{
+    private final static Logger logger = LoggerFactory.getLogger(ObjectMapperSingleton.class);
+
+    private static ObjectMapperSingleton instance;
+
+    private ObjectMapperSingleton(){}
+
+    public static ObjectMapperSingleton getInstance(){
+        if(instance == null)
+            instance = new ObjectMapperSingleton();
+        return instance;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/server/SharingRegistryServer.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/server/SharingRegistryServer.java b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/server/SharingRegistryServer.java
new file mode 100644
index 0000000..96fdb90
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-core/src/main/java/org/apache/airavata/sharing/registry/server/SharingRegistryServer.java
@@ -0,0 +1,28 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.sharing.registry.server;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class SharingRegistryServer {
+    private final static Logger logger = LoggerFactory.getLogger(SharingRegistryServer.class);
+}
\ No newline at end of file


[10/17] airavata git commit: renaming directory names

Posted by sc...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/service/cpi/GovRegistryService.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/service/cpi/GovRegistryService.java b/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/service/cpi/GovRegistryService.java
deleted file mode 100644
index efcbab5..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/service/cpi/GovRegistryService.java
+++ /dev/null
@@ -1,42708 +0,0 @@
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- *  @generated
- */
-package org.apache.airavata.sharing.registry.service.cpi;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-05")
-public class GovRegistryService {
-
-  public interface Iface {
-
-    /**
-     *  * Domain Operations
-     * *
-     * 
-     * @param domain
-     */
-    public String createDomain(org.apache.airavata.sharing.registry.models.Domain domain) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-    public boolean updateDomain(org.apache.airavata.sharing.registry.models.Domain domain) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-    public boolean deleteDomain(String domainId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-    public org.apache.airavata.sharing.registry.models.Domain getDomain(String domainId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-    public List<org.apache.airavata.sharing.registry.models.Domain> getDomains(int offset, int limit) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-    /**
-     *  * User Operations
-     * *
-     * 
-     * @param user
-     */
-    public String createUser(org.apache.airavata.sharing.registry.models.User user) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-    public boolean updatedUser(org.apache.airavata.sharing.registry.models.User user) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-    public boolean deleteUser(String userId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-    public org.apache.airavata.sharing.registry.models.User getUser(String userId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-    public List<org.apache.airavata.sharing.registry.models.User> getUsers(String domain, int offset, int limit) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-    /**
-     *  * Group Operations
-     * *
-     * 
-     * @param group
-     */
-    public String createGroup(org.apache.airavata.sharing.registry.models.UserGroup group) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-    public boolean updateGroup(org.apache.airavata.sharing.registry.models.UserGroup group) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-    public boolean deleteGroup(String groupId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-    public org.apache.airavata.sharing.registry.models.UserGroup getGroup(String groupId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-    public List<org.apache.airavata.sharing.registry.models.UserGroup> getGroups(String domain, int offset, int limit) throws org.apache.thrift.TException;
-
-    public boolean addUsersToGroup(List<String> userIds, String groupId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-    public boolean removeUsersFromGroup(List<String> userIds, String groupId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-    public Map<String,org.apache.airavata.sharing.registry.models.GroupChildType> getGroupMembers(String groupId, int offset, int limit) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-    public boolean addChildGroupToParentGroup(String childId, String groupId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-    public boolean removeChildGroupFromParentGroup(String childId, String groupId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-    /**
-     *  * EntityType Operations
-     * *
-     * 
-     * @param entityType
-     */
-    public String createEntityType(org.apache.airavata.sharing.registry.models.EntityType entityType) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-    public boolean updateEntityType(org.apache.airavata.sharing.registry.models.EntityType entityType) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-    public boolean deleteEntityType(String entityTypeId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-    public org.apache.airavata.sharing.registry.models.EntityType getEntityType(String entityTypeId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-    public List<org.apache.airavata.sharing.registry.models.EntityType> getEntityTypes(String domain, int offset, int limit) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-    /**
-     *  * Entity Operations
-     * *
-     * 
-     * @param entity
-     */
-    public String createEntity(org.apache.airavata.sharing.registry.models.Entity entity) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-    public boolean updateEntity(org.apache.airavata.sharing.registry.models.Entity entity) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-    public boolean deleteEntity(String entityId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-    public org.apache.airavata.sharing.registry.models.Entity getEntity(String entityId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-    public List<org.apache.airavata.sharing.registry.models.Entity> searchEntities(String userId, String entityTypeId, Map<org.apache.airavata.sharing.registry.models.EntitySearchFields,String> filters, int offset, int limit) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-    /**
-     *  * Permission Operations
-     * *
-     * 
-     * @param permissionType
-     */
-    public String createPermissionType(org.apache.airavata.sharing.registry.models.PermissionType permissionType) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-    public boolean updatePermissionType(org.apache.airavata.sharing.registry.models.PermissionType permissionType) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-    public boolean deletePermissionType(String entityTypeId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-    public org.apache.airavata.sharing.registry.models.PermissionType getPermissionType(String permissionTypeId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-    public List<org.apache.airavata.sharing.registry.models.PermissionType> getPermissionTypes(String domain, int offset, int limit) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-    /**
-     *  * Sharing Entity with Users and Groups
-     * *
-     * 
-     * @param entityId
-     * @param userList
-     * @param perssionTypeId
-     */
-    public boolean shareEntityWithUsers(String entityId, List<String> userList, String perssionTypeId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-    public boolean revokeEntitySharingFromUsers(String entityId, List<String> userList, String perssionTypeId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-    public boolean shareEntityWithGroups(String entityId, List<String> groupList, String perssionTypeId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-    public boolean revokeEntitySharingFromGroups(String entityId, List<String> groupList, String perssionTypeId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-    public boolean userHasAccess(String domainId, String userId, String entityId, String permissionTypeId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException;
-
-  }
-
-  public interface AsyncIface {
-
-    public void createDomain(org.apache.airavata.sharing.registry.models.Domain domain, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void updateDomain(org.apache.airavata.sharing.registry.models.Domain domain, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void deleteDomain(String domainId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void getDomain(String domainId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void getDomains(int offset, int limit, 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;
-
-    public void deleteUser(String userId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void getUser(String userId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void getUsers(String domain, int offset, int limit, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void createGroup(org.apache.airavata.sharing.registry.models.UserGroup group, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void updateGroup(org.apache.airavata.sharing.registry.models.UserGroup group, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void deleteGroup(String groupId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void getGroup(String groupId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void getGroups(String domain, int offset, int limit, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void addUsersToGroup(List<String> userIds, String groupId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void removeUsersFromGroup(List<String> userIds, String groupId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void getGroupMembers(String groupId, int offset, int limit, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void addChildGroupToParentGroup(String childId, String groupId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void removeChildGroupFromParentGroup(String childId, String groupId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void createEntityType(org.apache.airavata.sharing.registry.models.EntityType entityType, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void updateEntityType(org.apache.airavata.sharing.registry.models.EntityType entityType, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void deleteEntityType(String entityTypeId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void getEntityType(String entityTypeId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void getEntityTypes(String domain, int offset, int limit, 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;
-
-    public void deleteEntity(String entityId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void getEntity(String entityId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void searchEntities(String userId, String entityTypeId, Map<org.apache.airavata.sharing.registry.models.EntitySearchFields,String> filters, int offset, int limit, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void createPermissionType(org.apache.airavata.sharing.registry.models.PermissionType permissionType, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void updatePermissionType(org.apache.airavata.sharing.registry.models.PermissionType permissionType, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void deletePermissionType(String entityTypeId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void getPermissionType(String permissionTypeId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void getPermissionTypes(String domain, int offset, int limit, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void shareEntityWithUsers(String entityId, List<String> userList, String perssionTypeId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void revokeEntitySharingFromUsers(String entityId, List<String> userList, String perssionTypeId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void shareEntityWithGroups(String entityId, List<String> groupList, String perssionTypeId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void revokeEntitySharingFromGroups(String entityId, List<String> groupList, String perssionTypeId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-    public void userHasAccess(String domainId, String userId, String entityId, String permissionTypeId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
-  }
-
-  public static class Client extends org.apache.thrift.TServiceClient implements Iface {
-    public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
-      public Factory() {}
-      public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
-        return new Client(prot);
-      }
-      public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
-        return new Client(iprot, oprot);
-      }
-    }
-
-    public Client(org.apache.thrift.protocol.TProtocol prot)
-    {
-      super(prot, prot);
-    }
-
-    public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
-      super(iprot, oprot);
-    }
-
-    public String createDomain(org.apache.airavata.sharing.registry.models.Domain domain) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      send_createDomain(domain);
-      return recv_createDomain();
-    }
-
-    public void send_createDomain(org.apache.airavata.sharing.registry.models.Domain domain) throws org.apache.thrift.TException
-    {
-      createDomain_args args = new createDomain_args();
-      args.setDomain(domain);
-      sendBase("createDomain", args);
-    }
-
-    public String recv_createDomain() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      createDomain_result result = new createDomain_result();
-      receiveBase(result, "createDomain");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createDomain failed: unknown result");
-    }
-
-    public boolean updateDomain(org.apache.airavata.sharing.registry.models.Domain domain) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      send_updateDomain(domain);
-      return recv_updateDomain();
-    }
-
-    public void send_updateDomain(org.apache.airavata.sharing.registry.models.Domain domain) throws org.apache.thrift.TException
-    {
-      updateDomain_args args = new updateDomain_args();
-      args.setDomain(domain);
-      sendBase("updateDomain", args);
-    }
-
-    public boolean recv_updateDomain() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      updateDomain_result result = new updateDomain_result();
-      receiveBase(result, "updateDomain");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "updateDomain failed: unknown result");
-    }
-
-    public boolean deleteDomain(String domainId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      send_deleteDomain(domainId);
-      return recv_deleteDomain();
-    }
-
-    public void send_deleteDomain(String domainId) throws org.apache.thrift.TException
-    {
-      deleteDomain_args args = new deleteDomain_args();
-      args.setDomainId(domainId);
-      sendBase("deleteDomain", args);
-    }
-
-    public boolean recv_deleteDomain() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      deleteDomain_result result = new deleteDomain_result();
-      receiveBase(result, "deleteDomain");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deleteDomain failed: unknown result");
-    }
-
-    public org.apache.airavata.sharing.registry.models.Domain getDomain(String domainId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      send_getDomain(domainId);
-      return recv_getDomain();
-    }
-
-    public void send_getDomain(String domainId) throws org.apache.thrift.TException
-    {
-      getDomain_args args = new getDomain_args();
-      args.setDomainId(domainId);
-      sendBase("getDomain", args);
-    }
-
-    public org.apache.airavata.sharing.registry.models.Domain recv_getDomain() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      getDomain_result result = new getDomain_result();
-      receiveBase(result, "getDomain");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getDomain failed: unknown result");
-    }
-
-    public List<org.apache.airavata.sharing.registry.models.Domain> getDomains(int offset, int limit) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      send_getDomains(offset, limit);
-      return recv_getDomains();
-    }
-
-    public void send_getDomains(int offset, int limit) throws org.apache.thrift.TException
-    {
-      getDomains_args args = new getDomains_args();
-      args.setOffset(offset);
-      args.setLimit(limit);
-      sendBase("getDomains", args);
-    }
-
-    public List<org.apache.airavata.sharing.registry.models.Domain> recv_getDomains() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      getDomains_result result = new getDomains_result();
-      receiveBase(result, "getDomains");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getDomains failed: unknown result");
-    }
-
-    public String createUser(org.apache.airavata.sharing.registry.models.User user) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      send_createUser(user);
-      return recv_createUser();
-    }
-
-    public void send_createUser(org.apache.airavata.sharing.registry.models.User user) throws org.apache.thrift.TException
-    {
-      createUser_args args = new createUser_args();
-      args.setUser(user);
-      sendBase("createUser", args);
-    }
-
-    public String recv_createUser() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      createUser_result result = new createUser_result();
-      receiveBase(result, "createUser");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      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.GovRegistryException, org.apache.thrift.TException
-    {
-      send_updatedUser(user);
-      return recv_updatedUser();
-    }
-
-    public void send_updatedUser(org.apache.airavata.sharing.registry.models.User user) throws org.apache.thrift.TException
-    {
-      updatedUser_args args = new updatedUser_args();
-      args.setUser(user);
-      sendBase("updatedUser", args);
-    }
-
-    public boolean recv_updatedUser() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      updatedUser_result result = new updatedUser_result();
-      receiveBase(result, "updatedUser");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "updatedUser failed: unknown result");
-    }
-
-    public boolean deleteUser(String userId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      send_deleteUser(userId);
-      return recv_deleteUser();
-    }
-
-    public void send_deleteUser(String userId) throws org.apache.thrift.TException
-    {
-      deleteUser_args args = new deleteUser_args();
-      args.setUserId(userId);
-      sendBase("deleteUser", args);
-    }
-
-    public boolean recv_deleteUser() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      deleteUser_result result = new deleteUser_result();
-      receiveBase(result, "deleteUser");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deleteUser failed: unknown result");
-    }
-
-    public org.apache.airavata.sharing.registry.models.User getUser(String userId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      send_getUser(userId);
-      return recv_getUser();
-    }
-
-    public void send_getUser(String userId) throws org.apache.thrift.TException
-    {
-      getUser_args args = new getUser_args();
-      args.setUserId(userId);
-      sendBase("getUser", args);
-    }
-
-    public org.apache.airavata.sharing.registry.models.User recv_getUser() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      getUser_result result = new getUser_result();
-      receiveBase(result, "getUser");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getUser failed: unknown result");
-    }
-
-    public List<org.apache.airavata.sharing.registry.models.User> getUsers(String domain, int offset, int limit) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      send_getUsers(domain, offset, limit);
-      return recv_getUsers();
-    }
-
-    public void send_getUsers(String domain, int offset, int limit) throws org.apache.thrift.TException
-    {
-      getUsers_args args = new getUsers_args();
-      args.setDomain(domain);
-      args.setOffset(offset);
-      args.setLimit(limit);
-      sendBase("getUsers", args);
-    }
-
-    public List<org.apache.airavata.sharing.registry.models.User> recv_getUsers() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      getUsers_result result = new getUsers_result();
-      receiveBase(result, "getUsers");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getUsers failed: unknown result");
-    }
-
-    public String createGroup(org.apache.airavata.sharing.registry.models.UserGroup group) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      send_createGroup(group);
-      return recv_createGroup();
-    }
-
-    public void send_createGroup(org.apache.airavata.sharing.registry.models.UserGroup group) throws org.apache.thrift.TException
-    {
-      createGroup_args args = new createGroup_args();
-      args.setGroup(group);
-      sendBase("createGroup", args);
-    }
-
-    public String recv_createGroup() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      createGroup_result result = new createGroup_result();
-      receiveBase(result, "createGroup");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createGroup failed: unknown result");
-    }
-
-    public boolean updateGroup(org.apache.airavata.sharing.registry.models.UserGroup group) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      send_updateGroup(group);
-      return recv_updateGroup();
-    }
-
-    public void send_updateGroup(org.apache.airavata.sharing.registry.models.UserGroup group) throws org.apache.thrift.TException
-    {
-      updateGroup_args args = new updateGroup_args();
-      args.setGroup(group);
-      sendBase("updateGroup", args);
-    }
-
-    public boolean recv_updateGroup() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      updateGroup_result result = new updateGroup_result();
-      receiveBase(result, "updateGroup");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "updateGroup failed: unknown result");
-    }
-
-    public boolean deleteGroup(String groupId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      send_deleteGroup(groupId);
-      return recv_deleteGroup();
-    }
-
-    public void send_deleteGroup(String groupId) throws org.apache.thrift.TException
-    {
-      deleteGroup_args args = new deleteGroup_args();
-      args.setGroupId(groupId);
-      sendBase("deleteGroup", args);
-    }
-
-    public boolean recv_deleteGroup() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      deleteGroup_result result = new deleteGroup_result();
-      receiveBase(result, "deleteGroup");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deleteGroup failed: unknown result");
-    }
-
-    public org.apache.airavata.sharing.registry.models.UserGroup getGroup(String groupId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      send_getGroup(groupId);
-      return recv_getGroup();
-    }
-
-    public void send_getGroup(String groupId) throws org.apache.thrift.TException
-    {
-      getGroup_args args = new getGroup_args();
-      args.setGroupId(groupId);
-      sendBase("getGroup", args);
-    }
-
-    public org.apache.airavata.sharing.registry.models.UserGroup recv_getGroup() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      getGroup_result result = new getGroup_result();
-      receiveBase(result, "getGroup");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getGroup failed: unknown result");
-    }
-
-    public List<org.apache.airavata.sharing.registry.models.UserGroup> getGroups(String domain, int offset, int limit) throws org.apache.thrift.TException
-    {
-      send_getGroups(domain, offset, limit);
-      return recv_getGroups();
-    }
-
-    public void send_getGroups(String domain, int offset, int limit) throws org.apache.thrift.TException
-    {
-      getGroups_args args = new getGroups_args();
-      args.setDomain(domain);
-      args.setOffset(offset);
-      args.setLimit(limit);
-      sendBase("getGroups", args);
-    }
-
-    public List<org.apache.airavata.sharing.registry.models.UserGroup> recv_getGroups() throws org.apache.thrift.TException
-    {
-      getGroups_result result = new getGroups_result();
-      receiveBase(result, "getGroups");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getGroups failed: unknown result");
-    }
-
-    public boolean addUsersToGroup(List<String> userIds, String groupId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      send_addUsersToGroup(userIds, groupId);
-      return recv_addUsersToGroup();
-    }
-
-    public void send_addUsersToGroup(List<String> userIds, String groupId) throws org.apache.thrift.TException
-    {
-      addUsersToGroup_args args = new addUsersToGroup_args();
-      args.setUserIds(userIds);
-      args.setGroupId(groupId);
-      sendBase("addUsersToGroup", args);
-    }
-
-    public boolean recv_addUsersToGroup() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      addUsersToGroup_result result = new addUsersToGroup_result();
-      receiveBase(result, "addUsersToGroup");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "addUsersToGroup failed: unknown result");
-    }
-
-    public boolean removeUsersFromGroup(List<String> userIds, String groupId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      send_removeUsersFromGroup(userIds, groupId);
-      return recv_removeUsersFromGroup();
-    }
-
-    public void send_removeUsersFromGroup(List<String> userIds, String groupId) throws org.apache.thrift.TException
-    {
-      removeUsersFromGroup_args args = new removeUsersFromGroup_args();
-      args.setUserIds(userIds);
-      args.setGroupId(groupId);
-      sendBase("removeUsersFromGroup", args);
-    }
-
-    public boolean recv_removeUsersFromGroup() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      removeUsersFromGroup_result result = new removeUsersFromGroup_result();
-      receiveBase(result, "removeUsersFromGroup");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "removeUsersFromGroup failed: unknown result");
-    }
-
-    public Map<String,org.apache.airavata.sharing.registry.models.GroupChildType> getGroupMembers(String groupId, int offset, int limit) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      send_getGroupMembers(groupId, offset, limit);
-      return recv_getGroupMembers();
-    }
-
-    public void send_getGroupMembers(String groupId, int offset, int limit) throws org.apache.thrift.TException
-    {
-      getGroupMembers_args args = new getGroupMembers_args();
-      args.setGroupId(groupId);
-      args.setOffset(offset);
-      args.setLimit(limit);
-      sendBase("getGroupMembers", args);
-    }
-
-    public Map<String,org.apache.airavata.sharing.registry.models.GroupChildType> recv_getGroupMembers() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      getGroupMembers_result result = new getGroupMembers_result();
-      receiveBase(result, "getGroupMembers");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getGroupMembers failed: unknown result");
-    }
-
-    public boolean addChildGroupToParentGroup(String childId, String groupId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      send_addChildGroupToParentGroup(childId, groupId);
-      return recv_addChildGroupToParentGroup();
-    }
-
-    public void send_addChildGroupToParentGroup(String childId, String groupId) throws org.apache.thrift.TException
-    {
-      addChildGroupToParentGroup_args args = new addChildGroupToParentGroup_args();
-      args.setChildId(childId);
-      args.setGroupId(groupId);
-      sendBase("addChildGroupToParentGroup", args);
-    }
-
-    public boolean recv_addChildGroupToParentGroup() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      addChildGroupToParentGroup_result result = new addChildGroupToParentGroup_result();
-      receiveBase(result, "addChildGroupToParentGroup");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "addChildGroupToParentGroup failed: unknown result");
-    }
-
-    public boolean removeChildGroupFromParentGroup(String childId, String groupId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      send_removeChildGroupFromParentGroup(childId, groupId);
-      return recv_removeChildGroupFromParentGroup();
-    }
-
-    public void send_removeChildGroupFromParentGroup(String childId, String groupId) throws org.apache.thrift.TException
-    {
-      removeChildGroupFromParentGroup_args args = new removeChildGroupFromParentGroup_args();
-      args.setChildId(childId);
-      args.setGroupId(groupId);
-      sendBase("removeChildGroupFromParentGroup", args);
-    }
-
-    public boolean recv_removeChildGroupFromParentGroup() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      removeChildGroupFromParentGroup_result result = new removeChildGroupFromParentGroup_result();
-      receiveBase(result, "removeChildGroupFromParentGroup");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "removeChildGroupFromParentGroup failed: unknown result");
-    }
-
-    public String createEntityType(org.apache.airavata.sharing.registry.models.EntityType entityType) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      send_createEntityType(entityType);
-      return recv_createEntityType();
-    }
-
-    public void send_createEntityType(org.apache.airavata.sharing.registry.models.EntityType entityType) throws org.apache.thrift.TException
-    {
-      createEntityType_args args = new createEntityType_args();
-      args.setEntityType(entityType);
-      sendBase("createEntityType", args);
-    }
-
-    public String recv_createEntityType() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      createEntityType_result result = new createEntityType_result();
-      receiveBase(result, "createEntityType");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createEntityType failed: unknown result");
-    }
-
-    public boolean updateEntityType(org.apache.airavata.sharing.registry.models.EntityType entityType) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      send_updateEntityType(entityType);
-      return recv_updateEntityType();
-    }
-
-    public void send_updateEntityType(org.apache.airavata.sharing.registry.models.EntityType entityType) throws org.apache.thrift.TException
-    {
-      updateEntityType_args args = new updateEntityType_args();
-      args.setEntityType(entityType);
-      sendBase("updateEntityType", args);
-    }
-
-    public boolean recv_updateEntityType() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      updateEntityType_result result = new updateEntityType_result();
-      receiveBase(result, "updateEntityType");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "updateEntityType failed: unknown result");
-    }
-
-    public boolean deleteEntityType(String entityTypeId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      send_deleteEntityType(entityTypeId);
-      return recv_deleteEntityType();
-    }
-
-    public void send_deleteEntityType(String entityTypeId) throws org.apache.thrift.TException
-    {
-      deleteEntityType_args args = new deleteEntityType_args();
-      args.setEntityTypeId(entityTypeId);
-      sendBase("deleteEntityType", args);
-    }
-
-    public boolean recv_deleteEntityType() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      deleteEntityType_result result = new deleteEntityType_result();
-      receiveBase(result, "deleteEntityType");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deleteEntityType failed: unknown result");
-    }
-
-    public org.apache.airavata.sharing.registry.models.EntityType getEntityType(String entityTypeId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      send_getEntityType(entityTypeId);
-      return recv_getEntityType();
-    }
-
-    public void send_getEntityType(String entityTypeId) throws org.apache.thrift.TException
-    {
-      getEntityType_args args = new getEntityType_args();
-      args.setEntityTypeId(entityTypeId);
-      sendBase("getEntityType", args);
-    }
-
-    public org.apache.airavata.sharing.registry.models.EntityType recv_getEntityType() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      getEntityType_result result = new getEntityType_result();
-      receiveBase(result, "getEntityType");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getEntityType failed: unknown result");
-    }
-
-    public List<org.apache.airavata.sharing.registry.models.EntityType> getEntityTypes(String domain, int offset, int limit) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      send_getEntityTypes(domain, offset, limit);
-      return recv_getEntityTypes();
-    }
-
-    public void send_getEntityTypes(String domain, int offset, int limit) throws org.apache.thrift.TException
-    {
-      getEntityTypes_args args = new getEntityTypes_args();
-      args.setDomain(domain);
-      args.setOffset(offset);
-      args.setLimit(limit);
-      sendBase("getEntityTypes", args);
-    }
-
-    public List<org.apache.airavata.sharing.registry.models.EntityType> recv_getEntityTypes() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      getEntityTypes_result result = new getEntityTypes_result();
-      receiveBase(result, "getEntityTypes");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getEntityTypes failed: unknown result");
-    }
-
-    public String createEntity(org.apache.airavata.sharing.registry.models.Entity entity) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      send_createEntity(entity);
-      return recv_createEntity();
-    }
-
-    public void send_createEntity(org.apache.airavata.sharing.registry.models.Entity entity) throws org.apache.thrift.TException
-    {
-      createEntity_args args = new createEntity_args();
-      args.setEntity(entity);
-      sendBase("createEntity", args);
-    }
-
-    public String recv_createEntity() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      createEntity_result result = new createEntity_result();
-      receiveBase(result, "createEntity");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      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.GovRegistryException, org.apache.thrift.TException
-    {
-      send_updateEntity(entity);
-      return recv_updateEntity();
-    }
-
-    public void send_updateEntity(org.apache.airavata.sharing.registry.models.Entity entity) throws org.apache.thrift.TException
-    {
-      updateEntity_args args = new updateEntity_args();
-      args.setEntity(entity);
-      sendBase("updateEntity", args);
-    }
-
-    public boolean recv_updateEntity() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      updateEntity_result result = new updateEntity_result();
-      receiveBase(result, "updateEntity");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "updateEntity failed: unknown result");
-    }
-
-    public boolean deleteEntity(String entityId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      send_deleteEntity(entityId);
-      return recv_deleteEntity();
-    }
-
-    public void send_deleteEntity(String entityId) throws org.apache.thrift.TException
-    {
-      deleteEntity_args args = new deleteEntity_args();
-      args.setEntityId(entityId);
-      sendBase("deleteEntity", args);
-    }
-
-    public boolean recv_deleteEntity() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      deleteEntity_result result = new deleteEntity_result();
-      receiveBase(result, "deleteEntity");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deleteEntity failed: unknown result");
-    }
-
-    public org.apache.airavata.sharing.registry.models.Entity getEntity(String entityId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      send_getEntity(entityId);
-      return recv_getEntity();
-    }
-
-    public void send_getEntity(String entityId) throws org.apache.thrift.TException
-    {
-      getEntity_args args = new getEntity_args();
-      args.setEntityId(entityId);
-      sendBase("getEntity", args);
-    }
-
-    public org.apache.airavata.sharing.registry.models.Entity recv_getEntity() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      getEntity_result result = new getEntity_result();
-      receiveBase(result, "getEntity");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getEntity failed: unknown result");
-    }
-
-    public List<org.apache.airavata.sharing.registry.models.Entity> searchEntities(String userId, String entityTypeId, Map<org.apache.airavata.sharing.registry.models.EntitySearchFields,String> filters, int offset, int limit) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      send_searchEntities(userId, entityTypeId, filters, offset, limit);
-      return recv_searchEntities();
-    }
-
-    public void send_searchEntities(String userId, String entityTypeId, Map<org.apache.airavata.sharing.registry.models.EntitySearchFields,String> filters, int offset, int limit) throws org.apache.thrift.TException
-    {
-      searchEntities_args args = new searchEntities_args();
-      args.setUserId(userId);
-      args.setEntityTypeId(entityTypeId);
-      args.setFilters(filters);
-      args.setOffset(offset);
-      args.setLimit(limit);
-      sendBase("searchEntities", args);
-    }
-
-    public List<org.apache.airavata.sharing.registry.models.Entity> recv_searchEntities() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      searchEntities_result result = new searchEntities_result();
-      receiveBase(result, "searchEntities");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "searchEntities failed: unknown result");
-    }
-
-    public String createPermissionType(org.apache.airavata.sharing.registry.models.PermissionType permissionType) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      send_createPermissionType(permissionType);
-      return recv_createPermissionType();
-    }
-
-    public void send_createPermissionType(org.apache.airavata.sharing.registry.models.PermissionType permissionType) throws org.apache.thrift.TException
-    {
-      createPermissionType_args args = new createPermissionType_args();
-      args.setPermissionType(permissionType);
-      sendBase("createPermissionType", args);
-    }
-
-    public String recv_createPermissionType() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      createPermissionType_result result = new createPermissionType_result();
-      receiveBase(result, "createPermissionType");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createPermissionType failed: unknown result");
-    }
-
-    public boolean updatePermissionType(org.apache.airavata.sharing.registry.models.PermissionType permissionType) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      send_updatePermissionType(permissionType);
-      return recv_updatePermissionType();
-    }
-
-    public void send_updatePermissionType(org.apache.airavata.sharing.registry.models.PermissionType permissionType) throws org.apache.thrift.TException
-    {
-      updatePermissionType_args args = new updatePermissionType_args();
-      args.setPermissionType(permissionType);
-      sendBase("updatePermissionType", args);
-    }
-
-    public boolean recv_updatePermissionType() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      updatePermissionType_result result = new updatePermissionType_result();
-      receiveBase(result, "updatePermissionType");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "updatePermissionType failed: unknown result");
-    }
-
-    public boolean deletePermissionType(String entityTypeId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      send_deletePermissionType(entityTypeId);
-      return recv_deletePermissionType();
-    }
-
-    public void send_deletePermissionType(String entityTypeId) throws org.apache.thrift.TException
-    {
-      deletePermissionType_args args = new deletePermissionType_args();
-      args.setEntityTypeId(entityTypeId);
-      sendBase("deletePermissionType", args);
-    }
-
-    public boolean recv_deletePermissionType() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      deletePermissionType_result result = new deletePermissionType_result();
-      receiveBase(result, "deletePermissionType");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deletePermissionType failed: unknown result");
-    }
-
-    public org.apache.airavata.sharing.registry.models.PermissionType getPermissionType(String permissionTypeId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      send_getPermissionType(permissionTypeId);
-      return recv_getPermissionType();
-    }
-
-    public void send_getPermissionType(String permissionTypeId) throws org.apache.thrift.TException
-    {
-      getPermissionType_args args = new getPermissionType_args();
-      args.setPermissionTypeId(permissionTypeId);
-      sendBase("getPermissionType", args);
-    }
-
-    public org.apache.airavata.sharing.registry.models.PermissionType recv_getPermissionType() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      getPermissionType_result result = new getPermissionType_result();
-      receiveBase(result, "getPermissionType");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPermissionType failed: unknown result");
-    }
-
-    public List<org.apache.airavata.sharing.registry.models.PermissionType> getPermissionTypes(String domain, int offset, int limit) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      send_getPermissionTypes(domain, offset, limit);
-      return recv_getPermissionTypes();
-    }
-
-    public void send_getPermissionTypes(String domain, int offset, int limit) throws org.apache.thrift.TException
-    {
-      getPermissionTypes_args args = new getPermissionTypes_args();
-      args.setDomain(domain);
-      args.setOffset(offset);
-      args.setLimit(limit);
-      sendBase("getPermissionTypes", args);
-    }
-
-    public List<org.apache.airavata.sharing.registry.models.PermissionType> recv_getPermissionTypes() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      getPermissionTypes_result result = new getPermissionTypes_result();
-      receiveBase(result, "getPermissionTypes");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPermissionTypes failed: unknown result");
-    }
-
-    public boolean shareEntityWithUsers(String entityId, List<String> userList, String perssionTypeId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      send_shareEntityWithUsers(entityId, userList, perssionTypeId);
-      return recv_shareEntityWithUsers();
-    }
-
-    public void send_shareEntityWithUsers(String entityId, List<String> userList, String perssionTypeId) throws org.apache.thrift.TException
-    {
-      shareEntityWithUsers_args args = new shareEntityWithUsers_args();
-      args.setEntityId(entityId);
-      args.setUserList(userList);
-      args.setPerssionTypeId(perssionTypeId);
-      sendBase("shareEntityWithUsers", args);
-    }
-
-    public boolean recv_shareEntityWithUsers() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      shareEntityWithUsers_result result = new shareEntityWithUsers_result();
-      receiveBase(result, "shareEntityWithUsers");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "shareEntityWithUsers failed: unknown result");
-    }
-
-    public boolean revokeEntitySharingFromUsers(String entityId, List<String> userList, String perssionTypeId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      send_revokeEntitySharingFromUsers(entityId, userList, perssionTypeId);
-      return recv_revokeEntitySharingFromUsers();
-    }
-
-    public void send_revokeEntitySharingFromUsers(String entityId, List<String> userList, String perssionTypeId) throws org.apache.thrift.TException
-    {
-      revokeEntitySharingFromUsers_args args = new revokeEntitySharingFromUsers_args();
-      args.setEntityId(entityId);
-      args.setUserList(userList);
-      args.setPerssionTypeId(perssionTypeId);
-      sendBase("revokeEntitySharingFromUsers", args);
-    }
-
-    public boolean recv_revokeEntitySharingFromUsers() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      revokeEntitySharingFromUsers_result result = new revokeEntitySharingFromUsers_result();
-      receiveBase(result, "revokeEntitySharingFromUsers");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "revokeEntitySharingFromUsers failed: unknown result");
-    }
-
-    public boolean shareEntityWithGroups(String entityId, List<String> groupList, String perssionTypeId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      send_shareEntityWithGroups(entityId, groupList, perssionTypeId);
-      return recv_shareEntityWithGroups();
-    }
-
-    public void send_shareEntityWithGroups(String entityId, List<String> groupList, String perssionTypeId) throws org.apache.thrift.TException
-    {
-      shareEntityWithGroups_args args = new shareEntityWithGroups_args();
-      args.setEntityId(entityId);
-      args.setGroupList(groupList);
-      args.setPerssionTypeId(perssionTypeId);
-      sendBase("shareEntityWithGroups", args);
-    }
-
-    public boolean recv_shareEntityWithGroups() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      shareEntityWithGroups_result result = new shareEntityWithGroups_result();
-      receiveBase(result, "shareEntityWithGroups");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "shareEntityWithGroups failed: unknown result");
-    }
-
-    public boolean revokeEntitySharingFromGroups(String entityId, List<String> groupList, String perssionTypeId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      send_revokeEntitySharingFromGroups(entityId, groupList, perssionTypeId);
-      return recv_revokeEntitySharingFromGroups();
-    }
-
-    public void send_revokeEntitySharingFromGroups(String entityId, List<String> groupList, String perssionTypeId) throws org.apache.thrift.TException
-    {
-      revokeEntitySharingFromGroups_args args = new revokeEntitySharingFromGroups_args();
-      args.setEntityId(entityId);
-      args.setGroupList(groupList);
-      args.setPerssionTypeId(perssionTypeId);
-      sendBase("revokeEntitySharingFromGroups", args);
-    }
-
-    public boolean recv_revokeEntitySharingFromGroups() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      revokeEntitySharingFromGroups_result result = new revokeEntitySharingFromGroups_result();
-      receiveBase(result, "revokeEntitySharingFromGroups");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "revokeEntitySharingFromGroups failed: unknown result");
-    }
-
-    public boolean userHasAccess(String domainId, String userId, String entityId, String permissionTypeId) throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      send_userHasAccess(domainId, userId, entityId, permissionTypeId);
-      return recv_userHasAccess();
-    }
-
-    public void send_userHasAccess(String domainId, String userId, String entityId, String permissionTypeId) throws org.apache.thrift.TException
-    {
-      userHasAccess_args args = new userHasAccess_args();
-      args.setDomainId(domainId);
-      args.setUserId(userId);
-      args.setEntityId(entityId);
-      args.setPermissionTypeId(permissionTypeId);
-      sendBase("userHasAccess", args);
-    }
-
-    public boolean recv_userHasAccess() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException
-    {
-      userHasAccess_result result = new userHasAccess_result();
-      receiveBase(result, "userHasAccess");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.gre != null) {
-        throw result.gre;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "userHasAccess failed: unknown result");
-    }
-
-  }
-  public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface {
-    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
-      private org.apache.thrift.async.TAsyncClientManager clientManager;
-      private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
-      public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
-        this.clientManager = clientManager;
-        this.protocolFactory = protocolFactory;
-      }
-      public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
-        return new AsyncClient(protocolFactory, clientManager, transport);
-      }
-    }
-
-    public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
-      super(protocolFactory, clientManager, transport);
-    }
-
-    public void createDomain(org.apache.airavata.sharing.registry.models.Domain domain, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
-      checkReady();
-      createDomain_call method_call = new createDomain_call(domain, resultHandler, this, ___protocolFactory, ___transport);
-      this.___currentMethod = method_call;
-      ___manager.call(method_call);
-    }
-
-    public static class createDomain_call extends org.apache.thrift.async.TAsyncMethodCall {
-      private org.apache.airavata.sharing.registry.models.Domain domain;
-      public createDomain_call(org.apache.airavata.sharing.registry.models.Domain domain, 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.domain = domain;
-      }
-
-      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
-        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createDomain", org.apache.thrift.protocol.TMessageType.CALL, 0));
-        createDomain_args args = new createDomain_args();
-        args.setDomain(domain);
-        args.write(prot);
-        prot.writeMessageEnd();
-      }
-
-      public String getResult() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException {
-        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
-          throw new IllegalStateException("Method call not finished!");
-        }
-        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_createDomain();
-      }
-    }
-
-    public void updateDomain(org.apache.airavata.sharing.registry.models.Domain domain, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
-      checkReady();
-      updateDomain_call method_call = new updateDomain_call(domain, resultHandler, this, ___protocolFactory, ___transport);
-      this.___currentMethod = method_call;
-      ___manager.call(method_call);
-    }
-
-    public static class updateDomain_call extends org.apache.thrift.async.TAsyncMethodCall {
-      private org.apache.airavata.sharing.registry.models.Domain domain;
-      public updateDomain_call(org.apache.airavata.sharing.registry.models.Domain domain, 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.domain = domain;
-      }
-
-      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
-        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("updateDomain", org.apache.thrift.protocol.TMessageType.CALL, 0));
-        updateDomain_args args = new updateDomain_args();
-        args.setDomain(domain);
-        args.write(prot);
-        prot.writeMessageEnd();
-      }
-
-      public boolean getResult() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException {
-        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
-          throw new IllegalStateException("Method call not finished!");
-        }
-        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_updateDomain();
-      }
-    }
-
-    public void deleteDomain(String domainId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
-      checkReady();
-      deleteDomain_call method_call = new deleteDomain_call(domainId, resultHandler, this, ___protocolFactory, ___transport);
-      this.___currentMethod = method_call;
-      ___manager.call(method_call);
-    }
-
-    public static class deleteDomain_call extends org.apache.thrift.async.TAsyncMethodCall {
-      private String domainId;
-      public deleteDomain_call(String domainId, 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.domainId = domainId;
-      }
-
-      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
-        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteDomain", org.apache.thrift.protocol.TMessageType.CALL, 0));
-        deleteDomain_args args = new deleteDomain_args();
-        args.setDomainId(domainId);
-        args.write(prot);
-        prot.writeMessageEnd();
-      }
-
-      public boolean getResult() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException {
-        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
-          throw new IllegalStateException("Method call not finished!");
-        }
-        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_deleteDomain();
-      }
-    }
-
-    public void getDomain(String domainId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
-      checkReady();
-      getDomain_call method_call = new getDomain_call(domainId, resultHandler, this, ___protocolFactory, ___transport);
-      this.___currentMethod = method_call;
-      ___manager.call(method_call);
-    }
-
-    public static class getDomain_call extends org.apache.thrift.async.TAsyncMethodCall {
-      private String domainId;
-      public getDomain_call(String domainId, 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.domainId = domainId;
-      }
-
-      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
-        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getDomain", org.apache.thrift.protocol.TMessageType.CALL, 0));
-        getDomain_args args = new getDomain_args();
-        args.setDomainId(domainId);
-        args.write(prot);
-        prot.writeMessageEnd();
-      }
-
-      public org.apache.airavata.sharing.registry.models.Domain getResult() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException {
-        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
-          throw new IllegalStateException("Method call not finished!");
-        }
-        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_getDomain();
-      }
-    }
-
-    public void getDomains(int offset, int limit, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
-      checkReady();
-      getDomains_call method_call = new getDomains_call(offset, limit, resultHandler, this, ___protocolFactory, ___transport);
-      this.___currentMethod = method_call;
-      ___manager.call(method_call);
-    }
-
-    public static class getDomains_call extends org.apache.thrift.async.TAsyncMethodCall {
-      private int offset;
-      private int limit;
-      public getDomains_call(int offset, int limit, 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.offset = offset;
-        this.limit = limit;
-      }
-
-      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
-        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getDomains", org.apache.thrift.protocol.TMessageType.CALL, 0));
-        getDomains_args args = new getDomains_args();
-        args.setOffset(offset);
-        args.setLimit(limit);
-        args.write(prot);
-        prot.writeMessageEnd();
-      }
-
-      public List<org.apache.airavata.sharing.registry.models.Domain> getResult() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException {
-        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
-          throw new IllegalStateException("Method call not finished!");
-        }
-        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_getDomains();
-      }
-    }
-
-    public void createUser(org.apache.airavata.sharing.registry.models.User user, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
-      checkReady();
-      createUser_call method_call = new createUser_call(user, resultHandler, this, ___protocolFactory, ___transport);
-      this.___currentMethod = method_call;
-      ___manager.call(method_call);
-    }
-
-    public static class createUser_call extends org.apache.thrift.async.TAsyncMethodCall {
-      private org.apache.airavata.sharing.registry.models.User user;
-      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("createUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
-        createUser_args args = new createUser_args();
-        args.setUser(user);
-        args.write(prot);
-        prot.writeMessageEnd();
-      }
-
-      public String getResult() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException {
-        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
-          throw new IllegalStateException("Method call not finished!");
-        }
-        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_createUser();
-      }
-    }
-
-    public void updatedUser(org.apache.airavata.sharing.registry.models.User user, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
-      checkReady();
-      updatedUser_call method_call = new updatedUser_call(user, resultHandler, this, ___protocolFactory, ___transport);
-      this.___currentMethod = method_call;
-      ___manager.call(method_call);
-    }
-
-    public static class updatedUser_call extends org.apache.thrift.async.TAsyncMethodCall {
-      private org.apache.airavata.sharing.registry.models.User user;
-      public updatedUser_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("updatedUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
-        updatedUser_args args = new updatedUser_args();
-        args.setUser(user);
-        args.write(prot);
-        prot.writeMessageEnd();
-      }
-
-      public boolean getResult() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException {
-        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
-          throw new IllegalStateException("Method call not finished!");
-        }
-        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_updatedUser();
-      }
-    }
-
-    public void deleteUser(String userId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
-      checkReady();
-      deleteUser_call method_call = new deleteUser_call(userId, resultHandler, this, ___protocolFactory, ___transport);
-      this.___currentMethod = method_call;
-      ___manager.call(method_call);
-    }
-
-    public static class deleteUser_call extends org.apache.thrift.async.TAsyncMethodCall {
-      private String userId;
-      public deleteUser_call(String userId, 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.userId = userId;
-      }
-
-      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
-        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
-        deleteUser_args args = new deleteUser_args();
-        args.setUserId(userId);
-        args.write(prot);
-        prot.writeMessageEnd();
-      }
-
-      public boolean getResult() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException {
-        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
-          throw new IllegalStateException("Method call not finished!");
-        }
-        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_deleteUser();
-      }
-    }
-
-    public void getUser(String userId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
-      checkReady();
-      getUser_call method_call = new getUser_call(userId, resultHandler, this, ___protocolFactory, ___transport);
-      this.___currentMethod = method_call;
-      ___manager.call(method_call);
-    }
-
-    public static class getUser_call extends org.apache.thrift.async.TAsyncMethodCall {
-      private String userId;
-      public getUser_call(String userId, 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.userId = userId;
-      }
-
-      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
-        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
-        getUser_args args = new getUser_args();
-        args.setUserId(userId);
-        args.write(prot);
-        prot.writeMessageEnd();
-      }
-
-      public org.apache.airavata.sharing.registry.models.User getResult() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException {
-        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
-          throw new IllegalStateException("Method call not finished!");
-        }
-        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_getUser();
-      }
-    }
-
-    public void getUsers(String domain, int offset, int limit, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
-      checkReady();
-      getUsers_call method_call = new getUsers_call(domain, offset, limit, resultHandler, this, ___protocolFactory, ___transport);
-      this.___currentMethod = method_call;
-      ___manager.call(method_call);
-    }
-
-    public static class getUsers_call extends org.apache.thrift.async.TAsyncMethodCall {
-      private String domain;
-      private int offset;
-      private int limit;
-      public getUsers_call(String domain, int offset, int limit, 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.domain = domain;
-        this.offset = offset;
-        this.limit = limit;
-      }
-
-      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
-        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getUsers", org.apache.thrift.protocol.TMessageType.CALL, 0));
-        getUsers_args args = new getUsers_args();
-        args.setDomain(domain);
-        args.setOffset(offset);
-        args.setLimit(limit);
-        args.write(prot);
-        prot.writeMessageEnd();
-      }
-
-      public List<org.apache.airavata.sharing.registry.models.User> getResult() throws org.apache.airavata.sharing.registry.models.GovRegistryException, org.apache.thrift.TException {
-        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
-          throw new IllegalStateException("Method call not finished!");
-        }
-        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_getUsers();
-      }
-    }
-
-    public void createGroup(org.apache.airavata.sharing.registry.models.UserGroup group, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
-      checkReady();
-      createGroup_call method_call = new createGroup_call(group, resultHandler, this, ___protocolFactory, ___transport);
-      this.___currentMethod = method_call;
-      ___manager.call(method_call);
-    }
-
-    public static class createGroup_call extends org.apache.thrift.async.TAsyncMethodCall {
-      private org.apache.airavata.sharing.registry.models.UserGroup group;
-      public createGroup_call(org.apache.airavata.sharing.registry.models.UserGroup group, 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.group = group;
-      }
-
-      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
-        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createGroup", org.apache.thrift.protocol.TMe

<TRUNCATED>

[11/17] airavata git commit: renaming directory names

Posted by sc...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/UserGroup.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/UserGroup.java b/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/UserGroup.java
deleted file mode 100644
index 0c481bb..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/UserGroup.java
+++ /dev/null
@@ -1,1154 +0,0 @@
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- *  @generated
- */
-package org.apache.airavata.sharing.registry.models;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-05")
-public class UserGroup implements org.apache.thrift.TBase<UserGroup, UserGroup._Fields>, java.io.Serializable, Cloneable, Comparable<UserGroup> {
-  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("UserGroup");
-
-  private static final org.apache.thrift.protocol.TField GROUP_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("groupId", org.apache.thrift.protocol.TType.STRING, (short)1);
-  private static final org.apache.thrift.protocol.TField DOMAIN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("domainId", org.apache.thrift.protocol.TType.STRING, (short)2);
-  private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)3);
-  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)6);
-  private static final org.apache.thrift.protocol.TField OWNER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("ownerId", org.apache.thrift.protocol.TType.STRING, (short)7);
-  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)8);
-  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)9);
-  private static final org.apache.thrift.protocol.TField GROUP_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("groupType", org.apache.thrift.protocol.TType.I32, (short)10);
-
-  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-  static {
-    schemes.put(StandardScheme.class, new UserGroupStandardSchemeFactory());
-    schemes.put(TupleScheme.class, new UserGroupTupleSchemeFactory());
-  }
-
-  public String groupId; // optional
-  public String domainId; // optional
-  public String name; // optional
-  public String description; // optional
-  public String ownerId; // optional
-  public long createdTime; // optional
-  public long updatedTime; // optional
-  /**
-   * 
-   * @see GroupType
-   */
-  public GroupType groupType; // optional
-
-  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
-    GROUP_ID((short)1, "groupId"),
-    DOMAIN_ID((short)2, "domainId"),
-    NAME((short)3, "name"),
-    DESCRIPTION((short)6, "description"),
-    OWNER_ID((short)7, "ownerId"),
-    CREATED_TIME((short)8, "createdTime"),
-    UPDATED_TIME((short)9, "updatedTime"),
-    /**
-     * 
-     * @see GroupType
-     */
-    GROUP_TYPE((short)10, "groupType");
-
-    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
-    static {
-      for (_Fields field : EnumSet.allOf(_Fields.class)) {
-        byName.put(field.getFieldName(), field);
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, or null if its not found.
-     */
-    public static _Fields findByThriftId(int fieldId) {
-      switch(fieldId) {
-        case 1: // GROUP_ID
-          return GROUP_ID;
-        case 2: // DOMAIN_ID
-          return DOMAIN_ID;
-        case 3: // NAME
-          return NAME;
-        case 6: // DESCRIPTION
-          return DESCRIPTION;
-        case 7: // OWNER_ID
-          return OWNER_ID;
-        case 8: // CREATED_TIME
-          return CREATED_TIME;
-        case 9: // UPDATED_TIME
-          return UPDATED_TIME;
-        case 10: // GROUP_TYPE
-          return GROUP_TYPE;
-        default:
-          return null;
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, throwing an exception
-     * if it is not found.
-     */
-    public static _Fields findByThriftIdOrThrow(int fieldId) {
-      _Fields fields = findByThriftId(fieldId);
-      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-      return fields;
-    }
-
-    /**
-     * Find the _Fields constant that matches name, or null if its not found.
-     */
-    public static _Fields findByName(String name) {
-      return byName.get(name);
-    }
-
-    private final short _thriftId;
-    private final String _fieldName;
-
-    _Fields(short thriftId, String fieldName) {
-      _thriftId = thriftId;
-      _fieldName = fieldName;
-    }
-
-    public short getThriftFieldId() {
-      return _thriftId;
-    }
-
-    public String getFieldName() {
-      return _fieldName;
-    }
-  }
-
-  // isset id assignments
-  private static final int __CREATEDTIME_ISSET_ID = 0;
-  private static final int __UPDATEDTIME_ISSET_ID = 1;
-  private byte __isset_bitfield = 0;
-  private static final _Fields optionals[] = {_Fields.GROUP_ID,_Fields.DOMAIN_ID,_Fields.NAME,_Fields.DESCRIPTION,_Fields.OWNER_ID,_Fields.CREATED_TIME,_Fields.UPDATED_TIME,_Fields.GROUP_TYPE};
-  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);
-    tmpMap.put(_Fields.GROUP_ID, new org.apache.thrift.meta_data.FieldMetaData("groupId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.DOMAIN_ID, new org.apache.thrift.meta_data.FieldMetaData("domainId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("description", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.OWNER_ID, new org.apache.thrift.meta_data.FieldMetaData("ownerId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    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, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-    tmpMap.put(_Fields.GROUP_TYPE, new org.apache.thrift.meta_data.FieldMetaData("groupType", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, GroupType.class)));
-    metaDataMap = Collections.unmodifiableMap(tmpMap);
-    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(UserGroup.class, metaDataMap);
-  }
-
-  public UserGroup() {
-    this.groupId = "DO_NOT_SET_AT_CLIENTS_ID";
-
-  }
-
-  /**
-   * Performs a deep copy on <i>other</i>.
-   */
-  public UserGroup(UserGroup other) {
-    __isset_bitfield = other.__isset_bitfield;
-    if (other.isSetGroupId()) {
-      this.groupId = other.groupId;
-    }
-    if (other.isSetDomainId()) {
-      this.domainId = other.domainId;
-    }
-    if (other.isSetName()) {
-      this.name = other.name;
-    }
-    if (other.isSetDescription()) {
-      this.description = other.description;
-    }
-    if (other.isSetOwnerId()) {
-      this.ownerId = other.ownerId;
-    }
-    this.createdTime = other.createdTime;
-    this.updatedTime = other.updatedTime;
-    if (other.isSetGroupType()) {
-      this.groupType = other.groupType;
-    }
-  }
-
-  public UserGroup deepCopy() {
-    return new UserGroup(this);
-  }
-
-  @Override
-  public void clear() {
-    this.groupId = "DO_NOT_SET_AT_CLIENTS_ID";
-
-    this.domainId = null;
-    this.name = null;
-    this.description = null;
-    this.ownerId = null;
-    setCreatedTimeIsSet(false);
-    this.createdTime = 0;
-    setUpdatedTimeIsSet(false);
-    this.updatedTime = 0;
-    this.groupType = null;
-  }
-
-  public String getGroupId() {
-    return this.groupId;
-  }
-
-  public UserGroup setGroupId(String groupId) {
-    this.groupId = groupId;
-    return this;
-  }
-
-  public void unsetGroupId() {
-    this.groupId = null;
-  }
-
-  /** Returns true if field groupId is set (has been assigned a value) and false otherwise */
-  public boolean isSetGroupId() {
-    return this.groupId != null;
-  }
-
-  public void setGroupIdIsSet(boolean value) {
-    if (!value) {
-      this.groupId = null;
-    }
-  }
-
-  public String getDomainId() {
-    return this.domainId;
-  }
-
-  public UserGroup setDomainId(String domainId) {
-    this.domainId = domainId;
-    return this;
-  }
-
-  public void unsetDomainId() {
-    this.domainId = null;
-  }
-
-  /** Returns true if field domainId is set (has been assigned a value) and false otherwise */
-  public boolean isSetDomainId() {
-    return this.domainId != null;
-  }
-
-  public void setDomainIdIsSet(boolean value) {
-    if (!value) {
-      this.domainId = null;
-    }
-  }
-
-  public String getName() {
-    return this.name;
-  }
-
-  public UserGroup setName(String name) {
-    this.name = name;
-    return this;
-  }
-
-  public void unsetName() {
-    this.name = null;
-  }
-
-  /** Returns true if field name is set (has been assigned a value) and false otherwise */
-  public boolean isSetName() {
-    return this.name != null;
-  }
-
-  public void setNameIsSet(boolean value) {
-    if (!value) {
-      this.name = null;
-    }
-  }
-
-  public String getDescription() {
-    return this.description;
-  }
-
-  public UserGroup setDescription(String description) {
-    this.description = description;
-    return this;
-  }
-
-  public void unsetDescription() {
-    this.description = null;
-  }
-
-  /** Returns true if field description is set (has been assigned a value) and false otherwise */
-  public boolean isSetDescription() {
-    return this.description != null;
-  }
-
-  public void setDescriptionIsSet(boolean value) {
-    if (!value) {
-      this.description = null;
-    }
-  }
-
-  public String getOwnerId() {
-    return this.ownerId;
-  }
-
-  public UserGroup setOwnerId(String ownerId) {
-    this.ownerId = ownerId;
-    return this;
-  }
-
-  public void unsetOwnerId() {
-    this.ownerId = null;
-  }
-
-  /** Returns true if field ownerId is set (has been assigned a value) and false otherwise */
-  public boolean isSetOwnerId() {
-    return this.ownerId != null;
-  }
-
-  public void setOwnerIdIsSet(boolean value) {
-    if (!value) {
-      this.ownerId = null;
-    }
-  }
-
-  public long getCreatedTime() {
-    return this.createdTime;
-  }
-
-  public UserGroup setCreatedTime(long createdTime) {
-    this.createdTime = createdTime;
-    setCreatedTimeIsSet(true);
-    return this;
-  }
-
-  public void unsetCreatedTime() {
-    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CREATEDTIME_ISSET_ID);
-  }
-
-  /** Returns true if field createdTime is set (has been assigned a value) and false otherwise */
-  public boolean isSetCreatedTime() {
-    return EncodingUtils.testBit(__isset_bitfield, __CREATEDTIME_ISSET_ID);
-  }
-
-  public void setCreatedTimeIsSet(boolean value) {
-    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CREATEDTIME_ISSET_ID, value);
-  }
-
-  public long getUpdatedTime() {
-    return this.updatedTime;
-  }
-
-  public UserGroup setUpdatedTime(long updatedTime) {
-    this.updatedTime = updatedTime;
-    setUpdatedTimeIsSet(true);
-    return this;
-  }
-
-  public void unsetUpdatedTime() {
-    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID);
-  }
-
-  /** Returns true if field updatedTime is set (has been assigned a value) and false otherwise */
-  public boolean isSetUpdatedTime() {
-    return EncodingUtils.testBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID);
-  }
-
-  public void setUpdatedTimeIsSet(boolean value) {
-    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID, value);
-  }
-
-  /**
-   * 
-   * @see GroupType
-   */
-  public GroupType getGroupType() {
-    return this.groupType;
-  }
-
-  /**
-   * 
-   * @see GroupType
-   */
-  public UserGroup setGroupType(GroupType groupType) {
-    this.groupType = groupType;
-    return this;
-  }
-
-  public void unsetGroupType() {
-    this.groupType = null;
-  }
-
-  /** Returns true if field groupType is set (has been assigned a value) and false otherwise */
-  public boolean isSetGroupType() {
-    return this.groupType != null;
-  }
-
-  public void setGroupTypeIsSet(boolean value) {
-    if (!value) {
-      this.groupType = null;
-    }
-  }
-
-  public void setFieldValue(_Fields field, Object value) {
-    switch (field) {
-    case GROUP_ID:
-      if (value == null) {
-        unsetGroupId();
-      } else {
-        setGroupId((String)value);
-      }
-      break;
-
-    case DOMAIN_ID:
-      if (value == null) {
-        unsetDomainId();
-      } else {
-        setDomainId((String)value);
-      }
-      break;
-
-    case NAME:
-      if (value == null) {
-        unsetName();
-      } else {
-        setName((String)value);
-      }
-      break;
-
-    case DESCRIPTION:
-      if (value == null) {
-        unsetDescription();
-      } else {
-        setDescription((String)value);
-      }
-      break;
-
-    case OWNER_ID:
-      if (value == null) {
-        unsetOwnerId();
-      } else {
-        setOwnerId((String)value);
-      }
-      break;
-
-    case CREATED_TIME:
-      if (value == null) {
-        unsetCreatedTime();
-      } else {
-        setCreatedTime((Long)value);
-      }
-      break;
-
-    case UPDATED_TIME:
-      if (value == null) {
-        unsetUpdatedTime();
-      } else {
-        setUpdatedTime((Long)value);
-      }
-      break;
-
-    case GROUP_TYPE:
-      if (value == null) {
-        unsetGroupType();
-      } else {
-        setGroupType((GroupType)value);
-      }
-      break;
-
-    }
-  }
-
-  public Object getFieldValue(_Fields field) {
-    switch (field) {
-    case GROUP_ID:
-      return getGroupId();
-
-    case DOMAIN_ID:
-      return getDomainId();
-
-    case NAME:
-      return getName();
-
-    case DESCRIPTION:
-      return getDescription();
-
-    case OWNER_ID:
-      return getOwnerId();
-
-    case CREATED_TIME:
-      return getCreatedTime();
-
-    case UPDATED_TIME:
-      return getUpdatedTime();
-
-    case GROUP_TYPE:
-      return getGroupType();
-
-    }
-    throw new IllegalStateException();
-  }
-
-  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
-  public boolean isSet(_Fields field) {
-    if (field == null) {
-      throw new IllegalArgumentException();
-    }
-
-    switch (field) {
-    case GROUP_ID:
-      return isSetGroupId();
-    case DOMAIN_ID:
-      return isSetDomainId();
-    case NAME:
-      return isSetName();
-    case DESCRIPTION:
-      return isSetDescription();
-    case OWNER_ID:
-      return isSetOwnerId();
-    case CREATED_TIME:
-      return isSetCreatedTime();
-    case UPDATED_TIME:
-      return isSetUpdatedTime();
-    case GROUP_TYPE:
-      return isSetGroupType();
-    }
-    throw new IllegalStateException();
-  }
-
-  @Override
-  public boolean equals(Object that) {
-    if (that == null)
-      return false;
-    if (that instanceof UserGroup)
-      return this.equals((UserGroup)that);
-    return false;
-  }
-
-  public boolean equals(UserGroup that) {
-    if (that == null)
-      return false;
-
-    boolean this_present_groupId = true && this.isSetGroupId();
-    boolean that_present_groupId = true && that.isSetGroupId();
-    if (this_present_groupId || that_present_groupId) {
-      if (!(this_present_groupId && that_present_groupId))
-        return false;
-      if (!this.groupId.equals(that.groupId))
-        return false;
-    }
-
-    boolean this_present_domainId = true && this.isSetDomainId();
-    boolean that_present_domainId = true && that.isSetDomainId();
-    if (this_present_domainId || that_present_domainId) {
-      if (!(this_present_domainId && that_present_domainId))
-        return false;
-      if (!this.domainId.equals(that.domainId))
-        return false;
-    }
-
-    boolean this_present_name = true && this.isSetName();
-    boolean that_present_name = true && that.isSetName();
-    if (this_present_name || that_present_name) {
-      if (!(this_present_name && that_present_name))
-        return false;
-      if (!this.name.equals(that.name))
-        return false;
-    }
-
-    boolean this_present_description = true && this.isSetDescription();
-    boolean that_present_description = true && that.isSetDescription();
-    if (this_present_description || that_present_description) {
-      if (!(this_present_description && that_present_description))
-        return false;
-      if (!this.description.equals(that.description))
-        return false;
-    }
-
-    boolean this_present_ownerId = true && this.isSetOwnerId();
-    boolean that_present_ownerId = true && that.isSetOwnerId();
-    if (this_present_ownerId || that_present_ownerId) {
-      if (!(this_present_ownerId && that_present_ownerId))
-        return false;
-      if (!this.ownerId.equals(that.ownerId))
-        return false;
-    }
-
-    boolean this_present_createdTime = true && this.isSetCreatedTime();
-    boolean that_present_createdTime = true && that.isSetCreatedTime();
-    if (this_present_createdTime || that_present_createdTime) {
-      if (!(this_present_createdTime && that_present_createdTime))
-        return false;
-      if (this.createdTime != that.createdTime)
-        return false;
-    }
-
-    boolean this_present_updatedTime = true && this.isSetUpdatedTime();
-    boolean that_present_updatedTime = true && that.isSetUpdatedTime();
-    if (this_present_updatedTime || that_present_updatedTime) {
-      if (!(this_present_updatedTime && that_present_updatedTime))
-        return false;
-      if (this.updatedTime != that.updatedTime)
-        return false;
-    }
-
-    boolean this_present_groupType = true && this.isSetGroupType();
-    boolean that_present_groupType = true && that.isSetGroupType();
-    if (this_present_groupType || that_present_groupType) {
-      if (!(this_present_groupType && that_present_groupType))
-        return false;
-      if (!this.groupType.equals(that.groupType))
-        return false;
-    }
-
-    return true;
-  }
-
-  @Override
-  public int hashCode() {
-    List<Object> list = new ArrayList<Object>();
-
-    boolean present_groupId = true && (isSetGroupId());
-    list.add(present_groupId);
-    if (present_groupId)
-      list.add(groupId);
-
-    boolean present_domainId = true && (isSetDomainId());
-    list.add(present_domainId);
-    if (present_domainId)
-      list.add(domainId);
-
-    boolean present_name = true && (isSetName());
-    list.add(present_name);
-    if (present_name)
-      list.add(name);
-
-    boolean present_description = true && (isSetDescription());
-    list.add(present_description);
-    if (present_description)
-      list.add(description);
-
-    boolean present_ownerId = true && (isSetOwnerId());
-    list.add(present_ownerId);
-    if (present_ownerId)
-      list.add(ownerId);
-
-    boolean present_createdTime = true && (isSetCreatedTime());
-    list.add(present_createdTime);
-    if (present_createdTime)
-      list.add(createdTime);
-
-    boolean present_updatedTime = true && (isSetUpdatedTime());
-    list.add(present_updatedTime);
-    if (present_updatedTime)
-      list.add(updatedTime);
-
-    boolean present_groupType = true && (isSetGroupType());
-    list.add(present_groupType);
-    if (present_groupType)
-      list.add(groupType.getValue());
-
-    return list.hashCode();
-  }
-
-  @Override
-  public int compareTo(UserGroup other) {
-    if (!getClass().equals(other.getClass())) {
-      return getClass().getName().compareTo(other.getClass().getName());
-    }
-
-    int lastComparison = 0;
-
-    lastComparison = Boolean.valueOf(isSetGroupId()).compareTo(other.isSetGroupId());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetGroupId()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.groupId, other.groupId);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetDomainId()).compareTo(other.isSetDomainId());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetDomainId()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domainId, other.domainId);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetName()).compareTo(other.isSetName());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetName()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetDescription()).compareTo(other.isSetDescription());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetDescription()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.description, other.description);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetOwnerId()).compareTo(other.isSetOwnerId());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetOwnerId()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ownerId, other.ownerId);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetCreatedTime()).compareTo(other.isSetCreatedTime());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetCreatedTime()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.createdTime, other.createdTime);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetUpdatedTime()).compareTo(other.isSetUpdatedTime());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetUpdatedTime()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updatedTime, other.updatedTime);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetGroupType()).compareTo(other.isSetGroupType());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetGroupType()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.groupType, other.groupType);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    return 0;
-  }
-
-  public _Fields fieldForId(int fieldId) {
-    return _Fields.findByThriftId(fieldId);
-  }
-
-  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
-  }
-
-  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
-  }
-
-  @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder("UserGroup(");
-    boolean first = true;
-
-    if (isSetGroupId()) {
-      sb.append("groupId:");
-      if (this.groupId == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.groupId);
-      }
-      first = false;
-    }
-    if (isSetDomainId()) {
-      if (!first) sb.append(", ");
-      sb.append("domainId:");
-      if (this.domainId == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.domainId);
-      }
-      first = false;
-    }
-    if (isSetName()) {
-      if (!first) sb.append(", ");
-      sb.append("name:");
-      if (this.name == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.name);
-      }
-      first = false;
-    }
-    if (isSetDescription()) {
-      if (!first) sb.append(", ");
-      sb.append("description:");
-      if (this.description == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.description);
-      }
-      first = false;
-    }
-    if (isSetOwnerId()) {
-      if (!first) sb.append(", ");
-      sb.append("ownerId:");
-      if (this.ownerId == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.ownerId);
-      }
-      first = false;
-    }
-    if (isSetCreatedTime()) {
-      if (!first) sb.append(", ");
-      sb.append("createdTime:");
-      sb.append(this.createdTime);
-      first = false;
-    }
-    if (isSetUpdatedTime()) {
-      if (!first) sb.append(", ");
-      sb.append("updatedTime:");
-      sb.append(this.updatedTime);
-      first = false;
-    }
-    if (isSetGroupType()) {
-      if (!first) sb.append(", ");
-      sb.append("groupType:");
-      if (this.groupType == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.groupType);
-      }
-      first = false;
-    }
-    sb.append(")");
-    return sb.toString();
-  }
-
-  public void validate() throws org.apache.thrift.TException {
-    // check for required fields
-    // check for sub-struct validity
-  }
-
-  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-    try {
-      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-    } catch (org.apache.thrift.TException te) {
-      throw new java.io.IOException(te);
-    }
-  }
-
-  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-    try {
-      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
-      __isset_bitfield = 0;
-      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-    } catch (org.apache.thrift.TException te) {
-      throw new java.io.IOException(te);
-    }
-  }
-
-  private static class UserGroupStandardSchemeFactory implements SchemeFactory {
-    public UserGroupStandardScheme getScheme() {
-      return new UserGroupStandardScheme();
-    }
-  }
-
-  private static class UserGroupStandardScheme extends StandardScheme<UserGroup> {
-
-    public void read(org.apache.thrift.protocol.TProtocol iprot, UserGroup struct) throws org.apache.thrift.TException {
-      org.apache.thrift.protocol.TField schemeField;
-      iprot.readStructBegin();
-      while (true)
-      {
-        schemeField = iprot.readFieldBegin();
-        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
-          break;
-        }
-        switch (schemeField.id) {
-          case 1: // GROUP_ID
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.groupId = iprot.readString();
-              struct.setGroupIdIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 2: // DOMAIN_ID
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.domainId = iprot.readString();
-              struct.setDomainIdIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 3: // NAME
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.name = iprot.readString();
-              struct.setNameIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 6: // DESCRIPTION
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.description = iprot.readString();
-              struct.setDescriptionIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 7: // OWNER_ID
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.ownerId = iprot.readString();
-              struct.setOwnerIdIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 8: // CREATED_TIME
-            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
-              struct.createdTime = iprot.readI64();
-              struct.setCreatedTimeIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 9: // UPDATED_TIME
-            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
-              struct.updatedTime = iprot.readI64();
-              struct.setUpdatedTimeIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 10: // GROUP_TYPE
-            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
-              struct.groupType = org.apache.airavata.sharing.registry.models.GroupType.findByValue(iprot.readI32());
-              struct.setGroupTypeIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          default:
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-        }
-        iprot.readFieldEnd();
-      }
-      iprot.readStructEnd();
-
-      // check for required fields of primitive type, which can't be checked in the validate method
-      struct.validate();
-    }
-
-    public void write(org.apache.thrift.protocol.TProtocol oprot, UserGroup struct) throws org.apache.thrift.TException {
-      struct.validate();
-
-      oprot.writeStructBegin(STRUCT_DESC);
-      if (struct.groupId != null) {
-        if (struct.isSetGroupId()) {
-          oprot.writeFieldBegin(GROUP_ID_FIELD_DESC);
-          oprot.writeString(struct.groupId);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.domainId != null) {
-        if (struct.isSetDomainId()) {
-          oprot.writeFieldBegin(DOMAIN_ID_FIELD_DESC);
-          oprot.writeString(struct.domainId);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.name != null) {
-        if (struct.isSetName()) {
-          oprot.writeFieldBegin(NAME_FIELD_DESC);
-          oprot.writeString(struct.name);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.description != null) {
-        if (struct.isSetDescription()) {
-          oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC);
-          oprot.writeString(struct.description);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.ownerId != null) {
-        if (struct.isSetOwnerId()) {
-          oprot.writeFieldBegin(OWNER_ID_FIELD_DESC);
-          oprot.writeString(struct.ownerId);
-          oprot.writeFieldEnd();
-        }
-      }
-      if (struct.isSetCreatedTime()) {
-        oprot.writeFieldBegin(CREATED_TIME_FIELD_DESC);
-        oprot.writeI64(struct.createdTime);
-        oprot.writeFieldEnd();
-      }
-      if (struct.isSetUpdatedTime()) {
-        oprot.writeFieldBegin(UPDATED_TIME_FIELD_DESC);
-        oprot.writeI64(struct.updatedTime);
-        oprot.writeFieldEnd();
-      }
-      if (struct.groupType != null) {
-        if (struct.isSetGroupType()) {
-          oprot.writeFieldBegin(GROUP_TYPE_FIELD_DESC);
-          oprot.writeI32(struct.groupType.getValue());
-          oprot.writeFieldEnd();
-        }
-      }
-      oprot.writeFieldStop();
-      oprot.writeStructEnd();
-    }
-
-  }
-
-  private static class UserGroupTupleSchemeFactory implements SchemeFactory {
-    public UserGroupTupleScheme getScheme() {
-      return new UserGroupTupleScheme();
-    }
-  }
-
-  private static class UserGroupTupleScheme extends TupleScheme<UserGroup> {
-
-    @Override
-    public void write(org.apache.thrift.protocol.TProtocol prot, UserGroup struct) throws org.apache.thrift.TException {
-      TTupleProtocol oprot = (TTupleProtocol) prot;
-      BitSet optionals = new BitSet();
-      if (struct.isSetGroupId()) {
-        optionals.set(0);
-      }
-      if (struct.isSetDomainId()) {
-        optionals.set(1);
-      }
-      if (struct.isSetName()) {
-        optionals.set(2);
-      }
-      if (struct.isSetDescription()) {
-        optionals.set(3);
-      }
-      if (struct.isSetOwnerId()) {
-        optionals.set(4);
-      }
-      if (struct.isSetCreatedTime()) {
-        optionals.set(5);
-      }
-      if (struct.isSetUpdatedTime()) {
-        optionals.set(6);
-      }
-      if (struct.isSetGroupType()) {
-        optionals.set(7);
-      }
-      oprot.writeBitSet(optionals, 8);
-      if (struct.isSetGroupId()) {
-        oprot.writeString(struct.groupId);
-      }
-      if (struct.isSetDomainId()) {
-        oprot.writeString(struct.domainId);
-      }
-      if (struct.isSetName()) {
-        oprot.writeString(struct.name);
-      }
-      if (struct.isSetDescription()) {
-        oprot.writeString(struct.description);
-      }
-      if (struct.isSetOwnerId()) {
-        oprot.writeString(struct.ownerId);
-      }
-      if (struct.isSetCreatedTime()) {
-        oprot.writeI64(struct.createdTime);
-      }
-      if (struct.isSetUpdatedTime()) {
-        oprot.writeI64(struct.updatedTime);
-      }
-      if (struct.isSetGroupType()) {
-        oprot.writeI32(struct.groupType.getValue());
-      }
-    }
-
-    @Override
-    public void read(org.apache.thrift.protocol.TProtocol prot, UserGroup struct) throws org.apache.thrift.TException {
-      TTupleProtocol iprot = (TTupleProtocol) prot;
-      BitSet incoming = iprot.readBitSet(8);
-      if (incoming.get(0)) {
-        struct.groupId = iprot.readString();
-        struct.setGroupIdIsSet(true);
-      }
-      if (incoming.get(1)) {
-        struct.domainId = iprot.readString();
-        struct.setDomainIdIsSet(true);
-      }
-      if (incoming.get(2)) {
-        struct.name = iprot.readString();
-        struct.setNameIsSet(true);
-      }
-      if (incoming.get(3)) {
-        struct.description = iprot.readString();
-        struct.setDescriptionIsSet(true);
-      }
-      if (incoming.get(4)) {
-        struct.ownerId = iprot.readString();
-        struct.setOwnerIdIsSet(true);
-      }
-      if (incoming.get(5)) {
-        struct.createdTime = iprot.readI64();
-        struct.setCreatedTimeIsSet(true);
-      }
-      if (incoming.get(6)) {
-        struct.updatedTime = iprot.readI64();
-        struct.setUpdatedTimeIsSet(true);
-      }
-      if (incoming.get(7)) {
-        struct.groupType = org.apache.airavata.sharing.registry.models.GroupType.findByValue(iprot.readI32());
-        struct.setGroupTypeIsSet(true);
-      }
-    }
-  }
-
-}
-

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/sharing_modelsConstants.java
----------------------------------------------------------------------
diff --git a/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/sharing_modelsConstants.java b/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/sharing_modelsConstants.java
deleted file mode 100644
index 07fc3c7..0000000
--- a/modules/airavata-sharing-registry/airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/sharing_modelsConstants.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- *  @generated
- */
-package org.apache.airavata.sharing.registry.models;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-public class sharing_modelsConstants {
-
-  public static final String DO_NOT_SET_AT_CLIENTS_ID = "DO_NOT_SET_AT_CLIENTS_ID";
-
-}


[04/17] airavata git commit: renaming directory names

Posted by sc...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/Sharing.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/Sharing.java b/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/Sharing.java
new file mode 100644
index 0000000..5106eab
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/Sharing.java
@@ -0,0 +1,1167 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.3)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.airavata.sharing.registry.models;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import javax.annotation.Generated;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-05")
+public class Sharing implements org.apache.thrift.TBase<Sharing, Sharing._Fields>, java.io.Serializable, Cloneable, Comparable<Sharing> {
+  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Sharing");
+
+  private static final org.apache.thrift.protocol.TField PERMISSION_TYPE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("permissionTypeId", org.apache.thrift.protocol.TType.STRING, (short)1);
+  private static final org.apache.thrift.protocol.TField ENTITY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("entityId", org.apache.thrift.protocol.TType.STRING, (short)2);
+  private static final org.apache.thrift.protocol.TField GROUP_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("groupId", org.apache.thrift.protocol.TType.STRING, (short)3);
+  private static final org.apache.thrift.protocol.TField GROUP_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("groupType", org.apache.thrift.protocol.TType.I32, (short)4);
+  private static final org.apache.thrift.protocol.TField SHARING_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("sharingType", org.apache.thrift.protocol.TType.I32, (short)5);
+  private static final org.apache.thrift.protocol.TField INHERITED_PARENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("inheritedParentId", org.apache.thrift.protocol.TType.STRING, (short)6);
+  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)7);
+  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)8);
+
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new SharingStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new SharingTupleSchemeFactory());
+  }
+
+  public String permissionTypeId; // optional
+  public String entityId; // optional
+  public String groupId; // optional
+  /**
+   * 
+   * @see GroupType
+   */
+  public GroupType groupType; // optional
+  /**
+   * 
+   * @see SharingType
+   */
+  public SharingType sharingType; // optional
+  public String inheritedParentId; // optional
+  public long createdTime; // optional
+  public long updatedTime; // optional
+
+  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    PERMISSION_TYPE_ID((short)1, "permissionTypeId"),
+    ENTITY_ID((short)2, "entityId"),
+    GROUP_ID((short)3, "groupId"),
+    /**
+     * 
+     * @see GroupType
+     */
+    GROUP_TYPE((short)4, "groupType"),
+    /**
+     * 
+     * @see SharingType
+     */
+    SHARING_TYPE((short)5, "sharingType"),
+    INHERITED_PARENT_ID((short)6, "inheritedParentId"),
+    CREATED_TIME((short)7, "createdTime"),
+    UPDATED_TIME((short)8, "updatedTime");
+
+    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+    static {
+      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+        byName.put(field.getFieldName(), field);
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, or null if its not found.
+     */
+    public static _Fields findByThriftId(int fieldId) {
+      switch(fieldId) {
+        case 1: // PERMISSION_TYPE_ID
+          return PERMISSION_TYPE_ID;
+        case 2: // ENTITY_ID
+          return ENTITY_ID;
+        case 3: // GROUP_ID
+          return GROUP_ID;
+        case 4: // GROUP_TYPE
+          return GROUP_TYPE;
+        case 5: // SHARING_TYPE
+          return SHARING_TYPE;
+        case 6: // INHERITED_PARENT_ID
+          return INHERITED_PARENT_ID;
+        case 7: // CREATED_TIME
+          return CREATED_TIME;
+        case 8: // UPDATED_TIME
+          return UPDATED_TIME;
+        default:
+          return null;
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, throwing an exception
+     * if it is not found.
+     */
+    public static _Fields findByThriftIdOrThrow(int fieldId) {
+      _Fields fields = findByThriftId(fieldId);
+      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      return fields;
+    }
+
+    /**
+     * Find the _Fields constant that matches name, or null if its not found.
+     */
+    public static _Fields findByName(String name) {
+      return byName.get(name);
+    }
+
+    private final short _thriftId;
+    private final String _fieldName;
+
+    _Fields(short thriftId, String fieldName) {
+      _thriftId = thriftId;
+      _fieldName = fieldName;
+    }
+
+    public short getThriftFieldId() {
+      return _thriftId;
+    }
+
+    public String getFieldName() {
+      return _fieldName;
+    }
+  }
+
+  // isset id assignments
+  private static final int __CREATEDTIME_ISSET_ID = 0;
+  private static final int __UPDATEDTIME_ISSET_ID = 1;
+  private byte __isset_bitfield = 0;
+  private static final _Fields optionals[] = {_Fields.PERMISSION_TYPE_ID,_Fields.ENTITY_ID,_Fields.GROUP_ID,_Fields.GROUP_TYPE,_Fields.SHARING_TYPE,_Fields.INHERITED_PARENT_ID,_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);
+    tmpMap.put(_Fields.PERMISSION_TYPE_ID, new org.apache.thrift.meta_data.FieldMetaData("permissionTypeId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.ENTITY_ID, new org.apache.thrift.meta_data.FieldMetaData("entityId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.GROUP_ID, new org.apache.thrift.meta_data.FieldMetaData("groupId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.GROUP_TYPE, new org.apache.thrift.meta_data.FieldMetaData("groupType", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, GroupType.class)));
+    tmpMap.put(_Fields.SHARING_TYPE, new org.apache.thrift.meta_data.FieldMetaData("sharingType", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, SharingType.class)));
+    tmpMap.put(_Fields.INHERITED_PARENT_ID, new org.apache.thrift.meta_data.FieldMetaData("inheritedParentId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    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, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
+    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Sharing.class, metaDataMap);
+  }
+
+  public Sharing() {
+  }
+
+  /**
+   * Performs a deep copy on <i>other</i>.
+   */
+  public Sharing(Sharing other) {
+    __isset_bitfield = other.__isset_bitfield;
+    if (other.isSetPermissionTypeId()) {
+      this.permissionTypeId = other.permissionTypeId;
+    }
+    if (other.isSetEntityId()) {
+      this.entityId = other.entityId;
+    }
+    if (other.isSetGroupId()) {
+      this.groupId = other.groupId;
+    }
+    if (other.isSetGroupType()) {
+      this.groupType = other.groupType;
+    }
+    if (other.isSetSharingType()) {
+      this.sharingType = other.sharingType;
+    }
+    if (other.isSetInheritedParentId()) {
+      this.inheritedParentId = other.inheritedParentId;
+    }
+    this.createdTime = other.createdTime;
+    this.updatedTime = other.updatedTime;
+  }
+
+  public Sharing deepCopy() {
+    return new Sharing(this);
+  }
+
+  @Override
+  public void clear() {
+    this.permissionTypeId = null;
+    this.entityId = null;
+    this.groupId = null;
+    this.groupType = null;
+    this.sharingType = null;
+    this.inheritedParentId = null;
+    setCreatedTimeIsSet(false);
+    this.createdTime = 0;
+    setUpdatedTimeIsSet(false);
+    this.updatedTime = 0;
+  }
+
+  public String getPermissionTypeId() {
+    return this.permissionTypeId;
+  }
+
+  public Sharing setPermissionTypeId(String permissionTypeId) {
+    this.permissionTypeId = permissionTypeId;
+    return this;
+  }
+
+  public void unsetPermissionTypeId() {
+    this.permissionTypeId = null;
+  }
+
+  /** Returns true if field permissionTypeId is set (has been assigned a value) and false otherwise */
+  public boolean isSetPermissionTypeId() {
+    return this.permissionTypeId != null;
+  }
+
+  public void setPermissionTypeIdIsSet(boolean value) {
+    if (!value) {
+      this.permissionTypeId = null;
+    }
+  }
+
+  public String getEntityId() {
+    return this.entityId;
+  }
+
+  public Sharing setEntityId(String entityId) {
+    this.entityId = entityId;
+    return this;
+  }
+
+  public void unsetEntityId() {
+    this.entityId = null;
+  }
+
+  /** Returns true if field entityId is set (has been assigned a value) and false otherwise */
+  public boolean isSetEntityId() {
+    return this.entityId != null;
+  }
+
+  public void setEntityIdIsSet(boolean value) {
+    if (!value) {
+      this.entityId = null;
+    }
+  }
+
+  public String getGroupId() {
+    return this.groupId;
+  }
+
+  public Sharing setGroupId(String groupId) {
+    this.groupId = groupId;
+    return this;
+  }
+
+  public void unsetGroupId() {
+    this.groupId = null;
+  }
+
+  /** Returns true if field groupId is set (has been assigned a value) and false otherwise */
+  public boolean isSetGroupId() {
+    return this.groupId != null;
+  }
+
+  public void setGroupIdIsSet(boolean value) {
+    if (!value) {
+      this.groupId = null;
+    }
+  }
+
+  /**
+   * 
+   * @see GroupType
+   */
+  public GroupType getGroupType() {
+    return this.groupType;
+  }
+
+  /**
+   * 
+   * @see GroupType
+   */
+  public Sharing setGroupType(GroupType groupType) {
+    this.groupType = groupType;
+    return this;
+  }
+
+  public void unsetGroupType() {
+    this.groupType = null;
+  }
+
+  /** Returns true if field groupType is set (has been assigned a value) and false otherwise */
+  public boolean isSetGroupType() {
+    return this.groupType != null;
+  }
+
+  public void setGroupTypeIsSet(boolean value) {
+    if (!value) {
+      this.groupType = null;
+    }
+  }
+
+  /**
+   * 
+   * @see SharingType
+   */
+  public SharingType getSharingType() {
+    return this.sharingType;
+  }
+
+  /**
+   * 
+   * @see SharingType
+   */
+  public Sharing setSharingType(SharingType sharingType) {
+    this.sharingType = sharingType;
+    return this;
+  }
+
+  public void unsetSharingType() {
+    this.sharingType = null;
+  }
+
+  /** Returns true if field sharingType is set (has been assigned a value) and false otherwise */
+  public boolean isSetSharingType() {
+    return this.sharingType != null;
+  }
+
+  public void setSharingTypeIsSet(boolean value) {
+    if (!value) {
+      this.sharingType = null;
+    }
+  }
+
+  public String getInheritedParentId() {
+    return this.inheritedParentId;
+  }
+
+  public Sharing setInheritedParentId(String inheritedParentId) {
+    this.inheritedParentId = inheritedParentId;
+    return this;
+  }
+
+  public void unsetInheritedParentId() {
+    this.inheritedParentId = null;
+  }
+
+  /** Returns true if field inheritedParentId is set (has been assigned a value) and false otherwise */
+  public boolean isSetInheritedParentId() {
+    return this.inheritedParentId != null;
+  }
+
+  public void setInheritedParentIdIsSet(boolean value) {
+    if (!value) {
+      this.inheritedParentId = null;
+    }
+  }
+
+  public long getCreatedTime() {
+    return this.createdTime;
+  }
+
+  public Sharing setCreatedTime(long createdTime) {
+    this.createdTime = createdTime;
+    setCreatedTimeIsSet(true);
+    return this;
+  }
+
+  public void unsetCreatedTime() {
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CREATEDTIME_ISSET_ID);
+  }
+
+  /** Returns true if field createdTime is set (has been assigned a value) and false otherwise */
+  public boolean isSetCreatedTime() {
+    return EncodingUtils.testBit(__isset_bitfield, __CREATEDTIME_ISSET_ID);
+  }
+
+  public void setCreatedTimeIsSet(boolean value) {
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CREATEDTIME_ISSET_ID, value);
+  }
+
+  public long getUpdatedTime() {
+    return this.updatedTime;
+  }
+
+  public Sharing setUpdatedTime(long updatedTime) {
+    this.updatedTime = updatedTime;
+    setUpdatedTimeIsSet(true);
+    return this;
+  }
+
+  public void unsetUpdatedTime() {
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID);
+  }
+
+  /** Returns true if field updatedTime is set (has been assigned a value) and false otherwise */
+  public boolean isSetUpdatedTime() {
+    return EncodingUtils.testBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID);
+  }
+
+  public void setUpdatedTimeIsSet(boolean value) {
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID, value);
+  }
+
+  public void setFieldValue(_Fields field, Object value) {
+    switch (field) {
+    case PERMISSION_TYPE_ID:
+      if (value == null) {
+        unsetPermissionTypeId();
+      } else {
+        setPermissionTypeId((String)value);
+      }
+      break;
+
+    case ENTITY_ID:
+      if (value == null) {
+        unsetEntityId();
+      } else {
+        setEntityId((String)value);
+      }
+      break;
+
+    case GROUP_ID:
+      if (value == null) {
+        unsetGroupId();
+      } else {
+        setGroupId((String)value);
+      }
+      break;
+
+    case GROUP_TYPE:
+      if (value == null) {
+        unsetGroupType();
+      } else {
+        setGroupType((GroupType)value);
+      }
+      break;
+
+    case SHARING_TYPE:
+      if (value == null) {
+        unsetSharingType();
+      } else {
+        setSharingType((SharingType)value);
+      }
+      break;
+
+    case INHERITED_PARENT_ID:
+      if (value == null) {
+        unsetInheritedParentId();
+      } else {
+        setInheritedParentId((String)value);
+      }
+      break;
+
+    case CREATED_TIME:
+      if (value == null) {
+        unsetCreatedTime();
+      } else {
+        setCreatedTime((Long)value);
+      }
+      break;
+
+    case UPDATED_TIME:
+      if (value == null) {
+        unsetUpdatedTime();
+      } else {
+        setUpdatedTime((Long)value);
+      }
+      break;
+
+    }
+  }
+
+  public Object getFieldValue(_Fields field) {
+    switch (field) {
+    case PERMISSION_TYPE_ID:
+      return getPermissionTypeId();
+
+    case ENTITY_ID:
+      return getEntityId();
+
+    case GROUP_ID:
+      return getGroupId();
+
+    case GROUP_TYPE:
+      return getGroupType();
+
+    case SHARING_TYPE:
+      return getSharingType();
+
+    case INHERITED_PARENT_ID:
+      return getInheritedParentId();
+
+    case CREATED_TIME:
+      return getCreatedTime();
+
+    case UPDATED_TIME:
+      return getUpdatedTime();
+
+    }
+    throw new IllegalStateException();
+  }
+
+  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+  public boolean isSet(_Fields field) {
+    if (field == null) {
+      throw new IllegalArgumentException();
+    }
+
+    switch (field) {
+    case PERMISSION_TYPE_ID:
+      return isSetPermissionTypeId();
+    case ENTITY_ID:
+      return isSetEntityId();
+    case GROUP_ID:
+      return isSetGroupId();
+    case GROUP_TYPE:
+      return isSetGroupType();
+    case SHARING_TYPE:
+      return isSetSharingType();
+    case INHERITED_PARENT_ID:
+      return isSetInheritedParentId();
+    case CREATED_TIME:
+      return isSetCreatedTime();
+    case UPDATED_TIME:
+      return isSetUpdatedTime();
+    }
+    throw new IllegalStateException();
+  }
+
+  @Override
+  public boolean equals(Object that) {
+    if (that == null)
+      return false;
+    if (that instanceof Sharing)
+      return this.equals((Sharing)that);
+    return false;
+  }
+
+  public boolean equals(Sharing that) {
+    if (that == null)
+      return false;
+
+    boolean this_present_permissionTypeId = true && this.isSetPermissionTypeId();
+    boolean that_present_permissionTypeId = true && that.isSetPermissionTypeId();
+    if (this_present_permissionTypeId || that_present_permissionTypeId) {
+      if (!(this_present_permissionTypeId && that_present_permissionTypeId))
+        return false;
+      if (!this.permissionTypeId.equals(that.permissionTypeId))
+        return false;
+    }
+
+    boolean this_present_entityId = true && this.isSetEntityId();
+    boolean that_present_entityId = true && that.isSetEntityId();
+    if (this_present_entityId || that_present_entityId) {
+      if (!(this_present_entityId && that_present_entityId))
+        return false;
+      if (!this.entityId.equals(that.entityId))
+        return false;
+    }
+
+    boolean this_present_groupId = true && this.isSetGroupId();
+    boolean that_present_groupId = true && that.isSetGroupId();
+    if (this_present_groupId || that_present_groupId) {
+      if (!(this_present_groupId && that_present_groupId))
+        return false;
+      if (!this.groupId.equals(that.groupId))
+        return false;
+    }
+
+    boolean this_present_groupType = true && this.isSetGroupType();
+    boolean that_present_groupType = true && that.isSetGroupType();
+    if (this_present_groupType || that_present_groupType) {
+      if (!(this_present_groupType && that_present_groupType))
+        return false;
+      if (!this.groupType.equals(that.groupType))
+        return false;
+    }
+
+    boolean this_present_sharingType = true && this.isSetSharingType();
+    boolean that_present_sharingType = true && that.isSetSharingType();
+    if (this_present_sharingType || that_present_sharingType) {
+      if (!(this_present_sharingType && that_present_sharingType))
+        return false;
+      if (!this.sharingType.equals(that.sharingType))
+        return false;
+    }
+
+    boolean this_present_inheritedParentId = true && this.isSetInheritedParentId();
+    boolean that_present_inheritedParentId = true && that.isSetInheritedParentId();
+    if (this_present_inheritedParentId || that_present_inheritedParentId) {
+      if (!(this_present_inheritedParentId && that_present_inheritedParentId))
+        return false;
+      if (!this.inheritedParentId.equals(that.inheritedParentId))
+        return false;
+    }
+
+    boolean this_present_createdTime = true && this.isSetCreatedTime();
+    boolean that_present_createdTime = true && that.isSetCreatedTime();
+    if (this_present_createdTime || that_present_createdTime) {
+      if (!(this_present_createdTime && that_present_createdTime))
+        return false;
+      if (this.createdTime != that.createdTime)
+        return false;
+    }
+
+    boolean this_present_updatedTime = true && this.isSetUpdatedTime();
+    boolean that_present_updatedTime = true && that.isSetUpdatedTime();
+    if (this_present_updatedTime || that_present_updatedTime) {
+      if (!(this_present_updatedTime && that_present_updatedTime))
+        return false;
+      if (this.updatedTime != that.updatedTime)
+        return false;
+    }
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    List<Object> list = new ArrayList<Object>();
+
+    boolean present_permissionTypeId = true && (isSetPermissionTypeId());
+    list.add(present_permissionTypeId);
+    if (present_permissionTypeId)
+      list.add(permissionTypeId);
+
+    boolean present_entityId = true && (isSetEntityId());
+    list.add(present_entityId);
+    if (present_entityId)
+      list.add(entityId);
+
+    boolean present_groupId = true && (isSetGroupId());
+    list.add(present_groupId);
+    if (present_groupId)
+      list.add(groupId);
+
+    boolean present_groupType = true && (isSetGroupType());
+    list.add(present_groupType);
+    if (present_groupType)
+      list.add(groupType.getValue());
+
+    boolean present_sharingType = true && (isSetSharingType());
+    list.add(present_sharingType);
+    if (present_sharingType)
+      list.add(sharingType.getValue());
+
+    boolean present_inheritedParentId = true && (isSetInheritedParentId());
+    list.add(present_inheritedParentId);
+    if (present_inheritedParentId)
+      list.add(inheritedParentId);
+
+    boolean present_createdTime = true && (isSetCreatedTime());
+    list.add(present_createdTime);
+    if (present_createdTime)
+      list.add(createdTime);
+
+    boolean present_updatedTime = true && (isSetUpdatedTime());
+    list.add(present_updatedTime);
+    if (present_updatedTime)
+      list.add(updatedTime);
+
+    return list.hashCode();
+  }
+
+  @Override
+  public int compareTo(Sharing other) {
+    if (!getClass().equals(other.getClass())) {
+      return getClass().getName().compareTo(other.getClass().getName());
+    }
+
+    int lastComparison = 0;
+
+    lastComparison = Boolean.valueOf(isSetPermissionTypeId()).compareTo(other.isSetPermissionTypeId());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetPermissionTypeId()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.permissionTypeId, other.permissionTypeId);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetEntityId()).compareTo(other.isSetEntityId());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetEntityId()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityId, other.entityId);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetGroupId()).compareTo(other.isSetGroupId());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetGroupId()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.groupId, other.groupId);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetGroupType()).compareTo(other.isSetGroupType());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetGroupType()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.groupType, other.groupType);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetSharingType()).compareTo(other.isSetSharingType());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetSharingType()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sharingType, other.sharingType);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetInheritedParentId()).compareTo(other.isSetInheritedParentId());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetInheritedParentId()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.inheritedParentId, other.inheritedParentId);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetCreatedTime()).compareTo(other.isSetCreatedTime());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetCreatedTime()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.createdTime, other.createdTime);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetUpdatedTime()).compareTo(other.isSetUpdatedTime());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetUpdatedTime()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updatedTime, other.updatedTime);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    return 0;
+  }
+
+  public _Fields fieldForId(int fieldId) {
+    return _Fields.findByThriftId(fieldId);
+  }
+
+  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+  }
+
+  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+  }
+
+  @Override
+  public String toString() {
+    StringBuilder sb = new StringBuilder("Sharing(");
+    boolean first = true;
+
+    if (isSetPermissionTypeId()) {
+      sb.append("permissionTypeId:");
+      if (this.permissionTypeId == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.permissionTypeId);
+      }
+      first = false;
+    }
+    if (isSetEntityId()) {
+      if (!first) sb.append(", ");
+      sb.append("entityId:");
+      if (this.entityId == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.entityId);
+      }
+      first = false;
+    }
+    if (isSetGroupId()) {
+      if (!first) sb.append(", ");
+      sb.append("groupId:");
+      if (this.groupId == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.groupId);
+      }
+      first = false;
+    }
+    if (isSetGroupType()) {
+      if (!first) sb.append(", ");
+      sb.append("groupType:");
+      if (this.groupType == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.groupType);
+      }
+      first = false;
+    }
+    if (isSetSharingType()) {
+      if (!first) sb.append(", ");
+      sb.append("sharingType:");
+      if (this.sharingType == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.sharingType);
+      }
+      first = false;
+    }
+    if (isSetInheritedParentId()) {
+      if (!first) sb.append(", ");
+      sb.append("inheritedParentId:");
+      if (this.inheritedParentId == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.inheritedParentId);
+      }
+      first = false;
+    }
+    if (isSetCreatedTime()) {
+      if (!first) sb.append(", ");
+      sb.append("createdTime:");
+      sb.append(this.createdTime);
+      first = false;
+    }
+    if (isSetUpdatedTime()) {
+      if (!first) sb.append(", ");
+      sb.append("updatedTime:");
+      sb.append(this.updatedTime);
+      first = false;
+    }
+    sb.append(")");
+    return sb.toString();
+  }
+
+  public void validate() throws org.apache.thrift.TException {
+    // check for required fields
+    // check for sub-struct validity
+  }
+
+  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+    try {
+      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+    try {
+      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+      __isset_bitfield = 0;
+      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private static class SharingStandardSchemeFactory implements SchemeFactory {
+    public SharingStandardScheme getScheme() {
+      return new SharingStandardScheme();
+    }
+  }
+
+  private static class SharingStandardScheme extends StandardScheme<Sharing> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, Sharing struct) throws org.apache.thrift.TException {
+      org.apache.thrift.protocol.TField schemeField;
+      iprot.readStructBegin();
+      while (true)
+      {
+        schemeField = iprot.readFieldBegin();
+        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+          break;
+        }
+        switch (schemeField.id) {
+          case 1: // PERMISSION_TYPE_ID
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.permissionTypeId = iprot.readString();
+              struct.setPermissionTypeIdIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 2: // ENTITY_ID
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.entityId = iprot.readString();
+              struct.setEntityIdIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 3: // GROUP_ID
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.groupId = iprot.readString();
+              struct.setGroupIdIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 4: // GROUP_TYPE
+            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+              struct.groupType = org.apache.airavata.sharing.registry.models.GroupType.findByValue(iprot.readI32());
+              struct.setGroupTypeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 5: // SHARING_TYPE
+            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+              struct.sharingType = org.apache.airavata.sharing.registry.models.SharingType.findByValue(iprot.readI32());
+              struct.setSharingTypeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 6: // INHERITED_PARENT_ID
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.inheritedParentId = iprot.readString();
+              struct.setInheritedParentIdIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 7: // CREATED_TIME
+            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+              struct.createdTime = iprot.readI64();
+              struct.setCreatedTimeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 8: // UPDATED_TIME
+            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+              struct.updatedTime = iprot.readI64();
+              struct.setUpdatedTimeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          default:
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+        }
+        iprot.readFieldEnd();
+      }
+      iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      struct.validate();
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot, Sharing struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.permissionTypeId != null) {
+        if (struct.isSetPermissionTypeId()) {
+          oprot.writeFieldBegin(PERMISSION_TYPE_ID_FIELD_DESC);
+          oprot.writeString(struct.permissionTypeId);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.entityId != null) {
+        if (struct.isSetEntityId()) {
+          oprot.writeFieldBegin(ENTITY_ID_FIELD_DESC);
+          oprot.writeString(struct.entityId);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.groupId != null) {
+        if (struct.isSetGroupId()) {
+          oprot.writeFieldBegin(GROUP_ID_FIELD_DESC);
+          oprot.writeString(struct.groupId);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.groupType != null) {
+        if (struct.isSetGroupType()) {
+          oprot.writeFieldBegin(GROUP_TYPE_FIELD_DESC);
+          oprot.writeI32(struct.groupType.getValue());
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.sharingType != null) {
+        if (struct.isSetSharingType()) {
+          oprot.writeFieldBegin(SHARING_TYPE_FIELD_DESC);
+          oprot.writeI32(struct.sharingType.getValue());
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.inheritedParentId != null) {
+        if (struct.isSetInheritedParentId()) {
+          oprot.writeFieldBegin(INHERITED_PARENT_ID_FIELD_DESC);
+          oprot.writeString(struct.inheritedParentId);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.isSetCreatedTime()) {
+        oprot.writeFieldBegin(CREATED_TIME_FIELD_DESC);
+        oprot.writeI64(struct.createdTime);
+        oprot.writeFieldEnd();
+      }
+      if (struct.isSetUpdatedTime()) {
+        oprot.writeFieldBegin(UPDATED_TIME_FIELD_DESC);
+        oprot.writeI64(struct.updatedTime);
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class SharingTupleSchemeFactory implements SchemeFactory {
+    public SharingTupleScheme getScheme() {
+      return new SharingTupleScheme();
+    }
+  }
+
+  private static class SharingTupleScheme extends TupleScheme<Sharing> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, Sharing struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      BitSet optionals = new BitSet();
+      if (struct.isSetPermissionTypeId()) {
+        optionals.set(0);
+      }
+      if (struct.isSetEntityId()) {
+        optionals.set(1);
+      }
+      if (struct.isSetGroupId()) {
+        optionals.set(2);
+      }
+      if (struct.isSetGroupType()) {
+        optionals.set(3);
+      }
+      if (struct.isSetSharingType()) {
+        optionals.set(4);
+      }
+      if (struct.isSetInheritedParentId()) {
+        optionals.set(5);
+      }
+      if (struct.isSetCreatedTime()) {
+        optionals.set(6);
+      }
+      if (struct.isSetUpdatedTime()) {
+        optionals.set(7);
+      }
+      oprot.writeBitSet(optionals, 8);
+      if (struct.isSetPermissionTypeId()) {
+        oprot.writeString(struct.permissionTypeId);
+      }
+      if (struct.isSetEntityId()) {
+        oprot.writeString(struct.entityId);
+      }
+      if (struct.isSetGroupId()) {
+        oprot.writeString(struct.groupId);
+      }
+      if (struct.isSetGroupType()) {
+        oprot.writeI32(struct.groupType.getValue());
+      }
+      if (struct.isSetSharingType()) {
+        oprot.writeI32(struct.sharingType.getValue());
+      }
+      if (struct.isSetInheritedParentId()) {
+        oprot.writeString(struct.inheritedParentId);
+      }
+      if (struct.isSetCreatedTime()) {
+        oprot.writeI64(struct.createdTime);
+      }
+      if (struct.isSetUpdatedTime()) {
+        oprot.writeI64(struct.updatedTime);
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, Sharing struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      BitSet incoming = iprot.readBitSet(8);
+      if (incoming.get(0)) {
+        struct.permissionTypeId = iprot.readString();
+        struct.setPermissionTypeIdIsSet(true);
+      }
+      if (incoming.get(1)) {
+        struct.entityId = iprot.readString();
+        struct.setEntityIdIsSet(true);
+      }
+      if (incoming.get(2)) {
+        struct.groupId = iprot.readString();
+        struct.setGroupIdIsSet(true);
+      }
+      if (incoming.get(3)) {
+        struct.groupType = org.apache.airavata.sharing.registry.models.GroupType.findByValue(iprot.readI32());
+        struct.setGroupTypeIsSet(true);
+      }
+      if (incoming.get(4)) {
+        struct.sharingType = org.apache.airavata.sharing.registry.models.SharingType.findByValue(iprot.readI32());
+        struct.setSharingTypeIsSet(true);
+      }
+      if (incoming.get(5)) {
+        struct.inheritedParentId = iprot.readString();
+        struct.setInheritedParentIdIsSet(true);
+      }
+      if (incoming.get(6)) {
+        struct.createdTime = iprot.readI64();
+        struct.setCreatedTimeIsSet(true);
+      }
+      if (incoming.get(7)) {
+        struct.updatedTime = iprot.readI64();
+        struct.setUpdatedTimeIsSet(true);
+      }
+    }
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/SharingType.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/SharingType.java b/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/SharingType.java
new file mode 100644
index 0000000..ff9f919
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/SharingType.java
@@ -0,0 +1,45 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.3)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.airavata.sharing.registry.models;
+
+
+import java.util.Map;
+import java.util.HashMap;
+import org.apache.thrift.TEnum;
+
+public enum SharingType implements org.apache.thrift.TEnum {
+  DIRECT(0),
+  INHERITED(1);
+
+  private final int value;
+
+  private SharingType(int value) {
+    this.value = value;
+  }
+
+  /**
+   * Get the integer value of this enum value, as defined in the Thrift IDL.
+   */
+  public int getValue() {
+    return value;
+  }
+
+  /**
+   * Find a the enum type by its integer value, as defined in the Thrift IDL.
+   * @return null if the value is not found.
+   */
+  public static SharingType findByValue(int value) { 
+    switch (value) {
+      case 0:
+        return DIRECT;
+      case 1:
+        return INHERITED;
+      default:
+        return null;
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/43f228fc/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/User.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/User.java b/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/User.java
new file mode 100644
index 0000000..69be6e7
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/User.java
@@ -0,0 +1,817 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.3)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.airavata.sharing.registry.models;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import javax.annotation.Generated;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-05")
+public class User implements org.apache.thrift.TBase<User, User._Fields>, java.io.Serializable, Cloneable, Comparable<User> {
+  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("User");
+
+  private static final org.apache.thrift.protocol.TField USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userId", org.apache.thrift.protocol.TType.STRING, (short)1);
+  private static final org.apache.thrift.protocol.TField DOMAIN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("domainId", org.apache.thrift.protocol.TType.STRING, (short)2);
+  private static final org.apache.thrift.protocol.TField USER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("userName", org.apache.thrift.protocol.TType.STRING, (short)3);
+  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)4);
+  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)5);
+
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new UserStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new UserTupleSchemeFactory());
+  }
+
+  public String userId; // optional
+  public String domainId; // optional
+  public String userName; // optional
+  public long createdTime; // optional
+  public long updatedTime; // optional
+
+  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    USER_ID((short)1, "userId"),
+    DOMAIN_ID((short)2, "domainId"),
+    USER_NAME((short)3, "userName"),
+    CREATED_TIME((short)4, "createdTime"),
+    UPDATED_TIME((short)5, "updatedTime");
+
+    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+    static {
+      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+        byName.put(field.getFieldName(), field);
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, or null if its not found.
+     */
+    public static _Fields findByThriftId(int fieldId) {
+      switch(fieldId) {
+        case 1: // USER_ID
+          return USER_ID;
+        case 2: // DOMAIN_ID
+          return DOMAIN_ID;
+        case 3: // USER_NAME
+          return USER_NAME;
+        case 4: // CREATED_TIME
+          return CREATED_TIME;
+        case 5: // UPDATED_TIME
+          return UPDATED_TIME;
+        default:
+          return null;
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, throwing an exception
+     * if it is not found.
+     */
+    public static _Fields findByThriftIdOrThrow(int fieldId) {
+      _Fields fields = findByThriftId(fieldId);
+      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      return fields;
+    }
+
+    /**
+     * Find the _Fields constant that matches name, or null if its not found.
+     */
+    public static _Fields findByName(String name) {
+      return byName.get(name);
+    }
+
+    private final short _thriftId;
+    private final String _fieldName;
+
+    _Fields(short thriftId, String fieldName) {
+      _thriftId = thriftId;
+      _fieldName = fieldName;
+    }
+
+    public short getThriftFieldId() {
+      return _thriftId;
+    }
+
+    public String getFieldName() {
+      return _fieldName;
+    }
+  }
+
+  // isset id assignments
+  private static final int __CREATEDTIME_ISSET_ID = 0;
+  private static final int __UPDATEDTIME_ISSET_ID = 1;
+  private byte __isset_bitfield = 0;
+  private static final _Fields optionals[] = {_Fields.USER_ID,_Fields.DOMAIN_ID,_Fields.USER_NAME,_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);
+    tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.DOMAIN_ID, new org.apache.thrift.meta_data.FieldMetaData("domainId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.USER_NAME, new org.apache.thrift.meta_data.FieldMetaData("userName", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    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, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
+    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(User.class, metaDataMap);
+  }
+
+  public User() {
+    this.userId = "DO_NOT_SET_AT_CLIENTS_ID";
+
+  }
+
+  /**
+   * Performs a deep copy on <i>other</i>.
+   */
+  public User(User other) {
+    __isset_bitfield = other.__isset_bitfield;
+    if (other.isSetUserId()) {
+      this.userId = other.userId;
+    }
+    if (other.isSetDomainId()) {
+      this.domainId = other.domainId;
+    }
+    if (other.isSetUserName()) {
+      this.userName = other.userName;
+    }
+    this.createdTime = other.createdTime;
+    this.updatedTime = other.updatedTime;
+  }
+
+  public User deepCopy() {
+    return new User(this);
+  }
+
+  @Override
+  public void clear() {
+    this.userId = "DO_NOT_SET_AT_CLIENTS_ID";
+
+    this.domainId = null;
+    this.userName = null;
+    setCreatedTimeIsSet(false);
+    this.createdTime = 0;
+    setUpdatedTimeIsSet(false);
+    this.updatedTime = 0;
+  }
+
+  public String getUserId() {
+    return this.userId;
+  }
+
+  public User setUserId(String userId) {
+    this.userId = userId;
+    return this;
+  }
+
+  public void unsetUserId() {
+    this.userId = null;
+  }
+
+  /** Returns true if field userId is set (has been assigned a value) and false otherwise */
+  public boolean isSetUserId() {
+    return this.userId != null;
+  }
+
+  public void setUserIdIsSet(boolean value) {
+    if (!value) {
+      this.userId = null;
+    }
+  }
+
+  public String getDomainId() {
+    return this.domainId;
+  }
+
+  public User setDomainId(String domainId) {
+    this.domainId = domainId;
+    return this;
+  }
+
+  public void unsetDomainId() {
+    this.domainId = null;
+  }
+
+  /** Returns true if field domainId is set (has been assigned a value) and false otherwise */
+  public boolean isSetDomainId() {
+    return this.domainId != null;
+  }
+
+  public void setDomainIdIsSet(boolean value) {
+    if (!value) {
+      this.domainId = null;
+    }
+  }
+
+  public String getUserName() {
+    return this.userName;
+  }
+
+  public User setUserName(String userName) {
+    this.userName = userName;
+    return this;
+  }
+
+  public void unsetUserName() {
+    this.userName = null;
+  }
+
+  /** Returns true if field userName is set (has been assigned a value) and false otherwise */
+  public boolean isSetUserName() {
+    return this.userName != null;
+  }
+
+  public void setUserNameIsSet(boolean value) {
+    if (!value) {
+      this.userName = null;
+    }
+  }
+
+  public long getCreatedTime() {
+    return this.createdTime;
+  }
+
+  public User setCreatedTime(long createdTime) {
+    this.createdTime = createdTime;
+    setCreatedTimeIsSet(true);
+    return this;
+  }
+
+  public void unsetCreatedTime() {
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CREATEDTIME_ISSET_ID);
+  }
+
+  /** Returns true if field createdTime is set (has been assigned a value) and false otherwise */
+  public boolean isSetCreatedTime() {
+    return EncodingUtils.testBit(__isset_bitfield, __CREATEDTIME_ISSET_ID);
+  }
+
+  public void setCreatedTimeIsSet(boolean value) {
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CREATEDTIME_ISSET_ID, value);
+  }
+
+  public long getUpdatedTime() {
+    return this.updatedTime;
+  }
+
+  public User setUpdatedTime(long updatedTime) {
+    this.updatedTime = updatedTime;
+    setUpdatedTimeIsSet(true);
+    return this;
+  }
+
+  public void unsetUpdatedTime() {
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID);
+  }
+
+  /** Returns true if field updatedTime is set (has been assigned a value) and false otherwise */
+  public boolean isSetUpdatedTime() {
+    return EncodingUtils.testBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID);
+  }
+
+  public void setUpdatedTimeIsSet(boolean value) {
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID, value);
+  }
+
+  public void setFieldValue(_Fields field, Object value) {
+    switch (field) {
+    case USER_ID:
+      if (value == null) {
+        unsetUserId();
+      } else {
+        setUserId((String)value);
+      }
+      break;
+
+    case DOMAIN_ID:
+      if (value == null) {
+        unsetDomainId();
+      } else {
+        setDomainId((String)value);
+      }
+      break;
+
+    case USER_NAME:
+      if (value == null) {
+        unsetUserName();
+      } else {
+        setUserName((String)value);
+      }
+      break;
+
+    case CREATED_TIME:
+      if (value == null) {
+        unsetCreatedTime();
+      } else {
+        setCreatedTime((Long)value);
+      }
+      break;
+
+    case UPDATED_TIME:
+      if (value == null) {
+        unsetUpdatedTime();
+      } else {
+        setUpdatedTime((Long)value);
+      }
+      break;
+
+    }
+  }
+
+  public Object getFieldValue(_Fields field) {
+    switch (field) {
+    case USER_ID:
+      return getUserId();
+
+    case DOMAIN_ID:
+      return getDomainId();
+
+    case USER_NAME:
+      return getUserName();
+
+    case CREATED_TIME:
+      return getCreatedTime();
+
+    case UPDATED_TIME:
+      return getUpdatedTime();
+
+    }
+    throw new IllegalStateException();
+  }
+
+  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+  public boolean isSet(_Fields field) {
+    if (field == null) {
+      throw new IllegalArgumentException();
+    }
+
+    switch (field) {
+    case USER_ID:
+      return isSetUserId();
+    case DOMAIN_ID:
+      return isSetDomainId();
+    case USER_NAME:
+      return isSetUserName();
+    case CREATED_TIME:
+      return isSetCreatedTime();
+    case UPDATED_TIME:
+      return isSetUpdatedTime();
+    }
+    throw new IllegalStateException();
+  }
+
+  @Override
+  public boolean equals(Object that) {
+    if (that == null)
+      return false;
+    if (that instanceof User)
+      return this.equals((User)that);
+    return false;
+  }
+
+  public boolean equals(User that) {
+    if (that == null)
+      return false;
+
+    boolean this_present_userId = true && this.isSetUserId();
+    boolean that_present_userId = true && that.isSetUserId();
+    if (this_present_userId || that_present_userId) {
+      if (!(this_present_userId && that_present_userId))
+        return false;
+      if (!this.userId.equals(that.userId))
+        return false;
+    }
+
+    boolean this_present_domainId = true && this.isSetDomainId();
+    boolean that_present_domainId = true && that.isSetDomainId();
+    if (this_present_domainId || that_present_domainId) {
+      if (!(this_present_domainId && that_present_domainId))
+        return false;
+      if (!this.domainId.equals(that.domainId))
+        return false;
+    }
+
+    boolean this_present_userName = true && this.isSetUserName();
+    boolean that_present_userName = true && that.isSetUserName();
+    if (this_present_userName || that_present_userName) {
+      if (!(this_present_userName && that_present_userName))
+        return false;
+      if (!this.userName.equals(that.userName))
+        return false;
+    }
+
+    boolean this_present_createdTime = true && this.isSetCreatedTime();
+    boolean that_present_createdTime = true && that.isSetCreatedTime();
+    if (this_present_createdTime || that_present_createdTime) {
+      if (!(this_present_createdTime && that_present_createdTime))
+        return false;
+      if (this.createdTime != that.createdTime)
+        return false;
+    }
+
+    boolean this_present_updatedTime = true && this.isSetUpdatedTime();
+    boolean that_present_updatedTime = true && that.isSetUpdatedTime();
+    if (this_present_updatedTime || that_present_updatedTime) {
+      if (!(this_present_updatedTime && that_present_updatedTime))
+        return false;
+      if (this.updatedTime != that.updatedTime)
+        return false;
+    }
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    List<Object> list = new ArrayList<Object>();
+
+    boolean present_userId = true && (isSetUserId());
+    list.add(present_userId);
+    if (present_userId)
+      list.add(userId);
+
+    boolean present_domainId = true && (isSetDomainId());
+    list.add(present_domainId);
+    if (present_domainId)
+      list.add(domainId);
+
+    boolean present_userName = true && (isSetUserName());
+    list.add(present_userName);
+    if (present_userName)
+      list.add(userName);
+
+    boolean present_createdTime = true && (isSetCreatedTime());
+    list.add(present_createdTime);
+    if (present_createdTime)
+      list.add(createdTime);
+
+    boolean present_updatedTime = true && (isSetUpdatedTime());
+    list.add(present_updatedTime);
+    if (present_updatedTime)
+      list.add(updatedTime);
+
+    return list.hashCode();
+  }
+
+  @Override
+  public int compareTo(User other) {
+    if (!getClass().equals(other.getClass())) {
+      return getClass().getName().compareTo(other.getClass().getName());
+    }
+
+    int lastComparison = 0;
+
+    lastComparison = Boolean.valueOf(isSetUserId()).compareTo(other.isSetUserId());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetUserId()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, other.userId);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetDomainId()).compareTo(other.isSetDomainId());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetDomainId()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domainId, other.domainId);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetUserName()).compareTo(other.isSetUserName());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetUserName()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userName, other.userName);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetCreatedTime()).compareTo(other.isSetCreatedTime());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetCreatedTime()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.createdTime, other.createdTime);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetUpdatedTime()).compareTo(other.isSetUpdatedTime());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetUpdatedTime()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updatedTime, other.updatedTime);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    return 0;
+  }
+
+  public _Fields fieldForId(int fieldId) {
+    return _Fields.findByThriftId(fieldId);
+  }
+
+  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+  }
+
+  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+  }
+
+  @Override
+  public String toString() {
+    StringBuilder sb = new StringBuilder("User(");
+    boolean first = true;
+
+    if (isSetUserId()) {
+      sb.append("userId:");
+      if (this.userId == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.userId);
+      }
+      first = false;
+    }
+    if (isSetDomainId()) {
+      if (!first) sb.append(", ");
+      sb.append("domainId:");
+      if (this.domainId == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.domainId);
+      }
+      first = false;
+    }
+    if (isSetUserName()) {
+      if (!first) sb.append(", ");
+      sb.append("userName:");
+      if (this.userName == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.userName);
+      }
+      first = false;
+    }
+    if (isSetCreatedTime()) {
+      if (!first) sb.append(", ");
+      sb.append("createdTime:");
+      sb.append(this.createdTime);
+      first = false;
+    }
+    if (isSetUpdatedTime()) {
+      if (!first) sb.append(", ");
+      sb.append("updatedTime:");
+      sb.append(this.updatedTime);
+      first = false;
+    }
+    sb.append(")");
+    return sb.toString();
+  }
+
+  public void validate() throws org.apache.thrift.TException {
+    // check for required fields
+    // check for sub-struct validity
+  }
+
+  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+    try {
+      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+    try {
+      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+      __isset_bitfield = 0;
+      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private static class UserStandardSchemeFactory implements SchemeFactory {
+    public UserStandardScheme getScheme() {
+      return new UserStandardScheme();
+    }
+  }
+
+  private static class UserStandardScheme extends StandardScheme<User> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, User struct) throws org.apache.thrift.TException {
+      org.apache.thrift.protocol.TField schemeField;
+      iprot.readStructBegin();
+      while (true)
+      {
+        schemeField = iprot.readFieldBegin();
+        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+          break;
+        }
+        switch (schemeField.id) {
+          case 1: // USER_ID
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.userId = iprot.readString();
+              struct.setUserIdIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 2: // DOMAIN_ID
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.domainId = iprot.readString();
+              struct.setDomainIdIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 3: // USER_NAME
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.userName = iprot.readString();
+              struct.setUserNameIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 4: // CREATED_TIME
+            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+              struct.createdTime = iprot.readI64();
+              struct.setCreatedTimeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 5: // UPDATED_TIME
+            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+              struct.updatedTime = iprot.readI64();
+              struct.setUpdatedTimeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          default:
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+        }
+        iprot.readFieldEnd();
+      }
+      iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      struct.validate();
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot, User struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.userId != null) {
+        if (struct.isSetUserId()) {
+          oprot.writeFieldBegin(USER_ID_FIELD_DESC);
+          oprot.writeString(struct.userId);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.domainId != null) {
+        if (struct.isSetDomainId()) {
+          oprot.writeFieldBegin(DOMAIN_ID_FIELD_DESC);
+          oprot.writeString(struct.domainId);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.userName != null) {
+        if (struct.isSetUserName()) {
+          oprot.writeFieldBegin(USER_NAME_FIELD_DESC);
+          oprot.writeString(struct.userName);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.isSetCreatedTime()) {
+        oprot.writeFieldBegin(CREATED_TIME_FIELD_DESC);
+        oprot.writeI64(struct.createdTime);
+        oprot.writeFieldEnd();
+      }
+      if (struct.isSetUpdatedTime()) {
+        oprot.writeFieldBegin(UPDATED_TIME_FIELD_DESC);
+        oprot.writeI64(struct.updatedTime);
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class UserTupleSchemeFactory implements SchemeFactory {
+    public UserTupleScheme getScheme() {
+      return new UserTupleScheme();
+    }
+  }
+
+  private static class UserTupleScheme extends TupleScheme<User> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, User struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      BitSet optionals = new BitSet();
+      if (struct.isSetUserId()) {
+        optionals.set(0);
+      }
+      if (struct.isSetDomainId()) {
+        optionals.set(1);
+      }
+      if (struct.isSetUserName()) {
+        optionals.set(2);
+      }
+      if (struct.isSetCreatedTime()) {
+        optionals.set(3);
+      }
+      if (struct.isSetUpdatedTime()) {
+        optionals.set(4);
+      }
+      oprot.writeBitSet(optionals, 5);
+      if (struct.isSetUserId()) {
+        oprot.writeString(struct.userId);
+      }
+      if (struct.isSetDomainId()) {
+        oprot.writeString(struct.domainId);
+      }
+      if (struct.isSetUserName()) {
+        oprot.writeString(struct.userName);
+      }
+      if (struct.isSetCreatedTime()) {
+        oprot.writeI64(struct.createdTime);
+      }
+      if (struct.isSetUpdatedTime()) {
+        oprot.writeI64(struct.updatedTime);
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, User struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      BitSet incoming = iprot.readBitSet(5);
+      if (incoming.get(0)) {
+        struct.userId = iprot.readString();
+        struct.setUserIdIsSet(true);
+      }
+      if (incoming.get(1)) {
+        struct.domainId = iprot.readString();
+        struct.setDomainIdIsSet(true);
+      }
+      if (incoming.get(2)) {
+        struct.userName = iprot.readString();
+        struct.setUserNameIsSet(true);
+      }
+      if (incoming.get(3)) {
+        struct.createdTime = iprot.readI64();
+        struct.setCreatedTimeIsSet(true);
+      }
+      if (incoming.get(4)) {
+        struct.updatedTime = iprot.readI64();
+        struct.setUpdatedTimeIsSet(true);
+      }
+    }
+  }
+
+}
+