import java.util.Optional;
 import java.util.Set;
 import org.onap.aai.domain.yang.LInterface;
+import org.onap.aai.domain.yang.VfModule;
+import org.onap.aai.domain.yang.VfModules;
 import org.onap.aai.domain.yang.Vserver;
 import org.onap.so.client.aai.AAIObjectPlurals;
 import org.onap.so.client.aai.AAIObjectType;
+import org.onap.so.client.aai.entities.AAIResultWrapper;
+import org.onap.so.client.aai.entities.uri.AAIPluralResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIUriFactory;
 import org.onap.so.client.graphinventory.GraphInventoryCommonObjectMapperProvider;
 
     public Optional<AAIObjectAuditList> auditVserversThroughRelationships(String genericVnfId, String vfModuleName) {
         AAIObjectAuditList auditList = new AAIObjectAuditList();
-        AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.VF_MODULE, genericVnfId)
+        AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.VF_MODULE, genericVnfId)
                 .queryParam("vf-module-name", vfModuleName);
-        if (getAaiClient().get(uri).getRelationships().isPresent()) {
+        Optional<AAIResultWrapper> wrapper = getAaiClient().getFirstWrapper(VfModules.class, VfModule.class, uri);
+        if (wrapper.isPresent() && wrapper.get().getRelationships().isPresent()) {
             List<AAIResourceUri> relatedVservers =
-                    getAaiClient().get(uri).getRelationships().get().getRelatedUris(AAIObjectType.VSERVER);
+                    wrapper.get().getRelationships().get().getRelatedUris(AAIObjectType.VSERVER);
             if (!relatedVservers.isEmpty()) {
                 relatedVservers.forEach(vserverUri -> {
                     Optional<Vserver> vserver = getAaiClient().get(vserverUri).asBean(Vserver.class);
 
 
 import static org.junit.Assert.assertEquals;
 import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import java.io.File;
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Paths;
 import java.util.HashSet;
-import java.util.List;
 import java.util.Optional;
 import java.util.Set;
-import java.util.stream.Stream;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.junit.MockitoJUnitRunner;
 import org.onap.aai.domain.yang.LInterface;
 import org.onap.aai.domain.yang.LInterfaces;
-import org.onap.aai.domain.yang.Relationship;
-import org.onap.aai.domain.yang.RelationshipList;
 import org.onap.aai.domain.yang.VfModule;
+import org.onap.aai.domain.yang.VfModules;
 import org.onap.aai.domain.yang.Vserver;
 import org.onap.so.client.aai.AAIObjectPlurals;
 import org.onap.so.client.aai.AAIObjectType;
 import com.fasterxml.jackson.core.JsonParseException;
 import com.fasterxml.jackson.databind.JsonMappingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
-import com.woorea.openstack.heat.model.Resource;
-import com.woorea.openstack.heat.model.Resources;
 
 @RunWith(MockitoJUnitRunner.Silent.class)
 public class AuditVServerTest extends AuditVServer {
 
         AAIResultWrapper wrapper = new AAIResultWrapper(vfModule);
 
-        doReturn(wrapper).when(aaiResourcesMock)
-                .get(AAIUriFactory.createResourceUri(AAIObjectPlurals.VF_MODULE, "genericVnfId")
-                        .queryParam("vf-module-name", "vfModuleName"));
+        doReturn(Optional.of(wrapper)).when(aaiResourcesMock).getFirstWrapper(VfModules.class, VfModule.class,
+                AAIUriFactory.createResourceUri(AAIObjectPlurals.VF_MODULE, "genericVnfId").queryParam("vf-module-name",
+                        "vfModuleName"));
 
         Optional<AAIObjectAuditList> auditList =
                 auditNova.auditVserversThroughRelationships("genericVnfId", "vfModuleName");
         AAIResultWrapper wrapper = new AAIResultWrapper(vfModule);
         AAIResultWrapper vserverWrapper = new AAIResultWrapper(new Vserver());
 
-        doReturn(wrapper).when(aaiResourcesMock)
-                .get(AAIUriFactory.createResourceUri(AAIObjectPlurals.VF_MODULE, "genericVnfId")
-                        .queryParam("vf-module-name", "vfModuleName"));
+        doReturn(Optional.of(wrapper)).when(aaiResourcesMock).getFirstWrapper(VfModules.class, VfModule.class,
+                AAIUriFactory.createResourceUri(AAIObjectPlurals.VF_MODULE, "genericVnfId").queryParam("vf-module-name",
+                        "vfModuleName"));
 
         doReturn(vserverWrapper).when(aaiResourcesMock).get(AAIUriFactory.createResourceUri(AAIObjectType.VSERVER,
                 "cloud-owner", "cloud-region-id", "tenant-id", "VUSCHGA1"));
 
 
 package org.onap.so.bpmn.common.scripts
 
-import org.onap.so.logger.LoggingAnchor
 import org.apache.commons.lang.StringUtils
 import org.camunda.bpm.engine.delegate.DelegateExecution
 import org.onap.aai.domain.yang.GenericVnf
+import org.onap.aai.domain.yang.GenericVnfs
 import org.onap.so.bpmn.core.RollbackData
 import org.onap.so.client.aai.AAIObjectPlurals
 import org.onap.so.client.aai.AAIObjectType
 import org.onap.so.client.graphinventory.entities.uri.Depth
 import org.onap.so.db.catalog.beans.OrchestrationStatus
 import org.onap.logging.filter.base.ErrorCode
+import org.onap.so.logger.LoggingAnchor
 import org.onap.so.logger.MessageEnum
 import org.slf4j.Logger
 import org.slf4j.LoggerFactory
                AAIResourceUri uri
                def vnfId = execution.getVariable("CAAIVfMod_vnfId")
                def vnfName = execution.getVariable("CAAIVfMod_vnfName")
+        Optional<GenericVnf> genericVnfOp
                if (vnfId == null || vnfId.isEmpty()) {
-                       uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.GENERIC_VNF)
-                       uri.queryParam("vnf-name", vnfName)
+                       genericVnfOp = getAAIClient().getFirst(GenericVnfs.class, GenericVnf.class, AAIUriFactory.createResourceUri(AAIObjectPlurals.GENERIC_VNF).queryParam("vnf-name", vnfName).depth(Depth.ONE))
                } else {
-                       uri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
+                       genericVnfOp = getAAIClient().get(GenericVnf.class,  AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId))
                }
-               uri.depth(Depth.ONE)
                try {
-                       Optional<GenericVnf> genericVnfOp = getAAIClient().get(GenericVnf.class,  uri)
             if(genericVnfOp.isPresent()){
                 execution.setVariable("CAAIVfMod_queryGenericVnfResponseCode", 200)
                 execution.setVariable("CAAIVfMod_queryGenericVnfResponse", genericVnfOp.get())
 
 import org.onap.so.client.aai.AAIObjectType;
 import org.onap.so.client.aai.AAIResourcesClient;
 import org.onap.so.client.aai.entities.AAIResultWrapper;
+import org.onap.so.client.aai.entities.uri.AAIPluralResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIUriFactory;
 import org.onap.so.client.graphinventory.entities.uri.Depth;
                 .depth(Depth.TWO)).orElse(null);
     }
 
-    protected org.onap.aai.domain.yang.ServiceInstances getAAIServiceInstancesByName(String serviceInstanceName,
-            Customer customer) {
-
-        return injectionHelper.getAaiClient()
-                .get(org.onap.aai.domain.yang.ServiceInstances.class,
-                        AAIUriFactory
-                                .createResourceUri(AAIObjectPlurals.SERVICE_INSTANCE, customer.getGlobalCustomerId(),
-                                        customer.getServiceSubscription().getServiceType())
-                                .queryParam("service-instance-name", serviceInstanceName).depth(Depth.TWO))
-                .orElseGet(() -> {
-                    logger.debug("No Service Instance matched by name");
-                    return null;
-                });
-    }
-
     public org.onap.aai.domain.yang.ServiceInstance getAAIServiceInstanceByName(String serviceInstanceName,
             Customer customer) throws Exception {
-        org.onap.aai.domain.yang.ServiceInstance aaiServiceInstance = null;
-        org.onap.aai.domain.yang.ServiceInstances aaiServiceInstances = null;
-        aaiServiceInstances = getAAIServiceInstancesByName(serviceInstanceName, customer);
-
-        if (aaiServiceInstances == null) {
-            return null;
-        } else if (aaiServiceInstances.getServiceInstance().size() > 1) {
-            throw new Exception("Multiple Service Instances Returned");
-        } else {
-            aaiServiceInstance = aaiServiceInstances.getServiceInstance().get(0);
-        }
-        return aaiServiceInstance;
-    }
-
-    protected ServiceInstances getAAIServiceInstancesByName(String globalCustomerId, String serviceType,
-            String serviceInstanceName) {
+        Optional<org.onap.aai.domain.yang.ServiceInstance> aaiServiceInstance =
+                injectionHelper.getAaiClient()
+                        .getOne(ServiceInstances.class, org.onap.aai.domain.yang.ServiceInstance.class, AAIUriFactory
+                                .createResourceUri(AAIObjectPlurals.SERVICE_INSTANCE, customer.getGlobalCustomerId(),
+                                        customer.getServiceSubscription().getServiceType())
+                                .queryParam("service-instance-name", serviceInstanceName).depth(Depth.TWO));
 
-        return injectionHelper.getAaiClient()
-                .get(ServiceInstances.class,
-                        AAIUriFactory
-                                .createResourceUri(AAIObjectPlurals.SERVICE_INSTANCE, globalCustomerId, serviceType)
-                                .queryParam("service-instance-name", serviceInstanceName).depth(Depth.TWO))
-                .orElseGet(() -> {
-                    logger.debug("No Service Instance matched by name");
-                    return null;
-                });
+        return aaiServiceInstance.orElse(null);
     }
 
     public Optional<ServiceInstance> getAAIServiceInstanceByName(String globalCustomerId, String serviceType,
-            String serviceInstanceName) throws MultipleObjectsFoundException {
-        ServiceInstance aaiServiceInstance = null;
-        ServiceInstances aaiServiceInstances = null;
-        aaiServiceInstances = getAAIServiceInstancesByName(globalCustomerId, serviceType, serviceInstanceName);
+            String serviceInstanceName) {
 
-        if (aaiServiceInstances == null) {
-            return Optional.empty();
-        } else if (aaiServiceInstances.getServiceInstance().size() > 1) {
-            String message = String.format(
-                    "Multiple service instances found for customer-id: %s, service-type: %s and service-instance-name: %s.",
-                    globalCustomerId, serviceType, serviceInstanceName);
-            throw new MultipleObjectsFoundException(message);
-        } else {
-            aaiServiceInstance = aaiServiceInstances.getServiceInstance().get(0);
-        }
-        return Optional.of(aaiServiceInstance);
+        return injectionHelper.getAaiClient().getOne(ServiceInstances.class, ServiceInstance.class,
+                AAIUriFactory.createResourceUri(AAIObjectPlurals.SERVICE_INSTANCE, globalCustomerId, serviceType)
+                        .queryParam("service-instance-name", serviceInstanceName).depth(Depth.TWO));
     }
 
     public org.onap.so.db.catalog.beans.InstanceGroup getCatalogInstanceGroup(String modelUUID) {
 
     public Optional<ServiceInstance> getRelatedServiceInstanceFromInstanceGroup(String instanceGroupId)
             throws Exception {
-        AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.INSTANCE_GROUP, instanceGroupId);
-        uri.relatedTo(AAIObjectPlurals.SERVICE_INSTANCE);
+        AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.INSTANCE_GROUP, instanceGroupId)
+                .relatedTo(AAIObjectPlurals.SERVICE_INSTANCE);
         Optional<ServiceInstances> serviceInstances = injectionHelper.getAaiClient().get(ServiceInstances.class, uri);
         ServiceInstance serviceInstance = null;
         if (!serviceInstances.isPresent()) {
 
     public Optional<L3Network> getRelatedNetworkByNameFromServiceInstance(String serviceInstanceId, String networkName)
             throws MultipleObjectsFoundException {
-        AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstanceId);
-        uri.relatedTo(AAIObjectPlurals.L3_NETWORK).queryParam("network-name", networkName);
+        AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstanceId)
+                .relatedTo(AAIObjectPlurals.L3_NETWORK).queryParam("network-name", networkName);
         Optional<L3Networks> networks = injectionHelper.getAaiClient().get(L3Networks.class, uri);
         L3Network network = null;
         if (!networks.isPresent()) {
         }
     }
 
-    public Optional<GenericVnf> getRelatedVnfByNameFromServiceInstance(String serviceInstanceId, String vnfName)
-            throws MultipleObjectsFoundException {
-        AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstanceId);
-        uri.relatedTo(AAIObjectPlurals.GENERIC_VNF).queryParam("vnf-name", vnfName);
-        Optional<GenericVnfs> vnfs = injectionHelper.getAaiClient().get(GenericVnfs.class, uri);
-        GenericVnf vnf = null;
-        if (!vnfs.isPresent()) {
-            logger.debug("No Vnfs matched by name");
-            return Optional.empty();
-        } else {
-            if (vnfs.get().getGenericVnf().size() > 1) {
-                String message = String.format("Multiple vnfs found for service-instance-id: %s and vnf-name: %s.",
-                        serviceInstanceId, vnfName);
-                throw new MultipleObjectsFoundException(message);
-            } else {
-                vnf = vnfs.get().getGenericVnf().get(0);
-            }
-            return Optional.of(vnf);
-        }
+    public Optional<GenericVnf> getRelatedVnfByNameFromServiceInstance(String serviceInstanceId, String vnfName) {
+        AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstanceId)
+                .relatedTo(AAIObjectPlurals.GENERIC_VNF).queryParam("vnf-name", vnfName);
+        return injectionHelper.getAaiClient().getOne(GenericVnfs.class, GenericVnf.class, uri);
+
     }
 
-    public Optional<VolumeGroup> getRelatedVolumeGroupByNameFromVnf(String vnfId, String volumeGroupName)
-            throws MultipleObjectsFoundException {
-        AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId);
-        uri.relatedTo(AAIObjectPlurals.VOLUME_GROUP).queryParam("volume-group-name", volumeGroupName);
-        Optional<VolumeGroups> volumeGroups = injectionHelper.getAaiClient().get(VolumeGroups.class, uri);
-        VolumeGroup volumeGroup = null;
-        if (!volumeGroups.isPresent()) {
-            logger.debug("No VolumeGroups matched by name");
-            return Optional.empty();
-        } else {
-            if (volumeGroups.get().getVolumeGroup().size() > 1) {
-                String message = String.format("Multiple volume-groups found for vnf-id: %s and volume-group-name: %s.",
-                        vnfId, volumeGroupName);
-                throw new MultipleObjectsFoundException(message);
-            } else {
-                volumeGroup = volumeGroups.get().getVolumeGroup().get(0);
-            }
-            return Optional.of(volumeGroup);
-        }
+    public Optional<VolumeGroup> getRelatedVolumeGroupByNameFromVnf(String vnfId, String volumeGroupName) {
+        AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
+                .relatedTo(AAIObjectPlurals.VOLUME_GROUP).queryParam("volume-group-name", volumeGroupName);
+        return injectionHelper.getAaiClient().getOne(VolumeGroups.class, VolumeGroup.class, uri);
     }
 
     public Optional<VolumeGroup> getRelatedVolumeGroupByIdFromVnf(String vnfId, String volumeGroupId) {
-        AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId);
-        uri.relatedTo(AAIObjectPlurals.VOLUME_GROUP).queryParam("volume-group-id", volumeGroupId);
-        Optional<VolumeGroups> volumeGroups = injectionHelper.getAaiClient().get(VolumeGroups.class, uri);
-        VolumeGroup volumeGroup = null;
-        if (!volumeGroups.isPresent()) {
-            logger.debug("No VolumeGroups matched by id");
-            return Optional.empty();
-        } else {
-            volumeGroup = volumeGroups.get().getVolumeGroup().get(0);
-            return Optional.of(volumeGroup);
-        }
+        AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
+                .relatedTo(AAIObjectPlurals.VOLUME_GROUP).queryParam("volume-group-id", volumeGroupId);
+        return injectionHelper.getAaiClient().getOne(VolumeGroups.class, VolumeGroup.class, uri);
     }
 
     public Optional<VolumeGroup> getRelatedVolumeGroupByNameFromVfModule(String vnfId, String vfModuleId,
-            String volumeGroupName) throws MultipleObjectsFoundException {
-        AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.VF_MODULE, vnfId, vfModuleId);
-        uri.relatedTo(AAIObjectPlurals.VOLUME_GROUP).queryParam("volume-group-name", volumeGroupName);
-        Optional<VolumeGroups> volumeGroups = injectionHelper.getAaiClient().get(VolumeGroups.class, uri);
-        VolumeGroup volumeGroup = null;
-        if (!volumeGroups.isPresent()) {
-            logger.debug("No VolumeGroups matched by name");
-            return Optional.empty();
-        } else {
-            if (volumeGroups.get().getVolumeGroup().size() > 1) {
-                String message = String.format(
-                        "Multiple voulme-groups found for vnf-id: %s, vf-module-id: %s and volume-group-name: %s.",
-                        vnfId, vfModuleId, volumeGroupName);
-                throw new MultipleObjectsFoundException(message);
-            } else {
-                volumeGroup = volumeGroups.get().getVolumeGroup().get(0);
-            }
-            return Optional.of(volumeGroup);
-        }
+            String volumeGroupName) throws Exception {
+        AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.VF_MODULE, vnfId, vfModuleId)
+                .relatedTo(AAIObjectPlurals.VOLUME_GROUP).queryParam("volume-group-name", volumeGroupName);
+        return injectionHelper.getAaiClient().getOne(VolumeGroups.class, VolumeGroup.class, uri);
     }
 
     public Optional<VolumeGroup> getRelatedVolumeGroupFromVfModule(String vnfId, String vfModuleId) throws Exception {
-        AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.VF_MODULE, vnfId, vfModuleId);
-        uri.relatedTo(AAIObjectPlurals.VOLUME_GROUP);
-        Optional<VolumeGroups> volumeGroups = injectionHelper.getAaiClient().get(VolumeGroups.class, uri);
-        VolumeGroup volumeGroup = null;
-        if (!volumeGroups.isPresent()) {
-            logger.debug("VfModule does not have a volume group attached");
-            return Optional.empty();
-        } else {
-            if (volumeGroups.get().getVolumeGroup().size() > 1) {
-                throw new Exception("Multiple VolumeGroups Returned");
-            } else {
-                volumeGroup = volumeGroups.get().getVolumeGroup().get(0);
-            }
-            return Optional.of(volumeGroup);
-        }
+        AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.VF_MODULE, vnfId, vfModuleId)
+                .relatedTo(AAIObjectPlurals.VOLUME_GROUP);
+        return injectionHelper.getAaiClient().getOne(VolumeGroups.class, VolumeGroup.class, uri);
     }
 
     public Optional<org.onap.aai.domain.yang.VpnBinding> getAICVpnBindingFromNetwork(
 
     public boolean existsAAINetworksGloballyByName(String networkName) {
 
-        AAIResourceUri l3networkUri =
+        AAIPluralResourceUri l3networkUri =
                 AAIUriFactory.createResourceUri(AAIObjectPlurals.L3_NETWORK).queryParam("network-name", networkName);
         AAIResourcesClient aaiRC = injectionHelper.getAaiClient();
         return aaiRC.exists(l3networkUri);
     }
 
     public boolean existsAAIVfModuleGloballyByName(String vfModuleName) {
-        AAIResourceUri vfModuleUri =
+        AAIPluralResourceUri vfModuleUri =
                 AAIUriFactory.createNodesUri(AAIObjectPlurals.VF_MODULE).queryParam("vf-module-name", vfModuleName);
         return injectionHelper.getAaiClient().exists(vfModuleUri);
     }
 
     public boolean existsAAIConfigurationGloballyByName(String configurationName) {
-        AAIResourceUri configUri = AAIUriFactory.createResourceUri(AAIObjectPlurals.CONFIGURATION)
+        AAIPluralResourceUri configUri = AAIUriFactory.createResourceUri(AAIObjectPlurals.CONFIGURATION)
                 .queryParam("configuration-name", configurationName);
         return injectionHelper.getAaiClient().exists(configUri);
     }
 
     public boolean existsAAIVolumeGroupGloballyByName(String volumeGroupName) {
-        AAIResourceUri volumeGroupUri = AAIUriFactory.createNodesUri(AAIObjectPlurals.VOLUME_GROUP)
+        AAIPluralResourceUri volumeGroupUri = AAIUriFactory.createNodesUri(AAIObjectPlurals.VOLUME_GROUP)
                 .queryParam("volume-group-name", volumeGroupName);
         return injectionHelper.getAaiClient().exists(volumeGroupUri);
     }
     }
 
     public Optional<Configuration> getRelatedConfigurationByNameFromServiceInstance(String serviceInstanceId,
-            String configurationName) throws MultipleObjectsFoundException {
-        AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstanceId);
-        uri.relatedTo(AAIObjectPlurals.CONFIGURATION).queryParam("configuration-name", configurationName);
-        Optional<Configurations> configurations = injectionHelper.getAaiClient().get(Configurations.class, uri);
-        Configuration configuration = null;
-        if (!configurations.isPresent()) {
-            logger.debug("No Configurations matched by name");
-            return Optional.empty();
-        } else {
-            if (configurations.get().getConfiguration().size() > 1) {
-                String message = String.format(
-                        "Multiple configurations found for service-instance-d: %s and configuration-name: %s.",
-                        serviceInstanceId, configurationName);
-                throw new MultipleObjectsFoundException(message);
-            } else {
-                configuration = configurations.get().getConfiguration().get(0);
-            }
-            return Optional.of(configuration);
-        }
+            String configurationName) {
+        AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstanceId)
+                .relatedTo(AAIObjectPlurals.CONFIGURATION).queryParam("configuration-name", configurationName);
+        return injectionHelper.getAaiClient().getOne(Configurations.class, Configuration.class, uri);
     }
 }
 
 import org.onap.so.client.aai.AAIObjectType
 import org.onap.so.client.aai.AAIResourcesClient
 import org.onap.so.client.aai.entities.AAIResultWrapper
+import org.onap.so.client.aai.entities.uri.AAIPluralResourceUri
 import org.onap.so.client.aai.entities.uri.AAIResourceUri
 import org.onap.so.client.aai.entities.uri.AAIUriFactory
 import org.onap.so.client.graphinventory.entities.uri.Depth
     }
 
     protected Optional<GenericVnf> mockAAIGenericVnfByName(String vnfName){
-        AAIResourceUri resourceUri = AAIUriFactory.createResourceUri(AAIObjectPlurals.GENERIC_VNF).queryParam("vnf-name", vnfName)
-        AAIResourceUri resourceUriDepthOne = AAIUriFactory.createResourceUri(AAIObjectPlurals.GENERIC_VNF).queryParam("vnf-name", vnfName).depth(Depth.ONE)
+        AAIPluralResourceUri resourceUri = AAIUriFactory.createResourceUri(AAIObjectPlurals.GENERIC_VNF).queryParam("vnf-name", vnfName)
+        AAIPluralResourceUri resourceUriDepthOne = AAIUriFactory.createResourceUri(AAIObjectPlurals.GENERIC_VNF).queryParam("vnf-name", vnfName).depth(Depth.ONE)
         Optional<GenericVnf> genericVnf = getAAIObjectFromJson(GenericVnf.class,"__files/aai/GenericVnf.json");
         when(client.get(GenericVnf.class, resourceUri)).thenReturn(genericVnf)
         when(client.get(GenericVnf.class, resourceUriDepthOne)).thenReturn(genericVnf)
     }
 
     protected void mockAAIGenericVnfByNameNotFound(String vnfName){
-        AAIResourceUri resourceUri = AAIUriFactory.createResourceUri(AAIObjectPlurals.GENERIC_VNF).queryParam("vnf-name", vnfName)
-        AAIResourceUri resourceUriDepthOne = AAIUriFactory.createResourceUri(AAIObjectPlurals.GENERIC_VNF).queryParam("vnf-name", vnfName).depth(Depth.ONE)
+        AAIPluralResourceUri resourceUri = AAIUriFactory.createResourceUri(AAIObjectPlurals.GENERIC_VNF).queryParam("vnf-name", vnfName)
+        AAIPluralResourceUri resourceUriDepthOne = AAIUriFactory.createResourceUri(AAIObjectPlurals.GENERIC_VNF).queryParam("vnf-name", vnfName).depth(Depth.ONE)
         when(client.get(GenericVnf.class, resourceUri)).thenReturn(Optional.empty())
         when(client.get(GenericVnf.class, resourceUriDepthOne)).thenReturn(Optional.empty())
     }
 
 import org.onap.so.client.aai.AAIObjectPlurals;
 import org.onap.so.client.aai.AAIObjectType;
 import org.onap.so.client.aai.AAIResourcesClient;
+import org.onap.so.client.aai.entities.uri.AAIPluralResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIUriFactory;
 import org.onap.so.client.graphinventory.entities.uri.Depth;
         ServiceInstances serviceInstances = new ServiceInstances();
         serviceInstances.getServiceInstance().add(expectedServiceInstance);
 
-        doReturn(Optional.of(serviceInstances)).when(MOCK_aaiResourcesClient).get(isA(Class.class),
-                isA(AAIResourceUri.class));
-
-        assertThat(bbInputSetupUtils.getAAIServiceInstanceByName(serviceInstanceName, customer),
-                sameBeanAs(serviceInstances.getServiceInstance().get(0)));
-    }
-
-    @Test
-    public void getAAIServiceInstanceByNameExceptionTest() throws Exception {
-        final String serviceInstanceName = "serviceInstanceName";
-
-        expectedException.expect(Exception.class);
-        expectedException.expectMessage("Multiple Service Instances Returned");
-
-        ServiceInstance serviceInstance = new ServiceInstance();
-        serviceInstance.setServiceInstanceId("serviceInstanceId");
-
-        ServiceSubscription serviceSubscription = new ServiceSubscription();
-        serviceSubscription.setServiceType("serviceType");
-
-        Customer customer = new Customer();
-        customer.setGlobalCustomerId("globalCustomerId");
-        customer.setServiceSubscription(serviceSubscription);
-
-        ServiceInstances serviceInstances = new ServiceInstances();
-        serviceInstances.getServiceInstance().add(serviceInstance);
-        serviceInstances.getServiceInstance().add(serviceInstance);
-
-        doReturn(Optional.of(serviceInstances)).when(MOCK_aaiResourcesClient).get(isA(Class.class),
-                isA(AAIResourceUri.class));
-
+        AAIPluralResourceUri expectedUri = AAIUriFactory
+                .createResourceUri(AAIObjectPlurals.SERVICE_INSTANCE, customer.getGlobalCustomerId(),
+                        customer.getServiceSubscription().getServiceType())
+                .queryParam("service-instance-name", serviceInstanceName).depth(Depth.TWO);
         bbInputSetupUtils.getAAIServiceInstanceByName(serviceInstanceName, customer);
+
+        verify(MOCK_aaiResourcesClient, times(1)).getOne(org.onap.aai.domain.yang.ServiceInstances.class,
+                org.onap.aai.domain.yang.ServiceInstance.class, expectedUri);
     }
 
     @Test
         assertNull(bbInputSetupUtils.getAAIServiceInstanceByName("", customer));
     }
 
-    @Test
-    public void getOptionalAAIServiceInstanceByNameExceptionTest() throws Exception {
-        expectedException.expect(MultipleObjectsFoundException.class);
-        expectedException.expectMessage(containsString(
-                "Multiple service instances found for customer-id: globalCustomerId, service-type: serviceType and service-instance-name: serviceInstanceId."));
-
-        final String globalCustomerId = "globalCustomerId";
-        final String serviceType = "serviceType";
-        final String serviceInstanceId = "serviceInstanceId";
-
-        ServiceInstance serviceInstance = new ServiceInstance();
-        serviceInstance.setServiceInstanceId(serviceInstanceId);
-        serviceInstance.setServiceType(serviceType);
-
-        ServiceInstances serviceInstances = new ServiceInstances();
-        serviceInstances.getServiceInstance().add(serviceInstance);
-        serviceInstances.getServiceInstance().add(serviceInstance);
-
-        doReturn(Optional.of(serviceInstances)).when(MOCK_aaiResourcesClient).get(isA(Class.class),
-                isA(AAIResourceUri.class));
-
-        bbInputSetupUtils.getAAIServiceInstanceByName(globalCustomerId, serviceType, serviceInstanceId);
-    }
-
     @Test
     public void getOptionalAAIServiceInstanceByNameNullTest() throws Exception {
         Optional<ServiceInstance> actual = bbInputSetupUtils.getAAIServiceInstanceByName("", "", "");
         network.setNetworkId(networkId);
         network.setNetworkName(networkName);
         expected.get().getL3Network().add(network);
-
-        doReturn(expected).when(MOCK_aaiResourcesClient).get(eq(L3Networks.class), any(AAIResourceUri.class));
+        doReturn(expected).when(MOCK_aaiResourcesClient).get(eq(L3Networks.class), any(AAIPluralResourceUri.class));
         Optional<L3Network> actual =
                 bbInputSetupUtils.getRelatedNetworkByNameFromServiceInstance(networkId, networkName);
 
     }
 
     @Test
-    public void getRelatedNetworkByNameFromServiceInstanceMultipleNetworksExceptionTest() throws Exception {
-        final String serviceInstanceId = "serviceInstanceId";
-        final String networkName = "networkName";
-        expectedException.expect(MultipleObjectsFoundException.class);
-        expectedException.expectMessage(
-                String.format("Multiple networks found for service-instance-id: %s and network-name: %s.",
-                        serviceInstanceId, networkName));
-
-        L3Network network = new L3Network();
-        network.setNetworkId("id123");
-        network.setNetworkName("name123");
-
-        L3Networks l3Networks = new L3Networks();
-        l3Networks.getL3Network().add(network);
-        l3Networks.getL3Network().add(network);
-        Optional<L3Networks> optNetworks = Optional.of(l3Networks);
+    public void getRelatedNetworkByNameFromServiceInstanceNotFoundTest() throws Exception {
+        String serviceInstanceId = "serviceInstanceId";
+        String networkName = "networkName";
 
-        doReturn(optNetworks).when(MOCK_aaiResourcesClient).get(eq(L3Networks.class), any(AAIResourceUri.class));
+        doReturn(Optional.empty()).when(MOCK_aaiResourcesClient).get(eq(L3Networks.class),
+                any(AAIPluralResourceUri.class));
 
-        bbInputSetupUtils.getRelatedNetworkByNameFromServiceInstance(serviceInstanceId, networkName);
-    }
+        Optional<L3Network> actualNetwork =
+                bbInputSetupUtils.getRelatedNetworkByNameFromServiceInstance(serviceInstanceId, networkName);
 
-    @Test
-    public void getRelatedNetworkByNameFromServiceInstanceNotFoundTest() throws Exception {
-        assertEquals(Optional.empty(), bbInputSetupUtils.getRelatedNetworkByNameFromServiceInstance("", ""));
+        assertEquals(Optional.empty(), actualNetwork);
     }
 
     @Test
         serviceInstance.setServiceInstanceName("serviceInstanceName");
         expected.get().getServiceInstance().add(serviceInstance);
 
-        doReturn(expected).when(MOCK_aaiResourcesClient).get(eq(ServiceInstances.class), any(AAIResourceUri.class));
+        doReturn(expected).when(MOCK_aaiResourcesClient).get(eq(ServiceInstances.class),
+                any(AAIPluralResourceUri.class));
         Optional<ServiceInstance> actual = this.bbInputSetupUtils.getRelatedServiceInstanceFromInstanceGroup("ig-001");
 
         assertTrue(actual.isPresent());
     public void getRelatedServiceInstanceFromInstanceGroupMultipleExceptionTest() throws Exception {
         final String instanceGroupId = "ig-001";
         expectedException.expect(MultipleObjectsFoundException.class);
-        expectedException.expectMessage(
-                String.format("Mulitple service instances were found for instance-group-id: %s.", instanceGroupId));
-
         Optional<ServiceInstances> serviceInstances = Optional.of(new ServiceInstances());
         ServiceInstance si1 = Mockito.mock(ServiceInstance.class);
         ServiceInstance si2 = Mockito.mock(ServiceInstance.class);
         serviceInstances.get().getServiceInstance().add(si2);
 
         doReturn(serviceInstances).when(MOCK_aaiResourcesClient).get(eq(ServiceInstances.class),
-                any(AAIResourceUri.class));
-        bbInputSetupUtils.getRelatedServiceInstanceFromInstanceGroup(instanceGroupId);
+                any(AAIPluralResourceUri.class));
+        this.bbInputSetupUtils.getRelatedServiceInstanceFromInstanceGroup(instanceGroupId);
     }
 
     @Test
     public void getRelatedServiceInstanceFromInstanceGroupNotFoundExceptionTest() throws Exception {
         expectedException.expect(NoServiceInstanceFoundException.class);
-        expectedException.expectMessage("No ServiceInstances Returned");
-
         Optional<ServiceInstances> serviceInstances = Optional.of(new ServiceInstances());
 
         doReturn(serviceInstances).when(MOCK_aaiResourcesClient).get(eq(ServiceInstances.class),
-                any(AAIResourceUri.class));
-        bbInputSetupUtils.getRelatedServiceInstanceFromInstanceGroup("ig-001");
+                any(AAIPluralResourceUri.class));
+        this.bbInputSetupUtils.getRelatedServiceInstanceFromInstanceGroup("ig-001");
     }
 
     @Test
     public void getRelatedVnfByNameFromServiceInstanceTest() throws Exception {
         final String vnfId = "id123";
         final String vnfName = "name123";
-
-        Optional<GenericVnfs> expected = Optional.of(new GenericVnfs());
+        final String serviceInstanceId = "service-instance-id123";
         GenericVnf vnf = new GenericVnf();
         vnf.setVnfId(vnfId);
         vnf.setVnfName(vnfName);
-        expected.get().getGenericVnf().add(vnf);
-
-        doReturn(expected).when(MOCK_aaiResourcesClient).get(eq(GenericVnfs.class), any(AAIResourceUri.class));
-        Optional<GenericVnf> actual = this.bbInputSetupUtils.getRelatedVnfByNameFromServiceInstance(vnfId, vnfName);
-
+        doReturn(Optional.of(vnf)).when(MOCK_aaiResourcesClient).getOne(GenericVnfs.class, GenericVnf.class,
+                AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstanceId)
+                        .relatedTo(AAIObjectPlurals.GENERIC_VNF).queryParam("vnf-name", vnfName));
+        Optional<GenericVnf> actual =
+                this.bbInputSetupUtils.getRelatedVnfByNameFromServiceInstance(serviceInstanceId, vnfName);
         assertTrue(actual.isPresent());
