From cfb69f44f841338e1f208225ec006388e986bd2c Mon Sep 17 00:00:00 2001 From: "Kotta, Shireesha (sk434m)" Date: Tue, 6 Mar 2018 09:44:53 -0500 Subject: Added Junits & AAF attributes Support Issue-ID: PORTAL-136 Includes JUNITS, AAF attributes support Change-Id: Id4cc9f64268017665d7245d0a10369c9b498ba2f Signed-off-by: Kotta, Shireesha (sk434m) --- .../org/onap/portalsdk/core/service/UserServiceCentalizedImpl.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/UserServiceCentalizedImpl.java') diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/UserServiceCentalizedImpl.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/UserServiceCentalizedImpl.java index d1b05695..646581ae 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/UserServiceCentalizedImpl.java +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/UserServiceCentalizedImpl.java @@ -51,6 +51,7 @@ import org.onap.portalsdk.core.domain.Role; import org.onap.portalsdk.core.domain.RoleFunction; import org.onap.portalsdk.core.domain.User; import org.onap.portalsdk.core.domain.UserApp; +import org.onap.portalsdk.core.web.support.UserUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; @@ -64,6 +65,8 @@ public class UserServiceCentalizedImpl implements UserService { @Autowired private DataAccessService dataAccessService; + + private static String portalApiVersion = "/v1"; public DataAccessService getDataAccessService() { return dataAccessService; @@ -76,7 +79,7 @@ public class UserServiceCentalizedImpl implements UserService { @Override public User getUser(String id) throws IOException { String orgUserId = getUserByProfileId(id); - String responseString = restApiRequestBuilder.getViaREST("/user/" + orgUserId, true, id); + String responseString = restApiRequestBuilder.getViaREST(portalApiVersion+"/user/" + orgUserId, true, id); User user = userMapper(responseString); return user; } @@ -96,7 +99,6 @@ public class UserServiceCentalizedImpl implements UserService { public User userMapper(String res) throws IOException { ObjectMapper mapper = new ObjectMapper(); User user = mapper.readValue(res, User.class); - Set roleFunctionListNew = new HashSet<>(); SortedSet userAppSet = new TreeSet<>(); @SuppressWarnings("unchecked") Set setAppsObj = user.getUserApps(); @@ -108,6 +110,7 @@ public class UserServiceCentalizedImpl implements UserService { @SuppressWarnings("unchecked") Set roleFunctionList = role.getRoleFunctions(); Iterator roleFnIter = roleFunctionList.iterator(); + Set roleFunctionListNew = new HashSet<>(); while (roleFnIter.hasNext()) { Object nextValue = roleFnIter.next(); RoleFunction roleFunction = mapper.convertValue(nextValue, RoleFunction.class); -- cgit 1.2.3-korg