summaryrefslogtreecommitdiffstats
path: root/controlloop/common/actors/actor.appclcm/src
diff options
context:
space:
mode:
Diffstat (limited to 'controlloop/common/actors/actor.appclcm/src')
-rw-r--r--controlloop/common/actors/actor.appclcm/src/main/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmActorServiceProvider.java46
-rw-r--r--controlloop/common/actors/actor.appclcm/src/test/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmServiceProviderTest.java4
2 files changed, 25 insertions, 25 deletions
diff --git a/controlloop/common/actors/actor.appclcm/src/main/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmActorServiceProvider.java b/controlloop/common/actors/actor.appclcm/src/main/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmActorServiceProvider.java
index f2d0991e2..0db66c5af 100644
--- a/controlloop/common/actors/actor.appclcm/src/main/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmActorServiceProvider.java
+++ b/controlloop/common/actors/actor.appclcm/src/main/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmActorServiceProvider.java
@@ -31,14 +31,14 @@ import java.util.List;
import java.util.Map;
import java.util.UUID;
-import org.onap.policy.aai.AAIManager;
-import org.onap.policy.aai.AAINQInstanceFilters;
-import org.onap.policy.aai.AAINQInventoryResponseItem;
-import org.onap.policy.aai.AAINQNamedQuery;
-import org.onap.policy.aai.AAINQQueryParameters;
-import org.onap.policy.aai.AAINQRequest;
-import org.onap.policy.aai.AAINQResponse;
-import org.onap.policy.aai.util.AAIException;
+import org.onap.policy.aai.AaiManager;
+import org.onap.policy.aai.AaiNqInstanceFilters;
+import org.onap.policy.aai.AaiNqInventoryResponseItem;
+import org.onap.policy.aai.AaiNqNamedQuery;
+import org.onap.policy.aai.AaiNqQueryParameters;
+import org.onap.policy.aai.AaiNqRequest;
+import org.onap.policy.aai.AaiNqResponse;
+import org.onap.policy.aai.util.AaiException;
import org.onap.policy.appclcm.LCMCommonHeader;
import org.onap.policy.appclcm.LCMRequest;
import org.onap.policy.appclcm.LCMRequestWrapper;
@@ -115,12 +115,12 @@ public class AppcLcmActorServiceProvider implements Actor {
*
* @return the vnf-id of the target vnf to act upon or null if not found
*/
- private static String parseAaiResponse(List<AAINQInventoryResponseItem> items, String resourceId) {
+ private static String parseAaiResponse(List<AaiNqInventoryResponseItem> items, String resourceId) {
String vnfId = null;
- for (AAINQInventoryResponseItem item : items) {
- if ((item.getGenericVNF() != null) && (item.getGenericVNF().getModelInvariantId() != null)
- && (resourceId.equals(item.getGenericVNF().getModelInvariantId()))) {
- vnfId = item.getGenericVNF().getVnfID();
+ for (AaiNqInventoryResponseItem item : items) {
+ if ((item.getGenericVnf() != null) && (item.getGenericVnf().getModelInvariantId() != null)
+ && (resourceId.equals(item.getGenericVnf().getModelInvariantId()))) {
+ vnfId = item.getGenericVnf().getVnfId();
break;
} else {
if ((item.getItems() != null) && (item.getItems().getInventoryResponseItems() != null)) {
@@ -140,17 +140,17 @@ public class AppcLcmActorServiceProvider implements Actor {
* @param sourceVnfId the vnf id of the source entity reporting the alert
*
* @return the target entities vnf id to act upon
- * @throws AAIException it an error occurs
+ * @throws AaiException it an error occurs
*/
- public static String vnfNamedQuery(String resourceId, String sourceVnfId) throws AAIException {
+ public static String vnfNamedQuery(String resourceId, String sourceVnfId) throws AaiException {
// TODO: This request id should not be hard coded in future releases
UUID requestId = UUID.fromString("a93ac487-409c-4e8c-9e5f-334ae8f99087");
- AAINQRequest aaiRequest = new AAINQRequest();
- aaiRequest.setQueryParameters(new AAINQQueryParameters());
- aaiRequest.getQueryParameters().setNamedQuery(new AAINQNamedQuery());
- aaiRequest.getQueryParameters().getNamedQuery().setNamedQueryUUID(requestId);
+ AaiNqRequest aaiRequest = new AaiNqRequest();
+ aaiRequest.setQueryParameters(new AaiNqQueryParameters());
+ aaiRequest.getQueryParameters().setNamedQuery(new AaiNqNamedQuery());
+ aaiRequest.getQueryParameters().getNamedQuery().setNamedQueryUuid(requestId);
Map<String, Map<String, String>> filter = new HashMap<>();
Map<String, String> filterItem = new HashMap<>();
@@ -158,20 +158,20 @@ public class AppcLcmActorServiceProvider implements Actor {
filterItem.put("vnf-id", sourceVnfId);
filter.put("generic-vnf", filterItem);
- aaiRequest.setInstanceFilters(new AAINQInstanceFilters());
+ aaiRequest.setInstanceFilters(new AaiNqInstanceFilters());
aaiRequest.getInstanceFilters().getInstanceFilter().add(filter);
- AAINQResponse aaiResponse = new AAIManager(new RESTManager()).postQuery(getPeManagerEnvProperty("aai.url"),
+ AaiNqResponse aaiResponse = new AaiManager(new RESTManager()).postQuery(getPeManagerEnvProperty("aai.url"),
getPeManagerEnvProperty("aai.username"), getPeManagerEnvProperty("aai.password"), aaiRequest,
requestId);
if (aaiResponse == null) {
- throw new AAIException("The named query response was null");
+ throw new AaiException("The named query response was null");
}
String targetVnfId = parseAaiResponse(aaiResponse.getInventoryResponseItems(), resourceId);
if (targetVnfId == null) {
- throw new AAIException("Target vnf-id could not be found");
+ throw new AaiException("Target vnf-id could not be found");
}
return targetVnfId;
diff --git a/controlloop/common/actors/actor.appclcm/src/test/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmServiceProviderTest.java b/controlloop/common/actors/actor.appclcm/src/test/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmServiceProviderTest.java
index 50b03c6b4..72d43d318 100644
--- a/controlloop/common/actors/actor.appclcm/src/test/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmServiceProviderTest.java
+++ b/controlloop/common/actors/actor.appclcm/src/test/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmServiceProviderTest.java
@@ -32,7 +32,7 @@ import java.util.UUID;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
-import org.onap.policy.aai.util.AAIException;
+import org.onap.policy.aai.util.AaiException;
import org.onap.policy.appclcm.LCMCommonHeader;
import org.onap.policy.appclcm.LCMRequest;
import org.onap.policy.appclcm.LCMRequestWrapper;
@@ -312,7 +312,7 @@ public class AppcLcmServiceProviderTest {
String targetVnfId = null;
try {
targetVnfId = AppcLcmActorServiceProvider.vnfNamedQuery(resourceId, "vnf01");
- } catch (AAIException e) {
+ } catch (AaiException e) {
logger.warn(e.toString());
fail("no vnf-id found");
}