-        assertEquals(expected.get().getGenericVnf().get(0).getVnfId(), actual.get().getVnfId());
-    }
-
-    @Test
-    public void getRelatedVnfByNameFromServiceInstanceMultipleVnfsExceptionTest() throws Exception {
-        final String serviceInstanceId = "serviceInstanceId";
-        final String vnfName = "vnfName";
-        expectedException.expect(MultipleObjectsFoundException.class);
-        expectedException.expectMessage(String.format(
-                "Multiple vnfs found for service-instance-id: %s and vnf-name: %s.", serviceInstanceId, vnfName));
-
-        GenericVnf vnf = new GenericVnf();
-        vnf.setVnfId("id123");
-        vnf.setVnfName("name123");
-
-        GenericVnfs vnfs = new GenericVnfs();
-        vnfs.getGenericVnf().add(vnf);
-        vnfs.getGenericVnf().add(vnf);
-
-        Optional<GenericVnfs> optVnfs = Optional.of(vnfs);
-        doReturn(optVnfs).when(MOCK_aaiResourcesClient).get(eq(GenericVnfs.class), any(AAIResourceUri.class));
-
-        bbInputSetupUtils.getRelatedVnfByNameFromServiceInstance(serviceInstanceId, vnfName);
+        assertEquals(vnf.getVnfId(), actual.get().getVnfId());
     }
 
     @Test
         final String serviceInstanceId = "serviceInstanceId";
         final String vnfName = "vnfName";
 
+        doReturn(Optional.empty()).when(MOCK_aaiResourcesClient).getOne(eq(GenericVnfs.class), eq(GenericVnf.class),
+                any(AAIPluralResourceUri.class));
+
         assertEquals(Optional.empty(),
                 bbInputSetupUtils.getRelatedVnfByNameFromServiceInstance(serviceInstanceId, vnfName));
     }
 
     @Test
     public void getRelatedVolumeGroupByNameFromVnfTest() throws Exception {
-        final String vnfId = "id123";
-        final String vnfName = "name123";
-
-        Optional<VolumeGroups> expected = Optional.of(new VolumeGroups());
+        final String vnfId = "vnf-id123";
+        final String volumeGroupId = "id123";
+        final String volumeGroupName = "volume-group-name123";
         VolumeGroup volumeGroup = new VolumeGroup();
-        volumeGroup.setVolumeGroupId(vnfId);
-        volumeGroup.setVolumeGroupName(vnfName);
-        expected.get().getVolumeGroup().add(volumeGroup);
-
-        doReturn(expected).when(MOCK_aaiResourcesClient).get(eq(VolumeGroups.class), any(AAIResourceUri.class));
-        Optional<VolumeGroup> actual = this.bbInputSetupUtils.getRelatedVolumeGroupByNameFromVnf(vnfId, vnfName);
-
-        assertTrue(actual.isPresent());
-        assertEquals(expected.get().getVolumeGroup().get(0).getVolumeGroupId(), actual.get().getVolumeGroupId());
+        volumeGroup.setVolumeGroupId(volumeGroupId);
+        volumeGroup.setVolumeGroupName(volumeGroupName);
+        doReturn(Optional.of(volumeGroup)).when(MOCK_aaiResourcesClient).getOne(VolumeGroups.class, VolumeGroup.class,
+                AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
+                        .relatedTo(AAIObjectPlurals.VOLUME_GROUP).queryParam("volume-group-name", volumeGroupName));
+        Optional<VolumeGroup> actual =
+                this.bbInputSetupUtils.getRelatedVolumeGroupByNameFromVnf(vnfId, volumeGroupName);
+        assertEquals(volumeGroup.getVolumeGroupId(), actual.get().getVolumeGroupId());
     }
 
     @Test
-    public void getRelatedVolumeGroupByNameFromVnfMultipleVolumeGroupsExceptionTest() throws Exception {
-        final String vnfId = "vnfId";
-        final String volumeGroupName = "volumeGroupName";
-        expectedException.expect(MultipleObjectsFoundException.class);
-        expectedException.expectMessage(String.format(
-                "Multiple volume-groups found for vnf-id: %s and volume-group-name: %s.", vnfId, volumeGroupName));
-
-        VolumeGroup volumeGroup = new VolumeGroup();
-        volumeGroup.setVolumeGroupId("id123");
-        volumeGroup.setVolumeGroupName("name123");
+    public void getRelatedVolumeGroupByNameFromVnfNotFoundTest() throws Exception {
+        String vnfId = "vnfId";
+        String volumeGroupName = "volumeGroupName";
 
-        VolumeGroups volumeGroups = new VolumeGroups();
-        volumeGroups.getVolumeGroup().add(volumeGroup);
-        volumeGroups.getVolumeGroup().add(volumeGroup);
-        Optional<VolumeGroups> optVolumeGroups = Optional.of(volumeGroups);
+        doReturn(Optional.empty()).when(MOCK_aaiResourcesClient).getOne(eq(VolumeGroups.class), eq(VolumeGroup.class),
+                any(AAIPluralResourceUri.class));
 
-        doReturn(optVolumeGroups).when(MOCK_aaiResourcesClient).get(eq(VolumeGroups.class), any(AAIResourceUri.class));
+        Optional<VolumeGroup> actualVolumeGroup =
+                bbInputSetupUtils.getRelatedVolumeGroupByNameFromVnf(vnfId, volumeGroupName);
 
-        bbInputSetupUtils.getRelatedVolumeGroupByNameFromVnf(vnfId, volumeGroupName);
-    }
-
-    @Test
-    public void getRelatedVolumeGroupByNameFromVnfNotFoundTest() throws Exception {
-        assertEquals(Optional.empty(), bbInputSetupUtils.getRelatedVolumeGroupByNameFromVnf("", ""));
+        assertEquals(Optional.empty(), actualVolumeGroup);
     }
 
     @Test
     public void getRelatedVolumeGroupByNameFromVfModuleTest() throws Exception {
-        Optional<VolumeGroups> expected = Optional.of(new VolumeGroups());
         VolumeGroup volumeGroup = new VolumeGroup();
         volumeGroup.setVolumeGroupId("id123");
         volumeGroup.setVolumeGroupName("name123");
-        expected.get().getVolumeGroup().add(volumeGroup);
-
-        doReturn(expected).when(MOCK_aaiResourcesClient).get(eq(VolumeGroups.class), any(AAIResourceUri.class));
-        Optional<VolumeGroup> actual =
-                this.bbInputSetupUtils.getRelatedVolumeGroupByNameFromVfModule("id123", "id123", "name123");
-
+        doReturn(Optional.of(volumeGroup)).when(MOCK_aaiResourcesClient).getOne(VolumeGroups.class, VolumeGroup.class,
+                AAIUriFactory.createResourceUri(AAIObjectType.VF_MODULE, "vnf-id123", "vf-module-id123")
+                        .relatedTo(AAIObjectPlurals.VOLUME_GROUP)
+                        .queryParam("volume-group-name", "volume-group-name123"));
+        Optional<VolumeGroup> actual = this.bbInputSetupUtils.getRelatedVolumeGroupByNameFromVfModule("vnf-id123",
+                "vf-module-id123", "volume-group-name123");
         assertTrue(actual.isPresent());
-        assertEquals(expected.get().getVolumeGroup().get(0).getVolumeGroupId(), actual.get().getVolumeGroupId());
+        assertEquals(volumeGroup.getVolumeGroupId(), actual.get().getVolumeGroupId());
     }
 
     @Test
         final String vnfId = "vnfId";
         final String volumeGroupId = "volumeGroupId";
 
-        assertEquals(Optional.empty(), bbInputSetupUtils.getRelatedVolumeGroupFromVfModule(vnfId, volumeGroupId));
+        doReturn(Optional.empty()).when(MOCK_aaiResourcesClient).getOne(eq(VolumeGroups.class), eq(VolumeGroup.class),
+                any(AAIPluralResourceUri.class));
+
+        Optional<VolumeGroup> actualVolumeGroup =
+                bbInputSetupUtils.getRelatedVolumeGroupFromVfModule(vnfId, volumeGroupId);
+
+        assertEquals(Optional.empty(), actualVolumeGroup);
     }
 
     @Test
     public void getRelatedVolumeGroupFromVfModuleTest() throws Exception {
-        Optional<VolumeGroups> expected = Optional.of(new VolumeGroups());
         VolumeGroup volumeGroup = new VolumeGroup();
         volumeGroup.setVolumeGroupId("id123");
-        expected.get().getVolumeGroup().add(volumeGroup);
-
-        doReturn(expected).when(MOCK_aaiResourcesClient).get(eq(VolumeGroups.class), any(AAIResourceUri.class));
-        Optional<VolumeGroup> actual = bbInputSetupUtils.getRelatedVolumeGroupFromVfModule("id123", "id123");
-
+        doReturn(Optional.of(volumeGroup)).when(MOCK_aaiResourcesClient).getOne(VolumeGroups.class, VolumeGroup.class,
+                AAIUriFactory.createResourceUri(AAIObjectType.VF_MODULE, "vnf-id123", "vf-module-id123")
+                        .relatedTo(AAIObjectPlurals.VOLUME_GROUP));
+        Optional<VolumeGroup> actual =
+                this.bbInputSetupUtils.getRelatedVolumeGroupFromVfModule("vnf-id123", "vf-module-id123");
         assertTrue(actual.isPresent());
-        assertEquals(expected.get().getVolumeGroup().get(0).getVolumeGroupId(), actual.get().getVolumeGroupId());
+        assertEquals(volumeGroup.getVolumeGroupId(), actual.get().getVolumeGroupId());
     }
 
     @Test
-    public void getRelatedVolumeGroupByNameFromVfModuleMultipleVolumeGroupsExceptionTest() throws Exception {
-        final String vnfId = "vnfId";
-        final String vfModuleId = "vfModuleId";
-        final String volumeGroupName = "volumeGroupName";
-
-        expectedException.expect(MultipleObjectsFoundException.class);
-        expectedException.expectMessage(String.format(
-                "Multiple voulme-groups found for vnf-id: %s, vf-module-id: %s and volume-group-name: %s.", vnfId,
-                vfModuleId, volumeGroupName));
-
-        VolumeGroup volumeGroup = new VolumeGroup();
-        volumeGroup.setVolumeGroupId("id123");
-        volumeGroup.setVolumeGroupName("name123");
-
-        VolumeGroups volumeGroups = new VolumeGroups();
-        volumeGroups.getVolumeGroup().add(volumeGroup);
-        volumeGroups.getVolumeGroup().add(volumeGroup);
+    public void getRelatedVolumeGroupByNameFromVfModuleNotFoundTest() throws Exception {
+        String vnfId = "vnfId";
+        String volumeGroupId = "volumeGroupId";
+        String volumeGroupName = "volumeGroupName";
 
-        Optional<VolumeGroups> optVolumeGroups = Optional.of(volumeGroups);
-        doReturn(optVolumeGroups).when(MOCK_aaiResourcesClient).get(eq(VolumeGroups.class), any(AAIResourceUri.class));
+        doReturn(Optional.empty()).when(MOCK_aaiResourcesClient).getOne(eq(VolumeGroups.class), eq(VolumeGroup.class),
+                any(AAIPluralResourceUri.class));
 
-        bbInputSetupUtils.getRelatedVolumeGroupByNameFromVfModule(vnfId, vfModuleId, volumeGroupName);
-    }
+        Optional<VolumeGroup> actualVolumeGroup =
+                bbInputSetupUtils.getRelatedVolumeGroupByNameFromVfModule(vnfId, volumeGroupId, volumeGroupName);
 
-    @Test
-    public void getRelatedVolumeGroupByNameFromVfModuleNotFoundTest() throws Exception {
-        assertEquals(Optional.empty(), bbInputSetupUtils.getRelatedVolumeGroupByNameFromVfModule("", "", ""));
+        assertEquals(Optional.empty(), actualVolumeGroup);
     }
 
     @Test
         assertEquals(mapper.writeValueAsString(expectedFlowsToExecute), mapper.writeValueAsString(flowsToExecute));
     }
 
-    @Test
-    public void getRelatedConfigurationByNameFromServiceInstanceExceptionTest() throws Exception {
-        Configuration configuration = new Configuration();
-        configuration.setConfigurationId("id123");
-
-        Configurations configurations = new Configurations();
-        configurations.getConfiguration().add(configuration);
-        configurations.getConfiguration().add(configuration);
-
-        Optional<Configurations> optConfigurations = Optional.of(configurations);
-
-        doReturn(optConfigurations).when(MOCK_aaiResourcesClient).get(eq(Configurations.class),
-                any(AAIResourceUri.class));
-
-        expectedException.expect(MultipleObjectsFoundException.class);
-        this.bbInputSetupUtils.getRelatedConfigurationByNameFromServiceInstance("id123", "name123");
-    }
-
     @Test
     public void getRelatedConfigurationByNameFromServiceInstanceNotFoundTest() throws Exception {
         assertEquals(Optional.empty(), bbInputSetupUtils.getRelatedConfigurationByNameFromServiceInstance("", ""));
 
     @Test
     public void getRelatedConfigurationByNameFromServiceInstanceTest() throws Exception {
-        Optional<Configurations> expected = Optional.of(new Configurations());
         Configuration configuration = new Configuration();
         configuration.setConfigurationId("id123");
-        expected.get().getConfiguration().add(configuration);
-
-        doReturn(expected).when(MOCK_aaiResourcesClient).get(eq(Configurations.class), any(AAIResourceUri.class));
-        Optional<Configuration> actual =
-                this.bbInputSetupUtils.getRelatedConfigurationByNameFromServiceInstance("id123", "name123");
-
+        doReturn(Optional.of(configuration)).when(MOCK_aaiResourcesClient).getOne(Configurations.class,
+                Configuration.class,
+                AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, "service-instance-id123")
+                        .relatedTo(AAIObjectPlurals.CONFIGURATION)
+                        .queryParam("configuration-name", "configuration-name123"));
+        Optional<Configuration> actual = this.bbInputSetupUtils
+                .getRelatedConfigurationByNameFromServiceInstance("service-instance-id123", "configuration-name123");
         assertTrue(actual.isPresent());
-        assertEquals(expected.get().getConfiguration().get(0).getConfigurationId(), actual.get().getConfigurationId());
+        assertEquals(configuration.getConfigurationId(), actual.get().getConfigurationId());
     }
 
     @Test
     public void existsAAIVfModuleGloballyByNameTest() {
-        AAIResourceUri expectedUri =
+        AAIPluralResourceUri expectedUri =
                 AAIUriFactory.createNodesUri(AAIObjectPlurals.VF_MODULE).queryParam("vf-module-name", "testVfModule");
         bbInputSetupUtils.existsAAIVfModuleGloballyByName("testVfModule");
 
 
     @Test
     public void existsAAIConfigurationGloballyByNameTest() {
-        AAIResourceUri expectedUri = AAIUriFactory.createResourceUri(AAIObjectPlurals.CONFIGURATION)
+        AAIPluralResourceUri expectedUri = AAIUriFactory.createResourceUri(AAIObjectPlurals.CONFIGURATION)
                 .queryParam("configuration-name", "testConfig");
         bbInputSetupUtils.existsAAIConfigurationGloballyByName("testConfig");
 
 
     @Test
     public void existsAAINetworksGloballyByNameTest() {
-        AAIResourceUri expectedUri =
+        AAIPluralResourceUri expectedUri =
                 AAIUriFactory.createResourceUri(AAIObjectPlurals.L3_NETWORK).queryParam("network-name", "testNetwork");
         bbInputSetupUtils.existsAAINetworksGloballyByName("testNetwork");
 
 
     @Test
     public void existsAAIVolumeGroupGloballyByNameTest() {
-        AAIResourceUri expectedUri = AAIUriFactory.createNodesUri(AAIObjectPlurals.VOLUME_GROUP)
+        AAIPluralResourceUri expectedUri = AAIUriFactory.createNodesUri(AAIObjectPlurals.VOLUME_GROUP)
                 .queryParam("volume-group-name", "testVoumeGroup");
 
         bbInputSetupUtils.existsAAIVolumeGroupGloballyByName("testVoumeGroup");
 
         bbInputSetupUtils.updateInfraActiveRequestVnfId(infraActiveRequests, vnfId);
 
-        assertEquals(infraActiveRequests.getVnfId(), vnfId);
+        assertEquals(vnfId, infraActiveRequests.getVnfId());
     }
 
     @Test
 
         bbInputSetupUtils.updateInfraActiveRequestVfModuleId(infraActiveRequests, vfModuleId);
 
-        assertEquals(infraActiveRequests.getVfModuleId(), vfModuleId);
+        assertEquals(vfModuleId, infraActiveRequests.getVfModuleId());
     }
 
     @Test
 
         bbInputSetupUtils.updateInfraActiveRequestVolumeGroupId(infraActiveRequests, volumeGroupId);
 
-        assertEquals(infraActiveRequests.getVolumeGroupId(), volumeGroupId);
+        assertEquals(volumeGroupId, infraActiveRequests.getVolumeGroupId());
     }
 
     @Test
 
         bbInputSetupUtils.updateInfraActiveRequestNetworkId(infraActiveRequests, networkId);
 
-        assertEquals(infraActiveRequests.getNetworkId(), networkId);
+        assertEquals(networkId, infraActiveRequests.getNetworkId());
     }
 
     @Test
                 mapper.readValue(new File(RESOURCE_PATH + "aaiL3NetworkInputWithSubnets.json"), L3Network.class);
 
         Optional<VpnBinding> actual = bbInputSetupUtils.getAICVpnBindingFromNetwork(l3Network);
-        assertEquals(actual, Optional.empty());
+        assertEquals(Optional.empty(), actual);
     }
 
     @Test
     public void getAAIServiceInstancesGloballyByName_noAAIResourceTest() {
         final String serviceInstanceName = "serviceInstanceName";
 
-        doReturn(Optional.empty()).when(MOCK_aaiResourcesClient).get(isA(Class.class), isA(AAIResourceUri.class));
+        doReturn(Optional.empty()).when(MOCK_aaiResourcesClient).get(isA(Class.class), isA(AAIPluralResourceUri.class));
         ServiceInstances actualServiceInstances =
                 bbInputSetupUtils.getAAIServiceInstancesGloballyByName(serviceInstanceName);
 
     public void getAAIVnfsGloballyByName_noAAIResourceTest() {
         final String vnfName = "vnfName";
 
-        doReturn(Optional.empty()).when(MOCK_aaiResourcesClient).get(isA(Class.class), isA(AAIResourceUri.class));
+        doReturn(Optional.empty()).when(MOCK_aaiResourcesClient).get(isA(Class.class), isA(AAIPluralResourceUri.class));
         GenericVnfs actualGenericVnfs = bbInputSetupUtils.getAAIVnfsGloballyByName(vnfName);
 
         assertNull(actualGenericVnfs);
 
 
 import java.util.List;
 import java.util.concurrent.Executor;
-import org.onap.so.logger.LoggingAnchor;
 import javax.annotation.PostConstruct;
 import org.camunda.bpm.application.PreUndeploy;
 import org.camunda.bpm.application.ProcessApplicationInfo;
 import org.camunda.bpm.engine.ProcessEngine;
 import org.camunda.bpm.engine.repository.DeploymentBuilder;
+import org.onap.logging.filter.spring.MDCTaskDecorator;
 import org.onap.so.bpmn.common.DefaultToShortClassNameBeanNameGenerator;
 import org.onap.so.db.catalog.beans.Workflow;
 import org.onap.so.db.catalog.client.CatalogDbClient;
-import org.onap.logging.filter.spring.MDCTaskDecorator;;
+import org.onap.so.logger.LoggingAnchor;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 
 import org.onap.so.client.aai.AAIObjectPlurals
 import org.onap.so.client.aai.AAIObjectType
 import org.onap.so.client.aai.AAIResourcesClient
+import org.onap.so.client.aai.entities.uri.AAIPluralResourceUri
 import org.onap.so.client.aai.entities.uri.AAIResourceUri
 import org.onap.so.client.aai.entities.uri.AAIUriFactory
 import org.onap.so.client.aai.entities.AAIResultWrapper
                        String networkName   = utils.getNodeText(networkInputs, "network-name")
 
                        AAIResourcesClient client = new AAIResourcesClient()
-                       AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.L3_NETWORK).queryParam("network-name", networkName)
+                       AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.L3_NETWORK).queryParam("network-name", networkName)
                        L3Networks networks = client.get(uri, NotFoundException.class).asBean(L3Networks.class).get()
                        L3Network network = networks.getL3Network().get(0)
 
 
 package org.onap.so.bpmn.infrastructure.scripts;
 
 import static org.apache.commons.lang3.StringUtils.*;
-
 import org.camunda.bpm.engine.delegate.BpmnError
 import org.camunda.bpm.engine.delegate.DelegateExecution
 import org.onap.aai.domain.yang.OwningEntity
 import org.onap.so.client.aai.AAIObjectType
 import org.onap.so.client.aai.AAIResourcesClient
 import org.onap.so.client.aai.entities.uri.AAIResourceUri
-import org.onap.so.client.aai.entities.uri.AAIUri
 import org.onap.so.client.aai.entities.uri.AAIUriFactory
 import org.slf4j.Logger
 import org.slf4j.LoggerFactory
                        String globalCustomerId = execution.getVariable("globalSubscriberId") //VID to AAI name map
                        logger.debug(" ***** getAAICustomerById ***** globalCustomerId:" + globalCustomerId)
 
-                       AAIUri uri = AAIUriFactory.createResourceUri(AAIObjectType.CUSTOMER, globalCustomerId)
+                       AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.CUSTOMER, globalCustomerId)
                        if(!getAAIClient().exists(uri)){
                                exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "GlobalCustomerId:" + globalCustomerId + " not found (404) in AAI")
                        }
 
 import org.onap.so.client.aai.AAIObjectType
 import org.onap.so.client.aai.AAIResourcesClient
 import org.onap.so.client.aai.entities.uri.AAIResourceUri
-import org.onap.so.client.aai.entities.uri.AAIUri
 import org.onap.so.client.aai.entities.uri.AAIUriFactory
 import org.slf4j.Logger
 import org.slf4j.LoggerFactory
 
 
 package org.onap.so.bpmn.infrastructure.scripts
 
-import org.onap.so.logger.LoggingAnchor
-import org.onap.so.bpmn.common.scripts.CatalogDbUtilsFactory
-import org.onap.so.client.HttpClientFactory
-import org.onap.logging.filter.base.ErrorCode
-
 import javax.ws.rs.core.MediaType
 import javax.ws.rs.core.Response
 import javax.xml.parsers.DocumentBuilder
 import javax.xml.parsers.DocumentBuilderFactory
-
 import org.camunda.bpm.engine.delegate.BpmnError
 import org.camunda.bpm.engine.delegate.DelegateExecution
 import org.json.JSONArray
 import org.json.JSONObject
 import org.onap.aai.domain.yang.GenericVnf
 import org.onap.aai.domain.yang.NetworkPolicy
+import org.onap.logging.filter.base.ErrorCode
+import org.onap.logging.filter.base.ONAPComponents;
 import org.onap.so.bpmn.common.scripts.AaiUtil
 import org.onap.so.bpmn.common.scripts.CatalogDbUtils
+import org.onap.so.bpmn.common.scripts.CatalogDbUtilsFactory
 import org.onap.so.bpmn.common.scripts.ExceptionUtil
 import org.onap.so.bpmn.common.scripts.MsoUtils
 import org.onap.so.bpmn.common.scripts.NetworkUtils
 import org.onap.so.bpmn.core.json.DecomposeJsonUtil
 import org.onap.so.bpmn.core.json.JsonUtils
 import org.onap.so.client.HttpClient
+import org.onap.so.client.HttpClientFactory
 import org.onap.so.client.aai.AAIObjectPlurals
 import org.onap.so.client.aai.AAIObjectType;
 import org.onap.so.client.aai.AAIResourcesClient
 import org.onap.so.client.aai.entities.AAIResultWrapper
+import org.onap.so.client.aai.entities.uri.AAIPluralResourceUri
 import org.onap.so.client.aai.entities.uri.AAIResourceUri
-import org.onap.so.client.aai.entities.uri.AAIUri
 import org.onap.so.client.aai.entities.uri.AAIUriFactory;
 import org.onap.so.client.graphinventory.entities.uri.Depth
 import org.onap.so.constants.Defaults
 import org.onap.so.db.catalog.beans.HomingInstance
+import org.onap.so.logger.LoggingAnchor
 import org.onap.so.logger.MessageEnum
 import org.slf4j.Logger
 import org.slf4j.LoggerFactory
-
-import org.onap.logging.filter.base.ONAPComponents;
 import org.w3c.dom.Document
 import org.w3c.dom.Element
 import org.w3c.dom.NamedNodeMap
 import org.w3c.dom.Node
 import org.w3c.dom.NodeList
 import org.xml.sax.InputSource
-
 import com.fasterxml.jackson.databind.ObjectMapper
 
 
                                }
 
                                try{
-                                       AAIUri serviceInstanceURI = AAIUriFactory.create(AAIObjectType.SERVICE_INSTANCE, globalSubscriberId,serviceType,serviceInstanceId)
+                                       AAIResourceUri serviceInstanceURI = AAIUriFactory.create(AAIObjectType.SERVICE_INSTANCE, globalSubscriberId,serviceType,serviceInstanceId)
                                        AAIResourcesClient aaiRC = new AAIResourcesClient()
                                        AAIResultWrapper aaiRW = aaiRC.get(serviceInstanceURI)
                                        Map<String, Object> aaiJson = aaiRW.asMap()
                        def vfModuleName = execution.getVariable('DCVFM_vfModuleName')
 
                        AaiUtil aaiUriUtil = new AaiUtil(this)
-                       AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.VF_MODULE, vnfId).queryParam("vf-module-name",vfModuleName)
+                       AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.VF_MODULE, vnfId).queryParam("vf-module-name",vfModuleName)
                        String endPoint = aaiUriUtil.createAaiUri(uri)
 
                        HttpClient client = httpClientFactory.newXmlClient(new URL(endPoint), ONAPComponents.AAI)
                                        String fqdn = fqdnList[i]
 
                                        // Query AAI for this network policy FQDN
-                                       AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.NETWORK_POLICY)
+                                       AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.NETWORK_POLICY)
                                        uri.queryParam("network-policy-fqdn", fqdn)
 
                                        AAIResourcesClient resourceClient = new AAIResourcesClient()
 
 import org.onap.so.bpmn.core.WorkflowException
 import org.onap.so.client.aai.AAIObjectPlurals
 import org.onap.so.client.aai.AAIObjectType
+import org.onap.so.client.aai.entities.uri.AAIPluralResourceUri
 import org.onap.so.client.aai.entities.uri.AAIResourceUri
 import org.onap.so.client.aai.entities.uri.AAIUriFactory
 import org.onap.logging.filter.base.ErrorCode
 
                     try {
                         // Query AAI for this network policy FQDN
-                        AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.NETWORK_POLICY)
+                        AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.NETWORK_POLICY)
                         uri.queryParam("network-policy-fqdn", fqdn)
                         Optional<NetworkPolicies> networkPolicies = getAAIClient().get(NetworkPolicies.class, uri)
 
 
 import org.onap.so.bpmn.core.json.JsonUtils
 import org.onap.so.client.aai.AAIObjectPlurals
 import org.onap.so.client.aai.AAIObjectType
+import org.onap.so.client.aai.entities.uri.AAIPluralResourceUri
 import org.onap.so.client.aai.entities.uri.AAIResourceUri
 import org.onap.so.client.aai.entities.uri.AAIUriFactory
 import org.onap.so.constants.Defaults
                        volumeGroupName = testVolumeGroupName
                }
 
