diff options
author | Benjamin, Max <max.benjamin@att.com> | 2020-09-21 11:38:23 -0400 |
---|---|---|
committer | Benjamin, Max (mb388a) <mb388a@att.com> | 2020-09-23 16:32:42 -0400 |
commit | 2505a543b0e45c1c3c2fe2fb8b85664b08bf2fca (patch) | |
tree | 5f1593d45f8c9a2fb2d400b8fa58dbb3e29ef671 /adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter | |
parent | 8d68a316f303d0fc57eb7da4fef881a26d39d439 (diff) |
removed references to AAIObjectType
removed references to AAIObjectType and AAIObjectPlurals
additional corrections for removal of aai object type
corrected additional java files
updated groovy files to match aai fluent builder style
Issue-ID: SO-3259
Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com>
Change-Id: Ifdf12fcacb34cc648548eb18b638afd06dad67a9
Diffstat (limited to 'adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter')
4 files changed, 47 insertions, 39 deletions
diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/aai/AaiServiceProviderImpl.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/aai/AaiServiceProviderImpl.java index d9450b3472..8f95d8ab85 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/aai/AaiServiceProviderImpl.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/aai/AaiServiceProviderImpl.java @@ -26,8 +26,8 @@ import org.onap.aai.domain.yang.EsrVnfmList; import org.onap.aai.domain.yang.GenericVnf; import org.onap.aai.domain.yang.GenericVnfs; import org.onap.aai.domain.yang.Vserver; -import org.onap.aaiclient.client.aai.AAIObjectType; import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory; +import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder; import org.onap.aaiclient.client.graphinventory.entities.uri.Depth; import org.onap.so.adapters.etsisol003adapter.lcm.v1.model.Tenant; import org.slf4j.Logger; @@ -49,7 +49,8 @@ public class AaiServiceProviderImpl implements AaiServiceProvider { @Override public GenericVnf invokeGetGenericVnf(final String vnfId) { return aaiClientProvider.getAaiClient() - .get(GenericVnf.class, AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)) + .get(GenericVnf.class, + AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(vnfId))) .orElseGet(() -> { logger.debug("No vnf found in AAI with ID: {}", vnfId); return null; @@ -58,9 +59,8 @@ public class AaiServiceProviderImpl implements AaiServiceProvider { @Override public GenericVnfs invokeQueryGenericVnf(final String selfLink) { - return aaiClientProvider.getAaiClient() - .get(GenericVnfs.class, - AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNFS).queryParam("selflink", selfLink)) + return aaiClientProvider.getAaiClient().get(GenericVnfs.class, AAIUriFactory + .createResourceUri(AAIFluentTypeBuilder.network().genericVnfs()).queryParam("selflink", selfLink)) .orElseGet(() -> { logger.debug("No vnf found in AAI with selflink: {}", selfLink); return null; @@ -70,7 +70,9 @@ public class AaiServiceProviderImpl implements AaiServiceProvider { @Override public EsrVnfmList invokeGetVnfms() { return aaiClientProvider.getAaiClient() - .get(EsrVnfmList.class, AAIUriFactory.createResourceUri(AAIObjectType.VNFM_LIST)).orElseGet(() -> { + .get(EsrVnfmList.class, + AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.externalSystem().esrVnfmList())) + .orElseGet(() -> { logger.debug("No VNFMs in AAI"); return null; }); @@ -79,7 +81,8 @@ public class AaiServiceProviderImpl implements AaiServiceProvider { @Override public EsrVnfm invokeGetVnfm(final String vnfmId) { return aaiClientProvider.getAaiClient() - .get(EsrVnfm.class, AAIUriFactory.createResourceUri(AAIObjectType.VNFM, vnfmId).depth(Depth.ONE)) + .get(EsrVnfm.class, AAIUriFactory + .createResourceUri(AAIFluentTypeBuilder.externalSystem().esrVnfm(vnfmId)).depth(Depth.ONE)) .orElseGet(() -> { logger.debug("VNFM not found in AAI"); return null; @@ -90,7 +93,8 @@ public class AaiServiceProviderImpl implements AaiServiceProvider { public EsrSystemInfoList invokeGetVnfmEsrSystemInfoList(final String vnfmId) { return aaiClientProvider.getAaiClient() .get(EsrSystemInfoList.class, - AAIUriFactory.createResourceUri(AAIObjectType.VNFM_ESR_SYSTEM_INFO_LIST, vnfmId)) + AAIUriFactory.createResourceUri( + AAIFluentTypeBuilder.externalSystem().esrVnfm(vnfmId).esrSystemInfoList())) .orElseGet(() -> { logger.debug("VNFM ESR system info list not found in AAI"); return null; @@ -99,45 +103,47 @@ public class AaiServiceProviderImpl implements AaiServiceProvider { @Override public void invokePatchGenericVnf(final GenericVnf vnf) { - aaiClientProvider.getAaiClient() - .update(AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnf.getVnfId()), vnf); + aaiClientProvider.getAaiClient().update( + AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(vnf.getVnfId())), vnf); } @Override public void invokePutGenericVnfToVnfmRelationship(final GenericVnf vnf, final String vnfmId) { - aaiClientProvider.getAaiClient().connect(AAIUriFactory.createResourceUri(AAIObjectType.VNFM, vnfmId), - AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnf.getVnfId())); + aaiClientProvider.getAaiClient().connect( + AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.externalSystem().esrVnfm(vnfmId)), + AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(vnf.getVnfId()))); } @Override public void invokePutVserver(final String cloudOwner, final String cloudRegion, final String tenant, final Vserver vserver) { - aaiClientProvider.getAaiClient().create(AAIUriFactory.createResourceUri(AAIObjectType.VSERVER, cloudOwner, - cloudRegion, tenant, vserver.getVserverId()), vserver); + aaiClientProvider + .getAaiClient().create( + AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.cloudInfrastructure() + .cloudRegion(cloudOwner, cloudRegion).tenant(tenant).vserver(vserver.getVserverId())), + vserver); } @Override public void invokePutVserverToVnfRelationship(final String cloudOwner, final String cloudRegion, final String tenant, final Vserver vserver, final String vnfId) { - aaiClientProvider.getAaiClient() - .connect( - AAIUriFactory.createResourceUri(AAIObjectType.VSERVER, cloudOwner, cloudRegion, tenant, - vserver.getVserverId()), - AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)); + aaiClientProvider.getAaiClient().connect( + AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.cloudInfrastructure() + .cloudRegion(cloudOwner, cloudRegion).tenant(tenant).vserver(vserver.getVserverId())), + AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(vnfId))); } @Override public void invokeDeleteVserver(final String cloudOwner, final String cloudRegion, final String tenant, final String vserverId) { - aaiClientProvider.getAaiClient().delete( - AAIUriFactory.createResourceUri(AAIObjectType.VSERVER, cloudOwner, cloudRegion, tenant, vserverId)); + aaiClientProvider.getAaiClient().delete(AAIUriFactory.createResourceUri(AAIFluentTypeBuilder + .cloudInfrastructure().cloudRegion(cloudOwner, cloudRegion).tenant(tenant).vserver(vserverId))); } @Override public Tenant invokeGetTenant(final String cloudOwner, final String cloudRegion, final String tenantId) { - return aaiClientProvider.getAaiClient() - .get(Tenant.class, - AAIUriFactory.createResourceUri(AAIObjectType.TENANT, cloudOwner, cloudRegion, tenantId)) + return aaiClientProvider.getAaiClient().get(Tenant.class, AAIUriFactory.createResourceUri( + AAIFluentTypeBuilder.cloudInfrastructure().cloudRegion(cloudOwner, cloudRegion).tenant(tenantId))) .orElseGet(() -> { logger.debug("Tenant not found in AAI"); return null; @@ -147,8 +153,8 @@ public class AaiServiceProviderImpl implements AaiServiceProvider { @Override public EsrSystemInfoList invokeGetCloudRegionEsrSystemInfoList(final String cloudOwner, final String cloudRegion) { return aaiClientProvider - .getAaiClient().get(EsrSystemInfoList.class, AAIUriFactory - .createResourceUri(AAIObjectType.CLOUD_ESR_SYSTEM_INFO_LIST, cloudOwner, cloudRegion)) + .getAaiClient().get(EsrSystemInfoList.class, AAIUriFactory.createResourceUri(AAIFluentTypeBuilder + .cloudInfrastructure().cloudRegion(cloudOwner, cloudRegion).esrSystemInfoList())) .orElseGet(() -> { logger.debug("Cloud esr system info list not found in AAI"); return null; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/EtsiSol003AdapterControllerTest.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/EtsiSol003AdapterControllerTest.java index 9aed675324..5bc4daac42 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/EtsiSol003AdapterControllerTest.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/EtsiSol003AdapterControllerTest.java @@ -53,6 +53,7 @@ import org.onap.aai.domain.yang.RelationshipData; import org.onap.aai.domain.yang.RelationshipList; import org.onap.aaiclient.client.aai.AAIResourcesClient; import org.onap.aaiclient.client.aai.AAIVersion; +import org.onap.aaiclient.client.aai.entities.uri.AAIBaseResourceUri; import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri; import org.onap.so.adapters.etsisol003adapter.lcm.extclients.EtsiPackageProvider; import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.VnfmRestTemplateConfiguration; @@ -534,7 +535,7 @@ public class EtsiSol003AdapterControllerTest { } - private class AaiResourceUriMatcher extends BaseMatcher<AAIResourceUri> { + private class AaiResourceUriMatcher extends BaseMatcher<AAIBaseResourceUri<?, ?>> { final String uriAsString; @@ -544,12 +545,12 @@ public class EtsiSol003AdapterControllerTest { @Override public boolean matches(final Object item) { - if (item instanceof AAIResourceUri) { + if (item instanceof AAIBaseResourceUri<?, ?>) { if (uriAsString.endsWith("...")) { - return ((AAIResourceUri) item).build().toString() + return ((AAIBaseResourceUri<?, ?>) item).build().toString() .startsWith(uriAsString.substring(0, uriAsString.indexOf("..."))); } - return ((AAIResourceUri) item).build().toString().equals(uriAsString); + return ((AAIBaseResourceUri<?, ?>) item).build().toString().equals(uriAsString); } return false; } diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/Sol003GrantControllerTest.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/Sol003GrantControllerTest.java index 21e56617cd..99b8c71764 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/Sol003GrantControllerTest.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/Sol003GrantControllerTest.java @@ -43,7 +43,7 @@ import org.onap.aai.domain.yang.Relationship; import org.onap.aai.domain.yang.RelationshipData; import org.onap.aai.domain.yang.RelationshipList; import org.onap.aaiclient.client.aai.AAIResourcesClient; -import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri; +import org.onap.aaiclient.client.aai.entities.uri.AAIBaseResourceUri; import org.onap.so.adapters.etsisol003adapter.lcm.grant.model.GrantRequest; import org.onap.so.adapters.etsisol003adapter.lcm.grant.model.GrantRequest.OperationEnum; import org.onap.so.adapters.etsisol003adapter.lcm.grant.model.GrantsAddResources; @@ -224,7 +224,7 @@ public class Sol003GrantControllerTest { "/network/generic-vnfs?selflink=http%3A%2F%2Fvnfm%3A8080%2Fvnfs%2FmyTestVnfIdOnVnfm"))); } - private class AaiResourceUriMatcher extends BaseMatcher<AAIResourceUri> { + private class AaiResourceUriMatcher extends BaseMatcher<AAIBaseResourceUri<?, ?>> { final String uriAsString; @@ -234,12 +234,12 @@ public class Sol003GrantControllerTest { @Override public boolean matches(final Object item) { - if (item instanceof AAIResourceUri) { + if (item instanceof AAIBaseResourceUri) { if (uriAsString.endsWith("...")) { - return ((AAIResourceUri) item).build().toString() + return ((AAIBaseResourceUri<?, ?>) item).build().toString() .startsWith(uriAsString.substring(0, uriAsString.indexOf("..."))); } - return ((AAIResourceUri) item).build().toString().equals(uriAsString); + return ((AAIBaseResourceUri<?, ?>) item).build().toString().equals(uriAsString); } return false; } diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/Sol003LcnControllerTest.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/Sol003LcnControllerTest.java index 86eda0abfa..0d5bcd2573 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/Sol003LcnControllerTest.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/Sol003LcnControllerTest.java @@ -54,6 +54,7 @@ import org.onap.aai.domain.yang.RelationshipData; import org.onap.aai.domain.yang.RelationshipList; import org.onap.aai.domain.yang.Vserver; import org.onap.aaiclient.client.aai.AAIResourcesClient; +import org.onap.aaiclient.client.aai.entities.uri.AAIBaseResourceUri; import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri; import org.onap.so.adapters.etsisol003adapter.lcm.extclients.aai.AaiHelper; import org.onap.so.adapters.etsisol003adapter.lcm.extclients.aai.OamIpAddressSource; @@ -385,7 +386,7 @@ public class Sol003LcnControllerTest { genericVnf.getRelationshipList().getRelationship().add(relationshipToVserver); } - private class AaiResourceUriMatcher extends BaseMatcher<AAIResourceUri> { + private class AaiResourceUriMatcher extends BaseMatcher<AAIBaseResourceUri<?, ?>> { final String uriAsString; @@ -395,12 +396,12 @@ public class Sol003LcnControllerTest { @Override public boolean matches(final Object item) { - if (item instanceof AAIResourceUri) { + if (item instanceof AAIBaseResourceUri<?, ?>) { if (uriAsString.endsWith("...")) { - return ((AAIResourceUri) item).build().toString() + return ((AAIBaseResourceUri<?, ?>) item).build().toString() .startsWith(uriAsString.substring(0, uriAsString.indexOf("..."))); } - return ((AAIResourceUri) item).build().toString().equals(uriAsString); + return ((AAIBaseResourceUri<?, ?>) item).build().toString().equals(uriAsString); } return false; } |