aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/java/org/onap/vid/services/RoleGenaratorServiceImpl.java
diff options
context:
space:
mode:
Diffstat (limited to 'vid-app-common/src/main/java/org/onap/vid/services/RoleGenaratorServiceImpl.java')
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/services/RoleGenaratorServiceImpl.java16
1 files changed, 5 insertions, 11 deletions
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<String,String> servicesNames = new HashMap<String,String>();
+ String query;
+ String availableRoles="";
+ HashMap<String,String> servicesNames = new HashMap<>();
for (Subscriber subscriber: subscribers.customer) {
AaiResponse<Services> 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;
}