-               AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.VOLUME_GROUP, Defaults.CLOUD_OWNER.toString(), cloudRegion).queryParam("volume-group-name", volumeGroupName)
+               AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.VOLUME_GROUP, Defaults.CLOUD_OWNER.toString(), cloudRegion).queryParam("volume-group-name", volumeGroupName)
                try {
                        Optional<VolumeGroups> volumeGroups = getAAIClient().get(VolumeGroups.class, uri)
                        if (volumeGroups.isPresent()) {
 
 
 package org.onap.so.bpmn.infrastructure.scripts
 
+import javax.ws.rs.NotFoundException
 import org.camunda.bpm.engine.delegate.BpmnError
 import org.camunda.bpm.engine.delegate.DelegateExecution
 import org.onap.aai.domain.yang.GenericVnf
 import org.slf4j.Logger
 import org.slf4j.LoggerFactory
 
-import javax.ws.rs.NotFoundException
-
 class DoCreateVfModuleVolumeV2 extends VfModuleBase {
 
     private static final Logger logger = LoggerFactory.getLogger( DoCreateVfModuleVolumeV2.class);
-       String prefix='DCVFMODVOLV2_'
-       JsonUtils jsonUtil = new JsonUtils()
-       private ExceptionUtil exceptionUtil = new ExceptionUtil()
+    String prefix='DCVFMODVOLV2_'
+    JsonUtils jsonUtil = new JsonUtils()
+    private ExceptionUtil exceptionUtil = new ExceptionUtil()
 
 
     /**
 
     public void preProcessRequest(DelegateExecution execution, isDebugLogEnabled) {
 
-               execution.setVariable("prefix",prefix)
-               execution.setVariable(prefix+'SuccessIndicator', false)
-               execution.setVariable(prefix+'isPONR', false)
-
-               displayInput(execution, isDebugLogEnabled)
-               setRollbackData(execution, isDebugLogEnabled)
-               setRollbackEnabled(execution, isDebugLogEnabled)
-
-
-               def tenantId = execution.getVariable("tenantId")
-               if (tenantId == null) {
-                       String cloudConfiguration = execution.getVariable("cloudConfiguration")
-                       tenantId = jsonUtil.getJsonValue(cloudConfiguration, "cloudConfiguration.tenantId")
-                       execution.setVariable("tenantId", tenantId)
-               }
-
-               def cloudSiteId = execution.getVariable("lcpCloudRegionId")
-               if (cloudSiteId == null) {
-                       String cloudConfiguration = execution.getVariable("cloudConfiguration")
-                       cloudSiteId = jsonUtil.getJsonValue(cloudConfiguration, "cloudConfiguration.lcpCloudRegionId")
-                       def cloudOwner = jsonUtil.getJsonValue(cloudConfiguration, "cloudConfiguration.cloudOwner")
-                       execution.setVariable("lcpCloudRegionId", cloudSiteId)
-                       execution.setVariable("cloudOwner", cloudOwner)
-               }
-
-               // Extract attributes from modelInfo
-               String vfModuleModelInfo = execution.getVariable("vfModuleModelInfo")
-
-               //modelCustomizationUuid
-               def modelCustomizationUuid = jsonUtil.getJsonValue(vfModuleModelInfo, "modelCustomizationUuid")
-               execution.setVariable("modelCustomizationId", modelCustomizationUuid)
-               logger.debug("modelCustomizationId: " + modelCustomizationUuid)
-
-               //modelName
-               def modelName = jsonUtil.getJsonValue(vfModuleModelInfo, "modelName")
-               execution.setVariable("modelName", modelName)
-               logger.debug("modelName: " + modelName)
-
-               // The following is used on the get Generic Service Instance call
-               execution.setVariable('GENGS_type', 'service-instance')
-       }
-
-
-       /**
-        * Display input variables
-        * @param execution
-        * @param isDebugLogEnabled
-        */
-       public void displayInput(DelegateExecution execution, isDebugLogEnabled) {
-               def input = ['mso-request-id', 'msoRequestId', 'isDebugLogEnabled', 'disableRollback', 'failIfExists', 'serviceInstanceId',
-                       'vnfId', 'vnfName', 'tenantId', 'volumeGroupId', 'volumeGroupName', 'lcpCloudRegionId', 'vnfType', 'vfModuleModelInfo',  'asdcServiceModelVersion',
-                       'test-volume-group-name', 'test-volume-group-id', 'vfModuleInputParams']
-
-               logger.debug('Begin input: ')
-               input.each {
-                       logger.debug(it + ': ' + execution.getVariable(it))
-               }
-               logger.debug('End input.')
-       }
-
-
-       /**
-        * Define and set rollbackdata object
-        * @param execution
-        * @param isDebugEnabled
-        */
-       public void setRollbackData(DelegateExecution execution, isDebugEnabled) {
-               def rollbackData = execution.getVariable("rollbackData")
-               if (rollbackData == null) {
-                       rollbackData = new RollbackData()
-               }
-               def volumeGroupName = execution.getVariable('volumeGroupName')
-               rollbackData.put("DCVFMODULEVOL", "volumeGroupName", volumeGroupName)
-               execution.setVariable("rollbackData", rollbackData)
-       }
-
-
-       /**
-        * Gets the service instance uri from aai
-        */
-       public void getServiceInstance(DelegateExecution execution) {
-               try {
-                       String serviceInstanceId = execution.getVariable('serviceInstanceId')
-
-                       AAIResourcesClient resourceClient = new AAIResourcesClient()
-                       AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstanceId)
-
-                       if(!resourceClient.exists(uri)){
-                               (new ExceptionUtil()).buildAndThrowWorkflowException(execution, 2500, "Service instance was not found in aai")
-                       }
-
-               }catch(BpmnError e) {
-                       throw e
-               }catch (Exception ex){
-                       String msg = "Exception in getServiceInstance. " + ex.getMessage()
-                       logger.debug(msg)
-                       (new ExceptionUtil()).buildAndThrowWorkflowException(execution, 2500, msg)
-               }
-       }
-
-       /**
-        * Get cloud region
-        * @param execution
-        * @param isDebugEnabled
-        */
-       public void callRESTQueryAAICloudRegion (DelegateExecution execution, isDebugEnabled) {
-
-               def cloudRegion = execution.getVariable("lcpCloudRegionId")
-               logger.debug('Request cloud region is: ' + cloudRegion)
-
-               AaiUtil aaiUtil = new AaiUtil(this)
-
-               AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.CLOUD_REGION, Defaults.CLOUD_OWNER.toString(), cloudRegion)
-               def queryCloudRegionRequest = aaiUtil.createAaiUri(uri)
-
-               cloudRegion = aaiUtil.getAAICloudReqion(execution,  queryCloudRegionRequest, "PO", cloudRegion)
-
-               def aaiCloudRegion = aaiUtil.getAAICloudReqion(execution,  queryCloudRegionRequest, "AAI", cloudRegion)
-               if ((aaiCloudRegion != "ERROR")) {
-                       execution.setVariable("lcpCloudRegionId", aaiCloudRegion)
-                       logger.debug("AIC Cloud Region for AAI: " + aaiCloudRegion)
-               } else {
-                       String errorMessage = "AAI Query Cloud Region Unsuccessful. Return Code: " + execution.getVariable(prefix+"queryCloudRegionReturnCode")
-                       logger.debug(errorMessage)
-                       (new ExceptionUtil()).buildAndThrowWorkflowException(execution, 2500, errorMessage)
-               }
-
-               def poCloudRegion = aaiUtil.getAAICloudReqion(execution,  queryCloudRegionRequest, "PO", cloudRegion)
-               if ((poCloudRegion != "ERROR")) {
-                       execution.setVariable("poLcpCloudRegionId", poCloudRegion)
-                       logger.debug("AIC Cloud Region for PO: " + poCloudRegion)
-               } else {
-                       String errorMessage = "AAI Query Cloud Region Unsuccessful. Return Code: " + execution.getVariable(prefix+"queryCloudRegionReturnCode")
-                       logger.debug(errorMessage)
-                       (new ExceptionUtil()).buildAndThrowWorkflowException(execution, 2500, errorMessage)
-               }
-
-               def rollbackData = execution.getVariable("rollbackData")
-               rollbackData.put("DCVFMODULEVOL", "aiccloudregion", cloudRegion)
-       }
-
-
-       /**
-        * Query AAI volume group by name
-        * @param execution
-        * @param isDebugEnabled
-        */
-       public void callRESTQueryAAIVolGrpName(DelegateExecution execution, isDebugEnabled) {
-
-               def volumeGroupName = execution.getVariable('volumeGroupName')
-               def cloudRegion = execution.getVariable('lcpCloudRegionId')
-
-               try {
-                       AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.VOLUME_GROUP, Defaults.CLOUD_OWNER.toString(), cloudRegion).queryParam("volume-group-name", volumeGroupName)
-                       Optional<VolumeGroups> volumeGroups = getAAIClient().get(VolumeGroups.class,uri)
-                       if(volumeGroups.isPresent()){
-                               VolumeGroup volumeGroup = volumeGroups.get().getVolumeGroup().get(0);
-                               execution.setVariable(prefix+'AaiReturnCode', 200)
-                               execution.setVariable("queriedVolumeGroupId",volumeGroup.getVolumeGroupId())
-                               logger.debug("Volume Group Name $volumeGroupName exists in AAI.")
-                       }else{
-                               execution.setVariable(prefix+'AaiReturnCode', 404)
-                               exceptionUtil.buildAndThrowWorkflowException(execution,25000, "Volume Group Name $volumeGroupName does not exist in AAI.")
-                       }
-               }catch(BpmnError error){
-                       throw error
-               }catch(Exception e){
-                       execution.setVariable(prefix+'AaiReturnCode', 500)
-                       exceptionUtil.buildAndThrowWorkflowException(execution,25000, "Exception in get volume group by name: " + e.getMessage())
-               }
-       }
-
-
-       /**
-        * Create a WorkflowException
-        * @param execution
-        * @param isDebugEnabled
-        */
-       public void buildWorkflowException(DelegateExecution execution, int errorCode, errorMessage) {
-               logger.debug(errorMessage)
-               (new ExceptionUtil()).buildWorkflowException(execution, 2500, errorMessage)
-       }
-
-
-       /**
-        * Create a WorkflowException
-        * @param execution
-        * @param isDebugEnabled
-        */
-       public void handleError(DelegateExecution execution, isDebugEnabled) {
-               WorkflowException we = execution.getVariable('WorkflowException')
-               if (we == null) {
-                       (new ExceptionUtil()).buildWorkflowException(execution, 2500, "Enexpected error encountered!")
-               }
-               throw new BpmnError("MSOWorkflowException")
-       }
-
-
-       /**
-        * Create volume group in AAI
-        * @param execution
-        * @param isDebugEnabled
-        */
-       public void callRESTCreateAAIVolGrpName(DelegateExecution execution, isDebugEnabled) {
-
-               def vnfId = execution.getVariable('vnfId')
-               def volumeGroupId = execution.getVariable('volumeGroupId')
-               def volumeName = execution.getVariable("volumeGroupName")
-               def modelCustomizationId = execution.getVariable("modelCustomizationId")
-               def vnfType = execution.getVariable("vnfType")
-               def tenantId = execution.getVariable("tenantId")
-               def cloudRegion = execution.getVariable('lcpCloudRegionId')
-               def cloudOwner = execution.getVariable('cloudOwner')
-
-               def testGroupId = execution.getVariable('test-volume-group-id')
-               if (testGroupId != null && testGroupId.trim() != '') {
-                       logger.debug("test volumeGroupId is present: " + testGroupId)
-                       volumeGroupId = testGroupId
-                       execution.setVariable("test-volume-group-name", "MSOTESTVOL101a-vSAMP12_base_vol_module-0")
-               }
-
-               VolumeGroup volumeGroup = new VolumeGroup()
-               volumeGroup.setVolumeGroupId(volumeGroupId)
-               volumeGroup.setVolumeGroupName(volumeName)
-               volumeGroup.setVnfType(vnfType)
-               volumeGroup.setOrchestrationStatus(OrchestrationStatus.PENDING.toString())
-               volumeGroup.setModelCustomizationId(modelCustomizationId)
-
-               logger.debug("volumeGroupId to be used: " + volumeGroupId)
-
-               AAIResourceUri volumeGroupUri = AAIUriFactory.createResourceUri(AAIObjectType.VOLUME_GROUP, cloudOwner, cloudRegion, volumeGroupId)
-               AAIResourceUri tenantUri = AAIUriFactory.createResourceUri(AAIObjectType.TENANT, cloudOwner, cloudRegion, tenantId)
-               AAIResourceUri vnfUri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
-               try {
-                       getAAIClient().create(volumeGroupUri, volumeGroup)
-                       getAAIClient().connect(volumeGroupUri, vnfUri)
-                       getAAIClient().connect(volumeGroupUri, tenantUri)
-                       execution.setVariable("queriedVolumeGroupId", volumeGroupId)
-                       RollbackData rollbackData = execution.getVariable("rollbackData")
-                       rollbackData.put("DCVFMODULEVOL", "isAAIRollbackNeeded", "true")
-               } catch (NotFoundException ignored) {
-                       execution.setVariable(prefix + "isErrorMessageException", true)
-                       exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Unable to create volume group in AAI. Response code: 404")
-               } catch (Exception ex) {
-                       execution.setVariable(prefix + "isErrorMessageException", true)
-                       exceptionUtil.buildAndThrowWorkflowException(execution, 2500, ex.getMessage())
-               }
-       }
-
-       /**
-        * Prepare VNF adapter create request XML
-        * @param execution
-        */
-       public void prepareVnfAdapterCreateRequest(DelegateExecution execution, isDebugEnabled) {
-
-               GenericVnf aaiGenericVnfResponse = execution.getVariable(prefix+'AAIQueryGenericVfnResponse')
-               def vnfId = aaiGenericVnfResponse.getVnfId()
-               def vnfName = aaiGenericVnfResponse.getVnfName()
-               def vnfType = aaiGenericVnfResponse.getVnfType()
-
-               def requestId = execution.getVariable('msoRequestId')
-               def serviceId = execution.getVariable('serviceInstanceId')
-               def cloudSiteId = execution.getVariable('poLcpCloudRegionId')
-               def tenantId = execution.getVariable('tenantId')
-               def volumeGroupId = execution.getVariable('volumeGroupId')
-               def volumeGroupnName = execution.getVariable('volumeGroupName')
-
-               def vnfVersion = execution.getVariable("asdcServiceModelVersion")
-               def vnfModuleType = execution.getVariable("modelName")
-
-               def modelCustomizationId = execution.getVariable("modelCustomizationId")
-
-               // for testing
-               logger.debug("volumeGroupId: " + volumeGroupId)
-               def testGroupId = execution.getVariable('test-volume-group-id')
-               if (testGroupId != null && testGroupId.trim() != '') {
-                       logger.debug("test volumeGroupId is present: " + testGroupId)
-                       volumeGroupId = testGroupId
-                       execution.setVariable("test-volume-group-name", "MSOTESTVOL101a-vSAMP12_base_vol_module-0")
-               }
-               logger.debug("volumeGroupId to be used: " + volumeGroupId)
-
-               // volume group parameters
-
-               String volumeGroupParams = ''
-               StringBuilder sbParams = new StringBuilder()
-               Map<String, String> paramsMap = execution.getVariable("vfModuleInputParams")
-               for (Map.Entry<String, String> entry : paramsMap.entrySet()) {
-                       String paramsXml
-                       String paramName = entry.getKey()
-                       String paramValue = entry.getValue()
-                       paramsXml =
-                               """     <entry>
+        execution.setVariable("prefix",prefix)
+        execution.setVariable(prefix+'SuccessIndicator', false)
+        execution.setVariable(prefix+'isPONR', false)
+
+        displayInput(execution, isDebugLogEnabled)
+        setRollbackData(execution, isDebugLogEnabled)
+        setRollbackEnabled(execution, isDebugLogEnabled)
+
+
+        def tenantId = execution.getVariable("tenantId")
+        if (tenantId == null) {
+            String cloudConfiguration = execution.getVariable("cloudConfiguration")
+            tenantId = jsonUtil.getJsonValue(cloudConfiguration, "cloudConfiguration.tenantId")
+            execution.setVariable("tenantId", tenantId)
+        }
+
+        def cloudSiteId = execution.getVariable("lcpCloudRegionId")
+        if (cloudSiteId == null) {
+            String cloudConfiguration = execution.getVariable("cloudConfiguration")
+            cloudSiteId = jsonUtil.getJsonValue(cloudConfiguration, "cloudConfiguration.lcpCloudRegionId")
+            def cloudOwner = jsonUtil.getJsonValue(cloudConfiguration, "cloudConfiguration.cloudOwner")
+            execution.setVariable("lcpCloudRegionId", cloudSiteId)
+            execution.setVariable("cloudOwner", cloudOwner)
+        }
+
+        // Extract attributes from modelInfo
+        String vfModuleModelInfo = execution.getVariable("vfModuleModelInfo")
+
+        //modelCustomizationUuid
+        def modelCustomizationUuid = jsonUtil.getJsonValue(vfModuleModelInfo, "modelCustomizationUuid")
+        execution.setVariable("modelCustomizationId", modelCustomizationUuid)
+        logger.debug("modelCustomizationId: " + modelCustomizationUuid)
+
+        //modelName
+        def modelName = jsonUtil.getJsonValue(vfModuleModelInfo, "modelName")
+        execution.setVariable("modelName", modelName)
+        logger.debug("modelName: " + modelName)
+
+        // The following is used on the get Generic Service Instance call
+        execution.setVariable('GENGS_type', 'service-instance')
+    }
+
+
+    /**
+     * Display input variables
+     * @param execution
+     * @param isDebugLogEnabled
+     */
+    public void displayInput(DelegateExecution execution, isDebugLogEnabled) {
+        def input = ['mso-request-id', 'msoRequestId', 'isDebugLogEnabled', 'disableRollback', 'failIfExists', 'serviceInstanceId', 'vnfId', 'vnfName', 'tenantId', 'volumeGroupId', 'volumeGroupName', 'lcpCloudRegionId', 'vnfType', 'vfModuleModelInfo', 'asdcServiceModelVersion', 'test-volume-group-name', 'test-volume-group-id', 'vfModuleInputParams']
+
+        logger.debug('Begin input: ')
+        input.each {
+            logger.debug(it + ': ' + execution.getVariable(it))
+        }
+        logger.debug('End input.')
+    }
+
+
+    /**
+     * Define and set rollbackdata object
+     * @param execution
+     * @param isDebugEnabled
+     */
+    public void setRollbackData(DelegateExecution execution, isDebugEnabled) {
+        def rollbackData = execution.getVariable("rollbackData")
+        if (rollbackData == null) {
+            rollbackData = new RollbackData()
+        }
+        def volumeGroupName = execution.getVariable('volumeGroupName')
+        rollbackData.put("DCVFMODULEVOL", "volumeGroupName", volumeGroupName)
+        execution.setVariable("rollbackData", rollbackData)
+    }
+
+
+    /**
+     * Gets the service instance uri from aai
+     */
+    public void getServiceInstance(DelegateExecution execution) {
+        try {
+            String serviceInstanceId = execution.getVariable('serviceInstanceId')
+
+            AAIResourcesClient resourceClient = new AAIResourcesClient()
+            AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstanceId)
+
+            if(!resourceClient.exists(uri)){
+                (new ExceptionUtil()).buildAndThrowWorkflowException(execution, 2500, "Service instance was not found in aai")
+            }
+        }catch(BpmnError e) {
+            throw e
+        }catch (Exception ex){
+            String msg = "Exception in getServiceInstance. " + ex.getMessage()
+            logger.debug(msg)
+            (new ExceptionUtil()).buildAndThrowWorkflowException(execution, 2500, msg)
+        }
+    }
+
+    /**
+     * Get cloud region
+     * @param execution
+     * @param isDebugEnabled
+     */
+    public void callRESTQueryAAICloudRegion (DelegateExecution execution, isDebugEnabled) {
+
+        def cloudRegion = execution.getVariable("lcpCloudRegionId")
+        logger.debug('Request cloud region is: ' + cloudRegion)
+
+        AaiUtil aaiUtil = new AaiUtil(this)
+
+        AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.CLOUD_REGION, Defaults.CLOUD_OWNER.toString(), cloudRegion)
+        def queryCloudRegionRequest = aaiUtil.createAaiUri(uri)
+
+        cloudRegion = aaiUtil.getAAICloudReqion(execution,  queryCloudRegionRequest, "PO", cloudRegion)
+
+        def aaiCloudRegion = aaiUtil.getAAICloudReqion(execution,  queryCloudRegionRequest, "AAI", cloudRegion)
+        if ((aaiCloudRegion != "ERROR")) {
+            execution.setVariable("lcpCloudRegionId", aaiCloudRegion)
+            logger.debug("AIC Cloud Region for AAI: " + aaiCloudRegion)
+        } else {
+            String errorMessage = "AAI Query Cloud Region Unsuccessful. Return Code: " + execution.getVariable(prefix+"queryCloudRegionReturnCode")
+            logger.debug(errorMessage)
+            (new ExceptionUtil()).buildAndThrowWorkflowException(execution, 2500, errorMessage)
+        }
+
+        def poCloudRegion = aaiUtil.getAAICloudReqion(execution,  queryCloudRegionRequest, "PO", cloudRegion)
+        if ((poCloudRegion != "ERROR")) {
+            execution.setVariable("poLcpCloudRegionId", poCloudRegion)
+            logger.debug("AIC Cloud Region for PO: " + poCloudRegion)
+        } else {
+            String errorMessage = "AAI Query Cloud Region Unsuccessful. Return Code: " + execution.getVariable(prefix+"queryCloudRegionReturnCode")
+            logger.debug(errorMessage)
+            (new ExceptionUtil()).buildAndThrowWorkflowException(execution, 2500, errorMessage)
+        }
+
+        def rollbackData = execution.getVariable("rollbackData")
+        rollbackData.put("DCVFMODULEVOL", "aiccloudregion", cloudRegion)
+    }
+
+
+    /**
+     * Query AAI volume group by name
+     * @param execution
+     * @param isDebugEnabled
+     */
+    public void callRESTQueryAAIVolGrpName(DelegateExecution execution, isDebugEnabled) {
+
+        def volumeGroupName = execution.getVariable('volumeGroupName')
+        def cloudRegion = execution.getVariable('lcpCloudRegionId')
+
+        try {
+            AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.VOLUME_GROUP, Defaults.CLOUD_OWNER.toString(), cloudRegion).queryParam("volume-group-name", volumeGroupName)
+            Optional<VolumeGroups> volumeGroups = getAAIClient().get(VolumeGroups.class,uri)
+            if(volumeGroups.isPresent()){
+                VolumeGroup volumeGroup = volumeGroups.get().getVolumeGroup().get(0);
+                execution.setVariable(prefix+'AaiReturnCode', 200)
+                execution.setVariable("queriedVolumeGroupId",volumeGroup.getVolumeGroupId())
+                logger.debug("Volume Group Name $volumeGroupName exists in AAI.")
+            }else{
+                execution.setVariable(prefix+'AaiReturnCode', 404)
+                exceptionUtil.buildAndThrowWorkflowException(execution,25000, "Volume Group Name $volumeGroupName does not exist in AAI.")
+            }
+        }catch(BpmnError error){
+            throw error
+        }catch(Exception e){
+            execution.setVariable(prefix+'AaiReturnCode', 500)
+            exceptionUtil.buildAndThrowWorkflowException(execution,25000, "Exception in get volume group by name: " + e.getMessage())
+        }
+    }
+
+
+    /**
+     * Create a WorkflowException
+     * @param execution
+     * @param isDebugEnabled
+     */
+    public void buildWorkflowException(DelegateExecution execution, int errorCode, errorMessage) {
+        logger.debug(errorMessage)
+        (new ExceptionUtil()).buildWorkflowException(execution, 2500, errorMessage)
+    }
+
+
+    /**
+     * Create a WorkflowException
+     * @param execution
+     * @param isDebugEnabled
+     */
+    public void handleError(DelegateExecution execution, isDebugEnabled) {
+        WorkflowException we = execution.getVariable('WorkflowException')
+        if (we == null) {
+            (new ExceptionUtil()).buildWorkflowException(execution, 2500, "Enexpected error encountered!")
+        }
+        throw new BpmnError("MSOWorkflowException")
+    }
+
+
+    /**
+     * Create volume group in AAI
+     * @param execution
+     * @param isDebugEnabled
+     */
+    public void callRESTCreateAAIVolGrpName(DelegateExecution execution, isDebugEnabled) {
+
+        def vnfId = execution.getVariable('vnfId')
+        def volumeGroupId = execution.getVariable('volumeGroupId')
+        def volumeName = execution.getVariable("volumeGroupName")
+        def modelCustomizationId = execution.getVariable("modelCustomizationId")
+        def vnfType = execution.getVariable("vnfType")
+        def tenantId = execution.getVariable("tenantId")
+        def cloudRegion = execution.getVariable('lcpCloudRegionId')
+        def cloudOwner = execution.getVariable('cloudOwner')
+
+        def testGroupId = execution.getVariable('test-volume-group-id')
+        if (testGroupId != null && testGroupId.trim() != '') {
+            logger.debug("test volumeGroupId is present: " + testGroupId)
+            volumeGroupId = testGroupId
+            execution.setVariable("test-volume-group-name", "MSOTESTVOL101a-vSAMP12_base_vol_module-0")
+        }
+
+        VolumeGroup volumeGroup = new VolumeGroup()
+        volumeGroup.setVolumeGroupId(volumeGroupId)
+        volumeGroup.setVolumeGroupName(volumeName)
+        volumeGroup.setVnfType(vnfType)
+        volumeGroup.setOrchestrationStatus(OrchestrationStatus.PENDING.toString())
+        volumeGroup.setModelCustomizationId(modelCustomizationId)
+
+        logger.debug("volumeGroupId to be used: " + volumeGroupId)
+
+        AAIResourceUri volumeGroupUri = AAIUriFactory.createResourceUri(AAIObjectType.VOLUME_GROUP, cloudOwner, cloudRegion, volumeGroupId)
+        AAIResourceUri tenantUri = AAIUriFactory.createResourceUri(AAIObjectType.TENANT, cloudOwner, cloudRegion, tenantId)
+        AAIResourceUri vnfUri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
+        try {
+            getAAIClient().create(volumeGroupUri, volumeGroup)
+            getAAIClient().connect(volumeGroupUri, vnfUri)
+            getAAIClient().connect(volumeGroupUri, tenantUri)
+            execution.setVariable("queriedVolumeGroupId", volumeGroupId)
+            RollbackData rollbackData = execution.getVariable("rollbackData")
+            rollbackData.put("DCVFMODULEVOL", "isAAIRollbackNeeded", "true")
+        } catch (NotFoundException ignored) {
+            execution.setVariable(prefix + "isErrorMessageException", true)
+            exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Unable to create volume group in AAI. Response code: 404")
+        } catch (Exception ex) {
+            execution.setVariable(prefix + "isErrorMessageException", true)
+            exceptionUtil.buildAndThrowWorkflowException(execution, 2500, ex.getMessage())
+        }
+    }
+
+    /**
+     * Prepare VNF adapter create request XML
+     * @param execution
+     */
+    public void prepareVnfAdapterCreateRequest(DelegateExecution execution, isDebugEnabled) {
+
+        GenericVnf aaiGenericVnfResponse = execution.getVariable(prefix+'AAIQueryGenericVfnResponse')
+        def vnfId = aaiGenericVnfResponse.getVnfId()
+        def vnfName = aaiGenericVnfResponse.getVnfName()
+        def vnfType = aaiGenericVnfResponse.getVnfType()
+
+        def requestId = execution.getVariable('msoRequestId')
+        def serviceId = execution.getVariable('serviceInstanceId')
+        def cloudSiteId = execution.getVariable('poLcpCloudRegionId')
+        def tenantId = execution.getVariable('tenantId')
+        def volumeGroupId = execution.getVariable('volumeGroupId')
+        def volumeGroupnName = execution.getVariable('volumeGroupName')
+
+        def vnfVersion = execution.getVariable("asdcServiceModelVersion")
+        def vnfModuleType = execution.getVariable("modelName")
+
+        def modelCustomizationId = execution.getVariable("modelCustomizationId")
+
+        // for testing
+        logger.debug("volumeGroupId: " + volumeGroupId)
+        def testGroupId = execution.getVariable('test-volume-group-id')
+        if (testGroupId != null && testGroupId.trim() != '') {
+            logger.debug("test volumeGroupId is present: " + testGroupId)
+            volumeGroupId = testGroupId
+            execution.setVariable("test-volume-group-name", "MSOTESTVOL101a-vSAMP12_base_vol_module-0")
+        }
+        logger.debug("volumeGroupId to be used: " + volumeGroupId)
+
+        // volume group parameters
+
+        String volumeGroupParams = ''
+        StringBuilder sbParams = new StringBuilder()
+        Map<String, String> paramsMap = execution.getVariable("vfModuleInputParams")
+        for (Map.Entry<String, String> entry : paramsMap.entrySet()) {
+            String paramsXml
+            String paramName = entry.getKey()
+            String paramValue = entry.getValue()
+            paramsXml =
+                    """        <entry>
                           <key>${MsoUtils.xmlEscape(paramName)}</key>
                           <value>${MsoUtils.xmlEscape(paramValue)}</value>
                        </entry>
                        """
-                       sbParams.append(paramsXml)
-               }
+            sbParams.append(paramsXml)
+        }
 
-               volumeGroupParams = sbParams.toString()
-               logger.debug("volumeGroupParams: "+ volumeGroupParams)
+        volumeGroupParams = sbParams.toString()
+        logger.debug("volumeGroupParams: "+ volumeGroupParams)
 
-               def backoutOnFailure = execution.getVariable(prefix+"backoutOnFailure")
-               logger.debug("backoutOnFailure: "+ backoutOnFailure)
+        def backoutOnFailure = execution.getVariable(prefix+"backoutOnFailure")
+        logger.debug("backoutOnFailure: "+ backoutOnFailure)
 
-               def failIfExists = execution.getVariable("failIfExists")
-               if(failIfExists == null) {
-                       failIfExists = 'true'
-               }
+        def failIfExists = execution.getVariable("failIfExists")
+        if(failIfExists == null) {
+            failIfExists = 'true'
+        }
 
-               String messageId = UUID.randomUUID()
-               logger.debug("messageId to be used is generated: " + messageId)
+        String messageId = UUID.randomUUID()
+        logger.debug("messageId to be used is generated: " + messageId)
 
-               def notificationUrl = createCallbackURL(execution, "VNFAResponse", messageId)
-               def useQualifiedHostName = UrnPropertiesReader.getVariable("mso.use.qualified.host",execution)
-               if ('true'.equals(useQualifiedHostName)) {
-                       notificationUrl = utils.getQualifiedHostNameForCallback(notificationUrl)
-               }
-               logger.debug("CreateVfModuleVolume - notificationUrl: "+ notificationUrl)
+        def notificationUrl = createCallbackURL(execution, "VNFAResponse", messageId)
+        def useQualifiedHostName = UrnPropertiesReader.getVariable("mso.use.qualified.host",execution)
+        if ('true'.equals(useQualifiedHostName)) {
+            notificationUrl = utils.getQualifiedHostNameForCallback(notificationUrl)
+        }
+        logger.debug("CreateVfModuleVolume - notificationUrl: "+ notificationUrl)
 
-               // build request
-               String vnfSubCreateWorkflowRequest =
-                               """
+        // build request
+        String vnfSubCreateWorkflowRequest =
+                """
                        <createVolumeGroupRequest>
                                <cloudSiteId>${MsoUtils.xmlEscape(cloudSiteId)}</cloudSiteId>
                                <tenantId>${MsoUtils.xmlEscape(tenantId)}</tenantId>
                        </createVolumeGroupRequest>
                """
 
-               String vnfSubCreateWorkflowRequestAsString = utils.formatXml(vnfSubCreateWorkflowRequest)
-               logger.debug(vnfSubCreateWorkflowRequestAsString)
-               logger.debug(vnfSubCreateWorkflowRequestAsString)
-               execution.setVariable(prefix+"createVnfARequest", vnfSubCreateWorkflowRequestAsString)
+        String vnfSubCreateWorkflowRequestAsString = utils.formatXml(vnfSubCreateWorkflowRequest)
+        logger.debug(vnfSubCreateWorkflowRequestAsString)
+        logger.debug(vnfSubCreateWorkflowRequestAsString)
+        execution.setVariable(prefix+"createVnfARequest", vnfSubCreateWorkflowRequestAsString)
 
-               // build rollback request for use later if needed
-               String vnfSubRollbackWorkflowRequest = buildRollbackVolumeGroupRequestXml(volumeGroupId, cloudSiteId, tenantId, requestId, serviceId, messageId, notificationUrl)
+        // build rollback request for use later if needed
+        String vnfSubRollbackWorkflowRequest = buildRollbackVolumeGroupRequestXml(volumeGroupId, cloudSiteId, tenantId, requestId, serviceId, messageId, notificationUrl)
 
-               logger.debug("Sub Vnf flow rollback request: vnfSubRollbackWorkflowRequest " + "\n" + vnfSubRollbackWorkflowRequest)
+        logger.debug("Sub Vnf flow rollback request: vnfSubRollbackWorkflowRequest " + "\n" + vnfSubRollbackWorkflowRequest)
 
-               String vnfSubRollbackWorkflowRequestAsString = utils.formatXml(vnfSubRollbackWorkflowRequest)
-               execution.setVariable(prefix+"rollbackVnfARequest", vnfSubRollbackWorkflowRequestAsString)
-       }
+        String vnfSubRollbackWorkflowRequestAsString = utils.formatXml(vnfSubRollbackWorkflowRequest)
+        execution.setVariable(prefix+"rollbackVnfARequest", vnfSubRollbackWorkflowRequestAsString)
+    }
 
