X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=vid-app-common%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fvid%2Fservices%2FRoleGenaratorServiceImpl.java;h=3ff8db0e5411fcc0c3071490a587374991e73acd;hb=refs%2Fchanges%2F59%2F75159%2F12;hp=500f5ac7fca6dd6e0ee21757f583840b0952997a;hpb=5ec29ff5e3864f1ba6ecac71f8bffbefa400cf27;p=vid.git diff --git a/vid-app-common/src/main/java/org/onap/vid/services/RoleGenaratorServiceImpl.java b/vid-app-common/src/main/java/org/onap/vid/services/RoleGenaratorServiceImpl.java index 500f5ac7f..3ff8db0e5 100644 --- a/vid-app-common/src/main/java/org/onap/vid/services/RoleGenaratorServiceImpl.java +++ b/vid-app-common/src/main/java/org/onap/vid/services/RoleGenaratorServiceImpl.java @@ -23,16 +23,11 @@ package org.onap.vid.services; import io.joshworks.restclient.http.HttpResponse; import jline.internal.Log; -import org.onap.vid.aai.AaiClientInterface; -import org.onap.vid.aai.AaiOverTLSClientInterface; -import org.onap.vid.aai.AaiResponse; -import org.onap.vid.aai.ServiceSubscription; -import org.onap.vid.aai.Services; +import org.onap.vid.aai.*; import org.onap.vid.model.ModelConstants; import org.onap.vid.model.Subscriber; import org.onap.vid.model.SubscriberList; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Service; import java.util.HashMap; @@ -46,7 +41,6 @@ public class RoleGenaratorServiceImpl implements RoleGeneratorService { AaiClientInterface client; @Autowired - @Qualifier("aaiClientForCodehausMapping") AaiOverTLSClientInterface aaiOverTLSClient; public static final String DB_NAME = "vid_portal"; @@ -73,8 +67,9 @@ public class RoleGenaratorServiceImpl implements RoleGeneratorService { } private String addAvailableRolesCombination(Boolean firstRun, SubscriberList subscribers) { - String query, availableRoles=""; - HashMap servicesNames = new HashMap(); + String query; + String availableRoles=""; + HashMap servicesNames = new HashMap<>(); for (Subscriber subscriber: subscribers.customer) { AaiResponse subscriberResponse = client.getSubscriberData(subscriber.globalCustomerId); for(ServiceSubscription service: subscriberResponse.getT().serviceSubscriptions.serviceSubscription) { @@ -146,13 +141,12 @@ public class RoleGenaratorServiceImpl implements RoleGeneratorService { } private String insertAvailableRolesToFnRole(){ - String query="INSERT INTO fn_role (ROLE_NAME, ACTIVE_YN, PRIORITY)\r\n" + + return "INSERT INTO fn_role (ROLE_NAME, ACTIVE_YN, PRIORITY)\r\n" + "SELECT RNAME, 'Y', 5\r\n" + "FROM available_roles\r\n" + "WHERE NOT EXISTS (SELECT ROLE_NAME\r\n" + "FROM fn_role \r\n" + "where RNAME = ROLE_NAME);\r\n"; - return query; }