Adding offset and limit filed to user-profile cpi

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

Branch: refs/heads/registry-refactoring
Commit: e43905cb1e482eaac589f705739e0cd74d79cdd2
Parents: 19b54a0
Author: Abhiit Karanjkar <[email protected]>
Authored: Tue Nov 29 15:03:57 2016 -0500
Committer: Abhiit Karanjkar <[email protected]>
Committed: Fri Dec 2 14:54:08 2016 -0500

----------------------------------------------------------------------
 .../workspacecatalog/UserProfileRepository.java |   4 +-
 .../server/UserProfileHandler.java              |   9 +-
 .../crude/cpi/UserProfileCrudeService.java      | 462 +++++++++----------
 .../cpi/user_profile_crud_cpiConstants.java     |  16 -
 4 files changed, 230 insertions(+), 261 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/e43905cb/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 7c5bd4b..de0f99e 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
@@ -60,12 +60,12 @@ public class UserProfileRepository extends 
AbstractRepository<UserProfile, UserP
         return userProfile;
     }
 
-    public List<UserProfile> getAllUserProfilesInGateway(String gatewayId)  {
+    public List<UserProfile> getAllUserProfilesInGateway(String gatewayId, int 
offset, int limit)  {
 
         Map<String, Object> queryParam = new HashMap<String, Object>();
         queryParam.put(UserProfile._Fields.GATEWAY_ID.getFieldName(), 
gatewayId);
 
-        List<UserProfile> resultList = 
select(QueryConstants.FIND_ALL_USER_PROFILES_BY_GATEWAY_ID, 0, 1, queryParam);
+        List<UserProfile> resultList = 
select(QueryConstants.FIND_ALL_USER_PROFILES_BY_GATEWAY_ID, limit, offset, 
queryParam);
 
         return  resultList;
     }

http://git-wip-us.apache.org/repos/asf/airavata/blob/e43905cb/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 8f04204..6c2726d 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
@@ -60,12 +60,13 @@ public class UserProfileHandler implements 
UserProfileCrudeService.Iface {
         return deleteResult;
     }
 
-    public List<UserProfile> getAllUserProfilesInGateway(String gatewayId) 
throws RegistryServiceException, TException {
+    public List<UserProfile> getAllUserProfilesInGateway(String gatewayId, int 
offset, int limit) throws RegistryServiceException, TException {
 
-        List<UserProfile> usersInGateway = 
userProfileRepository.getAllUserProfilesInGateway(gatewayId);
+        List<UserProfile> usersInGateway = 
userProfileRepository.getAllUserProfilesInGateway(gatewayId, offset, limit);
         return usersInGateway;
     }
 
+
     public UserProfile getUserProfileByName(String userName, String gatewayId) 
throws RegistryServiceException, TException {
 
         UserProfile userProfile = 
userProfileRepository.getUserProfileByNameAndGateWay(userName, gatewayId);
@@ -76,8 +77,8 @@ public class UserProfileHandler implements 
UserProfileCrudeService.Iface {
 
         UserProfile userProfile = 
userProfileRepository.getUserProfileByNameAndGateWay(userName, gatewayId);
 
-                if(null != userProfile)
-                    return true;
+        if (null != userProfile)
+            return true;
         return false;
     }
 }

Reply via email to