-       public String buildRollbackVolumeGroupRequestXml(volumeGroupId, cloudSiteId, tenantId, requestId, serviceId, messageId, notificationUrl) {
+    public String buildRollbackVolumeGroupRequestXml(volumeGroupId, cloudSiteId, tenantId, requestId, serviceId, messageId, notificationUrl) {
 
-               String request = """
+        String request = """
                <rollbackVolumeGroupRequest>
                        <volumeGroupRollback>
                           <volumeGroupId>${MsoUtils.xmlEscape(volumeGroupId)}</volumeGroupId>
                </rollbackVolumeGroupRequest>
                """
 
-               return request
-       }
-
-       public String updateRollbackVolumeGroupRequestXml(String rollabackRequest, String heatStackId) {
-               String newRequest = rollabackRequest.replace("{{VOLUMEGROUPSTACKID}}", heatStackId)
-               return newRequest
-       }
-
-       /**
-        * Validate VNF adapter response
-        * @param execution
-        */
-       public void validateVnfResponse(DelegateExecution execution, isDebugEnabled) {
-               def vnfSuccess = execution.getVariable('VNFREST_SuccessIndicator')
-               logger.debug("vnfAdapterSuccessIndicator: "+ vnfSuccess)
-               if(vnfSuccess==true) {
-                       String createVnfAResponse = execution.getVariable(prefix+"createVnfAResponse")
-                       String heatStackID = utils.getNodeText(createVnfAResponse, "volumeGroupStackId")
-                       String vnfRollbackRequest = execution.getVariable(prefix+"rollbackVnfARequest")
-                       String updatedVnfRollbackRequest = updateRollbackVolumeGroupRequestXml(vnfRollbackRequest, heatStackID)
-                       logger.debug("vnfAdapter rollback request: "+ updatedVnfRollbackRequest)
-                       RollbackData rollbackData = execution.getVariable("rollbackData")
-                       rollbackData.put("DCVFMODULEVOL", "rollbackVnfARequest", updatedVnfRollbackRequest)
-                       rollbackData.put("DCVFMODULEVOL", "isCreateVnfRollbackNeeded", "true")
-               }
-       }
-
-
-       /**
-        * Update voulume group in AAI
-        * @TODO: Can we re-use the create method??
-        * @param execution
-        * @param isDebugEnabled
-        */
-       public void callRESTUpdateCreatedVolGrpName(DelegateExecution execution, isDebugEnabled) {
-               String volumeGroupId = execution.getVariable("queriedVolumeGroupId")
-               String modelCustomizationId = execution.getVariable("modelCustomizationId")
-               String cloudRegion = execution.getVariable("lcpCloudRegionId")
-               String cloudOwner = execution.getVariable('cloudOwner')
-               String createVnfAResponse = execution.getVariable(prefix+"createVnfAResponse")
-               def heatStackID = utils.getNodeText(createVnfAResponse, "volumeGroupStackId")
-               AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.VOLUME_GROUP, cloudOwner, cloudRegion, volumeGroupId)
-
-               execution.setVariable(prefix+"heatStackId", heatStackID)
-
-               VolumeGroup volumeGroup = new VolumeGroup()
-               volumeGroup.setHeatStackId(heatStackID)
-               volumeGroup.setModelCustomizationId(modelCustomizationId)
-               try {
-                       getAAIClient().update(uri, volumeGroup)
-                       execution.setVariable(prefix+"isPONR", true)
-               }catch(NotFoundException ignored){
-                       execution.setVariable(prefix+"isErrorMessageException", true)
-                       exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Unable to update volume group in AAI. Response code: 404")
-               }catch(BpmnError error){
-                       throw error
-               }catch(Exception e){
-                       execution.setVariable(prefix+"isErrorMessageException", true)
-                       exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "AAI Adapter Query Failed. "+ e.getMessage())
-               }
-       }
-
-
-       /**
-        * Query AAI Generic VNF
-        * @param execution
-        * @param isDebugEnabled
-        */
-       public void callRESTQueryAAIGenericVnf(DelegateExecution execution, isDebugEnabled) {
-
-               def vnfId = execution.getVariable('vnfId')
-               AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
-               try {
-                       Optional<GenericVnf> genericVnf = getAAIClient().get(GenericVnf.class, uri)
-                       if (genericVnf.isPresent()) {
-                               execution.setVariable(prefix + 'AAIQueryGenericVfnResponse', genericVnf.get())
-                       } else {
-                               exceptionUtil.buildAndThrowWorkflowException(execution, 2500, 'Generic vnf ' + vnfId + ' was not found in AAI. Return code: 404.')
-                       }
-               }catch(Exception e){
-                       exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Exception in get generic VNF: " + e.getMessage())
-               }
-       }
+        return request
+    }
+
+    public String updateRollbackVolumeGroupRequestXml(String rollabackRequest, String heatStackId) {
+        String newRequest = rollabackRequest.replace("{{VOLUMEGROUPSTACKID}}", heatStackId)
+        return newRequest
+    }
+
+    /**
+     * Validate VNF adapter response
+     * @param execution
+     */
+    public void validateVnfResponse(DelegateExecution execution, isDebugEnabled) {
+        def vnfSuccess = execution.getVariable('VNFREST_SuccessIndicator')
+        logger.debug("vnfAdapterSuccessIndicator: "+ vnfSuccess)
+        if(vnfSuccess==true) {
+            String createVnfAResponse = execution.getVariable(prefix+"createVnfAResponse")
+            String heatStackID = utils.getNodeText(createVnfAResponse, "volumeGroupStackId")
+            String vnfRollbackRequest = execution.getVariable(prefix+"rollbackVnfARequest")
+            String updatedVnfRollbackRequest = updateRollbackVolumeGroupRequestXml(vnfRollbackRequest, heatStackID)
+            logger.debug("vnfAdapter rollback request: "+ updatedVnfRollbackRequest)
+            RollbackData rollbackData = execution.getVariable("rollbackData")
+            rollbackData.put("DCVFMODULEVOL", "rollbackVnfARequest", updatedVnfRollbackRequest)
+            rollbackData.put("DCVFMODULEVOL", "isCreateVnfRollbackNeeded", "true")
+        }
+    }
+
+
+    /**
+     * Update voulume group in AAI
+     * @TODO: Can we re-use the create method??
+     * @param execution
+     * @param isDebugEnabled
+     */
+    public void callRESTUpdateCreatedVolGrpName(DelegateExecution execution, isDebugEnabled) {
+        String volumeGroupId = execution.getVariable("queriedVolumeGroupId")
+        String modelCustomizationId = execution.getVariable("modelCustomizationId")
+        String cloudRegion = execution.getVariable("lcpCloudRegionId")
+        String cloudOwner = execution.getVariable('cloudOwner')
+        String createVnfAResponse = execution.getVariable(prefix+"createVnfAResponse")
+        def heatStackID = utils.getNodeText(createVnfAResponse, "volumeGroupStackId")
+        AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.VOLUME_GROUP, cloudOwner, cloudRegion, volumeGroupId)
+
+        execution.setVariable(prefix+"heatStackId", heatStackID)
+
+        VolumeGroup volumeGroup = new VolumeGroup()
+        volumeGroup.setHeatStackId(heatStackID)
+        volumeGroup.setModelCustomizationId(modelCustomizationId)
+        try {
+            getAAIClient().update(uri, volumeGroup)
+            execution.setVariable(prefix+"isPONR", true)
+        }catch(NotFoundException ignored){
+            execution.setVariable(prefix+"isErrorMessageException", true)
+            exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Unable to update volume group in AAI. Response code: 404")
+        }catch(BpmnError error){
+            throw error
+        }catch(Exception e){
+            execution.setVariable(prefix+"isErrorMessageException", true)
+            exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "AAI Adapter Query Failed. "+ e.getMessage())
+        }
+    }
+
+
+    /**
+     * Query AAI Generic VNF
+     * @param execution
+     * @param isDebugEnabled
+     */
+    public void callRESTQueryAAIGenericVnf(DelegateExecution execution, isDebugEnabled) {
+
+        def vnfId = execution.getVariable('vnfId')
+        AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
+        try {
+            Optional<GenericVnf> genericVnf = getAAIClient().get(GenericVnf.class, uri)
+            if (genericVnf.isPresent()) {
+                execution.setVariable(prefix + 'AAIQueryGenericVfnResponse', genericVnf.get())
+            } else {
+                exceptionUtil.buildAndThrowWorkflowException(execution, 2500, 'Generic vnf ' + vnfId + ' was not found in AAI. Return code: 404.')
+            }
+        }catch(Exception e){
+            exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Exception in get generic VNF: " + e.getMessage())
+        }
+    }
 
 }
 
 import org.onap.so.bpmn.core.json.JsonUtils
 import org.onap.so.client.aai.AAIObjectPlurals
 import org.onap.so.client.aai.AAIObjectType
+import org.onap.so.client.aai.entities.uri.AAIPluralResourceUri
 import org.onap.so.client.aai.entities.uri.AAIResourceUri
 import org.onap.so.client.aai.entities.uri.AAIUriFactory
 import org.onap.so.logger.MessageEnum
                                for (i in 0..fqdnCount-1) {
                                        String fqdn = fqdnList[i]
                                        // Query AAI for this network policy FQDN
-                                       AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.NETWORK_POLICY)
+                                       AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.NETWORK_POLICY)
                                        uri.queryParam("network-policy-fqdn", fqdn)
                                        try {
                                                Optional<NetworkPolicies> networkPolicies = getAAIClient().get(NetworkPolicies.class, uri)
 
 import org.onap.so.client.graphinventory.entities.uri.Depth
 import org.onap.so.client.aai.AAIObjectPlurals
 import org.onap.so.client.aai.AAIObjectType
+import org.onap.so.client.aai.entities.uri.AAIPluralResourceUri
 import org.onap.so.client.aai.entities.uri.AAIResourceUri
 import org.onap.so.client.aai.entities.uri.AAIUriFactory
 import org.onap.so.logger.MessageEnum
 
                                        // Query AAI for this network policy FQDN
 
-                                       AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.NETWORK_POLICY)
+                                       AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.NETWORK_POLICY)
                                        uri.queryParam("network-policy-fqdn", fqdn)
 
                     try {
 
 
 package org.onap.so.bpmn.infrastructure.scripts
 
-import org.onap.so.logger.LoggingAnchor
 import org.camunda.bpm.engine.delegate.BpmnError
 import org.camunda.bpm.engine.delegate.DelegateExecution
 import org.onap.aai.domain.yang.GenericVnf
+import org.onap.logging.filter.base.ErrorCode
 import org.onap.so.bpmn.common.scripts.AaiUtil
 import org.onap.so.bpmn.common.scripts.CatalogDbUtils
 import org.onap.so.bpmn.common.scripts.CatalogDbUtilsFactory
 import org.onap.so.bpmn.core.UrnPropertiesReader
 import org.onap.so.bpmn.core.WorkflowException
 import org.onap.so.bpmn.core.json.JsonUtils;
-import org.onap.so.client.graphinventory.entities.uri.Depth
 import org.onap.so.client.aai.AAIObjectType;
 import org.onap.so.client.aai.AAIResourcesClient
 import org.onap.so.client.aai.entities.AAIResultWrapper
-import org.onap.so.client.aai.entities.uri.AAIUri
-import org.onap.so.client.aai.entities.uri.AAIUriFactory;
 import org.onap.so.client.aai.entities.uri.AAIResourceUri
+import org.onap.so.client.aai.entities.uri.AAIUriFactory;
+import org.onap.so.client.graphinventory.entities.uri.Depth
 import org.onap.so.constants.Defaults
-import org.onap.logging.filter.base.ErrorCode
+import org.onap.so.logger.LoggingAnchor
 import org.onap.so.logger.MessageEnum
 import org.slf4j.Logger
 import org.slf4j.LoggerFactory
                                }
 
                                try{
-                                       AAIUri serviceInstanceURI = AAIUriFactory.create(AAIObjectType.SERVICE_INSTANCE, globalSubscriberId,serviceType,serviceInstanceId)
+                                       AAIResourceUri serviceInstanceURI = AAIUriFactory.create(AAIObjectType.SERVICE_INSTANCE, globalSubscriberId,serviceType,serviceInstanceId)
                                        AAIResourcesClient aaiRC = new AAIResourcesClient()
                                        AAIResultWrapper aaiRW = aaiRC.get(serviceInstanceURI)
                                        Map<String, Object> aaiJson = aaiRW.asMap()
 
 import org.onap.appc.client.lcm.model.ActionIdentifiers
 import org.onap.appc.client.lcm.model.Flags
 import org.onap.appc.client.lcm.model.Status
+import org.onap.logging.filter.base.ErrorCode
 import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
 import org.onap.so.bpmn.common.scripts.ExceptionUtil
 import org.onap.so.bpmn.common.scripts.MsoUtils
 import org.onap.so.client.aai.entities.AAIResultWrapper
 import org.onap.so.client.aai.entities.Relationships
 import org.onap.so.client.aai.entities.uri.AAIResourceUri
-import org.onap.so.client.aai.entities.uri.AAIUri
 import org.onap.so.client.aai.entities.uri.AAIUriFactory
 import org.onap.so.client.appc.ApplicationControllerClient
 import org.onap.so.client.appc.ApplicationControllerSupport
-import org.onap.logging.filter.base.ErrorCode
 import org.onap.so.logger.MessageEnum
 import org.slf4j.Logger
 import org.slf4j.LoggerFactory
             logger.debug("cloudRegionId is: {}", cloudRegionId)
                        
                        AAIResourcesClient client = new AAIResourcesClient()
-                       AAIUri genericVnfUri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
+                       AAIResourceUri genericVnfUri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
                        // Check if this VNF exists
                        if (!client.exists(genericVnfUri)) {
                 logger.debug("VNF with vnfId {} does not exist in A&AI", vnfId)
                        def vnfId = execution.getVariable("vnfId")
             logger.debug("vnfId is: {}", vnfId)
                        AAIResourcesClient client = new AAIResourcesClient()
-                       AAIUri genericVnfUri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
+                       AAIResourceUri genericVnfUri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
                        AAIResultWrapper aaiRW = client.get(genericVnfUri)
                        Map<String, Object> result = aaiRW.asMap()
                        boolean isClosedLoopDisabled = result.getOrDefault("is-closed-loop-disabled", false)
                        def transactionLoggingUuid = UUID.randomUUID().toString()
                        def vnfId = execution.getVariable("vnfId")
                        AAIResourcesClient client = new AAIResourcesClient()
-                       AAIUri genericVnfUri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
+                       AAIResourceUri genericVnfUri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
                        
                        Map<String, Boolean> request = new HashMap<>()
                        request.put("is-closed-loop-disabled", setDisabled)
 
 
 package org.onap.so.bpmn.infrastructure.scripts
 
-import groovy.json.JsonOutput
-import groovy.json.JsonSlurper
 import org.camunda.bpm.engine.delegate.BpmnError
 import org.camunda.bpm.engine.delegate.DelegateExecution
 import org.onap.appc.client.lcm.model.Action
+import org.onap.logging.filter.base.ErrorCode
 import org.onap.so.bpmn.common.scripts.ExceptionUtil
 import org.onap.so.bpmn.common.scripts.MsoUtils
 import org.onap.so.bpmn.core.json.JsonUtils
 import org.onap.so.client.aai.*
 import org.onap.so.client.aai.entities.AAIResultWrapper
-import org.onap.so.client.aai.entities.uri.AAIUri
+import org.onap.so.client.aai.entities.uri.AAIResourceUri
 import org.onap.so.client.aai.entities.uri.AAIUriFactory
-import org.onap.logging.filter.base.ErrorCode
 import org.onap.so.logger.MessageEnum
 import org.slf4j.Logger
 import org.slf4j.LoggerFactory
+import groovy.json.JsonOutput
+import groovy.json.JsonSlurper
 
 public class VnfConfigUpdate extends VnfCmBase {
     private static final Logger logger = LoggerFactory.getLogger( VnfConfigUpdate.class)
                        def vnfId = execution.getVariable("vnfId")
             logger.debug("vnfId is: {}", vnfId)
                        AAIResourcesClient client = new AAIResourcesClient()
-                       AAIUri genericVnfUri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
+                       AAIResourceUri genericVnfUri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
                        AAIResultWrapper aaiRW = client.get(genericVnfUri)
                        Map<String, Object> result = aaiRW.asMap()
                        boolean isClosedLoopDisabled = result.getOrDefault("is-closed-loop-disabled", false)
                        def transactionLoggingUuid = UUID.randomUUID().toString()
                        def vnfId = execution.getVariable("vnfId")
                        AAIResourcesClient client = new AAIResourcesClient()
-                       AAIUri genericVnfUri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
+                       AAIResourceUri genericVnfUri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
 
                        Map<String, Boolean> request = new HashMap<>()
                        request.put("is-closed-loop-disabled", setDisabled)
 
 
 package org.onap.so.bpmn.infrastructure.scripts
 
-import org.onap.so.logger.LoggingAnchor
-import groovy.json.JsonOutput
-import groovy.json.JsonSlurper
 import org.camunda.bpm.engine.delegate.BpmnError
 import org.camunda.bpm.engine.delegate.DelegateExecution
 import org.onap.appc.client.lcm.model.Action
 import org.onap.appc.client.lcm.model.ActionIdentifiers
 import org.onap.appc.client.lcm.model.Flags
 import org.onap.appc.client.lcm.model.Status
+import org.onap.logging.filter.base.ErrorCode
 import org.onap.so.bpmn.common.scripts.ExceptionUtil
 import org.onap.so.bpmn.common.scripts.MsoUtils
 import org.onap.so.bpmn.core.json.JsonUtils
 import org.onap.so.client.aai.*
 import org.onap.so.client.aai.entities.AAIResultWrapper
-import org.onap.so.client.aai.entities.uri.AAIUri
+import org.onap.so.client.aai.entities.uri.AAIResourceUri
 import org.onap.so.client.aai.entities.uri.AAIUriFactory
 import org.onap.so.client.appc.ApplicationControllerClient
 import org.onap.so.client.appc.ApplicationControllerSupport
-import org.onap.logging.filter.base.ErrorCode
+import org.onap.so.logger.LoggingAnchor
 import org.onap.so.logger.MessageEnum
 import org.slf4j.Logger
 import org.slf4j.LoggerFactory
+import groovy.json.JsonOutput
+import groovy.json.JsonSlurper
 
 public class VnfInPlaceUpdate extends VnfCmBase {
     private static final Logger logger = LoggerFactory.getLogger(VnfInPlaceUpdate.class)
                        def vnfId = execution.getVariable("vnfId")
                        logger.debug("vnfId is: " + vnfId)
                        AAIResourcesClient client = new AAIResourcesClient()
-                       AAIUri genericVnfUri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
+                       AAIResourceUri genericVnfUri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
                        AAIResultWrapper aaiRW = client.get(genericVnfUri)
                        Map<String, Object> result = aaiRW.asMap()
                        boolean isClosedLoopDisabled = result.getOrDefault("is-closed-loop-disabled", false)
                        def transactionLoggingUuid = UUID.randomUUID().toString()
                        def vnfId = execution.getVariable("vnfId")
                        AAIResourcesClient client = new AAIResourcesClient()
-                       AAIUri genericVnfUri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
+                       AAIResourceUri genericVnfUri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
 
                        Map<String, Boolean> request = new HashMap<>()
                        request.put("is-closed-loop-disabled", setDisabled)
 
 
 package org.onap.so.bpmn.vcpe.scripts
 
-import org.onap.so.logger.LoggingAnchor
+import static org.apache.commons.lang3.StringUtils.isBlank
+import javax.ws.rs.core.UriBuilder
 import org.camunda.bpm.engine.delegate.BpmnError
 import org.camunda.bpm.engine.delegate.DelegateExecution
 import org.onap.aai.domain.yang.AllottedResource
 import org.onap.so.client.aai.entities.uri.AAIResourceUri
 import org.onap.so.client.aai.entities.uri.AAIUriFactory
 import org.onap.logging.filter.base.ErrorCode
+import org.onap.so.logger.LoggingAnchor
 import org.onap.so.logger.MessageEnum
 import org.slf4j.Logger
 import org.slf4j.LoggerFactory
 
-import javax.ws.rs.NotFoundException
-import javax.ws.rs.core.UriBuilder
-
-import static org.apache.commons.lang3.StringUtils.isBlank
-
 /**
  * This groovy class supports the <class>DoCreateAllottedResourceBRG.bpmn</class> process.
  *
                        AAIResourcesClient resourceClient = new AAIResourcesClient()
                        AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstanceId)
 
-                       try {
                                //just to make sure the serviceInstance exists
-                               uri.build()
+                               if (resourceClient.exists(uri)) {
                                execution.setVariable("PSI_resourceLink", uri)
-                       } catch (NotFoundException e) {
+                       } else {
                                exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Service instance was not found in aai")
                        }
 
 
 
 package org.onap.so.bpmn.infrastructure.workflow.service;
 
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
 import java.io.IOException;
 import java.io.InputStream;
-import java.net.SocketTimeoutException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.http.HttpResponse;
 import org.apache.http.ParseException;
-import org.apache.http.client.HttpClient;
 import org.apache.http.client.config.RequestConfig;
 import org.apache.http.client.methods.HttpDelete;
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.client.methods.HttpPost;
 import org.apache.http.client.methods.HttpPut;
 import org.apache.http.client.methods.HttpRequestBase;
-import org.apache.http.conn.ConnectTimeoutException;
 import org.apache.http.entity.ContentType;
 import org.apache.http.entity.StringEntity;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.onap.so.client.aai.AAIResourcesClient;
 import org.onap.so.client.aai.entities.AAIResultWrapper;
 import org.onap.so.client.aai.entities.Relationships;
+import org.onap.so.client.aai.entities.uri.AAIPluralResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIUriFactory;
 import org.onap.logging.filter.base.ErrorCode;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.web.util.UriUtils;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializationFeature;
 
 public class ServicePluginFactory {
 
     public Map getTPsfromAAI(String serviceName) {
         Map<String, Object> tpInfo = new HashMap<>();
 
-        AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.LOGICAL_LINK);
+        AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.LOGICAL_LINK);
         AAIResourcesClient client = new AAIResourcesClient();
         Optional<LogicalLinks> result = client.get(LogicalLinks.class, uri);
 
 
 import org.onap.so.bpmn.mock.FileUtil
 import org.onap.so.client.aai.AAIObjectPlurals
 import org.onap.so.client.aai.AAIObjectType
+import org.onap.so.client.aai.entities.uri.AAIPluralResourceUri
 import org.onap.so.client.aai.entities.uri.AAIResourceUri
 import org.onap.so.client.aai.entities.uri.AAIUriFactory
 import org.onap.so.client.graphinventory.exceptions.GraphInventoryUriComputationException
         fqdnList.add("test")
         when(mockExecution.getVariable(prefix + "createdNetworkPolicyFqdnList")).thenReturn(fqdnList)
 
-        AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.NETWORK_POLICY)
+        AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.NETWORK_POLICY)
         uri.queryParam("network-policy-fqdn", "test")
         NetworkPolicies networkPolicies = new NetworkPolicies();
         NetworkPolicy networkPolicy = new NetworkPolicy();
         fqdnList.add("test")
         when(mockExecution.getVariable(prefix + "createdNetworkPolicyFqdnList")).thenReturn(fqdnList)
 
-        AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.NETWORK_POLICY)
+        AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.NETWORK_POLICY)
         uri.queryParam("network-policy-fqdn", "test")
         NetworkPolicies networkPolicies = new NetworkPolicies();
         NetworkPolicy networkPolicy = new NetworkPolicy();
         fqdnList.add("test")
         when(mockExecution.getVariable(prefix + "createdNetworkPolicyFqdnList")).thenReturn(fqdnList)
 
-        AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.NETWORK_POLICY)
+        AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.NETWORK_POLICY)
         uri.queryParam("network-policy-fqdn", "test")
         NetworkPolicies networkPolicies = new NetworkPolicies();
         NetworkPolicy networkPolicy = new NetworkPolicy();
 
 import org.onap.aai.domain.yang.VolumeGroups;
 import org.onap.so.bpmn.common.scripts.MsoGroovyTest
 import org.onap.so.client.aai.AAIObjectPlurals
+import org.onap.so.client.aai.entities.uri.AAIPluralResourceUri
 import org.onap.so.client.aai.entities.uri.AAIResourceUri
 import org.onap.so.client.aai.entities.uri.AAIUriFactory
 import org.onap.so.constants.Defaults
         String cloudRegionId = "cloudRegionId"
         when(mockExecution.getVariable("DCVFMODVOLRBK_volumeGroupName")).thenReturn(volumeGroupName)
         when(mockExecution.getVariable("DCVFMODVOLRBK_lcpCloudRegionId")).thenReturn(cloudRegionId)
-        AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.VOLUME_GROUP, Defaults.CLOUD_OWNER.toString(), cloudRegionId).queryParam("volume-group-name", volumeGroupName)
+        AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.VOLUME_GROUP, Defaults.CLOUD_OWNER.toString(), cloudRegionId).queryParam("volume-group-name", volumeGroupName)
         VolumeGroup volumeGroup = new VolumeGroup();
         volumeGroup.setVolumeGroupId("volumeGroupId")
         VolumeGroups groups = new VolumeGroups();
 
 import org.onap.so.bpmn.core.RollbackData
 import org.onap.so.client.aai.AAIObjectPlurals
 import org.onap.so.client.aai.AAIObjectType
+import org.onap.so.client.aai.entities.uri.AAIPluralResourceUri
 import org.onap.so.client.aai.entities.uri.AAIResourceUri
 import org.onap.so.client.aai.entities.uri.AAIUriFactory
 import org.onap.so.constants.Defaults
                String lcpCloudRegionId = "lcpCloudRegionId"
                when(mockExecution.getVariable(volumeGroupName)).thenReturn(volumeGroupName)
                when(mockExecution.getVariable(lcpCloudRegionId)).thenReturn(lcpCloudRegionId)
-               AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.VOLUME_GROUP, Defaults.CLOUD_OWNER.toString(), lcpCloudRegionId).queryParam("volume-group-name", volumeGroupName)
+               AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.VOLUME_GROUP, Defaults.CLOUD_OWNER.toString(), lcpCloudRegionId).queryParam("volume-group-name", volumeGroupName)
                VolumeGroups volumeGroups = new VolumeGroups();
                VolumeGroup volumeGroup = new  VolumeGroup()
                volumeGroup.setVolumeGroupId("volumeGroupId")
                String lcpCloudRegionId = "lcpCloudRegionId"
                when(mockExecution.getVariable(volumeGroupName)).thenReturn(volumeGroupName)
                when(mockExecution.getVariable(lcpCloudRegionId)).thenReturn(lcpCloudRegionId)
-               AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.VOLUME_GROUP, Defaults.CLOUD_OWNER.toString(), lcpCloudRegionId).queryParam("volume-group-name", volumeGroupName)
+               AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.VOLUME_GROUP, Defaults.CLOUD_OWNER.toString(), lcpCloudRegionId).queryParam("volume-group-name", volumeGroupName)
                when(client.get(VolumeGroup.class,uri)).thenReturn(Optional.empty())
                thrown.expect(BpmnError.class)
                doCreateVfModuleVolumeV2.callRESTQueryAAIVolGrpName(mockExecution,null)
 
 import org.onap.so.bpmn.core.WorkflowException
 import org.onap.so.client.aai.AAIObjectPlurals
 import org.onap.so.client.aai.AAIObjectType
+import org.onap.so.client.aai.entities.uri.AAIPluralResourceUri
 import org.onap.so.client.aai.entities.uri.AAIResourceUri
 import org.onap.so.client.aai.entities.uri.AAIUriFactory
 import org.onap.so.client.graphinventory.entities.uri.Depth
         List fqdnList = new ArrayList()
         fqdnList.add("test")
         when(mockExecution.getVariable("DDVFMV_contrailNetworkPolicyFqdnList")).thenReturn(fqdnList)
-        AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.NETWORK_POLICY)
+        AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.NETWORK_POLICY)
         uri.queryParam("network-policy-fqdn", "test")
         NetworkPolicies networkPolicies = new NetworkPolicies();
         NetworkPolicy networkPolicy = new NetworkPolicy();
         List fqdnList = new ArrayList()
         fqdnList.add("test")
         when(mockExecution.getVariable("DDVFMV_contrailNetworkPolicyFqdnList")).thenReturn(fqdnList)
-        AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.NETWORK_POLICY)
+        AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.NETWORK_POLICY)
         uri.queryParam("network-policy-fqdn", "test")
         when(client.get(NetworkPolicies.class, uri)).thenReturn(Optional.empty())
         deleteVfModuleFromVnf.deleteNetworkPoliciesFromAAI(mockExecution)
 
 import org.onap.so.bpmn.mock.FileUtil
 import org.onap.so.client.aai.AAIObjectPlurals
 import org.onap.so.client.aai.AAIObjectType
+import org.onap.so.client.aai.entities.uri.AAIPluralResourceUri
 import org.onap.so.client.aai.entities.uri.AAIResourceUri
 import org.onap.so.client.aai.entities.uri.AAIUriFactory
 
         NetworkPolicy networkPolicy = new NetworkPolicy()
         networkPolicy.setNetworkPolicyId("NP1")
         networkPolicies.getNetworkPolicy().add(networkPolicy)
-        AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.NETWORK_POLICY)
+        AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.NETWORK_POLICY)
         uri.queryParam("network-policy-fqdn", "test")
         when(client.get(NetworkPolicies.class, uri)).thenReturn(Optional.of(networkPolicies))
         doDeleteVfModule.deleteNetworkPoliciesFromAAI(mockExecution)
         NetworkPolicy networkPolicy = new NetworkPolicy()
         networkPolicy.setNetworkPolicyId("NP1")
         networkPolicies.getNetworkPolicy().add(networkPolicy)
-        AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.NETWORK_POLICY)
+        AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.NETWORK_POLICY)
         uri.queryParam("network-policy-fqdn", "test")
         when(client.get(NetworkPolicies.class, uri)).thenReturn(Optional.of(networkPolicies))
         AAIResourceUri delUri = AAIUriFactory.createResourceUri(AAIObjectType.NETWORK_POLICY, "NP1")
 
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
 import org.mockito.Spy;
 import org.mockito.junit.MockitoJUnitRunner;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
 
 import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
 import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
 import org.onap.so.client.aai.AAIObjectPlurals;
-import org.onap.so.client.aai.entities.uri.AAIResourceUri;
+import org.onap.so.client.aai.entities.uri.AAIPluralResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIUriFactory;
 import org.onap.so.client.exception.BBObjectNotFoundException;
 import org.onap.so.client.exception.ExceptionBuilder;
                 if (fqdnCount > 0) {
                     for (int i = 0; i < fqdnCount; i++) {
                         String fqdn = fqdnList[i];
-                        AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.NETWORK_POLICY);
+                        AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.NETWORK_POLICY);
                         uri.queryParam(NETWORK_POLICY_FQDN_PARAM, fqdn);
                         Optional<org.onap.aai.domain.yang.NetworkPolicy> oNetPolicy =
                                 aaiNetworkResources.getNetworkPolicy(uri);
 
 import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
 import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
 import org.onap.so.client.aai.AAIObjectPlurals;
-import org.onap.so.client.aai.entities.uri.AAIResourceUri;
+import org.onap.so.client.aai.entities.uri.AAIPluralResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIUriFactory;
 import org.onap.so.client.exception.ExceptionBuilder;
 import org.onap.so.client.orchestration.AAIConfigurationResources;
                 if (fqdnCount > 0) {
                     for (int i = 0; i < fqdnCount; i++) {
                         String fqdn = fqdnList[i];
-                        AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.NETWORK_POLICY);
+                        AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.NETWORK_POLICY);
                         uri.queryParam(networkPolicyFqdnParam, fqdn);
                         Optional<NetworkPolicies> oNetPolicies = aaiNetworkResources.getNetworkPolicies(uri);
                         if (oNetPolicies.isPresent()) {
 
 import javax.ws.rs.core.UriBuilder;
 import org.onap.so.bpmn.common.InjectionHelper;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration;
-import org.onap.so.client.aai.AAIObjectPlurals;
 import org.onap.so.client.aai.AAIObjectType;
 import org.onap.so.client.aai.entities.AAIEdgeLabel;
 import org.onap.so.client.aai.entities.uri.AAIResourceUri;
         injectionHelper.getAaiClient().update(aaiResourceUri, aaiConfiguration);
     }
 
-    public boolean checkConfigurationNameInUse(String configurationName) {
-        AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.CONFIGURATION)
-                .queryParam("configuration-name", configurationName);
-        return injectionHelper.getAaiClient().exists(uri);
-    }
-
 }
 
 import org.onap.so.client.aai.AAIObjectPlurals;
 import org.onap.so.client.aai.AAIObjectType;
 import org.onap.so.client.aai.entities.AAIEdgeLabel;
+import org.onap.so.client.aai.entities.uri.AAIPluralResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIUriFactory;
 import org.onap.so.client.aai.mapper.AAIObjectMapper;
     }
 
     public boolean checkInstanceGroupNameInUse(String instanceGroupName) {
-        AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.INSTANCE_GROUP)
+        AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.INSTANCE_GROUP)
                 .queryParam("instance-group-name", instanceGroupName);
         return injectionHelper.getAaiClient().exists(uri);
     }
 
 import org.onap.so.client.aai.AAIObjectType;
 import org.onap.so.client.aai.entities.AAIEdgeLabel;
 import org.onap.so.client.aai.entities.AAIResultWrapper;
+import org.onap.so.client.aai.entities.uri.AAIBaseResourceUri;
+import org.onap.so.client.aai.entities.uri.AAIPluralResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIUriFactory;
 import org.onap.so.client.aai.mapper.AAIObjectMapper;
         return injectionHelper.getAaiClient().get(netBindingUri.depth(Depth.TWO)).asBean(VpnBinding.class);
     }
 
-    public Optional<NetworkPolicy> getNetworkPolicy(AAIResourceUri netPolicyUri) {
+    public Optional<NetworkPolicy> getNetworkPolicy(AAIBaseResourceUri netPolicyUri) {
         return injectionHelper.getAaiClient().get(netPolicyUri).asBean(NetworkPolicy.class);
     }
 
-    public Optional<NetworkPolicies> getNetworkPolicies(AAIResourceUri netPoliciesUri) {
+    public Optional<NetworkPolicies> getNetworkPolicies(AAIBaseResourceUri netPoliciesUri) {
         return injectionHelper.getAaiClient().get(netPoliciesUri).asBean(NetworkPolicies.class);
     }
 
     }
 
     public boolean checkNetworkNameInUse(String networkName) {
-        AAIResourceUri uri =
+        AAIPluralResourceUri uri =
                 AAIUriFactory.createResourceUri(AAIObjectPlurals.L3_NETWORK).queryParam("network-name", networkName);
         return injectionHelper.getAaiClient().exists(uri);
     }
 
 import org.onap.so.client.aai.AAIObjectPlurals;
 import org.onap.so.client.aai.AAIObjectType;
 import org.onap.so.client.aai.AAIResourcesClient;
+import org.onap.so.client.aai.entities.uri.AAIPluralResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIUriFactory;
 import org.onap.so.client.aai.mapper.AAIObjectMapper;
     }
 
     public boolean existsOwningEntityName(String owningEntityName) {
-        AAIResourceUri owningEntityUri = AAIUriFactory.createResourceUri(AAIObjectPlurals.OWNING_ENTITY)
+        AAIPluralResourceUri owningEntityUri = AAIUriFactory.createResourceUri(AAIObjectPlurals.OWNING_ENTITY)
                 .queryParam("owning-entity-name", owningEntityName);
         AAIResourcesClient aaiRC = injectionHelper.getAaiClient();
         return aaiRC.exists(owningEntityUri);
 
     public org.onap.aai.domain.yang.OwningEntity getOwningEntityByName(String owningEntityName)
             throws AAIEntityNotFoundException {
-        AAIResourceUri owningEntityUri = AAIUriFactory.createResourceUri(AAIObjectPlurals.OWNING_ENTITY)
+        AAIPluralResourceUri owningEntityUri = AAIUriFactory.createResourceUri(AAIObjectPlurals.OWNING_ENTITY)
                 .queryParam("owning-entity-name", owningEntityName);
         AAIResourcesClient aaiRC = injectionHelper.getAaiClient();
         Optional<OwningEntities> owningEntities = aaiRC.get(OwningEntities.class, owningEntityUri);
     }
 
     public boolean checkInstanceServiceNameInUse(ServiceInstance serviceInstance) {
-        AAIResourceUri uriSI = AAIUriFactory.createNodesUri(AAIObjectPlurals.SERVICE_INSTANCE)
+        AAIPluralResourceUri uriSI = AAIUriFactory.createNodesUri(AAIObjectPlurals.SERVICE_INSTANCE)
                 .queryParam("service-instance-name", serviceInstance.getServiceInstanceName());
         return injectionHelper.getAaiClient().exists(uriSI);
     }
 
 package org.onap.so.client.orchestration;
 
 import java.util.Optional;
-import org.onap.aai.domain.yang.VfModules;
 import org.onap.so.bpmn.common.InjectionHelper;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup;
 import org.onap.so.client.aai.AAIObjectPlurals;
 import org.onap.so.client.aai.AAIObjectType;
-import org.onap.so.client.aai.entities.AAIResultWrapper;
+import org.onap.so.client.aai.entities.uri.AAIPluralResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIUriFactory;
 import org.onap.so.client.aai.mapper.AAIObjectMapper;
 import org.onap.so.db.catalog.beans.OrchestrationStatus;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 
     public boolean checkNameInUse(VfModule vfModule) {
         boolean nameInUse = false;
-        AAIResourceUri vfModuleUri = AAIUriFactory.createNodesUri(AAIObjectPlurals.VF_MODULE)
+        AAIPluralResourceUri vfModuleUri = AAIUriFactory.createNodesUri(AAIObjectPlurals.VF_MODULE)
                 .queryParam("vf-module-name", vfModule.getVfModuleName());
-        AAIResourceUri vfModuleUriWithCustomization = vfModuleUri.clone().queryParam("model-customization-id",
+        AAIPluralResourceUri vfModuleUriWithCustomization = vfModuleUri.clone().queryParam("model-customization-id",
                 vfModule.getModelInfoVfModule().getModelCustomizationUUID());
         if (injectionHelper.getAaiClient().exists(vfModuleUriWithCustomization)) {
             // assume it's a resume case and return false
 
 import org.onap.so.client.aai.AAIRestClientImpl;
 import org.onap.so.client.aai.AAIValidatorImpl;
 import org.onap.so.client.aai.entities.AAIResultWrapper;
+import org.onap.so.client.aai.entities.uri.AAIPluralResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIUriFactory;
 import org.onap.so.client.aai.mapper.AAIObjectMapper;
     }
 
     public boolean checkNameInUse(String vnfName) {
-        AAIResourceUri vnfUri =
+        AAIPluralResourceUri vnfUri =
                 AAIUriFactory.createResourceUri(AAIObjectPlurals.GENERIC_VNF).queryParam("vnf-name", vnfName);
         return injectionHelper.getAaiClient().exists(vnfUri);
     }
 
 import org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup;
 import org.onap.so.client.aai.AAIObjectPlurals;
 import org.onap.so.client.aai.AAIObjectType;
+import org.onap.so.client.aai.entities.uri.AAIPluralResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIUriFactory;
 import org.onap.so.client.aai.mapper.AAIObjectMapper;
 import org.onap.so.db.catalog.beans.OrchestrationStatus;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
     }
 
     public boolean checkNameInUse(VolumeGroup volumeGroup) {
-        AAIResourceUri volumeGroupUri = AAIUriFactory.createNodesUri(AAIObjectPlurals.VOLUME_GROUP)
+        AAIPluralResourceUri volumeGroupUri = AAIUriFactory.createNodesUri(AAIObjectPlurals.VOLUME_GROUP)
                 .queryParam("volume-group-name", volumeGroup.getVolumeGroupName());
         return injectionHelper.getAaiClient().exists(volumeGroupUri);
     }
 
 import org.onap.so.bpmn.servicedecomposition.bbobjects.VpnBinding;
 import org.onap.so.client.aai.AAIObjectPlurals;
 import org.onap.so.client.aai.AAIObjectType;
+import org.onap.so.client.aai.entities.uri.AAIPluralResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIUriFactory;
 import org.onap.so.client.aai.mapper.AAIObjectMapper;
      * @return
      */
     public Optional<VpnBindings> getVpnBindingByCustomerVpnId(String customerVpnId) {
-        AAIResourceUri aaiVpnBindingsResourceUri = AAIUriFactory.createResourceUri(AAIObjectPlurals.VPN_BINDING)
+        AAIPluralResourceUri aaiVpnBindingsResourceUri = AAIUriFactory.createResourceUri(AAIObjectPlurals.VPN_BINDING)
                 .queryParam("customer-vpn-id", customerVpnId);
         return injectionHelper.getAaiClient().get(VpnBindings.class, aaiVpnBindingsResourceUri);
 
 
 import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
 import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoGenericVnf;
 import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule;
+import org.onap.so.client.aai.entities.uri.AAIBaseResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIResourceUri;
 import org.onap.so.client.exception.BBObjectNotFoundException;
 import org.onap.so.db.catalog.beans.OrchestrationStatus;
         execution.setVariable("heatStackId", "testHeatStackId");
         execution.setVariable("contrailNetworkPolicyFqdnList", "ABC123");
         NetworkPolicy networkPolicy = new NetworkPolicy();
-        doReturn(Optional.of(networkPolicy)).when(aaiNetworkResources).getNetworkPolicy(any(AAIResourceUri.class));
+        doReturn(Optional.of(networkPolicy)).when(aaiNetworkResources).getNetworkPolicy(any(AAIBaseResourceUri.class));
         doNothing().when(aaiNetworkResources).createNetworkPolicy(any(NetworkPolicy.class));
         aaiCreateTasks.createNetworkPolicies(execution);
         verify(aaiNetworkResources, times(0)).createNetworkPolicy(any(NetworkPolicy.class));
 
 import org.mockito.Captor;
 import org.mockito.InjectMocks;
 import org.onap.aai.domain.yang.NetworkPolicies;
-import org.onap.aai.domain.yang.NetworkPolicy;
 import org.onap.so.bpmn.BaseTaskTest;
 import org.onap.so.bpmn.common.BuildingBlockExecution;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup;
 import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
 import org.onap.so.client.aai.entities.AAIResultWrapper;
-import org.onap.so.client.aai.entities.uri.AAIResourceUri;
+import org.onap.so.client.aai.entities.uri.AAIBaseResourceUri;
 import org.onap.so.client.exception.BBObjectNotFoundException;
 
 
         NetworkPolicies networkPolicies1 = aaiResultWrapper1.asBean(NetworkPolicies.class).get();
 
         doReturn(Optional.of(networkPolicies0), Optional.of(networkPolicies1)).when(aaiNetworkResources)
-                .getNetworkPolicies(any(AAIResourceUri.class));
+                .getNetworkPolicies(any(AAIBaseResourceUri.class));
         doNothing().when(aaiNetworkResources).deleteNetworkPolicy(any(String.class));
         aaiDeleteTasks.deleteNetworkPolicies(execution);
         verify(aaiNetworkResources, times(2)).deleteNetworkPolicy(stringCaptor.capture());
     public void deleteNetworkPolicyNeedToDeleteNoneTest() throws Exception {
         execution.setVariable("contrailNetworkPolicyFqdnList", "ABC123");
         Optional<NetworkPolicies> networkPolicies = Optional.empty();
-        doReturn(networkPolicies).when(aaiNetworkResources).getNetworkPolicies(any(AAIResourceUri.class));
+        doReturn(networkPolicies).when(aaiNetworkResources).getNetworkPolicies(any(AAIBaseResourceUri.class));
         aaiDeleteTasks.deleteNetworkPolicies(execution);
         verify(aaiNetworkResources, times(0)).deleteNetworkPolicy(any(String.class));
     }
 
 package org.onap.so.client.orchestration;
 
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.ArgumentMatchers.isA;
 import org.mockito.InjectMocks;
 import org.mockito.Mock;
 import org.mockito.junit.MockitoJUnitRunner;
-import org.onap.so.bpmn.common.data.TestDataSetup;
 import org.onap.so.bpmn.common.InjectionHelper;
+import org.onap.so.bpmn.common.data.TestDataSetup;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceProxy;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.VpnBinding;
-import org.onap.so.client.aai.AAIObjectPlurals;
 import org.onap.so.client.aai.AAIObjectType;
 import org.onap.so.client.aai.AAIResourcesClient;
 import org.onap.so.client.aai.entities.AAIEdgeLabel;
 import org.onap.so.client.aai.entities.uri.AAIUriFactory;
 import org.onap.so.client.aai.mapper.AAIObjectMapper;
 import org.onap.so.db.catalog.beans.OrchestrationStatus;
-import org.onap.so.bpmn.common.data.TestDataSetup;
 
 
 @RunWith(MockitoJUnitRunner.Silent.class)
                 any(org.onap.aai.domain.yang.Configuration.class));
     }
 
-    @Test
-    public void checkConfigurationNameInUseTrueTest() throws Exception {
-        AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.CONFIGURATION)
-                .queryParam("configuration-name", "configurationName");
-        doReturn(true).when(MOCK_aaiResourcesClient).exists(eq(uri));
-        boolean nameInUse = aaiConfigurationResources.checkConfigurationNameInUse("configurationName");
-        assertTrue(nameInUse);
-    }
-
-    @Test
-    public void checkConfigurationNameInUseFalseTest() throws Exception {
-        AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.CONFIGURATION)
-                .queryParam("configuration-name", "configurationName");
-        doReturn(false).when(MOCK_aaiResourcesClient).exists(eq(uri));
-        boolean nameInUse = aaiConfigurationResources.checkConfigurationNameInUse("configurationName");
-        assertFalse(nameInUse);
-    }
-
 }
 
 
 package org.onap.so.client.orchestration;
 
-import static org.mockito.ArgumentMatchers.eq;
-import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.ArgumentMatchers.isA;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
 import org.mockito.InjectMocks;
 import org.mockito.Mock;
 import org.mockito.junit.MockitoJUnitRunner;
-import org.onap.so.bpmn.common.data.TestDataSetup;
 import org.onap.so.bpmn.common.InjectionHelper;
+import org.onap.so.bpmn.common.data.TestDataSetup;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.InstanceGroup;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
 import org.onap.so.client.aai.AAIObjectType;
 import org.onap.so.client.aai.AAIResourcesClient;
 import org.onap.so.client.aai.entities.AAIEdgeLabel;
+import org.onap.so.client.aai.entities.uri.AAIPluralResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIUriFactory;
 import org.onap.so.client.aai.mapper.AAIObjectMapper;
-import org.onap.so.db.catalog.beans.OrchestrationStatus;
 
 @RunWith(MockitoJUnitRunner.Silent.class)
 public class AAIInstanceGroupResourcesTest extends TestDataSetup {
 
     @Test
     public void checkInstanceGroupNameInUseTrueTest() throws Exception {
-        AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.INSTANCE_GROUP)
+        AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.INSTANCE_GROUP)
                 .queryParam("instance-group-name", "instanceGroupName");
         doReturn(true).when(MOCK_aaiResourcesClient).exists(eq(uri));
         boolean nameInUse = aaiInstanceGroupResources.checkInstanceGroupNameInUse("instanceGroupName");
 
     @Test
     public void checkInstanceGroupNameInUseFalseTest() throws Exception {
-        AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.INSTANCE_GROUP)
+        AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.INSTANCE_GROUP)
                 .queryParam("instance-group-name", "instanceGroupName");
         doReturn(false).when(MOCK_aaiResourcesClient).exists(eq(uri));
         boolean nameInUse = aaiInstanceGroupResources.checkInstanceGroupNameInUse("instanceGroupName");
 
 import org.onap.so.client.aai.entities.AAIEdgeLabel;
 import org.onap.so.client.aai.entities.AAIResultWrapper;
 import org.onap.so.client.aai.entities.Relationships;
+import org.onap.so.client.aai.entities.uri.AAIPluralResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIUriFactory;
 import org.onap.so.client.aai.mapper.AAIObjectMapper;
                 new String(Files.readAllBytes(Paths.get(JSON_FILE_LOCATION + "queryAaiNetworkPolicies.json")));
         AAIResultWrapper aaiResultWrapper = new AAIResultWrapper(content);
         Optional<org.onap.aai.domain.yang.NetworkPolicies> oNetPolicies = Optional.empty();
-        AAIResourceUri netPoliciesUri = AAIUriFactory.createResourceUri(AAIObjectPlurals.NETWORK_POLICY);
+        AAIPluralResourceUri netPoliciesUri = AAIUriFactory.createResourceUri(AAIObjectPlurals.NETWORK_POLICY);
 
-        doReturn(aaiResultWrapper).when(MOCK_aaiResourcesClient).get(isA(AAIResourceUri.class));
+        doReturn(aaiResultWrapper).when(MOCK_aaiResourcesClient).get(isA(AAIPluralResourceUri.class));
         oNetPolicies = aaiNetworkResources.getNetworkPolicies(netPoliciesUri);
-        verify(MOCK_aaiResourcesClient, times(1)).get(any(AAIResourceUri.class));
+        verify(MOCK_aaiResourcesClient, times(1)).get(any(AAIPluralResourceUri.class));
         if (oNetPolicies.isPresent()) {
             org.onap.aai.domain.yang.NetworkPolicies networkPolicies = oNetPolicies.get();
             assertThat(aaiResultWrapper.asBean(org.onap.aai.domain.yang.NetworkPolicies.class).get(),
 
     @Test
     public void checkInstanceGroupNameInUseTrueTest() throws Exception {
-        AAIResourceUri uri =
+        AAIPluralResourceUri uri =
                 AAIUriFactory.createResourceUri(AAIObjectPlurals.L3_NETWORK).queryParam("network-name", "networkName");
         doReturn(true).when(MOCK_aaiResourcesClient).exists(eq(uri));
         boolean nameInUse = aaiNetworkResources.checkNetworkNameInUse("networkName");
 
     @Test
     public void checkInstanceGroupNameInUseFalseTest() throws Exception {
-        AAIResourceUri uri =
+        AAIPluralResourceUri uri =
                 AAIUriFactory.createResourceUri(AAIObjectPlurals.L3_NETWORK).queryParam("network-name", "networkName");
         doReturn(false).when(MOCK_aaiResourcesClient).exists(eq(uri));
         boolean nameInUse = aaiNetworkResources.checkNetworkNameInUse("networkName");
 
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.isA;
 import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.ArgumentMatchers.isA;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.doThrow;
 import org.mockito.InjectMocks;
 import org.mockito.Mock;
 import org.mockito.junit.MockitoJUnitRunner;
-import org.onap.so.bpmn.common.data.TestDataSetup;
 import org.onap.so.bpmn.common.InjectionHelper;
+import org.onap.so.bpmn.common.data.TestDataSetup;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.OwningEntity;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.Project;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceSubscription;
 import org.onap.so.client.aai.AAIObjectPlurals;
 import org.onap.so.client.aai.AAIResourcesClient;
+import org.onap.so.client.aai.entities.uri.AAIPluralResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIUriFactory;
 import org.onap.so.client.aai.mapper.AAIObjectMapper;
 
     @Test
     public void checkInstanceServiceNameInUseTrueTest() throws Exception {
-        AAIResourceUri uri = AAIUriFactory.createNodesUri(AAIObjectPlurals.SERVICE_INSTANCE)
+        AAIPluralResourceUri uri = AAIUriFactory.createNodesUri(AAIObjectPlurals.SERVICE_INSTANCE)
                 .queryParam("service-instance-name", serviceInstance.getServiceInstanceName());
         doReturn(true).when(MOCK_aaiResourcesClient).exists(eq(uri));
         boolean nameInUse = aaiServiceInstanceResources.checkInstanceServiceNameInUse(serviceInstance);
 
     @Test
     public void checkInstanceServiceNameInUseFalseTest() throws Exception {
-        AAIResourceUri uri = AAIUriFactory.createNodesUri(AAIObjectPlurals.SERVICE_INSTANCE)
+        AAIPluralResourceUri uri = AAIUriFactory.createNodesUri(AAIObjectPlurals.SERVICE_INSTANCE)
                 .queryParam("service-instance-name", serviceInstance.getServiceInstanceName());
         doReturn(false).when(MOCK_aaiResourcesClient).exists(eq(uri));
         boolean nameInUse = aaiServiceInstanceResources.checkInstanceServiceNameInUse(serviceInstance);
 
 import org.mockito.InjectMocks;
 import org.mockito.Mock;
 import org.mockito.junit.MockitoJUnitRunner;
-import org.onap.so.bpmn.common.data.TestDataSetup;
 import org.onap.so.bpmn.common.InjectionHelper;
+import org.onap.so.bpmn.common.data.TestDataSetup;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup;
 import org.onap.so.client.aai.AAIObjectPlurals;
 import org.onap.so.client.aai.AAIResourcesClient;
+import org.onap.so.client.aai.entities.uri.AAIPluralResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIUriFactory;
 import org.onap.so.client.aai.mapper.AAIObjectMapper;
 
     @Test
     public void checkNameInUseTrueTest() throws Exception {
-        AAIResourceUri vfModuleUri = AAIUriFactory.createNodesUri(AAIObjectPlurals.VF_MODULE)
+        AAIPluralResourceUri vfModuleUri = AAIUriFactory.createNodesUri(AAIObjectPlurals.VF_MODULE)
                 .queryParam("vf-module-name", vfModule.getVfModuleName());
-        AAIResourceUri vfModuleUriWithCustomization = vfModuleUri.clone().queryParam("model-customization-id",
+        AAIPluralResourceUri vfModuleUriWithCustomization = vfModuleUri.clone().queryParam("model-customization-id",
                 vfModule.getModelInfoVfModule().getModelCustomizationUUID());
         doReturn(false).when(MOCK_aaiResourcesClient).exists(eq(vfModuleUriWithCustomization));
         doReturn(true).when(MOCK_aaiResourcesClient).exists(eq(vfModuleUri));
 
     @Test
     public void checkNameInUseFalseIsResumeTest() throws Exception {
-        AAIResourceUri vfModuleUri = AAIUriFactory.createNodesUri(AAIObjectPlurals.VF_MODULE)
+        AAIPluralResourceUri vfModuleUri = AAIUriFactory.createNodesUri(AAIObjectPlurals.VF_MODULE)
                 .queryParam("vf-module-name", vfModule.getVfModuleName());
-        AAIResourceUri vfModuleUriWithCustomization = vfModuleUri.clone().queryParam("model-customization-id",
+        AAIPluralResourceUri vfModuleUriWithCustomization = vfModuleUri.clone().queryParam("model-customization-id",
                 vfModule.getModelInfoVfModule().getModelCustomizationUUID());
         doReturn(true).when(MOCK_aaiResourcesClient).exists(eq(vfModuleUriWithCustomization));
         boolean nameInUse = aaiVfModuleResources.checkNameInUse(vfModule);
 
     @Test
     public void checkNameInUseFalseTest() throws Exception {
-        AAIResourceUri vfModuleUri = AAIUriFactory.createNodesUri(AAIObjectPlurals.VF_MODULE)
+        AAIPluralResourceUri vfModuleUri = AAIUriFactory.createNodesUri(AAIObjectPlurals.VF_MODULE)
                 .queryParam("vf-module-name", vfModule.getVfModuleName());
-        AAIResourceUri vfModuleUriWithCustomization = vfModuleUri.clone().queryParam("model-customization-id",
+        AAIPluralResourceUri vfModuleUriWithCustomization = vfModuleUri.clone().queryParam("model-customization-id",
                 vfModule.getModelInfoVfModule().getModelCustomizationUUID());
         doReturn(false).when(MOCK_aaiResourcesClient).exists(eq(vfModuleUriWithCustomization));
         doReturn(false).when(MOCK_aaiResourcesClient).exists(eq(vfModuleUri));
 
 import org.mockito.InjectMocks;
 import org.mockito.Mock;
 import org.mockito.junit.MockitoJUnitRunner;
-import org.onap.so.bpmn.common.data.TestDataSetup;
 import org.onap.so.bpmn.common.InjectionHelper;
+import org.onap.so.bpmn.common.data.TestDataSetup;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.LineOfBusiness;
 import org.onap.so.client.aai.AAIRestClientImpl;
 import org.onap.so.client.aai.AAIValidatorImpl;
 import org.onap.so.client.aai.entities.AAIResultWrapper;
+import org.onap.so.client.aai.entities.uri.AAIPluralResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIUriFactory;
 import org.onap.so.client.aai.mapper.AAIObjectMapper;
 
     @Test
     public void checkNameInUseTrueTest() {
-        AAIResourceUri vnfUri =
+        AAIPluralResourceUri vnfUri =
                 AAIUriFactory.createResourceUri(AAIObjectPlurals.GENERIC_VNF).queryParam("vnf-name", "vnfName");
         doReturn(true).when(MOCK_aaiResourcesClient).exists(eq(vnfUri));
         boolean nameInUse = aaiVnfResources.checkNameInUse("vnfName");
 
     @Test
     public void checkNameInUseFalseTest() {
-        AAIResourceUri vnfUri =
+        AAIPluralResourceUri vnfUri =
                 AAIUriFactory.createResourceUri(AAIObjectPlurals.GENERIC_VNF).queryParam("vnf-name", "vnfName");
         doReturn(false).when(MOCK_aaiResourcesClient).exists(eq(vnfUri));
         boolean nameInUse = aaiVnfResources.checkNameInUse("vnfName");
 
 import org.mockito.InjectMocks;
 import org.mockito.Mock;
 import org.mockito.junit.MockitoJUnitRunner;
-import org.onap.so.bpmn.common.data.TestDataSetup;
 import org.onap.so.bpmn.common.InjectionHelper;
+import org.onap.so.bpmn.common.data.TestDataSetup;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup;
 import org.onap.so.client.aai.AAIObjectPlurals;
 import org.onap.so.client.aai.AAIResourcesClient;
-import org.onap.so.client.aai.entities.AAIResultWrapper;
+import org.onap.so.client.aai.entities.uri.AAIPluralResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIUriFactory;
 import org.onap.so.client.aai.mapper.AAIObjectMapper;
 
     @Test
     public void checkNameInUseTrueTest() {
-        AAIResourceUri volumeGroupUri = AAIUriFactory.createNodesUri(AAIObjectPlurals.VOLUME_GROUP)
+        AAIPluralResourceUri volumeGroupUri = AAIUriFactory.createNodesUri(AAIObjectPlurals.VOLUME_GROUP)
                 .queryParam("volume-group-name", "testVolumeGroupName1");
         doReturn(true).when(MOCK_aaiResourcesClient).exists(eq(volumeGroupUri));
         boolean nameInUse = aaiVolumeGroupResources.checkNameInUse(volumeGroup);
 
     @Test
     public void checkNameInUseFalseTest() {
-        AAIResourceUri volumeGroupUri = AAIUriFactory.createNodesUri(AAIObjectPlurals.VOLUME_GROUP)
+        AAIPluralResourceUri volumeGroupUri = AAIUriFactory.createNodesUri(AAIObjectPlurals.VOLUME_GROUP)
                 .queryParam("volume-group-name", "testVolumeGroupName1");
         doReturn(false).when(MOCK_aaiResourcesClient).exists(eq(volumeGroupUri));
         boolean nameInUse = aaiVolumeGroupResources.checkNameInUse(volumeGroup);
 
 import org.onap.so.bpmn.BaseTaskTest;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.VpnBinding;
+import org.onap.so.client.aai.entities.uri.AAIPluralResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIResourceUri;
 
 
 
     @Test
     public void getVpnBindingByCustomerVpnIdTest() {
-        when(MOCK_aaiResourcesClient.get(eq(VpnBindings.class), isA(AAIResourceUri.class)))
+        when(MOCK_aaiResourcesClient.get(eq(VpnBindings.class), isA(AAIPluralResourceUri.class)))
                 .thenReturn(Optional.of(new VpnBindings()));
         Optional<VpnBindings> vpnBindings = aaiVpnBindingResources.getVpnBindingByCustomerVpnId("testCustomerVpnId");
         assertNotNull(vpnBindings.get());
         verify(MOCK_aaiResourcesClient, times(1)).get(eq(org.onap.aai.domain.yang.VpnBindings.class),
-                isA(AAIResourceUri.class));
+                isA(AAIPluralResourceUri.class));
     }
 
     @Test
 
 import javax.ws.rs.core.UriBuilder;
 import org.onap.so.client.RestClient;
 import org.onap.so.client.graphinventory.GraphInventoryClient;
-import org.onap.so.client.graphinventory.entities.uri.GraphInventoryUri;
 import org.onap.so.client.graphinventory.exceptions.GraphInventoryUriComputationException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
     }
 
     @Override
-    protected URI constructPath(GraphInventoryUri uri) {
+    protected URI constructPath(URI uri) {
 
-        return UriBuilder.fromUri(AAI_ROOT + "/" + this.getVersion().toString() + uri.build().toString()).build();
+        return UriBuilder.fromUri(AAI_ROOT + "/" + this.getVersion().toString() + uri.toString()).build();
     }
 
     @Override
-    public RestClient createClient(GraphInventoryUri uri) {
+    protected RestClient createClient(URI uri) {
         try {
+
             return new AAIRestClient(getRestProperties(), constructPath(uri));
         } catch (GraphInventoryUriComputationException | NotFoundException e) {
             logger.debug("failed to construct A&AI uri", e);
 
--- /dev/null
+package org.onap.so.client.aai;
+
+import org.onap.so.client.graphinventory.GraphInventoryObjectBase;
+
+public interface AAIObjectBase extends GraphInventoryObjectBase {
+
+}
 
 import org.onap.so.constants.Defaults;
 import com.google.common.base.CaseFormat;
 
-public class AAIObjectPlurals implements GraphInventoryObjectPlurals, Serializable {
+public class AAIObjectPlurals implements AAIObjectBase, GraphInventoryObjectPlurals, Serializable {
 
     private static final long serialVersionUID = 5312713297525740746L;
 
     public static final AAIObjectPlurals CUSTOMER =
-            new AAIObjectPlurals(AAINamespaceConstants.BUSINESS, "/customers", "customer");
+            new AAIObjectPlurals(AAIObjectType.CUSTOMER, AAINamespaceConstants.BUSINESS, "/customers");
     public static final AAIObjectPlurals GENERIC_VNF =
-            new AAIObjectPlurals(AAINamespaceConstants.NETWORK, "/generic-vnfs", "generic-vnf");
+            new AAIObjectPlurals(AAIObjectType.GENERIC_VNF, AAINamespaceConstants.NETWORK, "/generic-vnfs");
     public static final AAIObjectPlurals PORT_GROUP =
-            new AAIObjectPlurals(AAIObjectType.VCE.uriTemplate(), "/port-groups", "port-group");
+            new AAIObjectPlurals(AAIObjectType.PORT_GROUP, AAIObjectType.VCE.uriTemplate(), "/port-groups");
     public static final AAIObjectPlurals PSERVER =
-            new AAIObjectPlurals(AAINamespaceConstants.CLOUD_INFRASTRUCTURE, "/pservers", "pserver");
+            new AAIObjectPlurals(AAIObjectType.PSERVER, AAINamespaceConstants.CLOUD_INFRASTRUCTURE, "/pservers");
     public static final AAIObjectPlurals P_INTERFACE =
-            new AAIObjectPlurals(AAIObjectType.PSERVER.uriTemplate(), "/p-interfaces", "p-interface");
+            new AAIObjectPlurals(AAIObjectType.P_INTERFACE, AAIObjectType.PSERVER.uriTemplate(), "/p-interfaces");
     public static final AAIObjectPlurals L3_NETWORK =
-            new AAIObjectPlurals(AAINamespaceConstants.NETWORK, "/l3-networks", "l3-network");
+            new AAIObjectPlurals(AAIObjectType.L3_NETWORK, AAINamespaceConstants.NETWORK, "/l3-networks");
     public static final AAIObjectPlurals NETWORK_POLICY =
-            new AAIObjectPlurals(AAINamespaceConstants.NETWORK, "/network-policies", "network-policy");
+            new AAIObjectPlurals(AAIObjectType.NETWORK_POLICY, AAINamespaceConstants.NETWORK, "/network-policies");
     public static final AAIObjectPlurals VPN_BINDING =
-            new AAIObjectPlurals(AAINamespaceConstants.NETWORK, "/vpn-bindings", "vpn-binding");
-    public static final AAIObjectPlurals SERVICE_SUBSCRIPTION = new AAIObjectPlurals(
-            AAIObjectType.CUSTOMER.uriTemplate(), "/service-subscriptions", "service-subscription");
-    public static final AAIObjectPlurals SERVICE_INSTANCE = new AAIObjectPlurals(
-            AAIObjectType.SERVICE_SUBSCRIPTION.uriTemplate(), "/service-instances", "service-instance");
+            new AAIObjectPlurals(AAIObjectType.VPN_BINDING, AAINamespaceConstants.NETWORK, "/vpn-bindings");
+    public static final AAIObjectPlurals SERVICE_SUBSCRIPTION = new AAIObjectPlurals(AAIObjectType.SERVICE_SUBSCRIPTION,
+            AAIObjectType.CUSTOMER.uriTemplate(), "/service-subscriptions");
+    public static final AAIObjectPlurals SERVICE_INSTANCE = new AAIObjectPlurals(AAIObjectType.SERVICE_INSTANCE,
+            AAIObjectType.SERVICE_SUBSCRIPTION.uriTemplate(), "/service-instances");
     public static final AAIObjectPlurals OWNING_ENTITY =
-            new AAIObjectPlurals(AAINamespaceConstants.BUSINESS, "/owning-entities", "owning-entity");
-    public static final AAIObjectPlurals VOLUME_GROUP =
-            new AAIObjectPlurals(AAIObjectType.CLOUD_REGION.uriTemplate(), "/volume-groups", "volume-group");
-    public static final AAIObjectPlurals AVAILIBILITY_ZONE =
-            new AAIObjectPlurals(AAIObjectType.CLOUD_REGION.uriTemplate(), "/availability-zones", "availability-zone");
+            new AAIObjectPlurals(AAIObjectType.OWNING_ENTITY, AAINamespaceConstants.BUSINESS, "/owning-entities");
+    public static final AAIObjectPlurals VOLUME_GROUP = new AAIObjectPlurals(AAIObjectType.VOLUME_GROUP,
+            AAIObjectType.CLOUD_REGION.uriTemplate(), "/volume-groups");
+    public static final AAIObjectPlurals AVAILIBILITY_ZONE = new AAIObjectPlurals(AAIObjectType.AVAILIBILITY_ZONE,
+            AAIObjectType.CLOUD_REGION.uriTemplate(), "/availability-zones");
     public static final AAIObjectPlurals VF_MODULE =
-            new AAIObjectPlurals(AAIObjectType.GENERIC_VNF.uriTemplate(), "/vf-modules", "vf-module");
+            new AAIObjectPlurals(AAIObjectType.VF_MODULE, AAIObjectType.GENERIC_VNF.uriTemplate(), "/vf-modules");
     public static final AAIObjectPlurals CONFIGURATION =
-            new AAIObjectPlurals(AAINamespaceConstants.NETWORK, "/configurations", "configuration");
+            new AAIObjectPlurals(AAIObjectType.CONFIGURATION, AAINamespaceConstants.NETWORK, "/configurations");
     public static final AAIObjectPlurals DEFAULT_TENANT =
-            new AAIObjectPlurals(AAINamespaceConstants.CLOUD_INFRASTRUCTURE + "/cloud-regions/cloud-region/"
-                    + Defaults.CLOUD_OWNER + "/AAIAIC25", "/tenants", "default-tenant");
-    public static final AAIObjectPlurals NETWORK_TECHNOLOGY = new AAIObjectPlurals(
-            AAINamespaceConstants.CLOUD_INFRASTRUCTURE, "/network-technologies", "network-technology");
+            new AAIObjectPlurals(AAIObjectType.DEFAULT_TENANT, AAINamespaceConstants.CLOUD_INFRASTRUCTURE
+                    + "/cloud-regions/cloud-region/" + Defaults.CLOUD_OWNER + "/AAIAIC25", "/tenants");
+    public static final AAIObjectPlurals NETWORK_TECHNOLOGY = new AAIObjectPlurals(AAIObjectType.NETWORK_TECHNOLOGY,
+            AAINamespaceConstants.CLOUD_INFRASTRUCTURE, "/network-technologies");
     public static final AAIObjectPlurals LOGICAL_LINK =
-            new AAIObjectPlurals(AAINamespaceConstants.NETWORK, "/logical-links", "logical-link");
+            new AAIObjectPlurals(AAIObjectType.LOGICAL_LINK, AAINamespaceConstants.NETWORK, "/logical-links");
     public static final AAIObjectPlurals L_INTERFACE =
-            new AAIObjectPlurals(AAIObjectType.VSERVER.uriTemplate(), "/l-interfaces", "l-interface");
+            new AAIObjectPlurals(AAIObjectType.L_INTERFACE, AAIObjectType.VSERVER.uriTemplate(), "/l-interfaces");
     public static final AAIObjectPlurals SUB_L_INTERFACE =
-            new AAIObjectPlurals(AAIObjectType.L_INTERFACE.uriTemplate(), "/l-interfaces", "l-interface");
+            new AAIObjectPlurals(AAIObjectType.L_INTERFACE, AAIObjectType.L_INTERFACE.uriTemplate(), "/l-interfaces");
     public static final AAIObjectPlurals INSTANCE_GROUP =
-            new AAIObjectPlurals(AAINamespaceConstants.NETWORK, "/instance-groups", "instance-group");
-    public static final AAIObjectPlurals PNF = new AAIObjectPlurals(AAINamespaceConstants.NETWORK, "/pnfs", "pnfs");
+            new AAIObjectPlurals(AAIObjectType.INSTANCE_GROUP, AAINamespaceConstants.NETWORK, "/instance-groups");
+    public static final AAIObjectPlurals PNF =
+            new AAIObjectPlurals(AAIObjectType.PNF, AAINamespaceConstants.NETWORK, "/pnfs");
 
     private final String uriTemplate;
     private final String partialUri;
-    private final String name;
+    private final AAIObjectType type;
 
-    protected AAIObjectPlurals(String parentUri, String partialUri, String name) {
+    protected AAIObjectPlurals(AAIObjectType type, String parentUri, String partialUri) {
         this.uriTemplate = parentUri + partialUri;
         this.partialUri = partialUri;
-        this.name = name;
+        this.type = type;
     }
 
     @Override
         return this.partialUri;
     }
 
+    @Override
+    public AAIObjectType getType() {
+        return this.type;
+    }
+
     @Override
     public String typeName() {
-        return this.typeName(CaseFormat.LOWER_HYPHEN);
+        return this.getType().typeName();
     }
 
     @Override
     public String typeName(CaseFormat format) {
-        return CaseFormat.LOWER_HYPHEN.to(format, this.name);
+        return this.getType().typeName(format);
     }
 }
 
 
 import com.google.common.base.CaseFormat;
 import org.onap.aai.annotations.Metadata;
-import org.onap.aai.domain.yang.*;
+import org.onap.aai.domain.yang.AggregateRoute;
+import org.onap.aai.domain.yang.AllottedResource;
+import org.onap.aai.domain.yang.AvailabilityZone;
+import org.onap.aai.domain.yang.CloudRegion;
+import org.onap.aai.domain.yang.Collection;
+import org.onap.aai.domain.yang.CommunicationServiceProfile;
+import org.onap.aai.domain.yang.Complex;
+import org.onap.aai.domain.yang.Configuration;
+import org.onap.aai.domain.yang.Connector;
+import org.onap.aai.domain.yang.Customer;
+import org.onap.aai.domain.yang.Device;
+import org.onap.aai.domain.yang.EsrVnfm;
+import org.onap.aai.domain.yang.ExtAaiNetwork;
+import org.onap.aai.domain.yang.Flavor;
+import org.onap.aai.domain.yang.GenericVnf;
+import org.onap.aai.domain.yang.Image;
+import org.onap.aai.domain.yang.InstanceGroup;
+import org.onap.aai.domain.yang.L3Network;
+import org.onap.aai.domain.yang.LInterface;
+import org.onap.aai.domain.yang.LineOfBusiness;
+import org.onap.aai.domain.yang.LogicalLink;
+import org.onap.aai.domain.yang.ModelVer;
+import org.onap.aai.domain.yang.NetworkPolicy;
+import org.onap.aai.domain.yang.NetworkTechnology;
+import org.onap.aai.domain.yang.OperationalEnvironment;
+import org.onap.aai.domain.yang.OwningEntity;
+import org.onap.aai.domain.yang.PInterface;
+import org.onap.aai.domain.yang.PhysicalLink;
+import org.onap.aai.domain.yang.Platform;
+import org.onap.aai.domain.yang.Pnf;
+import org.onap.aai.domain.yang.PortGroup;
+import org.onap.aai.domain.yang.Project;
+import org.onap.aai.domain.yang.Pserver;
+import org.onap.aai.domain.yang.RouteTableReference;
+import org.onap.aai.domain.yang.Service;
+import org.onap.aai.domain.yang.ServiceInstance;
+import org.onap.aai.domain.yang.ServiceProfile;
+import org.onap.aai.domain.yang.ServiceSubscription;
+import org.onap.aai.domain.yang.SliceProfile;
+import org.onap.aai.domain.yang.SpPartner;
+import org.onap.aai.domain.yang.SriovPf;
+import org.onap.aai.domain.yang.Subnet;
+import org.onap.aai.domain.yang.Tenant;
+import org.onap.aai.domain.yang.TunnelXconnect;
+import org.onap.aai.domain.yang.Vce;
+import org.onap.aai.domain.yang.VfModule;
+import org.onap.aai.domain.yang.VlanTag;
+import org.onap.aai.domain.yang.Vnfc;
+import org.onap.aai.domain.yang.VolumeGroup;
+import org.onap.aai.domain.yang.VpnBinding;
+import org.onap.aai.domain.yang.Vserver;
+import org.onap.aai.domain.yang.Zone;
 import org.onap.so.client.graphinventory.GraphInventoryObjectType;
 import org.onap.so.constants.Defaults;
 import org.reflections.Reflections;
 import java.util.Set;
 import java.util.regex.Pattern;
 
-public class AAIObjectType implements GraphInventoryObjectType, Serializable {
+public class AAIObjectType implements AAIObjectBase, GraphInventoryObjectType, Serializable {
 
     private static final long serialVersionUID = -2877184776691514600L;
     private static Map<String, AAIObjectType> map = new HashMap<>();
             new AAIObjectType(AAIObjectType.PSERVER.uriTemplate(), PInterface.class);
     public static final AAIObjectType SRIOV_PF =
             new AAIObjectType(AAIObjectType.P_INTERFACE.uriTemplate(), SriovPf.class);
+    public static final AAIObjectType LOGICAL_LINK =
+            new AAIObjectType(AAINamespaceConstants.NETWORK, LogicalLink.class);
     public static final AAIObjectType PHYSICAL_LINK =
             new AAIObjectType(AAINamespaceConstants.NETWORK, PhysicalLink.class);
     public static final AAIObjectType INSTANCE_GROUP =
     public static final AAIObjectType IMAGE = new AAIObjectType(AAIObjectType.CLOUD_REGION.uriTemplate(), Image.class);
     public static final AAIObjectType FLAVOR =
             new AAIObjectType(AAIObjectType.CLOUD_REGION.uriTemplate(), Flavor.class);
-    public static final AAIObjectType UNKNOWN = new AAIObjectType("", "", "unknown");
+    public static final AAIObjectType UNKNOWN = new AAIObjectType("", "", "unknown") {
+
+        private static final long serialVersionUID = 9208984071038447607L;
+
+        @Override
+        public boolean passThrough() {
+            return true;
+        }
+    };
     public static final AAIObjectType DSL = new AAIObjectType("/dsl", "", "dsl");
     public static final AAIObjectType VNFM = new AAIObjectType(
             AAINamespaceConstants.EXTERNAL_SYSTEM + "/esr-vnfm-list/esr-vnfm/{vnfm-id}", EsrVnfm.class);
     public static final AAIObjectType CLOUD_ESR_SYSTEM_INFO_LIST = new AAIObjectType(
             AAIObjectType.CLOUD_REGION.uriTemplate(), "/esr-system-info-list", "cloud-esr-system-info-list");
     public static final AAIObjectType ZONE = new AAIObjectType(AAINamespaceConstants.NETWORK, Zone.class);
+    public static final AAIObjectType AVAILIBILITY_ZONE =
+            new AAIObjectType(AAIObjectType.CLOUD_REGION.uriTemplate(), AvailabilityZone.class);
     public static final AAIObjectType THIRDPARTY_SDNC_LIST = new AAIObjectType(AAINamespaceConstants.EXTERNAL_SYSTEM,
             "/esr-thirdparty-sdnc-list", "thirdparty-sdnc-list");
     public static final AAIObjectType THIRDPARTY_SDNC_SYSTEM_INFO_LIST =
                 new Reflections(new ConfigurationBuilder().setUrls(packages).setScanners(new SubTypesScanner()));
 
         Set<Class<? extends AAIObjectType>> resources = r.getSubTypesOf(AAIObjectType.class);
-        try {
-            for (Class<? extends AAIObjectType> customTypeClass : resources) {
-                AAIObjectType customType;
+
+        for (Class<? extends AAIObjectType> customTypeClass : resources) {
+            AAIObjectType customType;
+            try {
                 customType = customTypeClass.newInstance();
+            } catch (InstantiationException | IllegalAccessException e) {
             }
-        } catch (InstantiationException | IllegalAccessException e) {
         }
     }
 
 
 import org.onap.aai.domain.yang.Relationship;
 import org.onap.so.client.aai.entities.AAIEdgeLabel;
 import org.onap.so.client.aai.entities.AAIResultWrapper;
+import org.onap.so.client.aai.entities.uri.AAIBaseResourceUri;
+import org.onap.so.client.aai.entities.uri.AAIPluralResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIResourceUri;
 import org.onap.so.client.graphinventory.GraphInventoryResourcesClient;
 import org.onap.so.client.graphinventory.entities.GraphInventoryEdgeLabel;
-import org.onap.so.client.graphinventory.entities.uri.GraphInventoryResourceUri;
 
 public class AAIResourcesClient extends
-        GraphInventoryResourcesClient<AAIResourcesClient, AAIResourceUri, AAIEdgeLabel, AAIResultWrapper, AAITransactionalClient, AAISingleTransactionClient> {
+        GraphInventoryResourcesClient<AAIResourcesClient, AAIBaseResourceUri<?, ?>, AAIResourceUri, AAIPluralResourceUri, AAIEdgeLabel, AAIResultWrapper, AAITransactionalClient, AAISingleTransactionClient> {
 
     private AAIClient aaiClient;
 
         return new AAIResultWrapper(json);
     }
 
+    @Override
+    public AAIResultWrapper createWrapper(Object obj) {
+        return new AAIResultWrapper(obj);
+    }
+
     @Override
     public AAITransactionalClient beginTransaction() {
         return new AAITransactionalClient(this, aaiClient);
     }
 
     @Override
-    protected Relationship buildRelationship(GraphInventoryResourceUri uri) {
+    protected Relationship buildRelationship(AAIResourceUri uri) {
         return super.buildRelationship(uri, Optional.empty());
     }
 
     @Override
-    protected Relationship buildRelationship(GraphInventoryResourceUri uri, GraphInventoryEdgeLabel label) {
+    protected Relationship buildRelationship(AAIResourceUri uri, GraphInventoryEdgeLabel label) {
         return super.buildRelationship(uri, Optional.of(label));
     }
 
     @Override
-    protected Relationship buildRelationship(GraphInventoryResourceUri uri, Optional<GraphInventoryEdgeLabel> label) {
+    protected Relationship buildRelationship(AAIResourceUri uri, Optional<GraphInventoryEdgeLabel> label) {
         return super.buildRelationship(uri, label);
     }
 
 
 import org.onap.so.client.aai.entities.singletransaction.OperationBodyResponse;
 import org.onap.so.client.aai.entities.singletransaction.SingleTransactionRequest;
 import org.onap.so.client.aai.entities.singletransaction.SingleTransactionResponse;
+import org.onap.so.client.aai.entities.uri.AAIBaseResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIUriFactory;
 import org.onap.so.client.graphinventory.GraphInventoryPatchConverter;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.google.common.base.Joiner;
 
-public class AAISingleTransactionClient
-        extends GraphInventoryTransactionClient<AAISingleTransactionClient, AAIResourceUri, AAIEdgeLabel> {
+public class AAISingleTransactionClient extends
+        GraphInventoryTransactionClient<AAISingleTransactionClient, AAIBaseResourceUri<?, ?>, AAIResourceUri, AAIEdgeLabel> {
 
     private final SingleTransactionRequest request;
     private AAIResourcesClient resourcesClient;
     }
 
     @Override
-    protected <T> Optional<T> get(GenericType<T> genericType, AAIResourceUri clone) {
+    protected <T> Optional<T> get(GenericType<T> genericType, AAIBaseResourceUri<?, ?> clone) {
         return resourcesClient.get(genericType, clone);
     }
 
     @Override
-    protected boolean exists(AAIResourceUri uri) {
+    protected boolean exists(AAIBaseResourceUri<?, ?> uri) {
         return resourcesClient.exists(uri);
     }
 
 
 import org.onap.so.client.aai.entities.bulkprocess.OperationBody;
 import org.onap.so.client.aai.entities.bulkprocess.Transaction;
 import org.onap.so.client.aai.entities.bulkprocess.Transactions;
+import org.onap.so.client.aai.entities.uri.AAIBaseResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIUriFactory;
 import org.onap.so.client.graphinventory.GraphInventoryPatchConverter;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.google.common.base.Joiner;
 
-public class AAITransactionalClient
-        extends GraphInventoryTransactionClient<AAITransactionalClient, AAIResourceUri, AAIEdgeLabel> {
+public class AAITransactionalClient extends
+        GraphInventoryTransactionClient<AAITransactionalClient, AAIBaseResourceUri<?, ?>, AAIResourceUri, AAIEdgeLabel> {
 
     private final Transactions transactions;
     private Transaction currentTransaction;
     }
 
     @Override
-    protected <T> Optional<T> get(GenericType<T> genericType, AAIResourceUri clone) {
+    protected <T> Optional<T> get(GenericType<T> genericType, AAIBaseResourceUri<?, ?> clone) {
         return resourcesClient.get(genericType, clone);
     }
 
     @Override
-    protected boolean exists(AAIResourceUri uri) {
+    protected boolean exists(AAIBaseResourceUri<?, ?> uri) {
         return resourcesClient.exists(uri);
     }
 
 
--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.client.aai.entities.uri;
+
+import org.onap.so.client.aai.AAIObjectBase;
+import org.onap.so.client.graphinventory.entities.uri.GraphInventoryResourceUri;
+
+public interface AAIBaseResourceUri<T extends AAIBaseResourceUri<?, ?>, OT extends AAIObjectBase>
+        extends AAIUri<T, OT>, GraphInventoryResourceUri<T, OT> {
+
+}
 
--- /dev/null
+package org.onap.so.client.aai.entities.uri;
+
+import org.onap.so.client.aai.AAIObjectPlurals;
+import org.onap.so.client.graphinventory.entities.uri.GraphInventoryPluralResourceUri;
+
+public interface AAIPluralResourceUri extends AAIBaseResourceUri<AAIPluralResourceUri, AAIObjectPlurals>,
+        GraphInventoryPluralResourceUri<AAIPluralResourceUri, AAIObjectPlurals> {
+
+}
 
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
 package org.onap.so.client.aai.entities.uri;
 
 import org.onap.so.client.aai.AAIObjectPlurals;
 import org.onap.so.client.aai.AAIObjectType;
-import org.onap.so.client.graphinventory.Format;
-import org.onap.so.client.graphinventory.entities.uri.Depth;
-import org.onap.so.client.graphinventory.entities.uri.GraphInventoryResourceUri;
-
-public interface AAIResourceUri extends AAIUri, GraphInventoryResourceUri {
-
-    public AAIResourceUri relationshipAPI();
-
-    public AAIResourceUri relatedTo(AAIObjectPlurals plural);
-
-    public AAIResourceUri relatedTo(AAIObjectType type, String... values);
-
-    public AAIResourceUri resourceVersion(String version);
-
-    public AAIResourceUri format(Format format);
-
-    @Override
-    public AAIResourceUri depth(Depth depth);
-
-    @Override
-    public AAIResourceUri nodesOnly(boolean nodesOnly);
-
-    @Override
-    public AAIResourceUri queryParam(String name, String... values);
-
-    @Override
-    public AAIResourceUri replaceQueryParam(String name, String... values);
-
-    @Override
-    public AAIResourceUri resultIndex(int index);
-
-    @Override
-    public AAIResourceUri resultSize(int size);
+import org.onap.so.client.graphinventory.entities.uri.GraphInventorySingleResourceUri;
 
-    @Override
-    public AAIResourceUri limit(int size);
+public interface AAIResourceUri extends AAIBaseResourceUri<AAIResourceUri, AAIObjectType>,
+        GraphInventorySingleResourceUri<AAIResourceUri, AAIPluralResourceUri, AAIObjectType, AAIObjectPlurals> {
 
-    @Override
-    public AAIResourceUri clone();
 }
 
--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.client.aai.entities.uri;
+
+import javax.ws.rs.core.UriBuilder;
+import org.onap.so.client.aai.AAIObjectPlurals;
+import org.onap.so.client.aai.AAIObjectType;
+import org.onap.so.client.graphinventory.entities.uri.SimplePluralUri;
+
+public class AAISimplePluralUri
+        extends SimplePluralUri<AAIPluralResourceUri, AAIResourceUri, AAIObjectPlurals, AAIObjectType>
+        implements AAIPluralResourceUri {
+
+    private static final long serialVersionUID = -6397024057188453229L;
+
+    protected AAISimplePluralUri(AAIObjectPlurals type, UriBuilder builder, Object... values) {
+        super(type, builder, values);
+    }
+
+    protected AAISimplePluralUri(AAIObjectPlurals type) {
+        super(type);
+    }
+
+    protected AAISimplePluralUri(AAIObjectPlurals type, Object... values) {
+        super(type, values);
+    }
+
+    protected AAISimplePluralUri(AAIObjectPlurals type, AAIResourceUri uri) {
+        super(type, uri);
+    }
+
+    protected AAISimplePluralUri(AAIResourceUri parentUri, AAIObjectPlurals childType) {
+        super(parentUri, childType);
+    }
+
+    protected AAISimplePluralUri(AAISimplePluralUri copy) {
+        super(copy);
+    }
+
+    @Override
+    public AAISimplePluralUri clone() {
+        return new AAISimplePluralUri(this);
+    }
+
+    @Override
+    public AAIObjectPlurals getObjectType() {
+        return this.pluralType;
+    }
+
+}
 
 package org.onap.so.client.aai.entities.uri;
 
 import java.net.URI;
-import java.util.regex.Pattern;
 import javax.ws.rs.core.UriBuilder;
 import org.onap.so.client.aai.AAIObjectPlurals;
 import org.onap.so.client.aai.AAIObjectType;
-import org.onap.so.client.graphinventory.Format;
-import org.onap.so.client.graphinventory.entities.uri.Depth;
 import org.onap.so.client.graphinventory.entities.uri.SimpleUri;
 
-public class AAISimpleUri extends SimpleUri implements AAIResourceUri {
+public class AAISimpleUri extends SimpleUri<AAIResourceUri, AAIPluralResourceUri, AAIObjectType, AAIObjectPlurals>
+        implements AAIResourceUri {
 
     private static final long serialVersionUID = -6397024057188453229L;
 
         super(type, builder, values);
     }
 
-    protected AAISimpleUri(AAIObjectPlurals type, UriBuilder builder, Object... values) {
-        super(type, builder, values);
-    }
-
-    protected AAISimpleUri(AAIObjectPlurals type) {
-        super(type);
-    }
-
-    protected AAISimpleUri(AAIObjectPlurals type, Object... values) {
-        super(type, values);
-    }
-
     protected AAISimpleUri(AAIResourceUri parentUri, AAIObjectType childType, Object... childValues) {
         super(parentUri, childType, childValues);
     }
 
-    protected AAISimpleUri(AAIResourceUri parentUri, AAIObjectPlurals childType) {
-        super(parentUri, childType);
-    }
-
-    @Override
-    public AAISimpleUri relationshipAPI() {
-        return (AAISimpleUri) super.relationshipAPI();
-    }
-
-    @Override
-    public AAISimpleUri relatedTo(AAIObjectPlurals plural) {
-        return (AAISimpleUri) super.relatedTo(plural);
-    }
-
-    @Override
-    public AAISimpleUri relatedTo(AAIObjectType type, String... values) {
-        return (AAISimpleUri) super.relatedTo(type, values);
-    }
-
-    @Override
-    public AAISimpleUri resourceVersion(String version) {
-        return (AAISimpleUri) super.resourceVersion(version);
-    }
-
-    @Override
-    public AAISimpleUri queryParam(String name, String... values) {
-        return (AAISimpleUri) super.queryParam(name, values);
-    }
-
-    @Override
-    public AAISimpleUri replaceQueryParam(String name, String... values) {
-        return (AAISimpleUri) super.replaceQueryParam(name, values);
-    }
-
-    @Override
-    public AAISimpleUri resultIndex(int index) {
-        return (AAISimpleUri) super.resultIndex(index);
-    }
-
-    @Override
-    public AAISimpleUri resultSize(int size) {
-        return (AAISimpleUri) super.resultSize(size);
-    }
-
-    @Override
-    public AAISimpleUri limit(int size) {
-        return (AAISimpleUri) super.limit(size);
+    // copy constructor
+    protected AAISimpleUri(AAISimpleUri copy) {
+        super(copy);
     }
 
     @Override
     public AAISimpleUri clone() {
-        if (this.type != null) {
-            return new AAISimpleUri((AAIObjectType) this.type, this.internalURI.clone(), values);
-        } else {
-            return new AAISimpleUri((AAIObjectPlurals) this.pluralType, this.internalURI.clone(), values);
-        }
-    }
-
-    @Override
-    public AAIObjectType getObjectType() {
-        return (AAIObjectType) this.type;
+        return new AAISimpleUri(this);
     }
 
     @Override
-    public AAISimpleUri depth(Depth depth) {
-        return (AAISimpleUri) super.depth(depth);
-    }
-
-    @Override
-    public AAISimpleUri nodesOnly(boolean nodesOnly) {
-        return (AAISimpleUri) super.nodesOnly(nodesOnly);
+    public AAISimpleUri relatedTo(AAIObjectType type, String... values) {
+        this.internalURI = internalURI.path(relatedTo);
+        return new AAISimpleUri(this, type, values);
     }
 
     @Override
-    public AAISimpleUri format(Format format) {
-        return (AAISimpleUri) super.format(format);
+    public AAISimplePluralUri relatedTo(AAIObjectPlurals plural) {
+        this.internalURI.path(relatedTo);
+        return new AAISimplePluralUri(this, plural);
     }
 
-    @Override
-    protected Pattern getPrefixPattern() {
-        return Pattern.compile("/aai/v\\d+");
-    }
 }
 
 
 package org.onap.so.client.aai.entities.uri;
 
-import org.onap.so.client.aai.AAIObjectType;
-import org.onap.so.client.graphinventory.entities.uri.Depth;
+import java.util.regex.Pattern;
+import org.onap.so.client.aai.AAIObjectBase;
 import org.onap.so.client.graphinventory.entities.uri.GraphInventoryUri;
 
-public interface AAIUri extends GraphInventoryUri {
+public interface AAIUri<T extends AAIUri<?, ?>, OP extends AAIObjectBase> extends GraphInventoryUri<T, OP> {
 
-    /**
-     * By default A&AI enforces a depth of 1. Some objects can be told to retrieve objects nested beneath them by
-     * increasing this number.
-     * 
-     * You can use 0 to restrict the returned information to only the object you requested You can use all to retrieve
-     * all nested objects (this should only be used if you really need a massive amount of information and are caching
-     * the retrieval)
-     * 
-     * @param depth
-     * @return
-     */
-    @Override
-    public AAIUri depth(Depth depth);
-
-    /**
-     * Makes client only return object fields, no relationships
-     * 
-     * @return
-     */
-    @Override
-    public AAIUri nodesOnly(boolean nodesOnly);
-
-    @Override
-    public AAIUri queryParam(String name, String... values);
-
-    @Override
-    public AAIUri replaceQueryParam(String name, String... values);
-
-    @Override
-    public AAIUri resultIndex(int index);
-
-    @Override
-    public AAIUri resultSize(int size);
-
-    @Override
-    public AAIUri limit(int size);
-
-    @Override
-    public AAIUri clone();
-
-    @Override
-    public AAIObjectType getObjectType();
+    public default Pattern getPrefixPattern() {
+        return Pattern.compile("/aai/v\\d+");
+    }
 }
 
         }
     }
 
-    public static AAIResourceUri createNodesUri(AAIObjectType type, Object... values) {
-        return new NodesUri(type, values);
+    public static NodesSingleUri createNodesUri(AAIObjectType type, Object... values) {
+        return new NodesSingleUri(type, values);
 
     }
 
-    public static AAIResourceUri createNodesUri(AAIObjectPlurals type) {
-        return new NodesUri(type);
+    public static NodesPluralUri createNodesUri(AAIObjectPlurals type) {
+        return new NodesPluralUri(type);
 
     }
 
      * @param uri
      * @return
      */
-    public static AAIResourceUri createResourceFromExistingURI(AAIObjectType type, URI uri) {
+    public static AAISimpleUri createResourceFromExistingURI(AAIObjectType type, URI uri) {
         return new AAISimpleUri(type, uri);
     }
 
      * @param childValues
      * @return
      */
-    public static AAIResourceUri createResourceFromParentURI(AAIResourceUri parentUri, AAIObjectType childType,
+    public static AAISimpleUri createResourceFromParentURI(AAIResourceUri parentUri, AAIObjectType childType,
             Object... childValues) {
 
         return new AAISimpleUri(parentUri, childType, childValues);
     }
 
-    public static AAIResourceUri createResourceFromParentURI(AAIResourceUri parentUri, AAIObjectPlurals childType) {
+    public static AAISimplePluralUri createResourceFromParentURI(AAIResourceUri parentUri, AAIObjectPlurals childType) {
 
-        return new AAISimpleUri(parentUri, childType);
+        return new AAISimplePluralUri(parentUri, childType);
     }
 
     /**
      * @param type
      * @return
      */
-    public static AAIResourceUri createResourceUri(AAIObjectPlurals type) {
+    public static AAISimplePluralUri createResourceUri(AAIObjectPlurals type) {
 
-        return new AAISimpleUri(type);
+        return new AAISimplePluralUri(type);
 
     }
 
      * @param type
      * @return
      */
-    public static AAIResourceUri createResourceUri(AAIObjectPlurals type, Object... values) {
+    public static AAISimplePluralUri createResourceUri(AAIObjectPlurals type, Object... values) {
 
-        return new AAISimpleUri(type, values);
+        return new AAISimplePluralUri(type, values);
 
     }
 }
 
         try {
             if (this.values.length == 1) {
                 String uri = getObjectById(this.values[0]);
-                Map<String, String> map = getURIKeys(uri);
-                return super.build(map.values().toArray(values));
+                Map<String, String> map = super.getURIKeys(uri);
+                this.values = map.values().toArray(values);
+                return super.build(values);
+            }
+        } catch (GraphInventoryUriNotFoundException | GraphInventoryPayloadException e) {
+            throw new GraphInventoryUriComputationException(e);
+        }
+        return super.build();
+    }
+
+    @Override
+    public URI locateAndBuild() {
+        try {
+            if (this.values.length == 1) {
+                String uri = getObjectById(this.values[0]);
+                Map<String, String> map = super.getURIKeys(uri);
+                this.values = map.values().toArray(values);
+                return super.build(values);
             }
         } catch (GraphInventoryUriNotFoundException | GraphInventoryPayloadException e) {
             throw new GraphInventoryUriComputationException(e);
         }
 
     }
-
-    @Override
-    public abstract URI buildNoNetwork();
 }
 
--- /dev/null
+package org.onap.so.client.aai.entities.uri;
+
+import javax.ws.rs.core.UriBuilder;
+import org.onap.so.client.aai.AAIObjectPlurals;
+import org.onap.so.client.graphinventory.GraphInventoryObjectBase;
+
+public class NodesPluralUri extends AAISimplePluralUri implements NodesUri {
+
+    private static final long serialVersionUID = -6743170679667245998L;
+
+    protected NodesPluralUri(AAIObjectPlurals type) {
+        super(type);
+    }
+
+    @Override
+    public String getTemplate(GraphInventoryObjectBase type) {
+        return UriBuilder.fromUri("/nodes").path(type.partialUri()).toTemplate();
+    }
+}
 
--- /dev/null
+package org.onap.so.client.aai.entities.uri;
+
+import javax.ws.rs.core.UriBuilder;
+import org.onap.so.client.aai.AAIObjectType;
+import org.onap.so.client.graphinventory.GraphInventoryObjectBase;
+
+public class NodesSingleUri extends AAISimpleUri implements NodesUri {
+
+    private static final long serialVersionUID = 2721165364903444248L;
+
+    protected NodesSingleUri(AAIObjectType type, Object... values) {
+        super(type, values);
+    }
+
+
+    @Override
+    public String getTemplate(GraphInventoryObjectBase type) {
+        return UriBuilder.fromUri("/nodes").path(type.partialUri()).toTemplate();
+    }
+
+}
 
 
 package org.onap.so.client.aai.entities.uri;
 
-import javax.ws.rs.core.UriBuilder;
-import org.onap.so.client.aai.AAIObjectPlurals;
-import org.onap.so.client.aai.AAIObjectType;
-import org.onap.so.client.graphinventory.GraphInventoryObjectPlurals;
-import org.onap.so.client.graphinventory.GraphInventoryObjectType;
+public interface NodesUri {
 
-public class NodesUri extends AAISimpleUri {
 
-    private static final long serialVersionUID = 8818689895730182042L;
-
-    protected NodesUri(AAIObjectType type, Object... values) {
-        super(type, values);
-    }
-
-    protected NodesUri(AAIObjectPlurals type) {
-        super(type);
-    }
-
-
-    @Override
-    protected String getTemplate(GraphInventoryObjectType type) {
-        return UriBuilder.fromUri("/nodes").path(type.partialUri()).toTemplate();
-    }
-
-    @Override
-    protected String getTemplate(GraphInventoryObjectPlurals type) {
-        return UriBuilder.fromUri("/nodes").path(type.partialUri()).toTemplate();
-    }
 }
 
 import org.onap.so.client.RestProperties;
 import org.onap.so.client.RestPropertiesLoader;
 import org.onap.so.client.graphinventory.entities.uri.GraphInventoryUri;
+import org.onap.so.client.graphinventory.entities.uri.HttpAwareUri;
 
 public abstract class GraphInventoryClient {
 
         this.props = props;
     }
 
-    protected abstract URI constructPath(GraphInventoryUri uri);
+    protected abstract URI constructPath(URI uri);
+
+    protected abstract RestClient createClient(URI uri);
+
+    public RestClient createClient(GraphInventoryUri uri) {
+        final URI result;
+        if (uri instanceof HttpAwareUri) {
+            result = ((HttpAwareUri) uri).locateAndBuild();
+        } else {
+            result = uri.build();
+        }
+
+        return createClient(result);
+
+    }
 
-    public abstract RestClient createClient(GraphInventoryUri uri);
 
     public <T extends RestProperties> T getRestProperties() {
         if (props == null) {
 
--- /dev/null
+package org.onap.so.client.graphinventory;
+
+public interface GraphInventoryObjectBase
+        extends GraphInventoryObjectName, GraphInventoryObjectUriTemplate, GraphInventoryObjectUriPartial {
+
+    public default boolean passThrough() {
+        return false;
+    }
+}
 
 
 package org.onap.so.client.graphinventory;
 
-public interface GraphInventoryObjectPlurals
-        extends GraphInventoryObjectName, GraphInventoryObjectUriTemplate, GraphInventoryObjectUriPartial {
+public interface GraphInventoryObjectPlurals extends GraphInventoryObjectBase {
+
+    public GraphInventoryObjectType getType();
 
 }
 
 
 package org.onap.so.client.graphinventory;
 
-public interface GraphInventoryObjectType
-        extends GraphInventoryObjectName, GraphInventoryObjectUriTemplate, GraphInventoryObjectUriPartial {
+public interface GraphInventoryObjectType extends GraphInventoryObjectBase {
 
 }
 
 package org.onap.so.client.graphinventory;
 
 import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.util.Arrays;
+import java.util.List;
 import java.util.Map;
 import java.util.Optional;
 import javax.ws.rs.NotFoundException;
 import org.onap.so.client.RestProperties;
 import org.onap.so.client.graphinventory.entities.GraphInventoryEdgeLabel;
 import org.onap.so.client.graphinventory.entities.GraphInventoryResultWrapper;
+import org.onap.so.client.graphinventory.entities.uri.GraphInventoryPluralResourceUri;
 import org.onap.so.client.graphinventory.entities.uri.GraphInventoryResourceUri;
+import org.onap.so.client.graphinventory.entities.uri.GraphInventorySingleResourceUri;
+import org.onap.so.client.graphinventory.entities.uri.HttpAwareUri;
+import org.onap.so.client.graphinventory.exceptions.GraphInventoryMultipleItemsException;
 
-public abstract class GraphInventoryResourcesClient<Self, Uri extends GraphInventoryResourceUri, EdgeLabel extends GraphInventoryEdgeLabel, Wrapper extends GraphInventoryResultWrapper, TransactionalClient, SingleTransactionClient> {
+public abstract class GraphInventoryResourcesClient<Self, Uri extends GraphInventoryResourceUri<?, ?>, SingleUri extends GraphInventorySingleResourceUri<?, ?, ?, ?>, PluralUri extends GraphInventoryPluralResourceUri<?, ?>, EdgeLabel extends GraphInventoryEdgeLabel, Wrapper extends GraphInventoryResultWrapper, TransactionalClient, SingleTransactionClient> {
 
     protected GraphInventoryClient client;
 
      * @param uri
      * @return
      */
-    public void create(Uri uri, Object obj) {
+    public void create(SingleUri uri, Object obj) {
         RestClient giRC = client.createClient(uri);
         giRC.put(obj);
     }
      * @param uri
      * @return
      */
-    public void createEmpty(Uri uri) {
+    public void createEmpty(SingleUri uri) {
         RestClient giRC = client.createClient(uri);
         giRC.put("");
     }
      * @return
      */
     public boolean exists(Uri uri) {
-        GraphInventoryResourceUri forceMinimal = uri.clone();
+        GraphInventoryResourceUri<?, ?> forceMinimal = (Uri) uri.clone();
         forceMinimal.format(Format.COUNT);
         forceMinimal.limit(1);
         try {
      * @param uriB
      * @return
      */
-    public void connect(Uri uriA, Uri uriB) {
-        GraphInventoryResourceUri uriAClone = uriA.clone();
+    public void connect(SingleUri uriA, SingleUri uriB) {
+        GraphInventorySingleResourceUri<?, ?, ?, ?> uriAClone = (SingleUri) uriA.clone();
         RestClient giRC = client.createClient(uriAClone.relationshipAPI());
         giRC.put(this.buildRelationship(uriB));
     }
      * @param edge label
      * @return
      */
-    public void connect(Uri uriA, Uri uriB, EdgeLabel label) {
-        GraphInventoryResourceUri uriAClone = uriA.clone();
+    public void connect(SingleUri uriA, SingleUri uriB, EdgeLabel label) {
+        GraphInventorySingleResourceUri<?, ?, ?, ?> uriAClone = (SingleUri) uriA.clone();
         RestClient giRC = client.createClient(uriAClone.relationshipAPI());
         giRC.put(this.buildRelationship(uriB, label));
     }
      * @param uriB
      * @return
      */
-    public void disconnect(Uri uriA, Uri uriB) {
-        GraphInventoryResourceUri uriAClone = uriA.clone();
+    public void disconnect(SingleUri uriA, SingleUri uriB) {
+        GraphInventorySingleResourceUri<?, ?, ?, ?> uriAClone = (SingleUri) uriA.clone();
         RestClient giRC = client.createClient(uriAClone.relationshipAPI());
         giRC.delete(this.buildRelationship(uriB));
     }
      * @param uri
      * @return
      */
-    public void delete(Uri uri) {
-        GraphInventoryResourceUri clone = uri.clone();
+    public void delete(SingleUri uri) {
+        GraphInventorySingleResourceUri<?, ?, ?, ?> clone = (SingleUri) uri.clone();
         RestClient giRC = client.createClient(clone);
         Map<String, Object> result = giRC.get(new GenericType<Map<String, Object>>() {}).orElseThrow(
                 () -> new NotFoundException(clone.build() + " does not exist in " + client.getGraphDBName()));
      * @param uri
      * @return
      */
-    public void update(Uri uri, Object obj) {
+    public void update(SingleUri uri, Object obj) {
         RestClient giRC = client.createClient(uri);
         giRC.patch(obj);
     }
         }
     }
 
+    public <T, R> Optional<R> getOne(Class<T> pluralClass, Class<R> resultClass, PluralUri uri) {
+        Optional<List<R>> result = unwrapPlural(pluralClass, resultClass, uri);
+
+        if (result.isPresent()) {
+            if (result.get().size() == 1) {
+                return Optional.of(result.get().get(0));
+            } else {
+                throw new GraphInventoryMultipleItemsException(result.get().size(), uri);
+            }
+        }
+
+        return Optional.empty();
+    }
+
+    public <T, R> Optional<R> getFirst(Class<T> pluralClass, Class<R> resultClass, PluralUri uri) {
+        Optional<List<R>> result = unwrapPlural(pluralClass, resultClass, uri);
+
+        if (result.isPresent() && !result.get().isEmpty()) {
+            return Optional.of(result.get().get(0));
+        }
+
+        return Optional.empty();
+    }
+
+    public <T, R> Optional<Wrapper> getFirstWrapper(Class<T> pluralClass, Class<R> resultClass, PluralUri uri) {
+
+        Optional<R> result = getFirst(pluralClass, resultClass, uri);
+        if (result.isPresent()) {
+            return Optional.of(this.createWrapper(result.get()));
+        } else {
+            return Optional.empty();
+        }
+    }
+
+    public <T, R> Optional<Wrapper> getOneWrapper(Class<T> pluralClass, Class<R> resultClass, PluralUri uri) {
+
+        Optional<R> result = getOne(pluralClass, resultClass, uri);
+        if (result.isPresent()) {
+            return Optional.of(this.createWrapper(result.get()));
+        } else {
+            return Optional.empty();
+        }
+    }
+
+    protected <T, R> Optional<List<R>> unwrapPlural(Class<T> pluralClass, Class<R> resultClass, PluralUri uri) {
+        try {
+            PluralUri clone = (PluralUri) uri.clone().limit(1);
+            Optional<T> obj = client.createClient(clone).get(pluralClass);
+            if (obj.isPresent()) {
+                Optional<Method> listMethod = Arrays.stream(obj.get().getClass().getMethods()).filter(method -> {
+
+                    Type returnType = method.getGenericReturnType();
+                    if (returnType instanceof ParameterizedType) {
+                        Type[] types = ((ParameterizedType) returnType).getActualTypeArguments();
+                        if (types != null && types[0] instanceof Class) {
+                            Class<?> listClass = (Class<?>) types[0];
+                            return resultClass.equals(listClass);
+                        }
+                    }
+
+                    return false;
+                }).findFirst();
+                if (listMethod.isPresent()) {
+                    try {
+                        return Optional.of((List<R>) listMethod.get().invoke(obj.get()));
+
+                    } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+                        throw new RuntimeException(e);
+                    }
+                }
+            }
+            return Optional.empty();
+
+        } catch (NotFoundException e) {
+            if (this.getRestProperties().mapNotFoundToEmpty()) {
+                return Optional.empty();
+            } else {
+                throw e;
+            }
+        }
+    }
+
     /**
      * Retrieves an object from GraphInventory wrapped in a helper class which offer additional features
      * 
      * @param uri
      * @return
      */
-    public Self createIfNotExists(Uri uri, Optional<Object> obj) {
-        if (!this.exists(uri)) {
+    public Self createIfNotExists(SingleUri uri, Optional<Object> obj) {
+        if (!this.exists((Uri) uri)) {
             if (obj.isPresent()) {
                 this.create(uri, obj.get());
             } else {
         return (Self) this;
     }
 
-    protected Relationship buildRelationship(GraphInventoryResourceUri uri) {
+    protected Relationship buildRelationship(SingleUri uri) {
         return buildRelationship(uri, Optional.empty());
     }
 
-    protected Relationship buildRelationship(GraphInventoryResourceUri uri, GraphInventoryEdgeLabel label) {
+    protected Relationship buildRelationship(SingleUri uri, GraphInventoryEdgeLabel label) {
         return buildRelationship(uri, Optional.of(label));
     }
 
-    protected Relationship buildRelationship(GraphInventoryResourceUri uri, Optional<GraphInventoryEdgeLabel> label) {
+    protected Relationship buildRelationship(SingleUri uri, Optional<GraphInventoryEdgeLabel> label) {
         final Relationship result = new Relationship();
-        result.setRelatedLink(uri.build().toString());
+        if (uri instanceof HttpAwareUri) {
+            result.setRelatedLink(((HttpAwareUri) uri).locateAndBuild().toString());
+        } else {
+            result.setRelatedLink(uri.build().toString());
+        }
         if (label.isPresent()) {
             result.setRelationshipLabel(label.get().toString());
         }
 
     public abstract Wrapper createWrapper(String json);
 
+    public abstract Wrapper createWrapper(Object json);
+
     /**
      * Starts a transaction which encloses multiple GraphInventory mutations
      * 
 
 import org.onap.aai.domain.yang.Relationship;
 import org.onap.so.client.graphinventory.entities.GraphInventoryEdgeLabel;
 import org.onap.so.client.graphinventory.entities.uri.GraphInventoryResourceUri;
+import org.onap.so.client.graphinventory.entities.uri.GraphInventorySingleResourceUri;
 import org.onap.so.client.graphinventory.exceptions.BulkProcessFailed;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public abstract class GraphInventoryTransactionClient<Self, Uri extends GraphInventoryResourceUri, EdgeLabel extends GraphInventoryEdgeLabel> {
+public abstract class GraphInventoryTransactionClient<Self, Uri extends GraphInventoryResourceUri<?, ?>, SingleUri extends GraphInventorySingleResourceUri<?, ?, ?, ?>, EdgeLabel extends GraphInventoryEdgeLabel> {
 
     protected static Logger logger = LoggerFactory.getLogger(GraphInventoryTransactionClient.class);
 
      * @param uri
      * @return
      */
-    public Self create(Uri uri, Object obj) {
+    public Self create(SingleUri uri, Object obj) {
         this.put(uri.build().toString(), obj);
         incrementActionAmount();
         return (Self) this;
      * @param uri
      * @return
      */
-    public Self createEmpty(Uri uri) {
+    public Self createEmpty(SingleUri uri) {
         this.put(uri.build().toString(), new HashMap<String, String>());
         incrementActionAmount();
         return (Self) this;
      * @param uri
      * @return
      */
-    public Self createIfNotExists(Uri uri, Optional<Object> obj) {
-        if (!this.exists(uri)) {
+    public Self createIfNotExists(SingleUri uri, Optional<Object> obj) {
+        if (!this.exists((Uri) uri)) {
             if (obj.isPresent()) {
                 this.create(uri, obj.get());
             } else {
      * @param uriB
      * @return
      */
-    public Self connect(Uri uriA, Uri uriB) {
-        GraphInventoryResourceUri uriAClone = uriA.clone();
+    public Self connect(SingleUri uriA, SingleUri uriB) {
+        GraphInventorySingleResourceUri uriAClone = uriA.clone();
         this.put(uriAClone.relationshipAPI().build().toString(), this.buildRelationship(uriB));
         incrementActionAmount();
         return (Self) this;
      * @param uris
      * @return
      */
-    public Self connect(Uri uriA, List<Uri> uris) {
-        for (Uri uri : uris) {
+    public Self connect(SingleUri uriA, List<SingleUri> uris) {
+        for (SingleUri uri : uris) {
             this.connect(uriA, uri);
         }
         return (Self) this;
      * @param uris
      * @return
      */
-    public Self connect(Uri uriA, Uri uriB, EdgeLabel label) {
-        GraphInventoryResourceUri uriAClone = uriA.clone();
+    public Self connect(SingleUri uriA, SingleUri uriB, EdgeLabel label) {
+        GraphInventorySingleResourceUri uriAClone = uriA.clone();
         this.put(uriAClone.relationshipAPI().build().toString(), this.buildRelationship(uriB, label));
         return (Self) this;
     }
      * @param uris
      * @return
      */
-    public Self connect(Uri uriA, List<Uri> uris, EdgeLabel label) {
-        for (Uri uri : uris) {
+    public Self connect(SingleUri uriA, List<SingleUri> uris, EdgeLabel label) {
+        for (SingleUri uri : uris) {
             this.connect(uriA, uri, label);
         }
         return (Self) this;
      * @param uriB
      * @return
      */
-    public Self disconnect(Uri uriA, Uri uriB) {
-        GraphInventoryResourceUri uriAClone = uriA.clone();
+    public Self disconnect(SingleUri uriA, SingleUri uriB) {
+        GraphInventorySingleResourceUri uriAClone = uriA.clone();
         this.delete(uriAClone.relationshipAPI().build().toString(), this.buildRelationship(uriB));
         incrementActionAmount();
         return (Self) this;
      * @param uris
      * @return
      */
-    public Self disconnect(Uri uriA, List<Uri> uris) {
-        for (Uri uri : uris) {
+    public Self disconnect(SingleUri uriA, List<SingleUri> uris) {
+        for (SingleUri uri : uris) {
             this.disconnect(uriA, uri);
         }
         return (Self) this;
      * @param uri
      * @return
      */
-    public Self delete(Uri uri) {
-        Map<String, Object> result = this.get(new GenericType<Map<String, Object>>() {}, (Uri) uri.clone())
+    public Self delete(SingleUri uri) {
+        Map<String, Object> result = this.get(new GenericType<Map<String, Object>>() {}, (Uri) uri)
                 .orElseThrow(() -> new NotFoundException(uri.build() + " does not exist in " + this.getGraphDBName()));
         String resourceVersion = (String) result.get("resource-version");
         this.delete(uri.resourceVersion(resourceVersion).build().toString());
      */
     public abstract void execute() throws BulkProcessFailed;
 
-    private Relationship buildRelationship(Uri uri) {
+    private Relationship buildRelationship(SingleUri uri) {
         return buildRelationship(uri, Optional.empty());
     }
 
-    private Relationship buildRelationship(Uri uri, EdgeLabel label) {
+    private Relationship buildRelationship(SingleUri uri, EdgeLabel label) {
         return buildRelationship(uri, Optional.of(label));
     }
 
-    private Relationship buildRelationship(Uri uri, Optional<EdgeLabel> label) {
+    private Relationship buildRelationship(SingleUri uri, Optional<EdgeLabel> label) {
         final Relationship result = new Relationship();
         result.setRelatedLink(uri.build().toString());
         if (label.isPresent()) {
 
 import org.onap.so.client.graphinventory.GraphInventoryCommonObjectMapperProvider;
 import org.onap.so.client.graphinventory.GraphInventoryObjectName;
 import org.onap.so.client.graphinventory.GraphInventoryObjectType;
-import org.onap.so.client.graphinventory.entities.uri.GraphInventoryResourceUri;
+import org.onap.so.client.graphinventory.entities.uri.GraphInventorySingleResourceUri;
 import org.onap.so.jsonpath.JsonPathUtil;
 import com.fasterxml.jackson.core.type.TypeReference;
 import com.fasterxml.jackson.databind.ObjectMapper;
 
-public abstract class GraphInventoryRelationships<Wrapper extends GraphInventoryResultWrapper, Uri extends GraphInventoryResourceUri, Type extends GraphInventoryObjectType> {
+public abstract class GraphInventoryRelationships<Wrapper extends GraphInventoryResultWrapper<?>, Uri extends GraphInventorySingleResourceUri<?, ?, ?, ?>, Type extends GraphInventoryObjectType> {
 
     protected final ObjectMapper mapper;
     protected Map<String, Object> map;
 
--- /dev/null
+package org.onap.so.client.graphinventory.entities.uri;
+
+import org.onap.so.client.graphinventory.GraphInventoryObjectBase;
+
+public interface GraphInventoryPluralResourceUri<T extends GraphInventoryResourceUri<?, ?>, OT extends GraphInventoryObjectBase>
+        extends GraphInventoryResourceUri<T, OT> {
+
+}
 
 package org.onap.so.client.graphinventory.entities.uri;
 
 import org.onap.so.client.graphinventory.Format;
-import org.onap.so.client.graphinventory.entities.uri.Depth;
-import org.onap.so.client.graphinventory.GraphInventoryObjectPlurals;
-import org.onap.so.client.graphinventory.GraphInventoryObjectType;
+import org.onap.so.client.graphinventory.GraphInventoryObjectBase;
 
-public interface GraphInventoryResourceUri extends GraphInventoryUri {
-    public GraphInventoryResourceUri relationshipAPI();
+public interface GraphInventoryResourceUri<T extends GraphInventoryResourceUri<?, ?>, OT extends GraphInventoryObjectBase>
+        extends GraphInventoryUri<T, OT> {
 
-    public GraphInventoryResourceUri relatedTo(GraphInventoryObjectPlurals plural);
+    public T format(Format format);
 
-    public GraphInventoryResourceUri relatedTo(GraphInventoryObjectType type, String... values);
-
-    public GraphInventoryResourceUri resourceVersion(String version);
-
-    public GraphInventoryResourceUri format(Format format);
-
-    @Override
-    public GraphInventoryResourceUri depth(Depth depth);
-
-    @Override
-    public GraphInventoryResourceUri nodesOnly(boolean nodesOnly);
-
-    @Override
-    public GraphInventoryResourceUri queryParam(String name, String... values);
-
-    @Override
-    public GraphInventoryResourceUri replaceQueryParam(String name, String... values);
-
-    @Override
-    public GraphInventoryResourceUri resultIndex(int index);
-
-    @Override
-    public GraphInventoryResourceUri resultSize(int size);
-
-    @Override
-    public GraphInventoryResourceUri limit(int size);
-
-    @Override
-    public GraphInventoryResourceUri clone();
 }
 
--- /dev/null
+package org.onap.so.client.graphinventory.entities.uri;
+
+import org.onap.so.client.graphinventory.GraphInventoryObjectPlurals;
+import org.onap.so.client.graphinventory.GraphInventoryObjectType;
+
+public interface GraphInventorySingleResourceUri<T extends GraphInventorySingleResourceUri<?, ?, ?, ?>, P extends GraphInventoryPluralResourceUri<?, ?>, SingleObject extends GraphInventoryObjectType, PluralObject extends GraphInventoryObjectPlurals>
+        extends GraphInventoryResourceUri<T, SingleObject> {
+
+    public T resourceVersion(String version);
+
+    public T relationshipAPI();
+
+    public P relatedTo(PluralObject plural);
+
+    public T relatedTo(SingleObject type, String... values);
+}
 
 
 package org.onap.so.client.graphinventory.entities.uri;
 
+import java.io.Serializable;
 import java.net.URI;
 import java.util.Map;
+import java.util.regex.Pattern;
+import org.onap.so.client.graphinventory.GraphInventoryObjectBase;
 import org.onap.so.client.graphinventory.GraphInventoryObjectType;
 
-public interface GraphInventoryUri {
+public interface GraphInventoryUri<T extends GraphInventoryUri<?, ?>, OT extends GraphInventoryObjectBase>
+        extends Serializable {
 
     public URI build();
 
      * @param depth
      * @return
      */
-    public GraphInventoryUri depth(Depth depth);
+    public T depth(Depth depth);
 
     /**
      * Makes client only return object fields, no relationships
      * 
      * @return
      */
-    public GraphInventoryUri nodesOnly(boolean nodesOnly);
+    public T nodesOnly(boolean nodesOnly);
 
-    public GraphInventoryUri queryParam(String name, String... values);
+    public T queryParam(String name, String... values);
 
-    public GraphInventoryUri replaceQueryParam(String name, String... values);
+    public T replaceQueryParam(String name, String... values);
 
-    public GraphInventoryUri resultIndex(int index);
+    public T resultIndex(int index);
 
-    public GraphInventoryUri resultSize(int size);
+    public T resultSize(int size);
 
-    public GraphInventoryUri limit(int size);
+    public T limit(int size);
 
-    public GraphInventoryUri clone();
+    public T clone();
 
     /**
      * returns all key values of the URI as a map. Key names can be found in {@link GraphInventoryObjectType}
      */
     public Map<String, String> getURIKeys();
 
-    public GraphInventoryObjectType getObjectType();
+    public OT getObjectType();
 
     public boolean equals(Object o);
 
     public int hashCode();
+
+    public Pattern getPrefixPattern();
 }
 
 package org.onap.so.client.graphinventory.entities.uri;
 
 import java.net.URI;
+import org.onap.so.client.aai.entities.uri.AAIResourceUri;
 
-public interface HttpAwareUri {
+public interface HttpAwareUri extends AAIResourceUri {
 
 
     public URI buildNoNetwork();
+
+    public URI locateAndBuild();
 }
 
--- /dev/null
+package org.onap.so.client.graphinventory.entities.uri;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.net.URI;
+import java.nio.charset.StandardCharsets;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import javax.ws.rs.core.UriBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import org.onap.so.client.graphinventory.Format;
+import org.onap.so.client.graphinventory.GraphInventoryObjectBase;
+import org.onap.so.client.graphinventory.entities.uri.parsers.UriParser;
+import org.onap.so.client.graphinventory.entities.uri.parsers.UriParserSpringImpl;
+import org.onap.so.client.graphinventory.exceptions.IncorrectNumberOfUriKeys;
+import org.springframework.web.util.UriUtils;
+
+public abstract class SimpleBaseUri<T extends GraphInventoryResourceUri<?, ?>, Parent extends GraphInventorySingleResourceUri<?, ?, ?, ?>, S extends GraphInventoryObjectBase>
+        implements GraphInventoryResourceUri<T, S> {
+
+    private static final long serialVersionUID = -1011069933894179423L;
+    protected transient UriBuilder internalURI;
+    protected static final String relationshipAPI = "/relationship-list/relationship";
+    protected static final String relatedTo = "/related-to";
+    protected Object[] values;
+    protected final S type;
+    protected final Parent parentUri;
+    protected final Map<String, Set<String>> queryParams = new HashMap<>();
+
+    protected SimpleBaseUri(S type, Object... values) {
+        this.type = type;
+        this.internalURI = UriBuilder.fromPath(this.getTemplate(type));
+        this.values = values;
+        this.parentUri = null;
+        validateValuesSize(this.getTemplate(type), values);
+    }
+
+    protected SimpleBaseUri(S type, URI uri) {
+        if (!type.passThrough()) {
+            this.type = type;
+            this.internalURI = UriBuilder.fromPath(this.getTemplate(type));
+            this.values =
+                    this.getURIKeys(uri.getRawPath().replaceAll(getPrefixPattern().toString(), "")).values().toArray();
+            this.parentUri = null;
+        } else {
+            this.type = type;
+            this.internalURI = UriBuilder.fromPath(uri.getRawPath().replaceAll(getPrefixPattern().toString(), ""));
+            this.values = new Object[0];
+            this.parentUri = null;
+        }
+
+    }
+
+    protected SimpleBaseUri(S type, UriBuilder builder, Object... values) {
+        this.internalURI = builder;
+        this.values = values;
+        this.type = type;
+        this.parentUri = null;
+
+    }
+
+    protected SimpleBaseUri(Parent parentUri, S childType, Object... childValues) {
+        this.type = childType;
+        this.internalURI = UriBuilder.fromUri(type.partialUri());
+        this.values = childValues;
+        this.parentUri = parentUri;
+
+        validateValuesSize(childType.partialUri(), values);
+    }
+
+    protected SimpleBaseUri(SimpleBaseUri<T, Parent, S> copy) {
+        this.type = copy.type;
+        this.internalURI = copy.internalURI.clone();
+        this.values = copy.values.clone();
+        if (copy.parentUri != null) {
+            this.parentUri = (Parent) copy.parentUri.clone();
+        } else {
+            this.parentUri = null;
+        }
+    }
+
+    protected void setInternalURI(UriBuilder builder) {
+        this.internalURI = builder;
+    }
+
+    @Override
+    public T queryParam(String name, String... values) {
+        this.internalURI = internalURI.queryParam(name, values);
+        if (queryParams.containsKey(name)) {
+            queryParams.get(name).addAll(Arrays.asList(values));
+        } else {
+            queryParams.put(name, Stream.of(values).collect(Collectors.toSet()));
+        }
+        return (T) this;
+    }
+
+    @Override
+    public T replaceQueryParam(String name, String... values) {
+        this.internalURI = internalURI.replaceQueryParam(name, values);
+        queryParams.put(name, Stream.of(values).collect(Collectors.toSet()));
+        return (T) this;
+    }
+
+    @Override
+    public T resultIndex(int index) {
+        this.internalURI = internalURI.replaceQueryParam("resultIndex", index);
+        return (T) this;
+    }
+
+    @Override
+    public T resultSize(int size) {
+        this.internalURI = internalURI.replaceQueryParam("resultSize", size);
+        return (T) this;
+    }
+
+    @Override
+    public T limit(int size) {
+        this.resultIndex(0).resultSize(size);
+        return (T) this;
+    }
+
+    @Override
+    public URI build() {
+        return build(this.values);
+    }
+
+    protected URI build(Object... values) {
+
+        // This is a workaround because resteasy does not encode URIs correctly
+        final String[] encoded = new String[values.length];
+        for (int i = 0; i < values.length; i++) {
+            encoded[i] = UriUtils.encode(values[i].toString(), StandardCharsets.UTF_8.toString());
+        }
+        if (this.parentUri != null) {
+            return UriBuilder
+                    .fromUri(this.parentUri.build().toString() + internalURI.buildFromEncoded(encoded).toString())
+                    .build();
+        } else {
+            return internalURI.buildFromEncoded(encoded);
+        }
+    }
+
+    @Override
+    public Map<String, String> getURIKeys() {
+        return this.getURIKeys(this.build().toString());
+    }
+
+    protected Map<String, String> getURIKeys(String uri) {
+        UriParser parser;
+        if (!("".equals(this.getTemplate(type)))) {
+            parser = new UriParserSpringImpl(this.getTemplate(type));
+        } else {
+            return new HashMap<>();
+        }
+
+
+        return parser.parse(uri);
+    }
+
+    @Override
+    public abstract T clone();
+
+    @Override
+    public S getObjectType() {
+        return this.type;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (o != null) {
+            return this.toString().equals(o.toString());
+        }
+        return false;
+    }
+
+    @Override
+    public int hashCode() {
+        return new HashCodeBuilder().append(this.toString()).toHashCode();
+    }
+
+
+    @Override
+    public T depth(Depth depth) {
+        this.internalURI.replaceQueryParam("depth", depth.toString());
+        return (T) this;
+    }
+
+    @Override
+    public T nodesOnly(boolean nodesOnly) {
+        if (nodesOnly) {
+            this.internalURI.replaceQueryParam("nodes-only", "");
+        }
+        return (T) this;
+    }
+
+    @Override
+    public T format(Format format) {
+        this.internalURI.replaceQueryParam("format", format);
+        return (T) this;
+    }
+
+    public void validateValuesSize(String template, Object... values) {
+        UriParser parser = new UriParserSpringImpl(template);
+        Set<String> variables = parser.getVariables();
+        if (variables.size() != values.length) {
+            throw new IncorrectNumberOfUriKeys(String.format("Expected %s variables: %s", variables.size(), variables));
+        }
+    }
+
+    protected String getTemplate(GraphInventoryObjectBase type) {
+        return type.uriTemplate();
+    }
+
+    private void writeObject(ObjectOutputStream oos) throws IOException {
+        oos.defaultWriteObject();
+        oos.writeUTF(this.internalURI.toTemplate());
+    }
+
+    private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException {
+        ois.defaultReadObject();
+        String uri = ois.readUTF();
+        this.setInternalURI(UriBuilder.fromUri(uri));
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(null, ToStringStyle.NO_CLASS_NAME_STYLE).append("type", type)
+                .append("parentUri", parentUri).append("values", values).append("queryParams", queryParams).toString();
+    }
+}
 
--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.client.graphinventory.entities.uri;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import javax.ws.rs.core.UriBuilder;
+import org.onap.so.client.graphinventory.GraphInventoryObjectPlurals;
+import org.onap.so.client.graphinventory.GraphInventoryObjectType;
+
+public abstract class SimplePluralUri<T extends GraphInventoryPluralResourceUri<?, ?>, Parent extends GraphInventorySingleResourceUri<?, ?, ?, ?>, PT extends GraphInventoryObjectPlurals, OT extends GraphInventoryObjectType>
+        extends SimpleBaseUri<T, Parent, PT> implements GraphInventoryPluralResourceUri<T, PT>, Serializable {
+
+    private static final long serialVersionUID = -337701171277616439L;
+
+    protected final PT pluralType;
+
+    protected SimplePluralUri(PT type, UriBuilder builder, Object... values) {
+        super(type, builder, values);
+        this.pluralType = type;
+    }
+
+    protected SimplePluralUri(PT type) {
+        super(type, new Object[0]);
+        this.pluralType = type;
+    }
+
+    protected SimplePluralUri(PT type, Object... values) {
+        super(type, values);
+        this.pluralType = type;
+    }
+
+    protected SimplePluralUri(Parent parentUri, PT childType) {
+        super(parentUri, childType, new Object[0]);
+        this.pluralType = childType;
+    }
+
+    public SimplePluralUri(SimplePluralUri<T, Parent, PT, OT> copy) {
+        super(copy);
+        this.pluralType = copy.pluralType;
+    }
+
+    protected void setInternalURI(UriBuilder builder) {
+        this.internalURI = builder;
+    }
+
+    private void writeObject(ObjectOutputStream oos) throws IOException {
+        oos.defaultWriteObject();
+        oos.writeUTF(this.internalURI.toTemplate());
+    }
+
+    private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException {
+        ois.defaultReadObject();
+        String uri = ois.readUTF();
+        this.setInternalURI(UriBuilder.fromUri(uri));
+    }
+}
 
 import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
-import java.io.Serializable;
 import java.net.URI;
-import java.nio.charset.StandardCharsets;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-import java.util.regex.Pattern;
 import javax.ws.rs.core.UriBuilder;
-import org.apache.commons.lang3.builder.HashCodeBuilder;
-import org.onap.so.client.graphinventory.Format;
 import org.onap.so.client.graphinventory.GraphInventoryObjectPlurals;
 import org.onap.so.client.graphinventory.GraphInventoryObjectType;
-import org.onap.so.client.graphinventory.entities.uri.parsers.UriParser;
-import org.onap.so.client.graphinventory.entities.uri.parsers.UriParserSpringImpl;
-import org.onap.so.client.graphinventory.exceptions.IncorrectNumberOfUriKeys;
-import org.springframework.web.util.UriUtils;
 
-public class SimpleUri implements GraphInventoryResourceUri, Serializable {
+public abstract class SimpleUri<T extends GraphInventorySingleResourceUri<?, ?, ?, ?>, PT extends GraphInventoryPluralResourceUri<?, ?>, S extends GraphInventoryObjectType, P extends GraphInventoryObjectPlurals>
+        extends SimpleBaseUri<T, T, S> implements GraphInventorySingleResourceUri<T, PT, S, P> {
 
     private static final long serialVersionUID = -337701171277616439L;
-
-    protected transient UriBuilder internalURI;
     protected static final String relationshipAPI = "/relationship-list/relationship";
     protected static final String relatedTo = "/related-to";
-    protected final Object[] values;
-    protected final GraphInventoryObjectType type;
-    protected final GraphInventoryObjectPlurals pluralType;
-
-    protected SimpleUri(GraphInventoryObjectType type, Object... values) {
-        this.type = type;
-        this.pluralType = null;
-        this.internalURI = UriBuilder.fromPath(this.getTemplate(type));
-        this.values = values;
-        validateValuesSize(this.getTemplate(type), values);
-    }
-
-    protected SimpleUri(GraphInventoryObjectType type, URI uri) {
-        this.type = type;
-        this.pluralType = null;
-        this.internalURI = UriBuilder.fromPath(uri.getRawPath().replaceAll(getPrefixPattern().toString(), ""));
-        this.values = new Object[0];
-    }
 
-    protected SimpleUri(GraphInventoryObjectType type, UriBuilder builder, Object... values) {
-        this.internalURI = builder;
-        this.values = values;
-        this.type = type;
-        this.pluralType = null;
+    protected SimpleUri(S type, Object... values) {
+        super(type, values);
     }
 
-    protected SimpleUri(GraphInventoryObjectPlurals type, UriBuilder builder, Object... values) {
-        this.internalURI = builder;
-        this.values = values;
-        this.type = null;
-        this.pluralType = type;
-    }
+    protected SimpleUri(S type, URI uri) {
+        super(type, uri);
 
-    protected SimpleUri(GraphInventoryObjectPlurals type) {
-        this.type = null;
-        this.pluralType = type;
-        this.internalURI = UriBuilder.fromPath(this.getTemplate(type));
-        this.values = new Object[0];
     }
 
-    protected SimpleUri(GraphInventoryObjectPlurals type, Object... values) {
-        this.type = null;
-        this.pluralType = type;
-        this.internalURI = UriBuilder.fromPath(this.getTemplate(type));
-        this.values = values;
-        validateValuesSize(this.getTemplate(type), values);
-    }
+    protected SimpleUri(S type, UriBuilder builder, Object... values) {
+        super(type, builder, values);
 
-    protected SimpleUri(GraphInventoryResourceUri parentUri, GraphInventoryObjectType childType,
-            Object... childValues) {
-        this.type = childType;
-        this.pluralType = null;
-        this.internalURI = UriBuilder.fromUri(parentUri.build()).path(childType.partialUri());
-        this.values = childValues;
-        validateValuesSize(childType.partialUri(), values);
     }
 
-    protected SimpleUri(GraphInventoryResourceUri parentUri, GraphInventoryObjectPlurals childType) {
-        this.type = null;
-        this.pluralType = childType;
-        this.internalURI = UriBuilder.fromUri(parentUri.build()).path(childType.partialUri());
-        this.values = new Object[0];
+    protected SimpleUri(T parentUri, S childType, Object... childValues) {
+        super(parentUri, childType, childValues);
     }
 
-    protected void setInternalURI(UriBuilder builder) {
-        this.internalURI = builder;
+    protected SimpleUri(SimpleBaseUri<T, T, S> copy) {
+        super(copy);
     }
 
     @Override
-    public SimpleUri relationshipAPI() {
-        this.internalURI = internalURI.path(relationshipAPI);
-        return this;
-    }
-
-    @Override
-    public SimpleUri relatedTo(GraphInventoryObjectPlurals plural) {
-
-        this.internalURI = internalURI.path(relatedTo).path(plural.partialUri());
-        return this;
-    }
-
-    @Override
-    public SimpleUri relatedTo(GraphInventoryObjectType type, String... values) {
-        this.internalURI =
-                internalURI.path(relatedTo).path(UriBuilder.fromPath(type.partialUri()).build(values).toString());
-        return this;
-    }
-
-    @Override
-    public SimpleUri resourceVersion(String version) {
+    public T resourceVersion(String version) {
         this.internalURI = internalURI.replaceQueryParam("resource-version", version);
-        return this;
-    }
-
-    @Override
-    public SimpleUri queryParam(String name, String... values) {
-        this.internalURI = internalURI.queryParam(name, values);
-        return this;
-    }
-
-    @Override
-    public SimpleUri replaceQueryParam(String name, String... values) {
-        this.internalURI = internalURI.replaceQueryParam(name, values);
-        return this;
-    }
-
-    @Override
-    public SimpleUri resultIndex(int index) {
-        this.internalURI = internalURI.replaceQueryParam("resultIndex", index);
-        return this;
-    }
-
-    @Override
-    public SimpleUri resultSize(int size) {
-        this.internalURI = internalURI.replaceQueryParam("resultSize", size);
-        return this;
-    }
-
-    @Override
-    public SimpleUri limit(int size) {
-        return this.resultIndex(0).resultSize(size);
-    }
-
-    @Override
-    public URI build() {
-        return build(this.values);
-    }
-
-    protected Pattern getPrefixPattern() {
-        return Pattern.compile("/.*?/v\\d+");
-    }
-
-    protected URI build(Object... values) {
-        // This is a workaround because resteasy does not encode URIs correctly
-        final String[] encoded = new String[values.length];
-        for (int i = 0; i < values.length; i++) {
-            encoded[i] = UriUtils.encode(values[i].toString(), StandardCharsets.UTF_8.toString());
-        }
-        return internalURI.buildFromEncoded(encoded);
-    }
-
-    @Override
-    public Map<String, String> getURIKeys() {
-        return this.getURIKeys(this.build().toString());
-    }
-
-    protected Map<String, String> getURIKeys(String uri) {
-        UriParser parser;
-        if (this.type != null) {
-            if (!("".equals(this.getTemplate(type)))) {
-                parser = new UriParserSpringImpl(this.getTemplate(type));
-            } else {
-                return new HashMap<>();
-            }
-        } else {
-            parser = new UriParserSpringImpl(this.getTemplate(pluralType));
-        }
-
-
-        return parser.parse(uri);
-    }
-
-    @Override
-    public SimpleUri clone() {
-        if (this.type != null) {
-            return new SimpleUri(this.type, this.internalURI.clone(), values);
-        } else {
-            return new SimpleUri(this.pluralType, this.internalURI.clone(), values);
-        }
-    }
-
-    @Override
-    public GraphInventoryObjectType getObjectType() {
-        return this.type;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (o instanceof GraphInventoryUri) {
-            return this.build().equals(((GraphInventoryUri) o).build());
-        }
-        return false;
+        return (T) this;
     }
 
     @Override
-    public int hashCode() {
-        return new HashCodeBuilder().append(this.build()).toHashCode();
-    }
-
-
-    @Override
-    public SimpleUri depth(Depth depth) {
-        this.internalURI.replaceQueryParam("depth", depth.toString());
-        return this;
-    }
-
-    @Override
-    public SimpleUri nodesOnly(boolean nodesOnly) {
-        if (nodesOnly) {
-            this.internalURI.replaceQueryParam("nodes-only", "");
-        }
-        return this;
-    }
-
-    @Override
-    public SimpleUri format(Format format) {
-        this.internalURI.replaceQueryParam("format", format);
-        return this;
-    }
-
-    public void validateValuesSize(String template, Object... values) {
-        UriParser parser = new UriParserSpringImpl(template);
-        Set<String> variables = parser.getVariables();
-        if (variables.size() != values.length) {
-            throw new IncorrectNumberOfUriKeys(String.format("Expected %s variables: %s", variables.size(), variables));
-        }
-    }
-
-    protected String getTemplate(GraphInventoryObjectType type) {
-        return type.uriTemplate();
-    }
-
-    protected String getTemplate(GraphInventoryObjectPlurals type) {
-        return type.uriTemplate();
+    public T relationshipAPI() {
+        this.internalURI = internalURI.path(relationshipAPI);
+        return (T) this;
     }
 
     private void writeObject(ObjectOutputStream oos) throws IOException {
         String uri = ois.readUTF();
         this.setInternalURI(UriBuilder.fromUri(uri));
     }
+
 }
 
--- /dev/null
+package org.onap.so.client.graphinventory.exceptions;
+
+import org.onap.so.client.graphinventory.entities.uri.GraphInventoryPluralResourceUri;
+
+public class GraphInventoryMultipleItemsException extends RuntimeException {
+
+    private static final long serialVersionUID = -1596266941681036917L;
+
+    public GraphInventoryMultipleItemsException(int size, GraphInventoryPluralResourceUri uri) {
+        super(String.format("Found %s objects at %s when we only expected to find one.", size, uri.build()));
+    }
+
+}
 
 
 import static org.junit.Assert.assertEquals;
 import org.junit.Test;
-import org.onap.so.client.aai.entities.uri.AAIUri;
+import org.onap.so.client.aai.entities.uri.AAIResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIUriFactory;
 
 public class AAIObjectTypeTest {
     @Test
     public void instanceGroupObjectTypeTest() {
         final String id = "test1";
-        AAIUri aaiUri = AAIUriFactory.createResourceUri(AAIObjectType.INSTANCE_GROUP, id);
+        AAIResourceUri aaiUri = AAIUriFactory.createResourceUri(AAIObjectType.INSTANCE_GROUP, id);
         assertEquals("/network/instance-groups/instance-group/test1", aaiUri.build().toString());
     }
 
     @Test
     public void collectionObjectTypeTest() {
         final String id = "test1";
-        AAIUri aaiUri = AAIUriFactory.createResourceUri(AAIObjectType.COLLECTION, id);
+        AAIResourceUri aaiUri = AAIUriFactory.createResourceUri(AAIObjectType.COLLECTION, id);
         assertEquals("/network/collections/collection/test1", aaiUri.build().toString());
     }
 
     @Test
     public void networkPolicyObjectTypeTest() {
         final String id = "test1";
-        AAIUri aaiUri = AAIUriFactory.createResourceUri(AAIObjectType.NETWORK_POLICY, id);
+        AAIResourceUri aaiUri = AAIUriFactory.createResourceUri(AAIObjectType.NETWORK_POLICY, id);
         assertEquals("/network/network-policies/network-policy/test1", aaiUri.build().toString());
     }
 }
 
 import org.onap.so.client.aai.entities.CustomQuery;
 import org.onap.so.client.aai.entities.Results;
 import org.onap.so.client.aai.entities.uri.AAIResourceUri;
-import org.onap.so.client.aai.entities.uri.AAIUri;
 import org.onap.so.client.aai.entities.uri.AAIUriFactory;
 import org.onap.so.client.graphinventory.Format;
 import org.onap.so.client.graphinventory.GraphInventoryClient;
         Format format = Format.SIMPLE;
         CustomQuery query = new CustomQuery(uris);
 
-        doReturn(restClient).when(client).createClient(isA(AAIUri.class));
+        doReturn(restClient).when(client).createClient(isA(AAIResourceUri.class));
         aaiQueryClient.query(format, query);
-        verify(client, times(1)).createClient(
-                AAIUriFactory.createResourceUri(AAIObjectType.CUSTOM_QUERY).queryParam("format", format.toString()));
+        verify(client, times(1))
+                .createClient(AAIUriFactory.createResourceUri(AAIObjectType.CUSTOM_QUERY).format(format));
         verify(restClient, times(1)).put(query, String.class);
     }
 
         aaiQueryClient.nodesOnly();
         aaiQueryClient.subgraph(subgraph);
 
-        AAIUri aaiUri = spy(AAIUriFactory.createResourceUri(AAIObjectType.CUSTOM_QUERY));
+        AAIResourceUri aaiUri = spy(AAIUriFactory.createResourceUri(AAIObjectType.CUSTOM_QUERY));
         doReturn(aaiUri).when(aaiUri).clone();
         aaiQueryClient.setupQueryParams(aaiUri);
 
 
     @Test
     public void querySingleTypeTest() throws IOException {
-        when(client.createClient(isA(AAIUri.class))).thenReturn(restClient);
+        when(client.createClient(isA(AAIResourceUri.class))).thenReturn(restClient);
         when(restClient.put(any(Object.class), any(GenericType.class))).thenReturn(
                 mapper.readValue(getJson("pathed-result.json"), new TypeReference<Results<Map<String, Object>>>() {}));
 
 
 import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
 import static org.hamcrest.CoreMatchers.containsString;
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertThat;
 import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+import java.util.Optional;
 import javax.ws.rs.BadRequestException;
 import org.junit.Before;
 import org.junit.Rule;
 import org.mockito.InjectMocks;
 import org.mockito.Spy;
 import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.aai.domain.yang.GenericVnf;
+import org.onap.aai.domain.yang.GenericVnfs;
 import org.onap.aai.domain.yang.Relationship;
+import org.onap.so.client.RestClient;
 import org.onap.so.client.aai.entities.AAIEdgeLabel;
 import org.onap.so.client.aai.entities.AAIResultWrapper;
+import org.onap.so.client.aai.entities.uri.AAIPluralResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIUriFactory;
 import org.onap.so.client.defaultproperties.DefaultAAIPropertiesImpl;
+import org.onap.so.client.graphinventory.exceptions.GraphInventoryMultipleItemsException;
 import com.github.tomakehurst.wiremock.admin.NotFoundException;
 import com.github.tomakehurst.wiremock.junit.WireMockRule;
 
 
     }
 
+    @Test
+    public void testGetOne() {
+        GenericVnf vnf = new GenericVnf();
+        vnf.setVnfId("my-vnf-id");
+        GenericVnfs vnfs = new GenericVnfs();
+        vnfs.getGenericVnf().add(vnf);
+        AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.GENERIC_VNF);
+        RestClient restClientMock = mock(RestClient.class);
+        doReturn(restClientMock).when(client).createClient(uri);
+        when(restClientMock.get(GenericVnfs.class)).thenReturn(Optional.of(vnfs));
+
+        Optional<GenericVnf> result = aaiClient.getOne(GenericVnfs.class, GenericVnf.class, uri);
+
+        assertEquals("my-vnf-id", result.get().getVnfId());
+    }
+
+    @Test
+    public void testGetOneMultipleResults() {
+        GenericVnf vnf = new GenericVnf();
+        vnf.setVnfId("my-vnf-id");
+        GenericVnf vnf2 = new GenericVnf();
+        vnf.setVnfId("my-vnf-id2");
+        GenericVnfs vnfs = new GenericVnfs();
+        vnfs.getGenericVnf().add(vnf);
+        vnfs.getGenericVnf().add(vnf2);
+        AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.GENERIC_VNF);
+        RestClient restClientMock = mock(RestClient.class);
+        doReturn(restClientMock).when(client).createClient(uri);
+        when(restClientMock.get(GenericVnfs.class)).thenReturn(Optional.of(vnfs));
+
+        thrown.expect(GraphInventoryMultipleItemsException.class);
+        aaiClient.getOne(GenericVnfs.class, GenericVnf.class, uri);
+    }
+
+    @Test
+    public void testGetFirstMultipleResults() {
+        GenericVnf vnf = new GenericVnf();
+        vnf.setVnfId("my-vnf-id");
+        GenericVnf vnf2 = new GenericVnf();
+        vnf2.setVnfId("my-vnf-id2");
+        GenericVnfs vnfs = new GenericVnfs();
+        vnfs.getGenericVnf().add(vnf);
+        vnfs.getGenericVnf().add(vnf2);
+        AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.GENERIC_VNF);
+        RestClient restClientMock = mock(RestClient.class);
+        doReturn(restClientMock).when(client).createClient(uri);
+        when(restClientMock.get(GenericVnfs.class)).thenReturn(Optional.of(vnfs));
+
+        Optional<GenericVnf> result = aaiClient.getFirst(GenericVnfs.class, GenericVnf.class, uri);
+
+        assertEquals("my-vnf-id", result.get().getVnfId());
+    }
+
+    @Test
+    public void testGetOneNoResults() {
+        GenericVnf vnf = new GenericVnf();
+        vnf.setVnfId("my-vnf-id");
+        GenericVnfs vnfs = new GenericVnfs();
+        vnfs.getGenericVnf().add(vnf);
+        AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.GENERIC_VNF);
+        RestClient restClientMock = mock(RestClient.class);
+        doReturn(restClientMock).when(client).createClient(uri);
+        when(restClientMock.get(GenericVnfs.class)).thenReturn(Optional.empty());
+
+        Optional<GenericVnf> result = aaiClient.getOne(GenericVnfs.class, GenericVnf.class, uri);
+
+        assertFalse(result.isPresent());
+    }
+
+    @Test
+    public void testGetFirstNoResults() {
+        GenericVnf vnf = new GenericVnf();
+        vnf.setVnfId("my-vnf-id");
+        GenericVnfs vnfs = new GenericVnfs();
+        vnfs.getGenericVnf().add(vnf);
+        AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.GENERIC_VNF);
+        RestClient restClientMock = mock(RestClient.class);
+        doReturn(restClientMock).when(client).createClient(uri);
+        when(restClientMock.get(GenericVnfs.class)).thenReturn(Optional.empty());
+
+        Optional<GenericVnf> result = aaiClient.getFirst(GenericVnfs.class, GenericVnf.class, uri);
+
+        assertFalse(result.isPresent());
+    }
+
+    @Test
+    public void testGetFirstWrongPluralClass() {
+        GenericVnf vnf = new GenericVnf();
+        AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.GENERIC_VNF);
+        RestClient restClientMock = mock(RestClient.class);
+        doReturn(restClientMock).when(client).createClient(uri);
+        when(restClientMock.get(GenericVnf.class)).thenReturn(Optional.of(vnf));
+
+        Optional<GenericVnf> result = aaiClient.getFirst(GenericVnf.class, GenericVnf.class, uri);
+
+        assertFalse(result.isPresent());
+    }
+
 }
 
 
     @Test
     public void testConnect() throws IOException {
-        List<AAIResourceUri> uris = new ArrayList<AAIResourceUri>();
+        List<AAIResourceUri> uris = new ArrayList<>();
         uris.add(uriB);
 
         Map<String, Object> map = new HashMap<>();
 
     @Test
     public void testDisconnect() throws IOException {
-        List<AAIResourceUri> uris = new ArrayList<AAIResourceUri>();
+        List<AAIResourceUri> uris = new ArrayList<>();
         uris.add(uriB);
 
         AAITransactionalClient transactions = aaiClient.beginTransaction().disconnect(uriA, uris);
 
 import static org.junit.Assert.assertEquals;
 import javax.ws.rs.core.UriBuilder;
 import org.junit.Test;
-import org.onap.so.client.aai.entities.uri.AAIUri;
+import org.onap.so.client.aai.entities.uri.AAIResourceUri;
 import org.onap.so.client.aai.entities.uri.AAIUriFactory;
 
 public class AAIURITest {
     @Test
     public void verifyTemplateReplacement() {
         final String id = "test1";
-        AAIUri aaiUri = AAIUriFactory.createResourceUri(AAIObjectType.CONFIGURATION, id);
+        AAIResourceUri aaiUri = AAIUriFactory.createResourceUri(AAIObjectType.CONFIGURATION, id);
         String manualReplace = AAIObjectType.CONFIGURATION.toString().replaceAll("\\{configuration-id\\}", id);
         assertEquals("uri template replaced", aaiUri.build(), UriBuilder.fromPath(manualReplace).build());
 
 
         Relationships relationships = wrapper.getRelationships().get();
 
         List<AAIResourceUri> test = relationships.getRelatedUris(AAIObjectType.VCE);
-
-        System.out.println(test.get(0).build());
         List<AAIResourceUri> uris = Arrays.asList(
                 AAIUriFactory.createResourceUri(AAIObjectType.VCE, "a9fec18e-1ea3-40e4-a6c0-a89b3de07053"),
                 AAIUriFactory.createResourceUri(AAIObjectType.VCE, "8ae1e5f8-61f1-4c71-913a-b40cc4593cb9"),
                 AAIUriFactory.createResourceUri(AAIObjectType.VCE, "a2935fa9-b743-49f4-9813-a127f13c4e93"),
                 AAIUriFactory.createResourceUri(AAIObjectType.VCE, "c7fe7698-8063-4e26-8bd3-ca3edde0b0d4"));
 
-
         assertTrue(uris.containsAll(test) && test.containsAll(uris));
 
     }
 
         AAIResourceUri parentUri =
                 AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, "key1", "key2", "key3");
 
-        AAIUri uri = new AAISimpleUri(parentUri, AAIObjectType.ALLOTTED_RESOURCE, "key4");
+        AAIResourceUri uri = new AAISimpleUri(parentUri, AAIObjectType.ALLOTTED_RESOURCE, "key4");
 
         assertEquals("path appended",
                 "/business/customers/customer/key1/service-subscriptions/service-subscription/key2/service-instances/service-instance/key3/allotted-resources/allotted-resource/key4",
 
 import javax.ws.rs.core.UriBuilder;
 import org.junit.Test;
 import org.onap.so.client.aai.AAIObjectType;
-import org.onap.so.client.graphinventory.entities.uri.SimpleUri;
 
 public class AAISimpleUriFromUriTest {
 
     @Test
     public void removeHost() {
 
-        AAIUri uri = new AAISimpleUri(AAIObjectType.UNKNOWN,
+        AAIResourceUri uri = new AAISimpleUri(AAIObjectType.UNKNOWN,
                 UriBuilder
                         .fromUri("https://localhost:8443/aai/v9/network/vces/vce/a9fec18e-1ea3-40e4-a6c0-a89b3de07053")
                         .build());
     @Test
     public void noChange() {
 
-        AAIUri uri = new AAISimpleUri(AAIObjectType.UNKNOWN,
+        AAIResourceUri uri = new AAISimpleUri(AAIObjectType.UNKNOWN,
                 UriBuilder.fromUri("/network/vces/vce/a9fec18e-1ea3-40e4-a6c0-a89b3de07053").build());
 
         assertEquals("no change", "/network/vces/vce/a9fec18e-1ea3-40e4-a6c0-a89b3de07053", uri.build().toString());
     @Test
     public void encodingPreserved() {
 
-        AAIUri uri = new AAISimpleUri(AAIObjectType.UNKNOWN,
+        AAIResourceUri uri = new AAISimpleUri(AAIObjectType.UNKNOWN,
                 UriBuilder.fromUri("/network/vces/vce/a9f%20%20ec18e-1ea3-40e4-a6c0-a89b3de07053").build());
 
         assertEquals("encoding preserved", "/network/vces/vce/a9f%20%20ec18e-1ea3-40e4-a6c0-a89b3de07053",
                 uri.build().toString());
 
     }
+
+    @Test
+    public void beforeBuildEquality() {
+
+        AAIResourceUri uri = new AAISimpleUri(AAIObjectType.VCE,
+                UriBuilder.fromUri("/network/vces/vce/a9f%20%20ec18e-1ea3-40e4-a6c0-a89b3de07053").build());
+
+        AAIResourceUri uri2 = new AAISimpleUri(AAIObjectType.VCE, "a9f  ec18e-1ea3-40e4-a6c0-a89b3de07053");
+        assertEquals("are equal", uri2, uri);
+
+    }
 }
 
 
 package org.onap.so.client.aai.entities.uri;
 
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.collection.IsEmptyCollection.empty;
-import static org.hamcrest.collection.IsIterableContainingInOrder.contains;
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import org.onap.so.client.aai.AAIObjectPlurals;
 import org.onap.so.client.aai.AAIObjectType;
 import org.onap.so.client.graphinventory.entities.uri.Depth;
-import org.onap.so.client.graphinventory.entities.uri.SimpleUri;
 
 public class AAISimpleUriTest {
 
 
     @Test
     public void relatedToTestPlural() {
-        AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, "test1");
-        uri.relatedTo(AAIObjectPlurals.PSERVER);
+        AAIPluralResourceUri uri =
+                AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, "test1").relatedTo(AAIObjectPlurals.PSERVER);
         String uriOutput = uri.build().toString();
-        assertEquals(true, uriOutput.contains("related-to"));
+        assertEquals("/network/generic-vnfs/generic-vnf/test1/related-to/pservers", uriOutput);
     }
 
     @Test
     public void relatedToTestSingular() {
-        AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, "test1");
-        uri.relatedTo(AAIObjectType.PSERVER, "test2");
+        AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, "test1")
+                .relatedTo(AAIObjectType.PSERVER, "test2");
         String uriOutput = uri.build().toString();
-        assertEquals(true, uriOutput.contains("related-to"));
+        assertEquals("/network/generic-vnfs/generic-vnf/test1/related-to/pservers/pserver/test2", uriOutput);
     }
 
     @Test
     public void cloneTestSingular() {
         AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, "test1");
         AAIResourceUri cloned = uri.clone();
-        Map<String, String> keys = cloned.getURIKeys();
-        assertThat(keys.values(), contains("test1"));
+        assertEquals("/network/generic-vnfs/generic-vnf/test1", cloned.build().toString());
+
+        cloned.limit(2);
+
+        assertNotEquals(uri.build().toString(), cloned.build().toString());
     }
 
     @Test
     public void cloneTestPlural() {
-        AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.GENERIC_VNF);
-        AAIResourceUri cloned = uri.clone();
-        Map<String, String> keys = cloned.getURIKeys();
-        assertThat(keys.values(), empty());
+        AAISimplePluralUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.GENERIC_VNF);
+        AAISimplePluralUri cloned = uri.clone();
+        assertEquals("/network/generic-vnfs", cloned.build().toString());
+    }
+
+    @Test
+    public void cloneTestWithRelatedTo() {
+        AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, "test1")
+                .relatedTo(AAIObjectType.PSERVER, "test2");
+        String uriOutput = uri.clone().build().toString();
+        assertEquals("/network/generic-vnfs/generic-vnf/test1/related-to/pservers/pserver/test2", uriOutput);
+    }
+
+    @Test
+    public void cloneTestPluralWithRelatedTo() {
+        AAIPluralResourceUri uri =
+                AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, "test1").relatedTo(AAIObjectPlurals.PSERVER);
+        String uriOutput = uri.clone().build().toString();
+        assertEquals("/network/generic-vnfs/generic-vnf/test1/related-to/pservers", uriOutput);
     }
 
     @Test
 
 import org.junit.Test;
 import org.onap.so.client.aai.AAIObjectPlurals;
 import org.onap.so.client.aai.AAIObjectType;
-import org.onap.so.client.graphinventory.entities.uri.SimpleUri;
 
 public class AAIUriFactoryTest {
 
     @Test
     public void testCreateResourceUri() {
 
-        AAIUri uri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, "VIP(VelocitytoIP)");
+        AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, "VIP(VelocitytoIP)");
 
         String expected = "/network/generic-vnfs/generic-vnf/VIP%28VelocitytoIP%29";
         assertEquals(expected, uri.build().toString());
     @Test
     public void testCreateNodesUri() {
 
-        AAIUri uri = AAIUriFactory.createNodesUri(AAIObjectType.GENERIC_VNF, "VIP(VelocitytoIP)");
+        AAIResourceUri uri = AAIUriFactory.createNodesUri(AAIObjectType.GENERIC_VNF, "VIP(VelocitytoIP)");
 
         String expected = "/nodes/generic-vnfs/generic-vnf/VIP%28VelocitytoIP%29";
         assertEquals(expected, uri.build().toString());
     @Test
     public void testCreateResourceFromExistingURI() {
 
-        AAIUri uri = new AAISimpleUri(AAIObjectType.GENERIC_VNF, "VIP(VelocitytoIP)");
-        AAIUri uri2 = AAIUriFactory.createResourceFromExistingURI(AAIObjectType.GENERIC_VNF, uri.build());
+        AAIResourceUri uri = new AAISimpleUri(AAIObjectType.GENERIC_VNF, "VIP(VelocitytoIP)");
+        AAIResourceUri uri2 = AAIUriFactory.createResourceFromExistingURI(AAIObjectType.GENERIC_VNF, uri.build());
 
         String expected = "/network/generic-vnfs/generic-vnf/VIP%28VelocitytoIP%29";
         assertEquals(expected, uri2.build().toString());
     @Test
     public void testCreateResourceURIForPluralsWithValues() {
 
-        AAIUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.SERVICE_INSTANCE, "customerId", "serviceType");
+        AAIPluralResourceUri uri =
+                AAIUriFactory.createResourceUri(AAIObjectPlurals.SERVICE_INSTANCE, "customerId", "serviceType");
 
         String expected =
                 "/business/customers/customer/customerId/service-subscriptions/service-subscription/serviceType/service-instances";
 
                 "/business/customers/customer/key1/service-subscriptions/service-subscription/key2/service-instances/service-instance/key3/allotted-resources/allotted-resource/key4")
                         .when(spy).getObjectById(any(Object.class));
 
-        final URI result = spy.build();
+        final URI result = spy.locateAndBuild();
         final URI expected = UriBuilder.fromPath(
                 "/business/customers/customer/key1/service-subscriptions/service-subscription/key2/service-instances/service-instance/key3/allotted-resources/allotted-resource/key4")
                 .build();
 
 package org.onap.so.client.aai.entities.uri;
 
 import static org.hamcrest.CoreMatchers.equalTo;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
     public void verifyIncorrectNumberOfKeysPlural() {
 
         thrown.expect(IncorrectNumberOfUriKeys.class);
-        AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.VOLUME_GROUP, "my-cloud-owner");
+        AAISimplePluralUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.VOLUME_GROUP, "my-cloud-owner");
 
     }
 
 
 import org.mockito.Spy;
 import org.mockito.junit.MockitoJUnitRunner;
 import org.onap.so.client.aai.AAIClient;
-import org.onap.so.client.aai.AAIObjectType;
+import org.onap.so.client.aai.AAIObjectPlurals;
 import org.onap.so.client.aai.AAIResourcesClient;
 import org.onap.so.client.aai.entities.AAIResultWrapper;
 import org.onap.so.client.defaultproperties.DefaultAAIPropertiesImpl;
-import org.onap.so.client.graphinventory.entities.uri.Depth;
+import org.onap.so.client.graphinventory.entities.uri.HttpAwareUri;
 import org.onap.so.client.graphinventory.exceptions.GraphInventoryPayloadException;
 import org.onap.so.client.graphinventory.exceptions.GraphInventoryUriComputationException;
 import org.onap.so.client.graphinventory.exceptions.GraphInventoryUriNotFoundException;
                 "/business/customers/customer/key1/service-subscriptions/service-subscription/key2/service-instances/service-instance/key3")
                         .when(spy).getObjectById(any(Object.class));
 
-        final URI result = spy.build();
+        final URI result = spy.locateAndBuild();
         final URI expected = UriBuilder.fromPath(
                 "/business/customers/customer/key1/service-subscriptions/service-subscription/key2/service-instances/service-instance/key3")
                 .build();
                 "/business/customers/customer/key1/service-subscriptions/service-subscription/key2/service-instances/service-instance/key3")
                         .when(spy).getObjectById(any(Object.class));
 
-        final URI result = spy.resourceVersion("1234").build();
+        final URI result = ((HttpAwareUri) spy.resourceVersion("1234")).locateAndBuild();
         final URI expected = UriBuilder.fromUri(
                 "/business/customers/customer/key1/service-subscriptions/service-subscription/key2/service-instances/service-instance/key3?resource-version=1234")
                 .build();
                 "/business/customers/customer/key1/service-subscriptions/service-subscription/key2/service-instances/service-instance/key3%20space")
                         .when(spy).getObjectById(any(Object.class));
 
-        final URI result = spy.build();
+        final URI result = spy.locateAndBuild();
         final URI expected = UriBuilder.fromUri(
                 "/business/customers/customer/key1/service-subscriptions/service-subscription/key2/service-instances/service-instance/key3%20space")
                 .build();
         ServiceInstanceUri spy = spy(instance);
         String uri =
                 "/business/customers/customer/key1/service-subscriptions/service-subscription/key2/service-instances/service-instance/key3";
-        doReturn(uri).when(spy).getObjectById(any(Object.class));
         doReturn(Optional.of(uri)).when(spy).getCachedValue();
-        final URI result = spy.resourceVersion("1234").clone().build();
+        final URI result = ((HttpAwareUri) spy.resourceVersion("1234").clone()).locateAndBuild();
         final URI expected = UriBuilder.fromUri(
                 "/business/customers/customer/key1/service-subscriptions/service-subscription/key2/service-instances/service-instance/key3?resource-version=1234")
                 .build();
         when(wrapper.getJson()).thenReturn(content);
         when(spy.getResourcesClient()).thenReturn(mockResourcesClient);
         exception.expect(GraphInventoryUriComputationException.class);
-        spy.build();
+        spy.locateAndBuild();
 
     }
 
                 .stubFor(get(urlPathMatching("/aai/v[0-9]+/nodes/service-instances/service-instance/key3")).willReturn(
                         aResponse().withStatus(404).withHeader("Content-Type", "application/json").withBodyFile("")));
         exception.expect(NotFoundException.class);
-        spy.build();
+        spy.locateAndBuild();
     }
 
     @Test
                 ArgumentMatchers.<Class<NotFoundException>>any())).thenReturn(wrapper);
         when(wrapper.getJson()).thenReturn(content);
         when(spy.getResourcesClient()).thenReturn(mockResourcesClient);
-        spy.build();
+        spy.locateAndBuild();
         instance = spy.clone();
         ByteArrayOutputStream bos = new ByteArrayOutputStream();
 
 
         // use the cached value do not call out to external system
         verify(spy2, times(0)).getResourcesClient();
+    }
+
+    @Test
+    public void relatedToTest() throws GraphInventoryUriNotFoundException, GraphInventoryPayloadException {
+        ServiceInstanceUri instance = new ServiceInstanceUri("key1");
+        ServiceInstanceUri spy = spy(instance);
+        doReturn(
+                "/business/customers/customer/key1/service-subscriptions/service-subscription/key2/service-instances/service-instance/key3")
+                        .when(spy).getObjectById(any(Object.class));
+
+        final URI result = spy.relatedTo(AAIObjectPlurals.GENERIC_VNF).queryParam("vnf-name", "my-vnf-name").build();
+        final URI expected = UriBuilder.fromUri(
+                "/business/customers/customer/key1/service-subscriptions/service-subscription/key2/service-instances/service-instance/key3/related-to/generic-vnfs?vnf-name=my-vnf-name")
+                .build();
+        assertEquals("result is equal", expected, result);
+    }
+
+    @Test
+    public void relatedToEqualityTestBeforeBuildTest()
+            throws GraphInventoryUriNotFoundException, GraphInventoryPayloadException {
+        ServiceInstanceUri instance = new ServiceInstanceUri("key1");
+        ServiceInstanceUri spy = spy(instance);
+
+        final AAIPluralResourceUri result =
+                spy.relatedTo(AAIObjectPlurals.GENERIC_VNF).queryParam("vnf-name", "my-vnf-name");
 
+        assertEquals("result is equal", result, result);
     }
 }