diff options
23 files changed, 139 insertions, 70 deletions
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java index eb4b9f538d..6817be8c49 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java @@ -39,6 +39,7 @@ import java.util.List; import java.util.Map; import java.util.stream.Collectors; import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import org.onap.aai.domain.yang.Flavor; import org.onap.aai.domain.yang.Image; import org.onap.aai.domain.yang.PInterface; @@ -77,9 +78,11 @@ public class AaiHelper { List<Relationship> relationships = relationshipList.getRelationship(); // vserver to pserver relationship - Relationship pserverRelationship = buildRelationship( - AAIUriFactory.createResourceUri(AAIObjectType.PSERVER, server.getHypervisorHostname())); - relationships.add(pserverRelationship); + if (!StringUtils.isEmpty(server.getHypervisorHostname())) { + Relationship pserverRelationship = buildRelationship( + AAIUriFactory.createResourceUri(AAIObjectType.PSERVER, server.getHypervisorHostname())); + relationships.add(pserverRelationship); + } // vserver to generic-vnf relationship Relationship genericVnfRelationship = @@ -87,10 +90,11 @@ public class AaiHelper { relationships.add(genericVnfRelationship); // vserver to vnfc relationship - Relationship vnfcRelationship = - buildRelationship(AAIUriFactory.createResourceUri(AAIObjectType.VNFC, server.getName())); - relationships.add(vnfcRelationship); - + if (!StringUtils.isEmpty(server.getName())) { + Relationship vnfcRelationship = + buildRelationship(AAIUriFactory.createResourceUri(AAIObjectType.VNFC, server.getName())); + relationships.add(vnfcRelationship); + } // vserver to vf-module relationship Relationship vfModuleRelationship = @@ -105,9 +109,12 @@ public class AaiHelper { } // vserver to flavor relationship - Relationship flavorRel = buildRelationship(AAIUriFactory.createResourceUri(AAIObjectType.FLAVOR, cloudOwner, - cloudRegionId, server.getFlavor().getId())); - relationships.add(flavorRel); + if (server.getFlavor() != null) { + Relationship flavorRel = buildRelationship(AAIUriFactory.createResourceUri(AAIObjectType.FLAVOR, cloudOwner, + cloudRegionId, server.getFlavor().getId())); + relationships.add(flavorRel); + } + return relationshipList; } diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java index 8ce537bb97..464a17d2a5 100644 --- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java +++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java @@ -72,6 +72,7 @@ import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory; import org.onap.aaiclient.client.graphinventory.exceptions.BulkProcessFailed; import org.onap.so.db.catalog.beans.CloudIdentity; import org.onap.so.heatbridge.constants.HeatBridgeConstants; +import org.onap.so.heatbridge.helpers.AaiHelper; import org.onap.so.heatbridge.openstack.api.OpenstackClient; import org.onap.so.heatbridge.openstack.api.OpenstackClientException; import org.openstack4j.model.compute.Flavor; @@ -228,7 +229,7 @@ public class HeatBridgeImplTest { Server server2 = mock(Server.class); when(server2.getId()).thenReturn("test-server2-id"); - when(server2.getHypervisorHostname()).thenReturn("test-hypervisor"); + when(server2.getHypervisorHostname()).thenReturn(""); when(server2.getName()).thenReturn("test-server2-name"); when(server2.getStatus()).thenReturn(Status.ACTIVE); when(server2.getLinks()).thenReturn(new ArrayList<>()); @@ -262,6 +263,90 @@ public class HeatBridgeImplTest { } @Test + public void testUpdateVserversToAaiNoHypervisorName() throws HeatBridgeException { + // Arrange + Server server1 = mock(Server.class); + + when(server1.getId()).thenReturn("test-server1-id"); + when(server1.getHypervisorHostname()).thenReturn(""); + when(server1.getName()).thenReturn("test-server1-name"); + when(server1.getStatus()).thenReturn(Status.ACTIVE); + when(server1.getLinks()).thenReturn(new ArrayList<>()); + + Server server2 = mock(Server.class); + when(server2.getId()).thenReturn("test-server2-id"); + when(server2.getName()).thenReturn("test-server2-name"); + when(server2.getStatus()).thenReturn(Status.ACTIVE); + when(server2.getLinks()).thenReturn(new ArrayList<>()); + + List<Server> servers = Arrays.asList(server1, server2); + + Image image = mock(Image.class); + when(server1.getImage()).thenReturn(image); + when(server2.getImage()).thenReturn(image); + when(image.getId()).thenReturn("test-image-id"); + + Flavor flavor = mock(Flavor.class); + when(server1.getFlavor()).thenReturn(flavor); + when(server2.getFlavor()).thenReturn(flavor); + when(flavor.getId()).thenReturn("test-flavor-id"); + + // Act + heatbridge.buildAddVserversToAaiAction("test-genericVnf-id", "test-vfModule-id", servers); + + // Assert + ArgumentCaptor<AAIResourceUri> captor = ArgumentCaptor.forClass(AAIResourceUri.class); + verify(transaction, times(2)).create(captor.capture(), any(Vserver.class)); + + List<AAIResourceUri> uris = captor.getAllValues(); + assertEquals(AAIUriFactory.createResourceUri(AAIObjectType.VSERVER, CLOUD_OWNER, REGION_ID, TENANT_ID, + server1.getId()), uris.get(0)); + assertEquals(AAIUriFactory.createResourceUri(AAIObjectType.VSERVER, CLOUD_OWNER, REGION_ID, TENANT_ID, + server2.getId()), uris.get(1)); + } + + @Test + public void testCreateRelationships() throws HeatBridgeException { + AaiHelper aaiHelper = new AaiHelper(); + // Arrange + Server server1 = mock(Server.class); + + when(server1.getId()).thenReturn("test-server1-id"); + when(server1.getHypervisorHostname()).thenReturn("test-hypervisor"); + when(server1.getName()).thenReturn("test-server1-name"); + when(server1.getStatus()).thenReturn(Status.ACTIVE); + when(server1.getLinks()).thenReturn(new ArrayList<>()); + + // HypervisorHostname is not set + Server server2 = mock(Server.class); + when(server2.getId()).thenReturn("test-server1-id"); + when(server2.getName()).thenReturn("test-server1-name"); + when(server2.getStatus()).thenReturn(Status.ACTIVE); + when(server2.getLinks()).thenReturn(new ArrayList<>()); + + // HypervisorHostname is empty string + Server server3 = mock(Server.class); + when(server3.getId()).thenReturn("test-server1-id"); + when(server3.getHypervisorHostname()).thenReturn(""); + when(server3.getName()).thenReturn("test-server1-name"); + when(server3.getStatus()).thenReturn(Status.ACTIVE); + when(server3.getLinks()).thenReturn(new ArrayList<>()); + + org.onap.aai.domain.yang.RelationshipList relList = aaiHelper.getVserverRelationshipList(CLOUD_OWNER, REGION_ID, + "test-genericVnf-id", "test-vfModule-id", server1); + assertEquals(4, relList.getRelationship().size()); + + org.onap.aai.domain.yang.RelationshipList relList2 = aaiHelper.getVserverRelationshipList(CLOUD_OWNER, + REGION_ID, "test-genericVnf-id", "test-vfModule-id", server2); + assertEquals(3, relList2.getRelationship().size()); + + org.onap.aai.domain.yang.RelationshipList relList3 = aaiHelper.getVserverRelationshipList(CLOUD_OWNER, + REGION_ID, "test-genericVnf-id", "test-vfModule-id", server3); + assertEquals(3, relList3.getRelationship().size()); + } + + + @Test public void testUpdateImagesToAai() throws HeatBridgeException { // Arrange Image image1 = mock(Image.class); diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomController.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomController.java index 28e931a3e1..2adba81f9e 100644 --- a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomController.java +++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomController.java @@ -29,6 +29,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -39,27 +41,25 @@ public class InfraActiveRequestsRepositoryCustomController { @Autowired InfraActiveRequestsRepository infraActiveRequestsRepository; - @RequestMapping(method = RequestMethod.POST, - value = "/infraActiveRequests/getCloudOrchestrationFiltersFromInfraActive") + @PostMapping(value = "/infraActiveRequests/getCloudOrchestrationFiltersFromInfraActive") public List<InfraActiveRequests> getCloudOrchestrationFiltersFromInfraActive( @RequestBody Map<String, String> orchestrationMap) { return infraActiveRequestsRepository.getCloudOrchestrationFiltersFromInfraActive(orchestrationMap); } - @RequestMapping(method = RequestMethod.POST, value = "/infraActiveRequests/getOrchestrationFiltersFromInfraActive") + @PostMapping(value = "/infraActiveRequests/getOrchestrationFiltersFromInfraActive") public List<InfraActiveRequests> getOrchestrationFiltersFromInfraActive( @RequestBody Map<String, List<String>> orchestrationMap) { return infraActiveRequestsRepository.getOrchestrationFiltersFromInfraActive(orchestrationMap); } - @RequestMapping(method = RequestMethod.GET, - value = "/infraActiveRequests/checkVnfIdStatus/{operationalEnvironmentId}") + @GetMapping(value = "/infraActiveRequests/checkVnfIdStatus/{operationalEnvironmentId}") public InfraActiveRequests checkVnfIdStatus( @PathVariable("operationalEnvironmentId") String operationalEnvironmentId) { return infraActiveRequestsRepository.checkVnfIdStatus(operationalEnvironmentId); } - @RequestMapping(method = RequestMethod.POST, value = "/infraActiveRequests/checkInstanceNameDuplicate") + @PostMapping(value = "/infraActiveRequests/checkInstanceNameDuplicate") public InfraActiveRequests checkInstanceNameDuplicate( @RequestBody InstanceNameDuplicateCheckRequest instanceNameDuplicateCheckRequest) { return infraActiveRequestsRepository.checkInstanceNameDuplicate( @@ -68,14 +68,14 @@ public class InfraActiveRequestsRepositoryCustomController { instanceNameDuplicateCheckRequest.getRequestScope()); } - @RequestMapping(method = RequestMethod.POST, value = "/infraActiveRequests/v1/getInfraActiveRequests") + @PostMapping(value = "/infraActiveRequests/v1/getInfraActiveRequests") public List<InfraActiveRequests> getInfraActiveRequests(@RequestBody Map<String, String[]> filters, @RequestParam("from") long startTime, @RequestParam("to") long endTime, @RequestParam(value = "maxResult", required = false) Integer maxResult) { return infraActiveRequestsRepository.getInfraActiveRequests(filters, startTime, endTime, maxResult); } - @RequestMapping(method = RequestMethod.GET, value = "/infraActiveRequests/getInProgressVolumeGroupsAndVfModules") + @GetMapping(value = "/infraActiveRequests/getInProgressVolumeGroupsAndVfModules") public List<InfraActiveRequests> getInProgressVolumeGroupsAndVfModules() { return infraActiveRequestsRepository.getInProgressVolumeGroupsAndVfModules(); } diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/OrchestrationTaskRepositoryCustomController.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/OrchestrationTaskRepositoryCustomController.java index e32d90b137..29585b94eb 100644 --- a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/OrchestrationTaskRepositoryCustomController.java +++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/OrchestrationTaskRepositoryCustomController.java @@ -33,29 +33,29 @@ public class OrchestrationTaskRepositoryCustomController { @Autowired private OrchestrationTaskRepository orchestrationTaskRepository; - @RequestMapping(method = RequestMethod.GET, value = "/orchestrationTask") + @GetMapping(value = "/orchestrationTask") public List<OrchestrationTask> getAllOrchestrationTask() { return orchestrationTaskRepository.findAll(); } - @RequestMapping(method = RequestMethod.GET, value = "/orchestrationTask/{taskId}") + @GetMapping(value = "/orchestrationTask/{taskId}") public OrchestrationTask getOrchestrationTask(@PathVariable("taskId") String taskId) throws MsoRequestsDbException { return orchestrationTaskRepository.findById(taskId) .orElseThrow(() -> new MsoRequestsDbException("orchestration task not found: " + taskId)); } - @RequestMapping(method = RequestMethod.POST, value = "/orchestrationTask/") + @PostMapping(value = "/orchestrationTask/") public OrchestrationTask createOrchestrationTask(@RequestBody OrchestrationTask orchestrationTask) { return orchestrationTaskRepository.save(orchestrationTask); } - @RequestMapping(method = RequestMethod.PUT, value = "/orchestrationTask/{taskId}") + @PutMapping(value = "/orchestrationTask/{taskId}") public OrchestrationTask updateOrchestrationTask(@PathVariable("taskId") String taskId, @RequestBody OrchestrationTask orchestrationTask) throws MsoRequestsDbException { return orchestrationTaskRepository.save(orchestrationTask); } - @RequestMapping(method = RequestMethod.DELETE, value = "/orchestrationTask/{taskId}") + @DeleteMapping(value = "/orchestrationTask/{taskId}") public void deleteOrchestrationTask(@PathVariable("taskId") String taskId) { orchestrationTaskRepository.deleteById(taskId); } diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/util/OofInfraUtils.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/util/OofInfraUtils.java index f25d4b440a..5f0cab3da8 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/util/OofInfraUtils.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/util/OofInfraUtils.java @@ -52,7 +52,7 @@ public class OofInfraUtils { getCloudsite = Optional.ofNullable(client.getCloudSite(cloudSite.getId(), endpoint + "/cloudSite/")) .orElse(new CloudSite()); if (!cloudSite.getId().equals(getCloudsite.getId())) { - client.postCloudSite(cloudSite); + client.postOofHomingCloudSite(cloudSite); logger.debug("Did not findd cloudsite : {}", cloudSite.getId()); logger.debug("Will create cloudSite: {}", cloudSite.toString()); } else { diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCommunicationService.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCommunicationService.groovy index cf6bef6510..89c3ab7c8b 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCommunicationService.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCommunicationService.groovy @@ -383,7 +383,7 @@ class CreateCommunicationService extends AbstractServiceTaskProcessor { } e2eInputMap.put("sNSSAI", execution.getVariable("sNSSAI_id")) - + e2eInputMap.put("sST", execution.getVariable("csServiceType")) execution.setVariable("e2eInputMap", e2eInputMap) execution.setVariable("e2eServiceType", e2eServiceDecomposition.getServiceType()) execution.setVariable("e2eModelInvariantUuid", e2eServiceDecomposition.getModelInfo().getModelInvariantUuid()) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy index cc2d865957..4a8469cc8d 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy @@ -111,13 +111,11 @@ class DoAllocateNSIandNSSI extends org.onap.so.bpmn.common.scripts.AbstractServi } void updateRelationship(DelegateExecution execution) { - logger.trace("Enter update relationship in DoAllocateNSIandNSSI()") - String nsiServiceInstanceId = execution.getVariable("nsiServiceInstanceId") + logger.debug("Enter update relationship in DoAllocateNSIandNSSI()") String allottedResourceId = execution.getVariable("allottedResourceId") //Need to check whether nsi exist : Begin org.onap.aai.domain.yang.ServiceInstance nsiServiceInstance = new org.onap.aai.domain.yang.ServiceInstance() SliceTaskParams sliceParams = execution.getVariable("sliceParams") - String nsiServiceInstanceID = sliceParams.getSuggestNsiId() AAIResourcesClient resourceClient = new AAIResourcesClient() @@ -136,14 +134,8 @@ class DoAllocateNSIandNSSI extends org.onap.so.bpmn.common.scripts.AbstractServi // exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Service instance was not found in aai to " + // "associate for service :"+serviceInstanceId) // } - }catch(BpmnError e) { - throw e; - }catch (Exception ex){ - String msg = "NSI suggested in the option doesn't exist. " + nsiServiceInstanceID - logger.debug(msg) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) - } - AAIResourceUri allottedResourceUri = AAIUriFactory.createResourceUri(AAIObjectType.ALLOTTED_RESOURCE, execution.getVariable("globalSubscriberId"), execution.getVariable("serviceType"), nsiServiceInstanceId, allottedResourceId) + + AAIResourceUri allottedResourceUri = AAIUriFactory.createResourceUri(AAIObjectType.ALLOTTED_RESOURCE, execution.getVariable("globalSubscriberId"), execution.getVariable("subscriptionServiceType"), execution.getVariable("sliceServiceInstanceId"), allottedResourceId) getAAIClient().connect(allottedResourceUri,nsiServiceuri) List<String> nssiAssociated = new ArrayList<>() @@ -160,7 +152,14 @@ class DoAllocateNSIandNSSI extends org.onap.so.bpmn.common.scripts.AbstractServi } execution.setVariable("nssiAssociated",nssiAssociated) execution.setVariable("nsiServiceInstanceName",nsiServiceInstance.getServiceInstanceName()) - logger.trace("Exit update relationship in DoAllocateNSIandNSSI()") + }catch(BpmnError e) { + throw e + }catch (Exception ex){ + String msg = "NSI suggested in the option doesn't exist. " + nsiServiceInstanceID + logger.debug(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + logger.debug("Exit update relationship in DoAllocateNSIandNSSI()") } void prepareNssiModelInfo(DelegateExecution execution){ diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSSI.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSSI.groovy index 2d0034a34d..570b6a5ed7 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSSI.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSSI.groovy @@ -227,7 +227,7 @@ class DoAllocateNSSI extends org.onap.so.bpmn.common.scripts.AbstractServiceTask } void updateRelationship(DelegateExecution execution) { - logger.trace("Enter updateRelationship in DoAllocateNSSI()") + logger.debug("Enter updateRelationship in DoAllocateNSSI()") String nssiInstanceId = execution.getVariable("nssiInstanceId") String nsiInstanceId = execution.getVariable("nsiServiceInstanceId") try{ @@ -239,7 +239,7 @@ class DoAllocateNSSI extends org.onap.so.bpmn.common.scripts.AbstractServiceTask logger.info(msg) exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) } - logger.trace("Exit updateRelationship in DoAllocateNSSI()") + logger.debug("Exit updateRelationship in DoAllocateNSSI()") } diff --git a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InstanceNfvoMappingRepository.java b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InstanceNfvoMappingRepository.java index 2e2c0872b6..31346d4383 100644 --- a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InstanceNfvoMappingRepository.java +++ b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InstanceNfvoMappingRepository.java @@ -18,6 +18,7 @@ import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.repository.query.Param; import org.springframework.data.rest.core.annotation.RepositoryRestResource; + @RepositoryRestResource(collectionResourceRel = "instanceNfvoMapping", path = "instanceNfvoMapping") public interface InstanceNfvoMappingRepository extends JpaRepository<InstanceNfvoMapping, String> { diff --git a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/OperationalEnvServiceModelStatusRepository.java b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/OperationalEnvServiceModelStatusRepository.java index 65a7ca12cd..f0d717df3c 100644 --- a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/OperationalEnvServiceModelStatusRepository.java +++ b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/OperationalEnvServiceModelStatusRepository.java @@ -6,7 +6,7 @@ * ================================================================================ * 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 + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -24,11 +24,8 @@ import java.util.List; import org.onap.so.db.request.beans.OperationalEnvServiceModelStatus; import org.onap.so.db.request.beans.OperationalEnvServiceModelStatusId; import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.Modifying; -import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; import org.springframework.data.rest.core.annotation.RepositoryRestResource; -import org.springframework.transaction.annotation.Transactional; @RepositoryRestResource(collectionResourceRel = "operationalEnvServiceModelStatus", path = "operationalEnvServiceModelStatus") diff --git a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/ResourceOperationStatusRepository.java b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/ResourceOperationStatusRepository.java index 2ed2d7cb42..32e77cd598 100644 --- a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/ResourceOperationStatusRepository.java +++ b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/ResourceOperationStatusRepository.java @@ -25,7 +25,6 @@ import org.onap.so.db.request.beans.ResourceOperationStatus; import org.onap.so.db.request.beans.ResourceOperationStatusId; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.rest.core.annotation.RepositoryRestResource; -import org.springframework.stereotype.Repository; @RepositoryRestResource(collectionResourceRel = "resourceOperationStatus", path = "resourceOperationStatus") public interface ResourceOperationStatusRepository diff --git a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/SiteStatusRepository.java b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/SiteStatusRepository.java index ebae4a4cec..b67fe61c19 100644 --- a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/SiteStatusRepository.java +++ b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/SiteStatusRepository.java @@ -23,7 +23,6 @@ package org.onap.so.db.request.data.repository; import org.onap.so.db.request.beans.SiteStatus; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.rest.core.annotation.RepositoryRestResource; -import org.springframework.stereotype.Repository; @RepositoryRestResource(collectionResourceRel = "siteStatus", path = "siteStatus") public interface SiteStatusRepository extends JpaRepository<SiteStatus, String> { diff --git a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/WatchdogComponentDistributionStatusRepository.java b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/WatchdogComponentDistributionStatusRepository.java index 9a89cdf783..2e1a401838 100644 --- a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/WatchdogComponentDistributionStatusRepository.java +++ b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/WatchdogComponentDistributionStatusRepository.java @@ -25,7 +25,6 @@ import org.onap.so.db.request.beans.WatchdogComponentDistributionStatus; import org.onap.so.db.request.beans.WatchdogComponentDistributionStatusId; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.rest.core.annotation.RepositoryRestResource; -import org.springframework.stereotype.Repository; @RepositoryRestResource(collectionResourceRel = "watchdogComponentDistributionStatus", path = "watchdogComponentDistributionStatus") diff --git a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/WatchdogDistributionStatusRepository.java b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/WatchdogDistributionStatusRepository.java index 7dfd61f8d0..a4d42e336b 100644 --- a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/WatchdogDistributionStatusRepository.java +++ b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/WatchdogDistributionStatusRepository.java @@ -23,7 +23,6 @@ package org.onap.so.db.request.data.repository; import org.onap.so.db.request.beans.WatchdogDistributionStatus; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.rest.core.annotation.RepositoryRestResource; -import org.springframework.stereotype.Repository; @RepositoryRestResource(collectionResourceRel = "watchdogDistributionStatus", path = "watchdogDistributionStatus") public interface WatchdogDistributionStatusRepository extends JpaRepository<WatchdogDistributionStatus, String> { diff --git a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/WatchdogServiceModVerIdLookupRepository.java b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/WatchdogServiceModVerIdLookupRepository.java index cf36d0c6e6..029a3c5fff 100644 --- a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/WatchdogServiceModVerIdLookupRepository.java +++ b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/WatchdogServiceModVerIdLookupRepository.java @@ -24,7 +24,6 @@ import org.onap.so.db.request.beans.WatchdogServiceModVerIdLookup; import org.onap.so.db.request.beans.WatchdogServiceModVerIdLookupId; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.rest.core.annotation.RepositoryRestResource; -import org.springframework.stereotype.Repository; @RepositoryRestResource(collectionResourceRel = "watchdogServiceModVerIdLookup", path = "watchdogServiceModVerIdLookup") public interface WatchdogServiceModVerIdLookupRepository diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/OperationalEnvDistributionStatus.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/OperationalEnvDistributionStatus.java index b50be2e8be..9727ae2236 100644 --- a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/OperationalEnvDistributionStatus.java +++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/OperationalEnvDistributionStatus.java @@ -12,7 +12,7 @@ * * 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. + * 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========================================================= @@ -22,14 +22,9 @@ package org.onap.so.db.request.beans; import java.io.Serializable; import java.util.Date; -import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.JoinColumns; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; import javax.persistence.PrePersist; import javax.persistence.PreUpdate; import javax.persistence.Table; diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/SiteStatus.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/SiteStatus.java index da426aecef..70758b3860 100644 --- a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/SiteStatus.java +++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/SiteStatus.java @@ -20,8 +20,6 @@ package org.onap.so.db.request.beans; - -import java.time.format.DateTimeFormatter; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecCategories.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecCategories.java index 8f3f7a34b0..2474d5cb8c 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecCategories.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecCategories.java @@ -1,20 +1,16 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; -import java.util.List; import javax.persistence.Column; import javax.persistence.Entity; -import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; -import javax.persistence.OneToMany; import javax.persistence.Table; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; import com.openpojo.business.annotation.BusinessKey; -import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity @Table(name = "activity_spec_categories") diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CvnfcConfigurationCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CvnfcConfigurationCustomization.java index 33994bae8b..97518ec81b 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CvnfcConfigurationCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CvnfcConfigurationCustomization.java @@ -30,7 +30,6 @@ import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; -import javax.persistence.JoinColumns; import javax.persistence.ManyToOne; import javax.persistence.PrePersist; import javax.persistence.Table; diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CvnfcCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CvnfcCustomization.java index 9bf0cdd6a7..f5b5d7319d 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CvnfcCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CvnfcCustomization.java @@ -23,7 +23,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; import java.util.List; -import java.util.Set; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceProxyResourceCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceProxyResourceCustomization.java index d8be423f5a..60f6642823 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceProxyResourceCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceProxyResourceCustomization.java @@ -22,18 +22,12 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; -import java.util.List; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; -import javax.persistence.JoinTable; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; import javax.persistence.OneToOne; import javax.persistence.PrePersist; import javax.persistence.Table; diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfcInstanceGroupCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfcInstanceGroupCustomization.java index 8a00ccd261..0f760ac91a 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfcInstanceGroupCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfcInstanceGroupCustomization.java @@ -31,7 +31,6 @@ import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; -import javax.persistence.IdClass; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.OneToMany; diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java index a68ed44ee7..8d342b673d 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java @@ -797,6 +797,11 @@ public class CatalogDbClient { return this.getSingleResource(cloudSiteClient, getUri(uri + id)); } + // Bring back old version of methind since the caller - OofInfraUtils.java - is not running in a spring context + public void postOofHomingCloudSite(CloudSite cloudSite) { + this.postSingleResource(cloudSiteClient, cloudSite); + } + public CloudSite postCloudSite(CloudSite cloudSite) { if (cloudSite == null) { throw new EntityNotFoundException("CloudSite passed as null"); |