Repository: airavata Updated Branches: refs/heads/registry-refactoring 208e5d387 -> 69af77805
removing references to removed fields Project: http://git-wip-us.apache.org/repos/asf/airavata/repo Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/69af7780 Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/69af7780 Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/69af7780 Branch: refs/heads/registry-refactoring Commit: 69af7780510af2e297f29b099303327adb7ca822 Parents: 208e5d3 Author: scnakandala <[email protected]> Authored: Tue May 30 15:13:30 2017 -0400 Committer: scnakandala <[email protected]> Committed: Tue May 30 15:13:30 2017 -0400 ---------------------------------------------------------------------- .../workspacecatalog/UserProfileRepository.java | 16 ---------------- .../registry/core/utils/QueryConstants.java | 9 --------- .../server/UserProfileHandler.java | 6 ++---- 3 files changed, 2 insertions(+), 29 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata/blob/69af7780/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workspacecatalog/UserProfileRepository.java ---------------------------------------------------------------------- diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workspacecatalog/UserProfileRepository.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workspacecatalog/UserProfileRepository.java index de0f99e..3fb71f0 100644 --- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workspacecatalog/UserProfileRepository.java +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workspacecatalog/UserProfileRepository.java @@ -69,20 +69,4 @@ public class UserProfileRepository extends AbstractRepository<UserProfile, UserP return resultList; } - - public UserProfile getUserProfileByNameAndGateWay(String name, String gatewayId) { - - UserProfile userProfile = null; - - Map<String, Object> queryParam = new HashMap<String, Object>(); - queryParam.put(UserProfile._Fields.USER_NAME.getFieldName(), name); - queryParam.put(UserProfile._Fields.GATEWAY_ID.getFieldName(), gatewayId); - List<UserProfile> resultList = select(QueryConstants.FIND_USER_PROFILE_BY_USER_NAME, 0, 1, queryParam); - - if (resultList != null && resultList.size() > 0) - userProfile = resultList.get(0); - - - return userProfile; - } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/69af7780/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/QueryConstants.java ---------------------------------------------------------------------- diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/QueryConstants.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/QueryConstants.java index 171317e..250c461 100644 --- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/QueryConstants.java +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/QueryConstants.java @@ -2,21 +2,12 @@ package org.apache.airavata.registry.core.utils; import org.apache.airavata.model.user.UserProfile; -/** - * Created by abhij on 11/11/2016. - */ public interface QueryConstants { - - String FIND_USER_PROFILE_BY_USER_ID = "SELECT u FROM UserProfileEntity u " + "where u.userId LIKE :" + UserProfile._Fields.USER_ID.getFieldName() + " " + "AND u.gatewayId LIKE :"+ UserProfile._Fields.GATEWAY_ID.getFieldName() + ""; String FIND_ALL_USER_PROFILES_BY_GATEWAY_ID = "SELECT u FROM UserProfileEntity u " + "where u.gatewayId LIKE :"+ UserProfile._Fields.GATEWAY_ID.getFieldName() + ""; - - String FIND_USER_PROFILE_BY_USER_NAME = "SELECT u FROM UserProfileEntity u " + - "where u.userId LIKE :" + UserProfile._Fields.USER_NAME.getFieldName() + " " + - "AND u.gatewayId LIKE :"+ UserProfile._Fields.GATEWAY_ID.getFieldName() + ""; } http://git-wip-us.apache.org/repos/asf/airavata/blob/69af7780/modules/user-profile/user-profile-service/src/main/java/com.apache.airavata.user.profile/server/UserProfileHandler.java ---------------------------------------------------------------------- diff --git a/modules/user-profile/user-profile-service/src/main/java/com.apache.airavata.user.profile/server/UserProfileHandler.java b/modules/user-profile/user-profile-service/src/main/java/com.apache.airavata.user.profile/server/UserProfileHandler.java index 6c2726d..4421f44 100644 --- a/modules/user-profile/user-profile-service/src/main/java/com.apache.airavata.user.profile/server/UserProfileHandler.java +++ b/modules/user-profile/user-profile-service/src/main/java/com.apache.airavata.user.profile/server/UserProfileHandler.java @@ -7,9 +7,7 @@ import org.apache.airavata.registry.core.repositories.workspacecatalog.UserProfi import org.apache.airavata.userprofile.crude.cpi.UserProfileCrudeService; import org.apache.thrift.TException; -import java.util.HashMap; import java.util.List; -import java.util.Map; /** * Created by Airavata on 11/11/2016. @@ -69,13 +67,13 @@ public class UserProfileHandler implements UserProfileCrudeService.Iface { public UserProfile getUserProfileByName(String userName, String gatewayId) throws RegistryServiceException, TException { - UserProfile userProfile = userProfileRepository.getUserProfileByNameAndGateWay(userName, gatewayId); + UserProfile userProfile = userProfileRepository.getUserProfileByIdAndGateWay(userName, gatewayId); return userProfile; } public boolean doesUserExist(String userName, String gatewayId) throws RegistryServiceException, TException { - UserProfile userProfile = userProfileRepository.getUserProfileByNameAndGateWay(userName, gatewayId); + UserProfile userProfile = userProfileRepository.getUserProfileByIdAndGateWay(userName, gatewayId); if (null != userProfile) return true;
