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/07 20:43:04 UTC
[3/3] airavata git commit: changing exception name. removing static
db connection string
changing exception name. removing static db connection string
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/4739a9fc
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/4739a9fc
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/4739a9fc
Branch: refs/heads/airavata-gov-registry
Commit: 4739a9fcbc714c3c6c2c42207f779485c31a1d77
Parents: d8eaa41
Author: scnakandala <su...@gmail.com>
Authored: Fri Oct 7 16:42:57 2016 -0400
Committer: scnakandala <su...@gmail.com>
Committed: Fri Oct 7 16:42:57 2016 -0400
----------------------------------------------------------------------
dev-tools/ansible/README.md | 2 +-
dev-tools/ansible/group_vars/all.yml | 5 +-
dev-tools/ansible/hosts | 2 +-
.../db/repositories/AbstractRepository.java | 22 +-
.../db/repositories/EntityRepository.java | 6 +-
.../repositories/GroupMembershipRepository.java | 10 +-
.../repositories/PermissionTypeRepository.java | 6 +-
.../db/repositories/SharingRepository.java | 8 +-
.../sharing/registry/db/utils/JPAUtils.java | 10 +-
.../server/SharingRegistryServerHandler.java | 98 +-
.../registry/models/GovRegistryException.java | 391 ------
.../models/SharingRegistryException.java | 381 ++++++
.../service/cpi/GovRegistryService.java | 1236 +++++++++---------
.../thrift_models/sharing_cpi.thrift | 82 +-
.../thrift_models/sharing_models.thrift | 2 +-
15 files changed, 1124 insertions(+), 1137 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/4739a9fc/dev-tools/ansible/README.md
----------------------------------------------------------------------
diff --git a/dev-tools/ansible/README.md b/dev-tools/ansible/README.md
index f497fb5..ef4628d 100644
--- a/dev-tools/ansible/README.md
+++ b/dev-tools/ansible/README.md
@@ -14,7 +14,7 @@ Ansible script to deploy Apache Airavata
- **common** :- Checkout Airavata source from git and run maven build. Move keystore files.
- **gfac** :- Setup Gfac deployment and Change configurations.
- **api-orch** :- Setup Api-Orch deployment and Change configurations.
-- **pga** :- Deploy Airavata PHP Gateway._(Under development)_
+- **pga** :- Deploy Airavata PHP Gateway.
## Useful commands
http://git-wip-us.apache.org/repos/asf/airavata/blob/4739a9fc/dev-tools/ansible/group_vars/all.yml
----------------------------------------------------------------------
diff --git a/dev-tools/ansible/group_vars/all.yml b/dev-tools/ansible/group_vars/all.yml
index 5e95586..92a007d 100644
--- a/dev-tools/ansible/group_vars/all.yml
+++ b/dev-tools/ansible/group_vars/all.yml
@@ -2,7 +2,7 @@
ansible_connection: ssh
# ansible_ssh_user: centos
ansible_ssh_user: root
-ansible_ssh_private_key_file: /Users/syodage/Projects/airavata-ansible/dev-deployment-key.pem
+ansible_ssh_private_key_file: /Users/supun/Desktop/shameera-key.pem
# ansible_ssh_private_key_file: /Users/syodage/Projects/airavata-ansible/shameera-aws.pem.txt
user: centos
@@ -14,7 +14,8 @@ deployment_dir: "{{ user_home }}/dev-deployment"
airavata_source_dir: "{{ user_home }}/source"
airavata_dist: "apache-airavata-server-0.17-SNAPSHOT"
airavata_dist_name: "{{ airavata_dist }}-bin.tar.gz"
-git_branch: airavata-gov-registry
+#git_branch: airavata-gov-registry
+git_branch: develop
# Database related variables
db_server: "{{ groups['database'][0] }}"
http://git-wip-us.apache.org/repos/asf/airavata/blob/4739a9fc/dev-tools/ansible/hosts
----------------------------------------------------------------------
diff --git a/dev-tools/ansible/hosts b/dev-tools/ansible/hosts
index 9dbec9c..b7500a9 100644
--- a/dev-tools/ansible/hosts
+++ b/dev-tools/ansible/hosts
@@ -20,7 +20,7 @@
149.165.170.105
[gfac]
-149.165.170.104
+149.165.171.0
[pga]
149.165.170.103
http://git-wip-us.apache.org/repos/asf/airavata/blob/4739a9fc/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
index 1a95b97..6e13c8d 100644
--- 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
@@ -23,7 +23,7 @@ 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.apache.airavata.sharing.registry.models.SharingRegistryException;
import org.dozer.Mapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -43,29 +43,29 @@ public abstract class AbstractRepository<T, E, Id> {
this.dbEntityGenericClass = dbEntityGenericClass;
}
- public T create(T t) throws GovRegistryException {
+ public T create(T t) throws SharingRegistryException {
return update(t);
}
- public List<T> create(List<T> tList) throws GovRegistryException {
+ public List<T> create(List<T> tList) throws SharingRegistryException {
return update(tList);
}
- public T update(T t) throws GovRegistryException {
+ public T update(T t) throws SharingRegistryException {
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 {
+ public List<T> update(List<T> tList) throws SharingRegistryException {
List<T> returnList = new ArrayList<>();
for(T temp : tList)
returnList.add(update(temp));
return returnList;
}
- public boolean delete(Id id) throws GovRegistryException {
+ public boolean delete(Id id) throws SharingRegistryException {
JPAUtils.execute(entityManager -> {
E entity = entityManager.find(dbEntityGenericClass, id);
entityManager.remove(entity);
@@ -74,13 +74,13 @@ public abstract class AbstractRepository<T, E, Id> {
return true;
}
- public boolean delete(List<Id> idList) throws GovRegistryException {
+ public boolean delete(List<Id> idList) throws SharingRegistryException {
for(Id id : idList)
delete(id);
return true;
}
- public T get(Id id) throws GovRegistryException {
+ public T get(Id id) throws SharingRegistryException {
E entity = JPAUtils.execute(entityManager -> entityManager
.find(dbEntityGenericClass, id));
Mapper mapper = ObjectMapperSingleton.getInstance();
@@ -89,14 +89,14 @@ public abstract class AbstractRepository<T, E, Id> {
return mapper.map(entity, thriftGenericClass);
}
- public List<T> get(List<Id> idList) throws GovRegistryException {
+ public List<T> get(List<Id> idList) throws SharingRegistryException {
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 {
+ public List<T> select(Map<String, String> filters, int offset, int limit) throws SharingRegistryException {
String queryString = getSelectQuery(filters);
int newLimit = limit < 0 ? DBConstants.SELECT_MAX_ROWS: limit;
List resultSet = JPAUtils.execute(entityManager -> entityManager.createQuery(queryString).setFirstResult(offset)
@@ -107,7 +107,7 @@ public abstract class AbstractRepository<T, E, Id> {
return gatewayList;
}
- public List<T> select(String queryString, int offset, int limit) throws GovRegistryException {
+ public List<T> select(String queryString, int offset, int limit) throws SharingRegistryException {
int newLimit = limit < 0 ? DBConstants.SELECT_MAX_ROWS: limit;
List resultSet = JPAUtils.execute(entityManager -> entityManager.createQuery(queryString).setFirstResult(offset)
.setMaxResults(newLimit).getResultList());
http://git-wip-us.apache.org/repos/asf/airavata/blob/4739a9fc/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
index 20e0fd9..bc726f6 100644
--- 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
@@ -25,7 +25,7 @@ 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.apache.airavata.sharing.registry.models.SharingRegistryException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -40,14 +40,14 @@ public class EntityRepository extends AbstractRepository<Entity, EntityEntity, S
super(Entity.class, EntityEntity.class);
}
- public List<Entity> getChildEntities(String parentId) throws GovRegistryException {
+ public List<Entity> getChildEntities(String parentId) throws SharingRegistryException {
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 {
+ int offset, int limit) throws SharingRegistryException {
String groupIdString = "'";
for(String groupId : groupIds)
groupIdString += groupId + "','";
http://git-wip-us.apache.org/repos/asf/airavata/blob/4739a9fc/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
index 259e22c..e976ba9 100644
--- 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
@@ -35,13 +35,13 @@ public class GroupMembershipRepository extends AbstractRepository<GroupMembershi
super(GroupMembership.class, GroupMembershipEntity.class);
}
- public List<GroupMembership> getChildMembershipsOfGroup(String parentId) throws GovRegistryException {
+ public List<GroupMembership> getChildMembershipsOfGroup(String parentId) throws SharingRegistryException {
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 {
+ public List<User> getAllChildUsers(String groupId) throws SharingRegistryException {
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
@@ -51,7 +51,7 @@ public class GroupMembershipRepository extends AbstractRepository<GroupMembershi
return users;
}
- public List<UserGroup> getAllChildGroups(String groupId) throws GovRegistryException {
+ public List<UserGroup> getAllChildGroups(String groupId) throws SharingRegistryException {
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
@@ -61,7 +61,7 @@ public class GroupMembershipRepository extends AbstractRepository<GroupMembershi
return groups;
}
- public List<GroupMembership> getAllParentMembershipsForChild(String childId) throws GovRegistryException {
+ public List<GroupMembership> getAllParentMembershipsForChild(String childId) throws SharingRegistryException {
List<GroupMembership> finalParentGroups = new ArrayList<>();
Map<String, String> filters = new HashMap<>();
filters.put(DBConstants.GroupMembershipTable.CHILD_ID, childId);
@@ -77,7 +77,7 @@ public class GroupMembershipRepository extends AbstractRepository<GroupMembershi
return finalParentGroups;
}
- public List<UserGroup> getAllParentGroupsForChild(String childId) throws GovRegistryException {
+ public List<UserGroup> getAllParentGroupsForChild(String childId) throws SharingRegistryException {
List<UserGroup> finalParentGroups = new ArrayList<>();
Map<String, String> filters = new HashMap<>();
filters.put(DBConstants.GroupMembershipTable.CHILD_ID, childId);
http://git-wip-us.apache.org/repos/asf/airavata/blob/4739a9fc/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
index e61f1ec..c5d683c 100644
--- 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
@@ -22,7 +22,7 @@ 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.SharingRegistryException;
import org.apache.airavata.sharing.registry.models.PermissionType;
import org.apache.airavata.sharing.registry.server.SharingRegistryServerHandler;
import org.slf4j.Logger;
@@ -38,13 +38,13 @@ public class PermissionTypeRepository extends AbstractRepository<PermissionType,
super(PermissionType.class, PermissionTypeEntity.class);
}
- public String getGlobalPermissionTypeIdForDomain(String domainId) throws GovRegistryException {
+ public String getGlobalPermissionTypeIdForDomain(String domainId) throws SharingRegistryException {
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()
+ throw new SharingRegistryException("GLOBAL Permission inconsistency. Found " + permissionTypeList.size()
+ " records with " + SharingRegistryServerHandler.GLOBAL_PERMISSION_NAME + " name");
}
return permissionTypeList.get(0).getPermissionTypeId();
http://git-wip-us.apache.org/repos/asf/airavata/blob/4739a9fc/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
index f5145a3..e706f24 100644
--- 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
@@ -23,7 +23,7 @@ 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.SharingRegistryException;
import org.apache.airavata.sharing.registry.models.Sharing;
import org.apache.airavata.sharing.registry.models.SharingType;
import org.slf4j.Logger;
@@ -39,7 +39,7 @@ public class SharingRepository extends AbstractRepository<Sharing, SharingEntity
super(Sharing.class, SharingEntity.class);
}
- public List<Sharing> getIndirectSharedChildren(String parentId, String permissionTypeId) throws GovRegistryException {
+ public List<Sharing> getIndirectSharedChildren(String parentId, String permissionTypeId) throws SharingRegistryException {
HashMap<String, String> filters = new HashMap<>();
filters.put(DBConstants.SharingTable.INHERITED_PARENT_ID, parentId);
filters.put(DBConstants.SharingTable.SHARING_TYPE, SharingType.INDIRECT_CASCADING.toString());
@@ -48,7 +48,7 @@ public class SharingRepository extends AbstractRepository<Sharing, SharingEntity
return select(filters, 0, -1);
}
- public List<Sharing> getCascadingPermissionsForEntity(String entityId) throws GovRegistryException {
+ public List<Sharing> getCascadingPermissionsForEntity(String entityId) throws SharingRegistryException {
HashMap<String, String> filters = new HashMap<>();
filters.put(DBConstants.SharingTable.ENTITY_ID, entityId);
String query = "SELECT p from " + SharingEntity.class.getSimpleName() + " as p";
@@ -60,7 +60,7 @@ public class SharingRepository extends AbstractRepository<Sharing, SharingEntity
return select(query, 0, -1);
}
- public boolean hasAccess(String entityId, List<String> groupIds, List<String> permissionTypeIds) throws GovRegistryException {
+ public boolean hasAccess(String entityId, List<String> groupIds, List<String> permissionTypeIds) throws SharingRegistryException {
String query = "SELECT p from " + SharingEntity.class.getSimpleName() + " as p";
query += " WHERE ";
query += "p." + DBConstants.SharingTable.ENTITY_ID + " = '" + entityId + "' AND ";
http://git-wip-us.apache.org/repos/asf/airavata/blob/4739a9fc/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
index f2f7c3a..0780bd3 100644
--- 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
@@ -22,7 +22,7 @@ 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.airavata.sharing.registry.models.SharingRegistryException;
import org.apache.derby.drda.NetworkServerControl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -100,7 +100,7 @@ public class JPAUtils {
return entityManager;
}
- public static <R> R execute(Committer<EntityManager, R> committer) throws GovRegistryException {
+ public static <R> R execute(Committer<EntityManager, R> committer) throws SharingRegistryException {
EntityManager entityManager = JPAUtils.getEntityManager();
try {
entityManager.getTransaction().begin();
@@ -117,7 +117,7 @@ public class JPAUtils {
}
}
- public static void initializeDB() throws GovRegistryException {
+ public static void initializeDB() throws SharingRegistryException {
jdbcDriver = readServerProperties(SHARING_REG_JDBC_DRIVER);
jdbcURl = readServerProperties(SHARING_REG_JDBC_URL);
jdbcUser = readServerProperties(SHARING_REG_JDBC_USER);
@@ -219,12 +219,12 @@ public class JPAUtils {
}
}
- private static String readServerProperties(String propertyName) throws GovRegistryException {
+ private static String readServerProperties(String propertyName) throws SharingRegistryException {
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...");
+ throw new SharingRegistryException("Unable to read airavata-server.properties...");
}
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/4739a9fc/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
index bfcaa1f..e136b47 100644
--- 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
@@ -63,9 +63,9 @@ public class SharingRegistryServerHandler implements GovRegistryService.Iface{
* *
*/
@Override
- public String createDomain(Domain domain) throws GovRegistryException, TException {
+ public String createDomain(Domain domain) throws SharingRegistryException, TException {
if(domainRepository.get(domain.domainId) != null)
- throw new GovRegistryException("There exist domain with given domain id");
+ throw new SharingRegistryException("There exist domain with given domain id");
domain.setCreatedTime(System.currentTimeMillis());
domain.setUpdatedTime(System.currentTimeMillis());
@@ -85,7 +85,7 @@ public class SharingRegistryServerHandler implements GovRegistryService.Iface{
}
@Override
- public boolean updateDomain(Domain domain) throws GovRegistryException, TException {
+ public boolean updateDomain(Domain domain) throws SharingRegistryException, TException {
Domain oldDomain = domainRepository.get(domain.domainId);
domain.setCreatedTime(oldDomain.createdTime);
domain.setUpdatedTime(System.currentTimeMillis());
@@ -95,13 +95,13 @@ public class SharingRegistryServerHandler implements GovRegistryService.Iface{
}
@Override
- public boolean deleteDomain(String domainId) throws GovRegistryException, TException {
+ public boolean deleteDomain(String domainId) throws SharingRegistryException, TException {
domainRepository.delete(domainId);
return true;
}
@Override
- public Domain getDomain(String domainId) throws GovRegistryException, TException {
+ public Domain getDomain(String domainId) throws SharingRegistryException, TException {
return domainRepository.get(domainId);
}
@@ -115,9 +115,9 @@ public class SharingRegistryServerHandler implements GovRegistryService.Iface{
* *
*/
@Override
- public String createUser(User user) throws GovRegistryException, TException {
+ public String createUser(User user) throws SharingRegistryException, TException {
if(userRepository.get(user.userId) != null)
- throw new GovRegistryException("There exist user with given user id");
+ throw new SharingRegistryException("There exist user with given user id");
user.setCreatedTime(System.currentTimeMillis());
user.setUpdatedTime(System.currentTimeMillis());
@@ -136,7 +136,7 @@ public class SharingRegistryServerHandler implements GovRegistryService.Iface{
}
@Override
- public boolean updatedUser(User user) throws GovRegistryException, TException {
+ public boolean updatedUser(User user) throws SharingRegistryException, TException {
User oldUser = userRepository.get(user.userId);
user.setCreatedTime(oldUser.createdTime);
user.setUpdatedTime(System.currentTimeMillis());
@@ -151,19 +151,19 @@ public class SharingRegistryServerHandler implements GovRegistryService.Iface{
}
@Override
- public boolean deleteUser(String userId) throws GovRegistryException, TException {
+ public boolean deleteUser(String userId) throws SharingRegistryException, TException {
userRepository.delete(userId);
userGroupRepository.delete(userId);
return true;
}
@Override
- public User getUser(String userId) throws GovRegistryException, TException {
+ public User getUser(String userId) throws SharingRegistryException, TException {
return userRepository.get(userId);
}
@Override
- public List<User> getUsers(String domain, int offset, int limit) throws GovRegistryException, TException {
+ public List<User> getUsers(String domain, int offset, int limit) throws SharingRegistryException, TException {
HashMap<String, String> filters = new HashMap<>();
filters.put(DBConstants.UserTable.DOMAIN_ID, domain);
return userRepository.select(filters, offset, limit);
@@ -174,9 +174,9 @@ public class SharingRegistryServerHandler implements GovRegistryService.Iface{
* *
*/
@Override
- public String createGroup(UserGroup group) throws GovRegistryException, TException {
+ public String createGroup(UserGroup group) throws SharingRegistryException, TException {
if(userGroupRepository.get(group.groupId) != null)
- throw new GovRegistryException("There exist group with given group id");
+ throw new SharingRegistryException("There exist group with given group id");
group.setCreatedTime(System.currentTimeMillis());
group.setUpdatedTime(System.currentTimeMillis());
@@ -185,7 +185,7 @@ public class SharingRegistryServerHandler implements GovRegistryService.Iface{
}
@Override
- public boolean updateGroup(UserGroup group) throws GovRegistryException, TException {
+ public boolean updateGroup(UserGroup group) throws SharingRegistryException, TException {
group.setUpdatedTime(System.currentTimeMillis());
UserGroup oldGroup = userGroupRepository.get(group.groupId);
group.setCreatedTime(oldGroup.createdTime);
@@ -195,13 +195,13 @@ public class SharingRegistryServerHandler implements GovRegistryService.Iface{
}
@Override
- public boolean deleteGroup(String groupId) throws GovRegistryException, TException {
+ public boolean deleteGroup(String groupId) throws SharingRegistryException, TException {
userGroupRepository.delete(groupId);
return true;
}
@Override
- public UserGroup getGroup(String groupId) throws GovRegistryException, TException {
+ public UserGroup getGroup(String groupId) throws SharingRegistryException, TException {
return userGroupRepository.get(groupId);
}
@@ -213,7 +213,7 @@ public class SharingRegistryServerHandler implements GovRegistryService.Iface{
}
@Override
- public boolean addUsersToGroup(List<String> userIds, String groupId) throws GovRegistryException, TException {
+ public boolean addUsersToGroup(List<String> userIds, String groupId) throws SharingRegistryException, TException {
for(int i=0; i < userIds.size(); i++){
GroupMembership groupMembership = new GroupMembership();
groupMembership.setParentId(groupId);
@@ -227,7 +227,7 @@ public class SharingRegistryServerHandler implements GovRegistryService.Iface{
}
@Override
- public boolean removeUsersFromGroup(List<String> userIds, String groupId) throws GovRegistryException, TException {
+ public boolean removeUsersFromGroup(List<String> userIds, String groupId) throws SharingRegistryException, TException {
for(int i=0; i < userIds.size(); i++){
GroupMembershipEntityPK groupMembershipEntityPK = new GroupMembershipEntityPK();
groupMembershipEntityPK.setParentId(groupId);
@@ -238,7 +238,7 @@ public class SharingRegistryServerHandler implements GovRegistryService.Iface{
}
@Override
- public Map<String, GroupChildType> getGroupMembers(String groupId, int offset, int limit) throws GovRegistryException, TException {
+ public Map<String, GroupChildType> getGroupMembers(String groupId, int offset, int limit) throws SharingRegistryException, TException {
HashMap<String, GroupChildType> groupMembers = new HashMap<>();
HashMap<String, String> filters = new HashMap<>();
filters.put(DBConstants.GroupMembershipTable.PARENT_ID, groupId);
@@ -248,7 +248,7 @@ public class SharingRegistryServerHandler implements GovRegistryService.Iface{
}
@Override
- public boolean addChildGroupToParentGroup(String childId, String groupId) throws GovRegistryException, TException {
+ public boolean addChildGroupToParentGroup(String childId, String groupId) throws SharingRegistryException, TException {
//Todo check for cyclic dependencies
GroupMembership groupMembership = new GroupMembership();
groupMembership.setParentId(groupId);
@@ -261,7 +261,7 @@ public class SharingRegistryServerHandler implements GovRegistryService.Iface{
}
@Override
- public boolean removeChildGroupFromParentGroup(String childId, String groupId) throws GovRegistryException, TException {
+ public boolean removeChildGroupFromParentGroup(String childId, String groupId) throws SharingRegistryException, TException {
GroupMembershipEntityPK groupMembershipEntityPK = new GroupMembershipEntityPK();
groupMembershipEntityPK.setParentId(groupId);
groupMembershipEntityPK.setChildId(childId);
@@ -274,9 +274,9 @@ public class SharingRegistryServerHandler implements GovRegistryService.Iface{
* *
*/
@Override
- public String createEntityType(EntityType entityType) throws GovRegistryException, TException {
+ public String createEntityType(EntityType entityType) throws SharingRegistryException, TException {
if(entityTypeRepository.get(entityType.entityTypeId) != null)
- throw new GovRegistryException("There exist EntityType with given EntityType id");
+ throw new SharingRegistryException("There exist EntityType with given EntityType id");
entityType.setCreatedTime(System.currentTimeMillis());
entityType.setUpdatedTime(System.currentTimeMillis());
@@ -285,7 +285,7 @@ public class SharingRegistryServerHandler implements GovRegistryService.Iface{
}
@Override
- public boolean updateEntityType(EntityType entityType) throws GovRegistryException, TException {
+ public boolean updateEntityType(EntityType entityType) throws SharingRegistryException, TException {
entityType.setUpdatedTime(System.currentTimeMillis());
EntityType oldEntityType = entityTypeRepository.get(entityType.entityTypeId);
entityType.setCreatedTime(oldEntityType.createdTime);
@@ -295,13 +295,13 @@ public class SharingRegistryServerHandler implements GovRegistryService.Iface{
}
@Override
- public boolean deleteEntityType(String entityTypeId) throws GovRegistryException, TException {
+ public boolean deleteEntityType(String entityTypeId) throws SharingRegistryException, TException {
entityTypeRepository.delete(entityTypeId);
return true;
}
@Override
- public EntityType getEntityType(String entityTypeId) throws GovRegistryException, TException {
+ public EntityType getEntityType(String entityTypeId) throws SharingRegistryException, TException {
return entityTypeRepository.get(entityTypeId);
}
@@ -317,9 +317,9 @@ public class SharingRegistryServerHandler implements GovRegistryService.Iface{
* *
*/
@Override
- public String createPermissionType(PermissionType permissionType) throws GovRegistryException, TException {
+ public String createPermissionType(PermissionType permissionType) throws SharingRegistryException, TException {
if(permissionTypeRepository.get(permissionType.permissionTypeId) != null)
- throw new GovRegistryException("There exist PermissionType with given PermissionType id");
+ throw new SharingRegistryException("There exist PermissionType with given PermissionType id");
permissionType.setCreatedTime(System.currentTimeMillis());
permissionType.setUpdatedTime(System.currentTimeMillis());
permissionTypeRepository.create(permissionType);
@@ -327,7 +327,7 @@ public class SharingRegistryServerHandler implements GovRegistryService.Iface{
}
@Override
- public boolean updatePermissionType(PermissionType permissionType) throws GovRegistryException, TException {
+ public boolean updatePermissionType(PermissionType permissionType) throws SharingRegistryException, TException {
permissionType.setUpdatedTime(System.currentTimeMillis());
PermissionType oldPermissionType = permissionTypeRepository.get(permissionType.permissionTypeId);
permissionType = getUpdatedObject(oldPermissionType, permissionType);
@@ -336,18 +336,18 @@ public class SharingRegistryServerHandler implements GovRegistryService.Iface{
}
@Override
- public boolean deletePermissionType(String entityTypeId) throws GovRegistryException, TException {
+ public boolean deletePermissionType(String entityTypeId) throws SharingRegistryException, TException {
permissionTypeRepository.delete(entityTypeId);
return true;
}
@Override
- public PermissionType getPermissionType(String permissionTypeId) throws GovRegistryException, TException {
+ public PermissionType getPermissionType(String permissionTypeId) throws SharingRegistryException, TException {
return permissionTypeRepository.get(permissionTypeId);
}
@Override
- public List<PermissionType> getPermissionTypes(String domain, int offset, int limit) throws GovRegistryException, TException {
+ public List<PermissionType> getPermissionTypes(String domain, int offset, int limit) throws SharingRegistryException, TException {
HashMap<String, String> filters = new HashMap<>();
filters.put(DBConstants.PermissionTypeTable.DOMAIN_ID, domain);
return permissionTypeRepository.select(filters, offset, limit);
@@ -358,9 +358,9 @@ public class SharingRegistryServerHandler implements GovRegistryService.Iface{
* *
*/
@Override
- public String createEntity(Entity entity) throws GovRegistryException, TException {
+ public String createEntity(Entity entity) throws SharingRegistryException, TException {
if(entityRepository.get(entity.entityId) != null)
- throw new GovRegistryException("There exist Entity with given Entity id");
+ throw new SharingRegistryException("There exist Entity with given Entity id");
entity.setCreatedTime(System.currentTimeMillis());
entity.setUpdatedTime(System.currentTimeMillis());
@@ -399,7 +399,7 @@ public class SharingRegistryServerHandler implements GovRegistryService.Iface{
}
@Override
- public boolean updateEntity(Entity entity) throws GovRegistryException, TException {
+ public boolean updateEntity(Entity entity) throws SharingRegistryException, TException {
//TODO Check for permission changes
entity.setUpdatedTime(System.currentTimeMillis());
Entity oldEntity = entityRepository.get(entity.getEntityId());
@@ -410,20 +410,20 @@ public class SharingRegistryServerHandler implements GovRegistryService.Iface{
}
@Override
- public boolean deleteEntity(String entityId) throws GovRegistryException, TException {
+ public boolean deleteEntity(String entityId) throws SharingRegistryException, TException {
//TODO Check for permission changes
entityRepository.delete(entityId);
return true;
}
@Override
- public Entity getEntity(String entityId) throws GovRegistryException, TException {
+ public Entity getEntity(String entityId) throws SharingRegistryException, 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 {
+ int offset, int limit) throws SharingRegistryException, TException {
List<String> groupIds = new ArrayList<>();
groupIds.add(userId);
groupMembershipRepository.getAllParentMembershipsForChild(userId).stream().forEach(gm->groupIds.add(gm.parentId));
@@ -431,12 +431,12 @@ public class SharingRegistryServerHandler implements GovRegistryService.Iface{
}
@Override
- public List<User> getListOfSharedUsers(String entityId, String permissionTypeId) throws GovRegistryException, TException {
+ public List<User> getListOfSharedUsers(String entityId, String permissionTypeId) throws SharingRegistryException, TException {
return null;
}
@Override
- public List<UserGroup> getListOfSharedGroups(String entityId, String permissionTypeId) throws GovRegistryException, TException {
+ public List<UserGroup> getListOfSharedGroups(String entityId, String permissionTypeId) throws SharingRegistryException, TException {
return null;
}
@@ -449,16 +449,16 @@ public class SharingRegistryServerHandler implements GovRegistryService.Iface{
* @param permissionType
*/
@Override
- public boolean shareEntityWithUsers(String entityId, List<String> userList, String permissionTypeId, boolean cascadePermission) throws GovRegistryException, TException {
+ public boolean shareEntityWithUsers(String entityId, List<String> userList, String permissionTypeId, boolean cascadePermission) throws SharingRegistryException, TException {
return shareEntity(entityId, userList, permissionTypeId, GroupType.SINGLE_USER, cascadePermission);
}
@Override
- public boolean shareEntityWithGroups(String entityId, List<String> groupList, String permissionTypeId, boolean cascadePermission) throws GovRegistryException, TException {
+ public boolean shareEntityWithGroups(String entityId, List<String> groupList, String permissionTypeId, boolean cascadePermission) throws SharingRegistryException, TException {
return shareEntity(entityId, groupList, permissionTypeId, GroupType.MULTI_USER, cascadePermission);
}
- private boolean shareEntity(String entityId, List<String> groupOrUserList, String permissionTypeId, GroupType groupType, boolean cascadePermission) throws GovRegistryException, TException {
+ private boolean shareEntity(String entityId, List<String> groupOrUserList, String permissionTypeId, GroupType groupType, boolean cascadePermission) throws SharingRegistryException, TException {
//Adding permission for the specified users/groups for the specified entity
LinkedList<Entity> temp = new LinkedList<>();
for(String userId : groupOrUserList){
@@ -503,18 +503,18 @@ public class SharingRegistryServerHandler implements GovRegistryService.Iface{
}
@Override
- public boolean revokeEntitySharingFromUsers(String entityId, List<String> userList, String permissionTypeId) throws GovRegistryException, TException {
+ public boolean revokeEntitySharingFromUsers(String entityId, List<String> userList, String permissionTypeId) throws SharingRegistryException, TException {
return revokeEntitySharing(entityId, userList, permissionTypeId);
}
@Override
- public boolean revokeEntitySharingFromGroups(String entityId, List<String> groupList, String permissionTypeId) throws GovRegistryException, TException {
+ public boolean revokeEntitySharingFromGroups(String entityId, List<String> groupList, String permissionTypeId) throws SharingRegistryException, TException {
return revokeEntitySharing(entityId, groupList, permissionTypeId);
}
@Override
- public boolean userHasAccess(String domainId, String userId, String entityId, String permissionTypeId) throws GovRegistryException, TException {
+ public boolean userHasAccess(String domainId, String userId, String entityId, String permissionTypeId) throws SharingRegistryException, TException {
//check whether the user has permission directly or indirectly
List<GroupMembership> parentMemberships = groupMembershipRepository.getAllParentMembershipsForChild(userId);
List<String> groupIds = new ArrayList<>();
@@ -524,7 +524,7 @@ public class SharingRegistryServerHandler implements GovRegistryService.Iface{
permissionTypeRepository.getGlobalPermissionTypeIdForDomain(domainId)));
}
- public boolean revokeEntitySharing(String entityId, List<String> groupOrUserList, String permissionTypeId) throws GovRegistryException {
+ public boolean revokeEntitySharing(String entityId, List<String> groupOrUserList, String permissionTypeId) throws SharingRegistryException {
//revoking permission for the entity
for(String groupId : groupOrUserList){
SharingEntityPK sharingEntityPK = new SharingEntityPK();
@@ -556,7 +556,7 @@ public class SharingRegistryServerHandler implements GovRegistryService.Iface{
- private <T> T getUpdatedObject(T oldEntity, T newEntity) throws GovRegistryException {
+ private <T> T getUpdatedObject(T oldEntity, T newEntity) throws SharingRegistryException {
Field[] newEntityFields = newEntity.getClass().getDeclaredFields();
Hashtable newHT = fieldsToHT(newEntityFields, newEntity);
@@ -574,7 +574,7 @@ public class SharingRegistryServerHandler implements GovRegistryService.Iface{
logger.debug("setting " + f.getName());
f.set(oldEntity, o);
} catch (Exception e) {
- throw new GovRegistryException(e.getMessage());
+ throw new SharingRegistryException(e.getMessage());
}
}
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/4739a9fc/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
deleted file mode 100644
index 40bc7c0..0000000
--- a/modules/sharing-registry/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-06")
-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/4739a9fc/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/SharingRegistryException.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/SharingRegistryException.java b/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/SharingRegistryException.java
new file mode 100644
index 0000000..83d0c00
--- /dev/null
+++ b/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/SharingRegistryException.java
@@ -0,0 +1,381 @@
+/**
+ * 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.TException;
+
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.EnumSet;
+import java.util.Collections;
+import javax.annotation.Generated;
+
+@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-06")
+public class SharingRegistryException extends TException implements org.apache.thrift.TBase<SharingRegistryException, SharingRegistryException._Fields>, java.io.Serializable, Cloneable, Comparable<SharingRegistryException> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SharingRegistryException");
+
+ 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(SharingRegistryException.class, metaDataMap);
+ }
+
+ public SharingRegistryException() {
+ }
+
+ public SharingRegistryException(
+ String message)
+ {
+ this();
+ this.message = message;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public SharingRegistryException(SharingRegistryException other) {
+ if (other.isSetMessage()) {
+ this.message = other.message;
+ }
+ }
+
+ public SharingRegistryException deepCopy() {
+ return new SharingRegistryException(this);
+ }
+
+ @Override
+ public void clear() {
+ this.message = null;
+ }
+
+ public String getMessage() {
+ return this.message;
+ }
+
+ public SharingRegistryException 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 SharingRegistryException)
+ return this.equals((SharingRegistryException)that);
+ return false;
+ }
+
+ public boolean equals(SharingRegistryException 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(SharingRegistryException 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("SharingRegistryException(");
+ 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<SharingRegistryException> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, SharingRegistryException 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, SharingRegistryException 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<SharingRegistryException> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, SharingRegistryException struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ oprot.writeString(struct.message);
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, SharingRegistryException struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ struct.message = iprot.readString();
+ struct.setMessageIsSet(true);
+ }
+ }
+
+}
+