summaryrefslogtreecommitdiffstats
path: root/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest
diff options
context:
space:
mode:
authorvasraz <vasyl.razinkov@est.tech>2021-03-22 15:33:06 +0000
committerChristophe Closset <christophe.closset@intl.att.com>2021-03-24 06:59:47 +0000
commitd378c37fbd1ecec7b43394926f1ca32a695e07de (patch)
tree5c8a085f8732f980d871d966ac49361644efa698 /openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest
parenta6ae7294ecd336d7e88f915710b08e2658eaee00 (diff)
Reformat openecomp-be
Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech> Issue-ID: SDC-3449 Change-Id: I13e02322f8e00820cc5a1d85752caaeda9bf10d1
Diffstat (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest')
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentDependencies.java108
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentMonitoringUploads.java88
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentProcesses.java201
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Components.java156
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Compute.java169
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/DeploymentFlavors.java122
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Images.java214
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Networks.java100
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Nics.java160
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/OrchestrationTemplateCandidate.java119
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Processes.java178
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VendorSoftwareProducts.java278
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VendorSoftwareProductsForSwaggerFileUpload.java48
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VspEntities.java1
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDataToComponentDto.java15
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDependencyEntityToCreationDto.java18
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDependencyEntityToDto.java23
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDependencyModelEntityToDto.java21
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDependencyModelRequestToEntity.java31
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentEntityToComponentCreationDto.java17
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentEntityToComponentDto.java20
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentRequestDtoToComponentEntity.java21
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapCompositionEntityResponseToDto.java36
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapCompositionEntityValidationDataToDto.java33
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComputeDataToComputeDetailsDto.java16
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComputeDetailsDtoToComputeEntity.java14
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComputeEntityToComputeCreationDto.java17
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComputeEntityToComputeDto.java25
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComputeEntityToVspComputeDto.java23
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapDeploymentFlavorEntityDeploymentFlavorToListResponse.java26
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapDeploymentFlavorEntityToDeploymentFlavorCreationDto.java18
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapDeploymentFlavorEntityToDeploymentFlavorDto.java13
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapDeploymentFlavorRequestDtoToDeploymentFlavorEntity.java26
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapDeploymentFlavorToDeploymentDto.java21
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapFilesDataStructureToDto.java22
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapImageDataToImageDto.java22
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapImageEntityToImageCreationDto.java16
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapImageEntityToImageDto.java21
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapImageRequestDtoToImageEntity.java16
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapItemToVspDetailsDto.java28
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapMonitoringUploadStatusToDto.java21
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkEntityToNetworkDto.java20
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkRequestDtoToNetworkEntity.java23
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkToNetworkDto.java16
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicEntityToNicCreationResponseDto.java18
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicEntityToNicDto.java20
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicRequestDtoToNicEntity.java26
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicToNicDto.java26
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapPackageInfoToPackageInfoDto.java34
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapProcessEntityToProcessEntityDto.java25
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapProcessRequestDtoToProcessEntity.java21
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapQuestionnaireResponseToQuestionnaireResponseDto.java20
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapQuestionnaireToQuestionnaireDto.java21
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapUploadFileResponseToUploadFileResponseDto.java24
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapValidationResponseToDto.java92
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDescriptionDtoToItem.java20
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDescriptionDtoToVspDetails.java47
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDetailsToDto.java51
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentDependenciesImpl.java146
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentMonitoringUploadsImpl.java121
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentProcessesImpl.java247
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentsImpl.java180
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComputeImpl.java213
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/DeploymentFlavorsImpl.java163
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ImagesImpl.java210
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/NetworksImpl.java131
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/NicsImpl.java206
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/OrchestrationTemplateCandidateException.java4
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/OrchestrationTemplateCandidateImpl.java255
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ProcessesImpl.java95
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VendorSoftwareProductsImpl.java412
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VspItemProperty.java11
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VspUniqueTypeProvider.java16
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentCreationDto.java30
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDependencyCreationDto.java30
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDependencyModel.java29
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDependencyModelRequestDto.java34
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDependencyResponseDto.java30
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDto.java30
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentRelationType.java34
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentRequestDto.java33
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentValidationResultDto.java34
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionDataEntityDto.java2
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionEntityResponseDto.java30
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionEntityValidationDataDto.java33
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComputeCreationDto.java30
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComputeDescription.java30
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComputeDetailsDto.java34
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComputeDto.java30
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/DeploymentFlavorCreationDto.java30
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/DeploymentFlavorDto.java30
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/DeploymentFlavorListResponseDto.java30
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/DeploymentFlavorRequestDto.java37
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/DeploymentFlavorValidationResultDto.java34
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/FileDataStructureDto.java34
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ImageCreationDto.java30
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ImageDto.java30
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ImageRequestDto.java30
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/MonitoringUploadStatusDto.java31
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NetworkDto.java30
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NetworkRequestDto.java33
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NicCreationResponseDto.java30
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NicDto.java30
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NicRequestDto.java36
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/OrchestrationTemplateAction.java33
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/OrchestrationTemplateActionResponseDto.java35
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/PackageInfoDto.java30
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ProcessEntityDto.java30
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ProcessRequestDto.java33
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/QuestionnaireDto.java34
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/QuestionnaireResponseDto.java31
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/QuestionnaireValidationResultDto.java34
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/TranslatedFileDataDto.java30
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/UploadFileResponseDto.java36
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ValidationResponseDto.java38
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VendorSoftwareProductAction.java34
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VersionSoftwareProductActionRequestDto.java31
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VmSizing.java42
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspComputeDto.java30
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspDescriptionDto.java34
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspDetailsDto.java46
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspRequestDto.java34
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/CustomJsonValidator.java25
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/IsValidJson.java68
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/StringValidator.java52
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/ValidateString.java49
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vnf-repository-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VnfPackageRepository.java47
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vnf-repository-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VnfPackageRepositoryImpl.java68
128 files changed, 3312 insertions, 3996 deletions
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentDependencies.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentDependencies.java
index bfeb476836..732167937d 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentDependencies.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentDependencies.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,30 +17,35 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest;
+import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
+import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.tags.Tags;
-import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDependencyModel;
-import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDependencyResponseDto;
-import org.springframework.validation.annotation.Validated;
-
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
-import javax.ws.rs.*;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-
-import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
-import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDependencyModel;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDependencyResponseDto;
+import org.springframework.validation.annotation.Validated;
@Path("/v1.0/vendor-software-products/{vspId}/versions/{versionId}/component-dependencies")
@Produces(MediaType.APPLICATION_JSON)
@@ -49,54 +54,41 @@ import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG
@Validated
public interface ComponentDependencies extends VspEntities {
- @POST
- @Path("/")
- @Operation( description= "Create a vendor software product component dependency")
- Response create(@Valid ComponentDependencyModel request,
- @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @POST
+ @Path("/")
+ @Operation(description = "Create a vendor software product component dependency")
+ Response create(@Valid ComponentDependencyModel request, @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @GET
- @Path("/")
- @Operation(description = "Get component dependencies for vendor software product", responses = @ApiResponse(content = @Content(array = @ArraySchema( schema = @Schema(implementation = ComponentDependencyResponseDto.class)))))
- Response list(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Vendor software product version Id") @PathParam("versionId")
- String versionId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @GET
+ @Path("/")
+ @Operation(description = "Get component dependencies for vendor software product", responses = @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = ComponentDependencyResponseDto.class)))))
+ Response list(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @DELETE
- @Path("/{dependencyId}")
- @Operation(description = "Delete component dependency for vendor software product")
- Response delete(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Vendor software product version Id")
- @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product Component Dependency Id") @PathParam
- ("dependencyId") String dependencyId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @DELETE
+ @Path("/{dependencyId}")
+ @Operation(description = "Delete component dependency for vendor software product")
+ Response delete(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product Component Dependency Id") @PathParam("dependencyId") String dependencyId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @PUT
- @Path("/{dependencyId}")
- @Operation(description = "Update component dependency for vendor software product")
- Response update(@Valid ComponentDependencyModel request,
- @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Vendor software product version Id") @PathParam("versionId")
- String versionId,
- @Parameter(description = "Vendor software product Component Dependency Id") @PathParam
- ("dependencyId") String dependencyId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @PUT
+ @Path("/{dependencyId}")
+ @Operation(description = "Update component dependency for vendor software product")
+ Response update(@Valid ComponentDependencyModel request, @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product Component Dependency Id") @PathParam("dependencyId") String dependencyId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @GET
- @Path("/{dependencyId}")
- @Operation(description = "Get component dependency for vendor software product", responses = @ApiResponse(content = @Content(schema = @Schema(implementation =ComponentDependencyResponseDto.class))))
- Response get(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product Component Dependency Id") @PathParam
- ("dependencyId") String dependencyId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @GET
+ @Path("/{dependencyId}")
+ @Operation(description = "Get component dependency for vendor software product", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = ComponentDependencyResponseDto.class))))
+ Response get(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product Component Dependency Id") @PathParam("dependencyId") String dependencyId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentMonitoringUploads.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentMonitoringUploads.java
index f575991456..1a34bfc47c 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentMonitoringUploads.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentMonitoringUploads.java
@@ -17,73 +17,67 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest;
+import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
+import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.tags.Tags;
+import javax.validation.constraints.NotNull;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
import org.apache.cxf.jaxrs.ext.multipart.Attachment;
import org.apache.cxf.jaxrs.ext.multipart.Multipart;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.MonitoringUploadStatusDto;
import org.springframework.validation.annotation.Validated;
-import javax.validation.constraints.NotNull;
-import javax.ws.rs.*;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
-import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
-
-@Path(
- "/v1.0/vendor-software-products/{vspId}/versions/{versionId}/components/{componentId}/uploads/")
+@Path("/v1.0/vendor-software-products/{vspId}/versions/{versionId}/components/{componentId}/uploads/")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Tags({@Tag(name = "SDCE-1 APIs"), @Tag(name = "Vendor Software Product Component Uploads")})
@Validated
public interface ComponentMonitoringUploads extends VspEntities {
- @POST
- @Path("types/{type}/")
- @Consumes(MediaType.MULTIPART_FORM_DATA)
- @Operation(description = "Upload file for component by type")
- Response upload(@Multipart("upload") Attachment attachment,
- @Parameter(description = "Vendor software product Id") @PathParam("vspId")
- String vspId,
- @Parameter(description = "Vendor software product version Id")
- @PathParam("versionId") String versionId,
- @Parameter(description = "Component Id") @PathParam("componentId") String
- componentId,
- @Parameter(description = "Upload Type") @PathParam("type") String type,
- @NotNull(message = USER_MISSING_ERROR_MSG)
- @HeaderParam(USER_ID_HEADER_PARAM) String user) throws Exception;
- @DELETE
- @Path("types/{type}")
- @Operation(description = "Delete file uploaded for component")
- Response delete(
- @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Vendor software product version Id") @PathParam("versionId")
- String versionId,
- @Parameter(description = "Component Id") @PathParam("componentId") String componentId,
- @Parameter(description = "Upload Type") @PathParam("type") String type,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user)
- throws Exception;
+ @POST
+ @Path("types/{type}/")
+ @Consumes(MediaType.MULTIPART_FORM_DATA)
+ @Operation(description = "Upload file for component by type")
+ Response upload(@Multipart("upload") Attachment attachment,
+ @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Component Id") @PathParam("componentId") String componentId,
+ @Parameter(description = "Upload Type") @PathParam("type") String type,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user) throws Exception;
+
+ @DELETE
+ @Path("types/{type}")
+ @Operation(description = "Delete file uploaded for component")
+ Response delete(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Component Id") @PathParam("componentId") String componentId,
+ @Parameter(description = "Upload Type") @PathParam("type") String type,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user) throws Exception;
- @GET
- @Path("")
- @Operation(description = "Get the filenames of uploaded files by type", responses = @ApiResponse(content = @Content(array = @ArraySchema( schema = @Schema(implementation =MonitoringUploadStatusDto.class)))))
- Response list(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Vendor software product version Id") @PathParam("versionId")
- String versionId,
- @Parameter(description = "Vendor software product component Id") @PathParam("componentId")
- String componentId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @GET
+ @Path("")
+ @Operation(description = "Get the filenames of uploaded files by type", responses = @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = MonitoringUploadStatusDto.class)))))
+ Response list(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product component Id") @PathParam("componentId") String componentId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentProcesses.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentProcesses.java
index b5907d5d30..3289238eb5 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentProcesses.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentProcesses.java
@@ -17,145 +17,124 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest;
+import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
+import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.tags.Tags;
+import java.util.List;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
import org.apache.cxf.jaxrs.ext.multipart.Attachment;
import org.apache.cxf.jaxrs.ext.multipart.Multipart;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ProcessEntityDto;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ProcessRequestDto;
import org.springframework.validation.annotation.Validated;
-import javax.validation.Valid;
-import javax.validation.constraints.NotNull;
-import javax.ws.rs.*;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import java.util.List;
-
-import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
-import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
-
@Path("/v1.0/vendor-software-products/{vspId}/versions/{versionId}/components/{componentId}/processes")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Tags({@Tag(name = "SDCE-1 APIs"), @Tag(name = "Vendor Software Product Component Processes")})
@Validated
public interface ComponentProcesses extends VspEntities {
- @GET
- @Path("/")
- @Operation(description = "List vendor software product component processes", responses = @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = ProcessEntityDto.class)))))
- Response list(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product component Id") @PathParam("componentId")
- String componentId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
-
- @DELETE
- @Path("/")
- @Operation(description = "Delete vendor software product processes",responses = @ApiResponse(content = @Content(schema = @Schema(implementation = List.class))))
- Response deleteList(
- @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product component Id") @PathParam("componentId")
- String componentId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @POST
- @Path("/")
- @Operation(description = "Create a vendor software product process")
- Response create(@Valid ProcessRequestDto request,
- @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @GET
+ @Path("/")
+ @Operation(description = "List vendor software product component processes", responses = @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = ProcessEntityDto.class)))))
+ Response list(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
@Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product component Id")
- @PathParam("componentId") String componentId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @Parameter(description = "Vendor software product component Id") @PathParam("componentId") String componentId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @GET
- @Path("/{processId}")
- @Operation(description = "Get vendor software product process",responses = @ApiResponse(content = @Content(schema = @Schema(implementation = ProcessEntityDto.class))))
- Response get(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product component Id") @PathParam("componentId")
- String componentId,
- @Parameter(description = "Vendor software product process Id") @PathParam("processId")
- String processId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @DELETE
+ @Path("/")
+ @Operation(description = "Delete vendor software product processes", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = List.class))))
+ Response deleteList(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product component Id") @PathParam("componentId") String componentId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @DELETE
- @Path("/{processId}")
- @Operation(description = "Delete vendor software product process")
- Response delete(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product component Id")
- @PathParam("componentId") String componentId,
- @Parameter(description = "Vendor software product process Id") @PathParam("processId")
- String processId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @POST
+ @Path("/")
+ @Operation(description = "Create a vendor software product process")
+ Response create(@Valid ProcessRequestDto request, @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product component Id") @PathParam("componentId") String componentId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @PUT
- @Path("/{processId}")
- @Operation(description = "Update vendor software product process")
- Response update(@Valid ProcessRequestDto request,
- @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product component Id")
- @PathParam("componentId") String componentId,
- @Parameter(description = "Vendor software product process Id") @PathParam("processId")
- String processId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @GET
+ @Path("/{processId}")
+ @Operation(description = "Get vendor software product process", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = ProcessEntityDto.class))))
+ Response get(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product component Id") @PathParam("componentId") String componentId,
+ @Parameter(description = "Vendor software product process Id") @PathParam("processId") String processId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
+
+ @DELETE
+ @Path("/{processId}")
+ @Operation(description = "Delete vendor software product process")
+ Response delete(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product component Id") @PathParam("componentId") String componentId,
+ @Parameter(description = "Vendor software product process Id") @PathParam("processId") String processId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
+
+ @PUT
+ @Path("/{processId}")
+ @Operation(description = "Update vendor software product process")
+ Response update(@Valid ProcessRequestDto request, @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product component Id") @PathParam("componentId") String componentId,
+ @Parameter(description = "Vendor software product process Id") @PathParam("processId") String processId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @GET
- @Path("/{processId}/upload")
- @Produces(MediaType.APPLICATION_OCTET_STREAM)
- @Operation(description = "Get vendor software product process uploaded file")
- Response getUploadedFile(
- @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product component Id") @PathParam("componentId")
- String componentId,
- @Parameter(description = "Vendor software product process Id") @PathParam("processId")
- String processId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
+ @GET
+ @Path("/{processId}/upload")
+ @Produces(MediaType.APPLICATION_OCTET_STREAM)
+ @Operation(description = "Get vendor software product process uploaded file")
+ Response getUploadedFile(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product component Id") @PathParam("componentId") String componentId,
+ @Parameter(description = "Vendor software product process Id") @PathParam("processId") String processId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @DELETE
- @Path("/{processId}/upload")
- @Operation(description = "Delete vendor software product process uploaded file")
- Response deleteUploadedFile(
- @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product component Id") @PathParam("componentId")
- String componentId,
- @Parameter(description = "Vendor software product process Id") @PathParam("processId")
- String processId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
+ @DELETE
+ @Path("/{processId}/upload")
+ @Operation(description = "Delete vendor software product process uploaded file")
+ Response deleteUploadedFile(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product component Id") @PathParam("componentId") String componentId,
+ @Parameter(description = "Vendor software product process Id") @PathParam("processId") String processId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @POST
- @Path("/{processId}/upload")
- @Consumes(MediaType.MULTIPART_FORM_DATA)
- @Operation(description = "Update vendor software product process upload")
- Response uploadFile(@Multipart("upload") Attachment attachment,
- @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product component Id")
- @PathParam("componentId") String componentId,
- @Parameter(description = "Vendor software product process Id")
- @PathParam("processId") String processId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @POST
+ @Path("/{processId}/upload")
+ @Consumes(MediaType.MULTIPART_FORM_DATA)
+ @Operation(description = "Update vendor software product process upload")
+ Response uploadFile(@Multipart("upload") Attachment attachment,
+ @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product component Id") @PathParam("componentId") String componentId,
+ @Parameter(description = "Vendor software product process Id") @PathParam("processId") String processId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Components.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Components.java
index fa0ecbdcbe..ccad46bb3e 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Components.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Components.java
@@ -17,18 +17,33 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest;
+import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
+import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.tags.Tags;
+import java.util.List;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDto;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentRequestDto;
@@ -36,99 +51,72 @@ import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireResponse
import org.openecomp.sdcrests.vendorsoftwareproducts.types.validation.IsValidJson;
import org.springframework.validation.annotation.Validated;
-import javax.validation.Valid;
-import javax.validation.constraints.NotNull;
-import javax.ws.rs.*;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import java.util.List;
-
-import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
-import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
-
@Path("/v1.0/vendor-software-products/{vspId}/versions/{versionId}/components")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Tags({@Tag(name = "SDCE-1 APIs"), @Tag(name = "Vendor Software Product Components")})
@Validated
public interface Components extends VspEntities {
- @GET
- @Path("/")
- @Operation(description = "List vendor software product components", responses = @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = ComponentDto.class)))))
- Response list(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
-
- @DELETE
- @Path("/")
- @Operation(description = "Delete vendor software product components", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = List.class))))
- Response deleteList(
- @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @POST
- @Path("/")
- @Operation(description = "Create a vendor software product component")
- Response create(@Valid ComponentRequestDto request,
- @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @GET
+ @Path("/")
+ @Operation(description = "List vendor software product components", responses = @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = ComponentDto.class)))))
+ Response list(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
@Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @GET
- @Path("/{componentId}")
- @Operation(description = "Get vendor software product component", responses = @ApiResponse(content = @Content(schema = @Schema(implementation =ComponentData.class))))
- Response get(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product component Id")
- @PathParam("componentId") String componentId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @DELETE
+ @Path("/")
+ @Operation(description = "Delete vendor software product components", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = List.class))))
+ Response deleteList(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @DELETE
- @Path("/{componentId}")
- @Operation(description = "Delete vendor software product component")
- Response delete(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product component Id")
- @PathParam("componentId") String componentId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @POST
+ @Path("/")
+ @Operation(description = "Create a vendor software product component")
+ Response create(@Valid ComponentRequestDto request, @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @PUT
- @Path("/{componentId}")
- @Operation(description = "Update vendor software product component")
- Response update(@Valid ComponentRequestDto request,
- @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product component Id")
- @PathParam("componentId") String componentId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @GET
+ @Path("/{componentId}")
+ @Operation(description = "Get vendor software product component", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = ComponentData.class))))
+ Response get(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product component Id") @PathParam("componentId") String componentId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
+
+ @DELETE
+ @Path("/{componentId}")
+ @Operation(description = "Delete vendor software product component")
+ Response delete(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product component Id") @PathParam("componentId") String componentId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
+
+ @PUT
+ @Path("/{componentId}")
+ @Operation(description = "Update vendor software product component")
+ Response update(@Valid ComponentRequestDto request, @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product component Id") @PathParam("componentId") String componentId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @GET
- @Path("/{componentId}/questionnaire")
- @Operation(description = "Get vendor software product component questionnaire",responses = @ApiResponse(content = @Content(schema = @Schema(implementation =QuestionnaireResponseDto.class))))
- Response getQuestionnaire(
- @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product component Id")
- @PathParam("componentId") String componentId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
+ @GET
+ @Path("/{componentId}/questionnaire")
+ @Operation(description = "Get vendor software product component questionnaire", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = QuestionnaireResponseDto.class))))
+ Response getQuestionnaire(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product component Id") @PathParam("componentId") String componentId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @PUT
- @Path("/{componentId}/questionnaire")
- @Operation(description = "Update vendor software product component questionnaire")
- Response updateQuestionnaire(@NotNull @IsValidJson String questionnaireData,
- @Parameter(description = "Vendor software product Id") @PathParam("vspId")
- String vspId,
- @Parameter(description = "Version Id") @PathParam("versionId")
- String versionId,
- @Parameter(description = "Vendor software product component Id")
- @PathParam("componentId") String componentId,
- @NotNull(message = USER_MISSING_ERROR_MSG)
- @HeaderParam(USER_ID_HEADER_PARAM) String user);
+ @PUT
+ @Path("/{componentId}/questionnaire")
+ @Operation(description = "Update vendor software product component questionnaire")
+ Response updateQuestionnaire(@NotNull @IsValidJson String questionnaireData,
+ @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product component Id") @PathParam("componentId") String componentId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Compute.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Compute.java
index ded4327dd2..666fad5ea3 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Compute.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Compute.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,125 +17,104 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest;
+import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
+import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.tags.Tags;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComputeDetailsDto;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComputeDto;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireResponseDto;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.validation.IsValidJson;
import org.springframework.validation.annotation.Validated;
-import javax.validation.Valid;
-import javax.validation.constraints.NotNull;
-import javax.ws.rs.*;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
-import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
-
-@Path("/v1.0/vendor-software-products/{vspId}/versions/{versionId}/components/{componentId" +
- "}/compute-flavors")
+@Path("/v1.0/vendor-software-products/{vspId}/versions/{versionId}/components/{componentId" + "}/compute-flavors")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Tags({@Tag(name = "SDCE-1 APIs"), @Tag(name = "Vendor Software Product Component Compute-flavors")})
@Validated
public interface Compute extends VspEntities {
- @GET
- @Path("/")
- @Operation(description = "Get list of vendor software product component compute-flavors", responses = @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation =ComputeDto.class)))))
- Response list(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product component Id") @PathParam("componentId")
- String componentId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @GET
+ @Path("/")
+ @Operation(description = "Get list of vendor software product component compute-flavors", responses = @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = ComputeDto.class)))))
+ Response list(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product component Id") @PathParam("componentId") String componentId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @GET
- @Path("/{computeFlavorId}")
- @Operation(description = "Get vendor software product component compute-flavor", responses = @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation =ComputeDetailsDto.class)))))
- Response get(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product component Id") @PathParam("componentId")
- String componentId,
- @Parameter(description = "Vendor software product compute-flavor Id") @PathParam
- ("computeFlavorId")
- String computeId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @GET
+ @Path("/{computeFlavorId}")
+ @Operation(description = "Get vendor software product component compute-flavor", responses = @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = ComputeDetailsDto.class)))))
+ Response get(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product component Id") @PathParam("componentId") String componentId,
+ @Parameter(description = "Vendor software product compute-flavor Id") @PathParam("computeFlavorId") String computeId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @POST
- @Path("/")
- @Operation(description = "Create a vendor software product component compute-flavor")
- Response create(@Valid ComputeDetailsDto request,
- @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product component Id")
- @PathParam("componentId") String componentId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @POST
+ @Path("/")
+ @Operation(description = "Create a vendor software product component compute-flavor")
+ Response create(@Valid ComputeDetailsDto request, @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product component Id") @PathParam("componentId") String componentId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @PUT
- @Path("/{computeFlavorId}")
- @Operation(description = "Update vendor software product component compute-flavor")
- Response update(@Valid ComputeDetailsDto request,
- @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product component Id")
- @PathParam("componentId") String componentId,
- @Parameter(description = "Vendor software product compute-flavor Id") @PathParam
- ("computeFlavorId")
- String computeFlavorId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @PUT
+ @Path("/{computeFlavorId}")
+ @Operation(description = "Update vendor software product component compute-flavor")
+ Response update(@Valid ComputeDetailsDto request, @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product component Id") @PathParam("componentId") String componentId,
+ @Parameter(description = "Vendor software product compute-flavor Id") @PathParam("computeFlavorId") String computeFlavorId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @PUT
- @Path("/{computeFlavorId}/questionnaire")
- @Operation(description = "Update vendor software product component compute-flavor questionnaire")
- Response updateQuestionnaire(@NotNull @IsValidJson String questionnaireData,
- @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product component Id")
- @PathParam("componentId") String componentId,
- @Parameter(description = "Vendor software product compute-flavor Id") @PathParam
- ("computeFlavorId")
- String computeFlavorId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @PUT
+ @Path("/{computeFlavorId}/questionnaire")
+ @Operation(description = "Update vendor software product component compute-flavor questionnaire")
+ Response updateQuestionnaire(@NotNull @IsValidJson String questionnaireData,
+ @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product component Id") @PathParam("componentId") String componentId,
+ @Parameter(description = "Vendor software product compute-flavor Id") @PathParam("computeFlavorId") String computeFlavorId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @DELETE
- @Path("/{computeFlavorId}")
- @Operation(description = "Delete vendor software product component compute-flavor")
- Response delete(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product component Id")
- @PathParam("componentId") String componentId,
- @Parameter(description = "Vendor software product compute-flavor Id") @PathParam
- ("computeFlavorId")
- String computeFlavorId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @DELETE
+ @Path("/{computeFlavorId}")
+ @Operation(description = "Delete vendor software product component compute-flavor")
+ Response delete(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product component Id") @PathParam("componentId") String componentId,
+ @Parameter(description = "Vendor software product compute-flavor Id") @PathParam("computeFlavorId") String computeFlavorId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @GET
- @Path("/{computeFlavorId}/questionnaire")
- @Operation(description = "Get vendor software product component compute-flavor questionnaire", responses = @ApiResponse(content = @Content(schema = @Schema(implementation =QuestionnaireResponseDto.class))))
- Response getQuestionnaire(
- @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product component Id") @PathParam("componentId")
- String componentId,
- @Parameter(description = "Vendor software product compute-flavor Id") @PathParam
- ("computeFlavorId") String computeId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
+ @GET
+ @Path("/{computeFlavorId}/questionnaire")
+ @Operation(description = "Get vendor software product component compute-flavor questionnaire", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = QuestionnaireResponseDto.class))))
+ Response getQuestionnaire(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product component Id") @PathParam("componentId") String componentId,
+ @Parameter(description = "Vendor software product compute-flavor Id") @PathParam("computeFlavorId") String computeId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/DeploymentFlavors.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/DeploymentFlavors.java
index 7d74044645..4312b10ab3 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/DeploymentFlavors.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/DeploymentFlavors.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,32 +17,36 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest;
+import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
+import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.tags.Tags;
-import org.openecomp.sdcrests.vendorsoftwareproducts.types.DeploymentFlavorDto;
-import org.openecomp.sdcrests.vendorsoftwareproducts.types.DeploymentFlavorListResponseDto;
-import org.openecomp.sdcrests.vendorsoftwareproducts.types.DeploymentFlavorRequestDto;
-import org.springframework.validation.annotation.Validated;
-
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
-import javax.ws.rs.*;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-
-import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
-import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
-
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.DeploymentFlavorDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.DeploymentFlavorListResponseDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.DeploymentFlavorRequestDto;
+import org.springframework.validation.annotation.Validated;
@Path("/v1.0/vendor-software-products/{vspId}/versions/{versionId}/deployment-flavors")
@Produces(MediaType.APPLICATION_JSON)
@@ -51,59 +55,49 @@ import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG
@Validated
public interface DeploymentFlavors extends VspEntities {
- @POST
- @Path("/")
- @Operation(description = "Create a vendor software product Deployment Flavor")
- Response create(@Valid DeploymentFlavorRequestDto request,
- @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @POST
+ @Path("/")
+ @Operation(description = "Create a vendor software product Deployment Flavor")
+ Response create(@Valid DeploymentFlavorRequestDto request,
+ @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
+
+ @GET
+ @Path("/")
+ @Operation(description = "List vendor software product Deployment Flavor", responses = @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = DeploymentFlavorListResponseDto.class)))))
+ Response list(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
@Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @GET
- @Path("/")
- @Operation(description = "List vendor software product Deployment Flavor", responses = @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = DeploymentFlavorListResponseDto.class)))))
- Response list(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @GET
+ @Path("/{deploymentFlavorId}")
+ @Operation(description = "Get vendor software product Deployment Flavor", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = DeploymentFlavorDto.class))))
+ Response get(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product Deployment Flavor Id") @PathParam("deploymentFlavorId") String deploymentFlavorId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @GET
- @Path("/{deploymentFlavorId}")
- @Operation(description = "Get vendor software product Deployment Flavor",responses = @ApiResponse(content = @Content(schema = @Schema(implementation = DeploymentFlavorDto.class))))
- Response get(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product Deployment Flavor Id") @PathParam
- ("deploymentFlavorId") String deploymentFlavorId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @GET
+ @Path("/schema")
+ Response getSchema(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @PathParam("versionId") String versionId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @GET
- @Path("/schema")
- Response getSchema(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String
- vspId,
- @PathParam("versionId") String versionId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @DELETE
+ @Path("/{deploymentFlavorId}")
+ @Operation(description = "Delete vendor software product Deployment Flavor")
+ Response delete(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product Deployment Flavor Id") @PathParam("deploymentFlavorId") String deploymentFlavorId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @DELETE
- @Path("/{deploymentFlavorId}")
- @Operation(description = "Delete vendor software product Deployment Flavor")
- Response delete(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product Deployment Flavor Id")
- @PathParam("deploymentFlavorId") String deploymentFlavorId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
-
- @PUT
- @Path("/{deploymentFlavorId}")
- @Operation(description = "Update vendor software product Deployment Flavor")
- Response update(@Valid DeploymentFlavorRequestDto request,
- @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product Deployment Flavor Id")
- @PathParam("deploymentFlavorId") String deploymentFlavorId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @PUT
+ @Path("/{deploymentFlavorId}")
+ @Operation(description = "Update vendor software product Deployment Flavor")
+ Response update(@Valid DeploymentFlavorRequestDto request,
+ @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product Deployment Flavor Id") @PathParam("deploymentFlavorId") String deploymentFlavorId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Images.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Images.java
index 49a25ed273..f480405e45 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Images.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Images.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,33 +17,38 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest;
+import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
+import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.tags.Tags;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ImageDto;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ImageRequestDto;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireResponseDto;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.validation.IsValidJson;
import org.springframework.validation.annotation.Validated;
-import javax.validation.Valid;
-import javax.validation.constraints.NotNull;
-import javax.ws.rs.*;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
-import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
-
@Path("/v1.0/vendor-software-products/{vspId}/versions/{versionId}/components/{componentId}/images")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@@ -51,117 +56,90 @@ import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG
@Validated
public interface Images extends VspEntities {
- @GET
- @Path("/")
- @Operation(description = "List vendor software product component images",responses = @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = ImageDto.class)))))
- Response list(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product component Id") @PathParam("componentId")
- String componentId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
-
- @POST
- @Path("/")
- @Operation(description = "Create a vendor software product component image")
- Response create(@Valid ImageRequestDto request,
- @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @GET
+ @Path("/")
+ @Operation(description = "List vendor software product component images", responses = @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = ImageDto.class)))))
+ Response list(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
@Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product component Id")
- @PathParam("componentId") String componentId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @Parameter(description = "Vendor software product component Id") @PathParam("componentId") String componentId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @GET
- @Path("/schema")
- //@Operation(description = "Get schema for vendor software product component Image" ,
- // response = QuestionnaireResponseDto.class)
- Response getImageSchema(@Parameter(description = "Vendor software product Id") @PathParam("vspId")
- String vspId,
- @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product component Id")
- @PathParam("componentId") String componentId,@NotNull
- (message = USER_MISSING_ERROR_MSG) @HeaderParam
- (USER_ID_HEADER_PARAM) String user);
+ @POST
+ @Path("/")
+ @Operation(description = "Create a vendor software product component image")
+ Response create(@Valid ImageRequestDto request, @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product component Id") @PathParam("componentId") String componentId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- /*@GET
- @Path("/{imageId}")
- @Operation(description = "Get vendor software product component Image",
- response = ImageDto.class,
- responseContainer = "ImageEntityResponse")
- Response get(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Vendor software product component Id") @PathParam("componentId")
- String componentId,
- @Parameter(description = "Vendor software product image Id") @PathParam("imageId")
- String imageId,
- @Pattern(regexp = Version.VERSION_REGEX,
- message = Version.VERSION_STRING_VIOLATION_MSG) @QueryParam("version")
- String version,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);*/
+ @GET
+ @Path("/schema")
+ //@Operation(description = "Get schema for vendor software product component Image" ,
- @GET
- @Path("/{imageId}")
- @Operation(description = "Get vendor software product component Image",responses = @ApiResponse(content = @Content(schema = @Schema(implementation = ImageDto.class))))
- Response get(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product component Id") @PathParam("componentId")
- String componentId,
- @Parameter(description = "Vendor software product Image Id") @PathParam
- ("imageId")
- String imageId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ // response = QuestionnaireResponseDto.class)
+ Response getImageSchema(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product component Id") @PathParam("componentId") String componentId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @DELETE
- @Path("/{imageId}")
- @Operation(description = "Delete vendor software product Image")
- Response delete(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product component Id")
- @PathParam("componentId") String componentId,
- @Parameter(description = "Vendor software product Image Id") @PathParam("imageId")
- String imageId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ /*@GET
+ @Path("/{imageId}")
+ @Operation(description = "Get vendor software product component Image",
+ response = ImageDto.class,
+ responseContainer = "ImageEntityResponse")
+ Response get(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Vendor software product component Id") @PathParam("componentId")
+ String componentId,
+ @Parameter(description = "Vendor software product image Id") @PathParam("imageId")
+ String imageId,
+ @Pattern(regexp = Version.VERSION_REGEX,
+ message = Version.VERSION_STRING_VIOLATION_MSG) @QueryParam("version")
+ String version,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
+ String user);*/
+ @GET
+ @Path("/{imageId}")
+ @Operation(description = "Get vendor software product component Image", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = ImageDto.class))))
+ Response get(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product component Id") @PathParam("componentId") String componentId,
+ @Parameter(description = "Vendor software product Image Id") @PathParam("imageId") String imageId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @PUT
- @Path("/{imageId}")
- @Operation(description = "Update vendor software product Image")
- Response update(@Valid ImageRequestDto request,
- @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product component Id")
- @PathParam("componentId") String componentId,
- @Parameter(description = "Vendor software product Image Id") @PathParam("imageId")
- String imageId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @DELETE
+ @Path("/{imageId}")
+ @Operation(description = "Delete vendor software product Image")
+ Response delete(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product component Id") @PathParam("componentId") String componentId,
+ @Parameter(description = "Vendor software product Image Id") @PathParam("imageId") String imageId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
+
+ @PUT
+ @Path("/{imageId}")
+ @Operation(description = "Update vendor software product Image")
+ Response update(@Valid ImageRequestDto request, @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product component Id") @PathParam("componentId") String componentId,
+ @Parameter(description = "Vendor software product Image Id") @PathParam("imageId") String imageId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @PUT
- @Path("/{imageId}/questionnaire")
- @Operation(description = "Update vendor software product component image questionnaire")
- Response updateQuestionnaire(@NotNull @IsValidJson String questionnaireData,
- @Parameter(description = "Vendor software product Id")
- @PathParam("vspId") String vspId,
- @Parameter(description = "Version Id")
- @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product component Id")
- @PathParam("componentId") String componentId,
- @Parameter(description = "Vendor software product image Id")
- @PathParam ("imageId") String imageId,
- @NotNull(message = USER_MISSING_ERROR_MSG)
- @HeaderParam(USER_ID_HEADER_PARAM) String user);
+ @PUT
+ @Path("/{imageId}/questionnaire")
+ @Operation(description = "Update vendor software product component image questionnaire")
+ Response updateQuestionnaire(@NotNull @IsValidJson String questionnaireData,
+ @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product component Id") @PathParam("componentId") String componentId,
+ @Parameter(description = "Vendor software product image Id") @PathParam("imageId") String imageId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @GET
- @Path("/{imageId}/questionnaire")
- @Operation(description = "Get vendor software product component image questionnaire", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = QuestionnaireResponseDto.class))))
- Response getQuestionnaire(
- @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product component Id") @PathParam("componentId")
- String componentId,
- @Parameter(description = "Vendor software product image Id") @PathParam
- ("imageId") String imageId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
+ @GET
+ @Path("/{imageId}/questionnaire")
+ @Operation(description = "Get vendor software product component image questionnaire", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = QuestionnaireResponseDto.class))))
+ Response getQuestionnaire(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product component Id") @PathParam("componentId") String componentId,
+ @Parameter(description = "Vendor software product image Id") @PathParam("imageId") String imageId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Networks.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Networks.java
index f269832d6b..b2e356c23d 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Networks.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Networks.java
@@ -17,30 +17,35 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest;
+import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
+import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.tags.Tags;
-import org.openecomp.sdcrests.vendorsoftwareproducts.types.NetworkDto;
-import org.openecomp.sdcrests.vendorsoftwareproducts.types.NetworkRequestDto;
-import org.springframework.validation.annotation.Validated;
-
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
-import javax.ws.rs.*;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-
-import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
-import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.NetworkDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.NetworkRequestDto;
+import org.springframework.validation.annotation.Validated;
@Path("/v1.0/vendor-software-products/{vspId}/versions/{versionId}/networks")
@Produces(MediaType.APPLICATION_JSON)
@@ -48,51 +53,42 @@ import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG
@Tags({@Tag(name = "SDCE-1 APIs"), @Tag(name = "Vendor Software Product Networks")})
@Validated
public interface Networks extends VspEntities {
- @GET
- @Path("/")
- @Operation(description = "List vendor software product networks",responses = @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = NetworkDto.class)))))
- Response list(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
- @POST
- @Path("/")
- @Operation(description = "Create a vendor software product network")
- Response create(@Valid NetworkRequestDto request,
- @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @GET
+ @Path("/")
+ @Operation(description = "List vendor software product networks", responses = @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = NetworkDto.class)))))
+ Response list(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
@Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @GET
- @Path("/{networkId}")
- @Operation(description = "Get vendor software product network",responses = @ApiResponse(content = @Content(schema = @Schema(implementation = NetworkDto.class))))
- Response get(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product network Id")
- @PathParam("networkId") String networkId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @POST
+ @Path("/")
+ @Operation(description = "Create a vendor software product network")
+ Response create(@Valid NetworkRequestDto request, @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @DELETE
- @Path("/{networkId}")
- @Operation(description = "Delete vendor software product network")
- Response delete(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product network Id") @PathParam("networkId")
- String networkId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @GET
+ @Path("/{networkId}")
+ @Operation(description = "Get vendor software product network", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = NetworkDto.class))))
+ Response get(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product network Id") @PathParam("networkId") String networkId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @PUT
- @Path("/{networkId}")
- @Operation(description = "Update vendor software product network")
- Response update(@Valid NetworkRequestDto request,
- @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product network Id") @PathParam("networkId")
- String networkId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @DELETE
+ @Path("/{networkId}")
+ @Operation(description = "Delete vendor software product network")
+ Response delete(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product network Id") @PathParam("networkId") String networkId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
+
+ @PUT
+ @Path("/{networkId}")
+ @Operation(description = "Update vendor software product network")
+ Response update(@Valid NetworkRequestDto request, @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product network Id") @PathParam("networkId") String networkId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Nics.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Nics.java
index c50c593fce..8d0b8ca617 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Nics.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Nics.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,118 +17,104 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest;
+import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
+import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.tags.Tags;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.NicDto;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.NicRequestDto;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireResponseDto;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.validation.IsValidJson;
import org.springframework.validation.annotation.Validated;
-import javax.validation.Valid;
-import javax.validation.constraints.NotNull;
-import javax.ws.rs.*;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
-import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
-
@Path("/v1.0/vendor-software-products/{vspId}/versions/{versionId}/components/{componentId}/nics")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Tags({@Tag(name = "SDCE-1 APIs"), @Tag(name = "Vendor Software Product Component NICs")})
@Validated
public interface Nics extends VspEntities {
- @GET
- @Path("/")
- @Operation(description = "List vendor software product component NICs",responses = @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = NicDto.class)))))
- Response list(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product component Id") @PathParam("componentId")
- String componentId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
- @POST
- @Path("/")
- @Operation(description = "Create a vendor software product NIC")
- Response create(@Valid NicRequestDto request,
- @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @GET
+ @Path("/")
+ @Operation(description = "List vendor software product component NICs", responses = @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = NicDto.class)))))
+ Response list(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
@Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product component Id")
- @PathParam("componentId") String componentId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @Parameter(description = "Vendor software product component Id") @PathParam("componentId") String componentId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @GET
- @Path("/{nicId}")
- @Operation(description = "Get vendor software product NIC", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = NicDto.class))))
- Response get(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product component Id") @PathParam("componentId")
- String componentId,
- @Parameter(description = "Vendor software product NIC Id") @PathParam("nicId") String nicId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @POST
+ @Path("/")
+ @Operation(description = "Create a vendor software product NIC")
+ Response create(@Valid NicRequestDto request, @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product component Id") @PathParam("componentId") String componentId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @DELETE
- @Path("/{nicId}")
- @Operation(description = "Delete vendor software product NIC")
- Response delete(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product component Id")
- @PathParam("componentId") String componentId,
- @Parameter(description = "Vendor software product NIC Id") @PathParam("nicId")
- String nicId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @GET
+ @Path("/{nicId}")
+ @Operation(description = "Get vendor software product NIC", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = NicDto.class))))
+ Response get(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product component Id") @PathParam("componentId") String componentId,
+ @Parameter(description = "Vendor software product NIC Id") @PathParam("nicId") String nicId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @PUT
- @Path("/{nicId}")
- @Operation(description = "Update vendor software product NIC")
- Response update(@Valid NicRequestDto request,
- @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product component Id")
- @PathParam("componentId") String componentId,
- @Parameter(description = "Vendor software product NIC Id") @PathParam("nicId")
- String nicId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @DELETE
+ @Path("/{nicId}")
+ @Operation(description = "Delete vendor software product NIC")
+ Response delete(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product component Id") @PathParam("componentId") String componentId,
+ @Parameter(description = "Vendor software product NIC Id") @PathParam("nicId") String nicId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
+
+ @PUT
+ @Path("/{nicId}")
+ @Operation(description = "Update vendor software product NIC")
+ Response update(@Valid NicRequestDto request, @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product component Id") @PathParam("componentId") String componentId,
+ @Parameter(description = "Vendor software product NIC Id") @PathParam("nicId") String nicId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @GET
- @Path("/{nicId}/questionnaire")
- @Operation(description = "Get vendor software product component NIC questionnaire", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = QuestionnaireResponseDto.class))))
- Response getQuestionnaire(
- @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product component Id") @PathParam("componentId")
- String componentId,
- @Parameter(description = "Vendor software product NIC Id") @PathParam("nicId") String nicId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
+ @GET
+ @Path("/{nicId}/questionnaire")
+ @Operation(description = "Get vendor software product component NIC questionnaire", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = QuestionnaireResponseDto.class))))
+ Response getQuestionnaire(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product component Id") @PathParam("componentId") String componentId,
+ @Parameter(description = "Vendor software product NIC Id") @PathParam("nicId") String nicId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @PUT
- @Path("/{nicId}/questionnaire")
- @Operation(description = "Update vendor software product component NIC questionnaire")
- Response updateQuestionnaire(@NotNull @IsValidJson String questionnaireData,
- @Parameter(description = "Vendor software product Id") @PathParam("vspId")
- String vspId,
- @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product component Id")
- @PathParam("componentId") String componentId,
- @Parameter(description = "Vendor software product NIC Id")
- @PathParam("nicId") String nicId,
- @NotNull(message = USER_MISSING_ERROR_MSG)
- @HeaderParam(USER_ID_HEADER_PARAM) String user);
+ @PUT
+ @Path("/{nicId}/questionnaire")
+ @Operation(description = "Update vendor software product component NIC questionnaire")
+ Response updateQuestionnaire(@NotNull @IsValidJson String questionnaireData,
+ @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product component Id") @PathParam("componentId") String componentId,
+ @Parameter(description = "Vendor software product NIC Id") @PathParam("nicId") String nicId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/OrchestrationTemplateCandidate.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/OrchestrationTemplateCandidate.java
index 5d99e2dc84..23c8ef2481 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/OrchestrationTemplateCandidate.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/OrchestrationTemplateCandidate.java
@@ -13,35 +13,40 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.openecomp.sdcrests.vsp.rest;
+import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
+import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.tags.Tags;
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
import org.apache.cxf.jaxrs.ext.multipart.Attachment;
import org.apache.cxf.jaxrs.ext.multipart.Multipart;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.FileDataStructureDto;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.UploadFileResponseDto;
import org.springframework.validation.annotation.Validated;
-import javax.validation.Valid;
-import javax.validation.constraints.NotNull;
-import javax.ws.rs.*;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.io.File;
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-
-import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
-import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
-
@Path("/v1.0/vendor-software-products/{vspId}/versions/{versionId}/orchestration-template-candidate")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@@ -49,60 +54,44 @@ import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG
@Validated
public interface OrchestrationTemplateCandidate extends VspEntities {
- @POST
- @Path("/")
- @Consumes(MediaType.MULTIPART_FORM_DATA)
- Response upload(
- @PathParam("vspId") String vspId,
- @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @Multipart("upload") Attachment fileToUpload,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
+ @POST
+ @Path("/")
+ @Consumes(MediaType.MULTIPART_FORM_DATA)
+ Response upload(@PathParam("vspId") String vspId, @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @Multipart("upload") Attachment fileToUpload,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @GET
- @Path("/")
- @Produces(MediaType.APPLICATION_OCTET_STREAM)
- @Operation(description = "Get uploaded Network Package file",
- summary = "Downloads in uploaded Network Package file", responses = @ApiResponse(content = @Content(schema = @Schema(implementation =File.class))))
- Response get(
- @PathParam("vspId") String vspId,
- @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user)
- throws IOException;
+ @GET
+ @Path("/")
+ @Produces(MediaType.APPLICATION_OCTET_STREAM)
+ @Operation(description = "Get uploaded Network Package file", summary = "Downloads in uploaded Network Package file", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = File.class))))
+ Response get(@PathParam("vspId") String vspId, @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user) throws IOException;
- @DELETE
- @Path("/")
- @Operation(description = "Delete orchestration template candidate file and its files data structure")
- Response abort(
- @PathParam("vspId") String vspId,
- @Parameter(description = "Version Id") @PathParam("versionId") String versionId)
- throws Exception;
+ @DELETE
+ @Path("/")
+ @Operation(description = "Delete orchestration template candidate file and its files data structure")
+ Response abort(@PathParam("vspId") String vspId, @Parameter(description = "Version Id") @PathParam("versionId") String versionId)
+ throws Exception;
- @PUT
- @Path("/process")
- @Operation(description = "process Orchestration Template Candidate",responses = @ApiResponse(content = @Content(schema = @Schema(implementation =UploadFileResponseDto.class))))
- Response process(
- @PathParam("vspId") String vspId,
- @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user)
- throws InvocationTargetException, IllegalAccessException;
+ @PUT
+ @Path("/process")
+ @Operation(description = "process Orchestration Template Candidate", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = UploadFileResponseDto.class))))
+ Response process(@PathParam("vspId") String vspId, @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user)
+ throws InvocationTargetException, IllegalAccessException;
- @PUT
- @Path("/manifest")
- @Operation(description = "Update an existing vendor software product")
- Response updateFilesDataStructure(
- @PathParam("vspId") String vspId,
- @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @Valid FileDataStructureDto fileDataStructureDto,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user)
- throws Exception;
+ @PUT
+ @Path("/manifest")
+ @Operation(description = "Update an existing vendor software product")
+ Response updateFilesDataStructure(@PathParam("vspId") String vspId,
+ @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @Valid FileDataStructureDto fileDataStructureDto,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user) throws Exception;
- @GET
- @Path("/manifest")
- @Operation(description = "Get uploaded HEAT file files data structure",
- summary = "Downloads the latest HEAT package",responses = @ApiResponse(content = @Content(schema = @Schema(implementation =FileDataStructureDto.class))))
- Response getFilesDataStructure(
- @PathParam("vspId") String vspId,
- @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user)
- throws Exception;
+ @GET
+ @Path("/manifest")
+ @Operation(description = "Get uploaded HEAT file files data structure", summary = "Downloads the latest HEAT package", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = FileDataStructureDto.class))))
+ Response getFilesDataStructure(@PathParam("vspId") String vspId, @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user) throws Exception;
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Processes.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Processes.java
index 27195e1cbb..5f4c6496ec 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Processes.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Processes.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,127 +17,115 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest;
+import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
+import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.tags.Tags;
+import java.util.List;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
import org.apache.cxf.jaxrs.ext.multipart.Attachment;
import org.apache.cxf.jaxrs.ext.multipart.Multipart;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ProcessEntityDto;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ProcessRequestDto;
import org.springframework.validation.annotation.Validated;
-import javax.validation.Valid;
-import javax.validation.constraints.NotNull;
-import javax.ws.rs.*;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import java.util.List;
-
-import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
-import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
-
@Path("/v1.0/vendor-software-products/{vspId}/versions/{versionId}/processes")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Tags({@Tag(name = "SDCE-1 APIs"), @Tag(name = "Vendor Software Product Processes")})
@Validated
public interface Processes {
- @GET
- @Path("/")
- @Operation(description = "List vendor software product processes", responses = @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = ProcessEntityDto.class)))))
- Response list(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
-
- @DELETE
- @Path("/")
- @Operation(description = "Delete vendor software product processes", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = List.class))))
- Response deleteList(
- @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @POST
- @Path("/")
- @Operation(description = "Create a vendor software product process")
- Response create(@Valid ProcessRequestDto request,
- @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @GET
+ @Path("/")
+ @Operation(description = "List vendor software product processes", responses = @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = ProcessEntityDto.class)))))
+ Response list(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
@Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @GET
- @Path("/{processId}")
- @Operation(description = "Get vendor software product process", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = ProcessEntityDto.class))))
- Response get(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product process Id") @PathParam("processId")
- String processId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @DELETE
+ @Path("/")
+ @Operation(description = "Delete vendor software product processes", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = List.class))))
+ Response deleteList(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @DELETE
- @Path("/{processId}")
- @Operation(description = "Delete vendor software product process")
- Response delete(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product process Id") @PathParam("processId")
- String processId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @POST
+ @Path("/")
+ @Operation(description = "Create a vendor software product process")
+ Response create(@Valid ProcessRequestDto request, @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @PUT
- @Path("/{processId}")
- @Operation(description = "Update vendor software product process")
- Response update(@Valid ProcessRequestDto request,
- @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product process Id") @PathParam("processId")
- String processId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @GET
+ @Path("/{processId}")
+ @Operation(description = "Get vendor software product process", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = ProcessEntityDto.class))))
+ Response get(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product process Id") @PathParam("processId") String processId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
+
+ @DELETE
+ @Path("/{processId}")
+ @Operation(description = "Delete vendor software product process")
+ Response delete(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product process Id") @PathParam("processId") String processId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
+
+ @PUT
+ @Path("/{processId}")
+ @Operation(description = "Update vendor software product process")
+ Response update(@Valid ProcessRequestDto request, @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product process Id") @PathParam("processId") String processId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @GET
- @Path("/{processId}/upload")
- @Produces(MediaType.APPLICATION_OCTET_STREAM)
- @Operation(description = "Get vendor software product process uploaded file")
- Response getUploadedFile(
- @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product process Id") @PathParam("processId")
- String processId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
+ @GET
+ @Path("/{processId}/upload")
+ @Produces(MediaType.APPLICATION_OCTET_STREAM)
+ @Operation(description = "Get vendor software product process uploaded file")
+ Response getUploadedFile(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product process Id") @PathParam("processId") String processId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @DELETE
- @Path("/{processId}/upload")
- @Operation(description = "Delete vendor software product process uploaded file")
- Response deleteUploadedFile(
- @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product process Id") @PathParam("processId")
- String processId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
+ @DELETE
+ @Path("/{processId}/upload")
+ @Operation(description = "Delete vendor software product process uploaded file")
+ Response deleteUploadedFile(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product process Id") @PathParam("processId") String processId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
- @POST
- @Path("/{processId}/upload")
- @Consumes(MediaType.MULTIPART_FORM_DATA)
- @Operation(description = "Update vendor software product process upload")
- Response uploadFile(@Multipart("upload") Attachment attachment,
- @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
- @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
- @Parameter(description = "Vendor software product process Id")
- @PathParam("processId") String processId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
- String user);
+ @POST
+ @Path("/{processId}/upload")
+ @Consumes(MediaType.MULTIPART_FORM_DATA)
+ @Operation(description = "Update vendor software product process upload")
+ Response uploadFile(@Multipart("upload") Attachment attachment,
+ @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
+ @Parameter(description = "Vendor software product process Id") @PathParam("processId") String processId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VendorSoftwareProducts.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VendorSoftwareProducts.java
index af9953ae69..328c96254f 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VendorSoftwareProducts.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VendorSoftwareProducts.java
@@ -13,35 +13,45 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
-
package org.openecomp.sdcrests.vsp.rest;
+import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
+import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.tags.Tags;
-import org.openecomp.sdcrests.item.types.ItemCreationDto;
-import org.openecomp.sdcrests.vendorsoftwareproducts.types.*;
-import org.openecomp.sdcrests.vendorsoftwareproducts.types.validation.IsValidJson;
-import org.springframework.validation.annotation.Validated;
-
+import java.io.File;
+import java.io.IOException;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
-import javax.ws.rs.*;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
-
-import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
-import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+import org.openecomp.sdcrests.item.types.ItemCreationDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.PackageInfoDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireResponseDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.VersionSoftwareProductActionRequestDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspComputeDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspDescriptionDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspDetailsDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspRequestDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.validation.IsValidJson;
+import org.springframework.validation.annotation.Validated;
@Path("/v1.0/vendor-software-products")
@Produces(MediaType.APPLICATION_JSON)
@@ -50,145 +60,105 @@ import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG
@Validated
public interface VendorSoftwareProducts extends VspEntities {
- @POST
- @Path("/")
- @Operation(description = "Create a new vendor software product",responses = @ApiResponse(content = @Content(schema = @Schema(implementation = ItemCreationDto.class))))
- Response createVsp(@Valid VspRequestDto vspRequestDto,
- @NotNull(message = USER_MISSING_ERROR_MSG)
- @HeaderParam(USER_ID_HEADER_PARAM) String user);
-
- @GET
- @Path("/")
- @Operation(description = "Get list of vendor software products and their description",responses = @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = VspDetailsDto.class)))))
- Response listVsps(@Parameter(description = "Filter to return only Vendor Software Products with at" +
- " least one version at this status. Currently supported values: 'Certified' , 'Draft'")
- @QueryParam("versionFilter") String versionStatus,
- @Parameter(description = "Filter to only return Vendor Software Products at this status." +
- "Currently supported values: 'ACTIVE' , 'ARCHIVED'." +
- "Default value = 'ACTIVE'.")
- @QueryParam("Status") String itemStatus,
- @NotNull(message = USER_MISSING_ERROR_MSG)
- @HeaderParam(USER_ID_HEADER_PARAM) String user);
-
- @GET
- @Path("/{vspId}/versions/{versionId}")
- @Parameter(description = "Get details of a vendor software product")
- Response getVsp(@PathParam("vspId") String vspId,
- @PathParam("versionId") String versionId,
- @NotNull(message = USER_MISSING_ERROR_MSG)
- @HeaderParam(USER_ID_HEADER_PARAM) String user);
-
- @PUT
- @Path("/{vspId}/versions/{versionId}")
- @Parameter(description = "Update an existing vendor software product")
- Response updateVsp(@PathParam("vspId") String vspId,
- @PathParam("versionId") String versionId,
- @Valid VspDescriptionDto vspDescriptionDto,
- @NotNull(message = USER_MISSING_ERROR_MSG)
- @HeaderParam(USER_ID_HEADER_PARAM) String user);
-
- @DELETE
- @Path("/{vspId}")
- @Parameter(description = "Deletes vendor software product by given id")
- Response deleteVsp(@PathParam("vspId") String vspId,
- @NotNull(message = USER_MISSING_ERROR_MSG)
- @HeaderParam(USER_ID_HEADER_PARAM) String user);
-
- @GET
- @Path("/packages")
- @Operation(description = "Get list of translated CSAR files details", responses = @ApiResponse(content = @Content(array = @ArraySchema( schema = @Schema(implementation=PackageInfoDto.class)))))
- Response listPackages(@Parameter(description = "Vendor Software Product status filter. " +
- "Currently supported values: 'ACTIVE', 'ARCHIVED'")
- @QueryParam("Status") String status,
- @Parameter(description = "Category") @QueryParam("category") String category,
- @Parameter(description = "Sub-category") @QueryParam("subCategory") String subCategory,
- @NotNull(message = USER_MISSING_ERROR_MSG)
- @HeaderParam(USER_ID_HEADER_PARAM) String user);
-
- @GET
- @Path("/{vspId}/versions/{versionId}/orchestration-template")
- @Produces(MediaType.APPLICATION_OCTET_STREAM)
- @Operation(description = "Get Orchestration Template (HEAT) file", responses = @ApiResponse(content = @Content(schema = @Schema(implementation=File.class))))
- Response getOrchestrationTemplate(
- @PathParam("vspId") String vspId,
- @PathParam("versionId") String versionId,
- @HeaderParam(USER_ID_HEADER_PARAM) String user);
-
-
- @GET
- @Path("/validation-vsp")
- Response getValidationVsp(
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user)
- throws Exception;
-
- @PUT
- @Path("/{vspId}/versions/{versionId}/actions")
- @Operation(description = "Actions on a vendor software product",
- summary = "Performs one of the following actions on a vendor software product: |"
- + "Checkout: Locks it for edits by other users. Only the locking user sees the edited "
- + "version.|"
- + "Undo_Checkout: Unlocks it and deletes the edits that were done.|"
- + "Checkin: Unlocks it and activates the edited version to all users.| "
- + "Submit: Finalize its active version.|"
- + "Create_Package: Creates a CSAR zip file.|")
- Response actOnVendorSoftwareProduct(VersionSoftwareProductActionRequestDto request,
- @PathParam("vspId") String vspId,
- @PathParam("versionId") String versionId,
- @NotNull(message = USER_MISSING_ERROR_MSG)
- @HeaderParam(USER_ID_HEADER_PARAM) String user)
- throws IOException;
-
- @GET
- @Path("/packages/{vspId}")
- @Produces(MediaType.APPLICATION_OCTET_STREAM)
- @Operation(description = "Get translated CSAR file",
- summary = "Exports translated file to a zip file", responses = @ApiResponse(content = @Content(schema = @Schema(implementation=File.class))))
- Response getTranslatedFile(@PathParam("vspId") String vspId,
- @QueryParam("versionId") String versionId,
- @HeaderParam(USER_ID_HEADER_PARAM) String user);
-
- @GET
- @Path("/{vspId}/versions/{versionId}/questionnaire")
- @Operation(description = "Get vendor software product questionnaire", responses = @ApiResponse(content = @Content(schema = @Schema(implementation=QuestionnaireResponseDto.class))))
- Response getQuestionnaire(@PathParam("vspId") String vspId,
- @PathParam("versionId") String versionId,
- @NotNull(message = USER_MISSING_ERROR_MSG)
- @HeaderParam(USER_ID_HEADER_PARAM) String user);
-
- @PUT
- @Path("/{vspId}/versions/{versionId}/questionnaire")
- @Operation(description = "Update vendor software product questionnaire")
- Response updateQuestionnaire(@NotNull @IsValidJson String questionnaireData,
- @PathParam("vspId") String vspId,
- @PathParam("versionId") String versionId,
- @NotNull(message = USER_MISSING_ERROR_MSG)
+ @POST
+ @Path("/")
+ @Operation(description = "Create a new vendor software product", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = ItemCreationDto.class))))
+ Response createVsp(@Valid VspRequestDto vspRequestDto, @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
+
+ @GET
+ @Path("/")
+ @Operation(description = "Get list of vendor software products and their description", responses = @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = VspDetailsDto.class)))))
+ Response listVsps(@Parameter(description = "Filter to return only Vendor Software Products with at"
+ + " least one version at this status. Currently supported values: 'Certified' , 'Draft'") @QueryParam("versionFilter") String versionStatus,
+ @Parameter(description = "Filter to only return Vendor Software Products at this status."
+ + "Currently supported values: 'ACTIVE' , 'ARCHIVED'."
+ + "Default value = 'ACTIVE'.") @QueryParam("Status") String itemStatus,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
+
+ @GET
+ @Path("/{vspId}/versions/{versionId}")
+ @Parameter(description = "Get details of a vendor software product")
+ Response getVsp(@PathParam("vspId") String vspId, @PathParam("versionId") String versionId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
+
+ @PUT
+ @Path("/{vspId}/versions/{versionId}")
+ @Parameter(description = "Update an existing vendor software product")
+ Response updateVsp(@PathParam("vspId") String vspId, @PathParam("versionId") String versionId, @Valid VspDescriptionDto vspDescriptionDto,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
+
+ @DELETE
+ @Path("/{vspId}")
+ @Parameter(description = "Deletes vendor software product by given id")
+ Response deleteVsp(@PathParam("vspId") String vspId, @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
+
+ @GET
+ @Path("/packages")
+ @Operation(description = "Get list of translated CSAR files details", responses = @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = PackageInfoDto.class)))))
+ Response listPackages(@Parameter(description = "Vendor Software Product status filter. "
+ + "Currently supported values: 'ACTIVE', 'ARCHIVED'") @QueryParam("Status") String status,
+ @Parameter(description = "Category") @QueryParam("category") String category,
+ @Parameter(description = "Sub-category") @QueryParam("subCategory") String subCategory,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
+
+ @GET
+ @Path("/{vspId}/versions/{versionId}/orchestration-template")
+ @Produces(MediaType.APPLICATION_OCTET_STREAM)
+ @Operation(description = "Get Orchestration Template (HEAT) file", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = File.class))))
+ Response getOrchestrationTemplate(@PathParam("vspId") String vspId, @PathParam("versionId") String versionId,
+ @HeaderParam(USER_ID_HEADER_PARAM) String user);
+
+ @GET
+ @Path("/validation-vsp")
+ Response getValidationVsp(@NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user) throws Exception;
+
+ @PUT
+ @Path("/{vspId}/versions/{versionId}/actions")
+ @Operation(description = "Actions on a vendor software product", summary = "Performs one of the following actions on a vendor software product: |"
+ + "Checkout: Locks it for edits by other users. Only the locking user sees the edited " + "version.|"
+ + "Undo_Checkout: Unlocks it and deletes the edits that were done.|" + "Checkin: Unlocks it and activates the edited version to all users.| "
+ + "Submit: Finalize its active version.|" + "Create_Package: Creates a CSAR zip file.|")
+ Response actOnVendorSoftwareProduct(VersionSoftwareProductActionRequestDto request, @PathParam("vspId") String vspId,
+ @PathParam("versionId") String versionId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user) throws IOException;
+
+ @GET
+ @Path("/packages/{vspId}")
+ @Produces(MediaType.APPLICATION_OCTET_STREAM)
+ @Operation(description = "Get translated CSAR file", summary = "Exports translated file to a zip file", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = File.class))))
+ Response getTranslatedFile(@PathParam("vspId") String vspId, @QueryParam("versionId") String versionId,
@HeaderParam(USER_ID_HEADER_PARAM) String user);
-
- @PUT
- @Path("/{vspId}/versions/{versionId}/heal")
- @Operation(description = "Checkout and heal vendor software product questionnaire",responses = @ApiResponse(content = @Content(schema = @Schema(implementation=QuestionnaireResponseDto.class))))
- Response heal(@PathParam("vspId") String vspId,
- @PathParam("versionId") String versionId,
- @NotNull(message = USER_MISSING_ERROR_MSG)
- @HeaderParam(USER_ID_HEADER_PARAM) String user);
-
-
- @GET
- @Path("/{vspId}/versions/{versionId}/vspInformationArtifact")
- @Produces(MediaType.TEXT_PLAIN)
- @Operation(description = "Get vendor software product information artifact for specified version",responses = @ApiResponse(content = @Content(schema = @Schema(implementation=File.class))))
- Response getVspInformationArtifact(@PathParam("vspId") String vspId,
- @PathParam("versionId") String versionId,
- @NotNull(message = USER_MISSING_ERROR_MSG)
- @HeaderParam(USER_ID_HEADER_PARAM) String user);
-
- @GET
- @Path("/{vspId}/versions/{versionId}/compute-flavors")
- @Operation(description = "Get list of vendor software product compute-flavors", responses = @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation=VspComputeDto.class)))))
- Response listComputes(@Parameter(description = "Vendor software product Id")
- @PathParam("vspId") String vspId,
- @PathParam("versionId") String versionId,
- @NotNull(message = USER_MISSING_ERROR_MSG)
- @HeaderParam(USER_ID_HEADER_PARAM) String user);
+ @GET
+ @Path("/{vspId}/versions/{versionId}/questionnaire")
+ @Operation(description = "Get vendor software product questionnaire", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = QuestionnaireResponseDto.class))))
+ Response getQuestionnaire(@PathParam("vspId") String vspId, @PathParam("versionId") String versionId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
+
+ @PUT
+ @Path("/{vspId}/versions/{versionId}/questionnaire")
+ @Operation(description = "Update vendor software product questionnaire")
+ Response updateQuestionnaire(@NotNull @IsValidJson String questionnaireData, @PathParam("vspId") String vspId,
+ @PathParam("versionId") String versionId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
+
+ @PUT
+ @Path("/{vspId}/versions/{versionId}/heal")
+ @Operation(description = "Checkout and heal vendor software product questionnaire", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = QuestionnaireResponseDto.class))))
+ Response heal(@PathParam("vspId") String vspId, @PathParam("versionId") String versionId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
+
+ @GET
+ @Path("/{vspId}/versions/{versionId}/vspInformationArtifact")
+ @Produces(MediaType.TEXT_PLAIN)
+ @Operation(description = "Get vendor software product information artifact for specified version", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = File.class))))
+ Response getVspInformationArtifact(@PathParam("vspId") String vspId, @PathParam("versionId") String versionId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
+
+ @GET
+ @Path("/{vspId}/versions/{versionId}/compute-flavors")
+ @Operation(description = "Get list of vendor software product compute-flavors", responses = @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = VspComputeDto.class)))))
+ Response listComputes(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @PathParam("versionId") String versionId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VendorSoftwareProductsForSwaggerFileUpload.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VendorSoftwareProductsForSwaggerFileUpload.java
index cc94725501..70de99035b 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VendorSoftwareProductsForSwaggerFileUpload.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VendorSoftwareProductsForSwaggerFileUpload.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,28 +17,30 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest;
+import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
+import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
import com.sun.jersey.multipart.FormDataParam;
import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.tags.Tags;
-import org.openecomp.sdcrests.vendorsoftwareproducts.types.UploadFileResponseDto;
-import org.springframework.validation.annotation.Validated;
-
+import java.io.InputStream;
import javax.validation.constraints.NotNull;
-import javax.ws.rs.*;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-import java.io.InputStream;
-
-import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
-import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.UploadFileResponseDto;
+import org.springframework.validation.annotation.Validated;
@Path("/v1.0/vendor-software-products")
@Produces(MediaType.APPLICATION_JSON)
@@ -47,17 +49,11 @@ import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG
@Validated
public interface VendorSoftwareProductsForSwaggerFileUpload {
-
-
- @POST
- @Path("/{vspId}/versions/{versionId}/orchestration-template-candidate")
- @Consumes(MediaType.MULTIPART_FORM_DATA)
- @Operation(description = "Uploads a HEAT package to translate",responses = @ApiResponse(content = @Content(schema = @Schema(implementation = UploadFileResponseDto.class))))
- Response uploadOrchestrationTemplateCandidate(@PathParam("vspId") String vspId,
- @PathParam("versionId") String versionId,
- @FormDataParam("upload")
- InputStream heatFileToUpload,
- @NotNull(message = USER_MISSING_ERROR_MSG)
- @HeaderParam(USER_ID_HEADER_PARAM) String user);
-
- }
+ @POST
+ @Path("/{vspId}/versions/{versionId}/orchestration-template-candidate")
+ @Consumes(MediaType.MULTIPART_FORM_DATA)
+ @Operation(description = "Uploads a HEAT package to translate", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = UploadFileResponseDto.class))))
+ Response uploadOrchestrationTemplateCandidate(@PathParam("vspId") String vspId, @PathParam("versionId") String versionId,
+ @FormDataParam("upload") InputStream heatFileToUpload,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VspEntities.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VspEntities.java
index 4514af649b..92b0dec6e3 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VspEntities.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VspEntities.java
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest;
public interface VspEntities {
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDataToComponentDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDataToComponentDto.java
index eae59cf103..ac6b3a887f 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDataToComponentDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDataToComponentDto.java
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData;
@@ -21,11 +20,11 @@ import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDto;
public class MapComponentDataToComponentDto extends MappingBase<ComponentData, ComponentDto> {
- @Override
- public void doMapping(ComponentData source, ComponentDto target) {
- target.setName(source.getName());
- target.setDisplayName(
- source.getDisplayName() == null ? source.getName() : source.getDisplayName());
- target.setDescription(source.getDescription());
- }
+
+ @Override
+ public void doMapping(ComponentData source, ComponentDto target) {
+ target.setName(source.getName());
+ target.setDisplayName(source.getDisplayName() == null ? source.getName() : source.getDisplayName());
+ target.setDescription(source.getDescription());
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDependencyEntityToCreationDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDependencyEntityToCreationDto.java
index a82902bd84..e69d6a9380 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDependencyEntityToCreationDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDependencyEntityToCreationDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,20 +17,16 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
-
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentDependencyModelEntity;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDependencyCreationDto;
-public class MapComponentDependencyEntityToCreationDto extends MappingBase
- <ComponentDependencyModelEntity, ComponentDependencyCreationDto> {
+public class MapComponentDependencyEntityToCreationDto extends MappingBase<ComponentDependencyModelEntity, ComponentDependencyCreationDto> {
- @Override
- public void doMapping(ComponentDependencyModelEntity source,
- ComponentDependencyCreationDto target) {
- target.setId(source.getId());
- }
+ @Override
+ public void doMapping(ComponentDependencyModelEntity source, ComponentDependencyCreationDto target) {
+ target.setId(source.getId());
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDependencyEntityToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDependencyEntityToDto.java
index 1fdadcbc88..aedd06be69 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDependencyEntityToDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDependencyEntityToDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,22 +17,19 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentDependencyModelEntity;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDependencyResponseDto;
-public class MapComponentDependencyEntityToDto extends
- MappingBase<ComponentDependencyModelEntity, ComponentDependencyResponseDto> {
+public class MapComponentDependencyEntityToDto extends MappingBase<ComponentDependencyModelEntity, ComponentDependencyResponseDto> {
- @Override
- public void doMapping(ComponentDependencyModelEntity source,
- ComponentDependencyResponseDto target) {
- target.setSourceId(source.getSourceComponentId());
- target.setTargetId(source.getTargetComponentId());
- target.setRelationType(source.getRelation());
- target.setId(source.getId());
- }
+ @Override
+ public void doMapping(ComponentDependencyModelEntity source, ComponentDependencyResponseDto target) {
+ target.setSourceId(source.getSourceComponentId());
+ target.setTargetId(source.getTargetComponentId());
+ target.setRelationType(source.getRelation());
+ target.setId(source.getId());
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDependencyModelEntityToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDependencyModelEntityToDto.java
index c4c54d4ed8..bcfe05da83 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDependencyModelEntityToDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDependencyModelEntityToDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,21 +17,18 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentDependencyModelEntity;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDependencyModel;
-public class MapComponentDependencyModelEntityToDto extends
- MappingBase<ComponentDependencyModelEntity, ComponentDependencyModel> {
+public class MapComponentDependencyModelEntityToDto extends MappingBase<ComponentDependencyModelEntity, ComponentDependencyModel> {
- @Override
- public void doMapping(ComponentDependencyModelEntity source,
- ComponentDependencyModel target) {
- target.setSourceId(source.getSourceComponentId());
- target.setTargetId(source.getTargetComponentId());
- target.setRelationType(source.getRelation());
- }
+ @Override
+ public void doMapping(ComponentDependencyModelEntity source, ComponentDependencyModel target) {
+ target.setSourceId(source.getSourceComponentId());
+ target.setTargetId(source.getTargetComponentId());
+ target.setRelationType(source.getRelation());
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDependencyModelRequestToEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDependencyModelRequestToEntity.java
index 4988ab43ab..73ef053455 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDependencyModelRequestToEntity.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDependencyModelRequestToEntity.java
@@ -12,11 +12,9 @@
* 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.
-*/
-
+ */
package org.openecomp.sdcrests.vsp.rest.mapping;
-
import org.openecomp.sdc.common.errors.CoreException;
import org.openecomp.sdc.common.errors.ErrorCode;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentDependencyModelEntity;
@@ -25,21 +23,18 @@ import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDependencyModel;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentRelationType;
-public class MapComponentDependencyModelRequestToEntity extends
- MappingBase<ComponentDependencyModel, ComponentDependencyModelEntity> {
+public class MapComponentDependencyModelRequestToEntity extends MappingBase<ComponentDependencyModel, ComponentDependencyModelEntity> {
- @Override
- public void doMapping(ComponentDependencyModel source,
- ComponentDependencyModelEntity target) {
- target.setSourceComponentId(source.getSourceId());
- target.setTargetComponentId(source.getTargetId());
- try {
- ComponentRelationType.valueOf(source.getRelationType());
- target.setRelation(source.getRelationType());
- } catch (IllegalArgumentException exception) {
- ErrorCode errorCode =
- ComponentDependencyModelErrorBuilder.getInvalidRelationTypeErrorBuilder();
- throw new CoreException(errorCode, exception);
+ @Override
+ public void doMapping(ComponentDependencyModel source, ComponentDependencyModelEntity target) {
+ target.setSourceComponentId(source.getSourceId());
+ target.setTargetComponentId(source.getTargetId());
+ try {
+ ComponentRelationType.valueOf(source.getRelationType());
+ target.setRelation(source.getRelationType());
+ } catch (IllegalArgumentException exception) {
+ ErrorCode errorCode = ComponentDependencyModelErrorBuilder.getInvalidRelationTypeErrorBuilder();
+ throw new CoreException(errorCode, exception);
+ }
}
- }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentEntityToComponentCreationDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentEntityToComponentCreationDto.java
index f2f346891f..089a91694e 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentEntityToComponentCreationDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentEntityToComponentCreationDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,17 +17,16 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentCreationDto;
-public class MapComponentEntityToComponentCreationDto extends MappingBase<ComponentEntity,
- ComponentCreationDto> {
- @Override
- public void doMapping(ComponentEntity source, ComponentCreationDto target) {
- target.setVfcId(source.getId());
- }
+public class MapComponentEntityToComponentCreationDto extends MappingBase<ComponentEntity, ComponentCreationDto> {
+
+ @Override
+ public void doMapping(ComponentEntity source, ComponentCreationDto target) {
+ target.setVfcId(source.getId());
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentEntityToComponentDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentEntityToComponentDto.java
index 8878581d1c..e82363eae9 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentEntityToComponentDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentEntityToComponentDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
@@ -26,12 +25,13 @@ import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDto;
public class MapComponentEntityToComponentDto extends MappingBase<ComponentEntity, ComponentDto> {
- @Override
- public void doMapping(ComponentEntity source, ComponentDto target) {
- target.setId(source.getId());
- ComponentData component = source.getComponentCompositionData();
- if (component != null) {
- new MapComponentDataToComponentDto().doMapping(component, target);
+
+ @Override
+ public void doMapping(ComponentEntity source, ComponentDto target) {
+ target.setId(source.getId());
+ ComponentData component = source.getComponentCompositionData();
+ if (component != null) {
+ new MapComponentDataToComponentDto().doMapping(component, target);
+ }
}
- }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentRequestDtoToComponentEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentRequestDtoToComponentEntity.java
index 53a4482820..a890d0d737 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentRequestDtoToComponentEntity.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentRequestDtoToComponentEntity.java
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
@@ -21,14 +20,14 @@ import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentRequestDto;
-public class MapComponentRequestDtoToComponentEntity
- extends MappingBase<ComponentRequestDto, ComponentEntity> {
- @Override
- public void doMapping(ComponentRequestDto source, ComponentEntity target) {
- ComponentData component = new ComponentData();
- component.setName(source.getName());
- component.setDisplayName(source.getDisplayName());
- component.setDescription(source.getDescription());
- target.setComponentCompositionData(component);
- }
+public class MapComponentRequestDtoToComponentEntity extends MappingBase<ComponentRequestDto, ComponentEntity> {
+
+ @Override
+ public void doMapping(ComponentRequestDto source, ComponentEntity target) {
+ ComponentData component = new ComponentData();
+ component.setName(source.getName());
+ component.setDisplayName(source.getDisplayName());
+ component.setDescription(source.getDescription());
+ target.setComponentCompositionData(component);
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapCompositionEntityResponseToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapCompositionEntityResponseToDto.java
index f7ecc243f1..743723771d 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapCompositionEntityResponseToDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapCompositionEntityResponseToDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityResponse;
@@ -26,22 +25,21 @@ import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionDataEntityDto;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityResponseDto;
-public class MapCompositionEntityResponseToDto<S extends CompositionDataEntity, T extends
- CompositionDataEntityDto, M extends MappingBase<S, T>>
- extends MappingBase<CompositionEntityResponse<S>, CompositionEntityResponseDto<T>> {
- private M dataMapper;
- private Class<T> targetDataClass;
+public class MapCompositionEntityResponseToDto<S extends CompositionDataEntity, T extends CompositionDataEntityDto, M extends MappingBase<S, T>> extends
+ MappingBase<CompositionEntityResponse<S>, CompositionEntityResponseDto<T>> {
+
+ private M dataMapper;
+ private Class<T> targetDataClass;
- public MapCompositionEntityResponseToDto(M dataMapper, Class<T> targetDataClass) {
- this.dataMapper = dataMapper;
- this.targetDataClass = targetDataClass;
- }
+ public MapCompositionEntityResponseToDto(M dataMapper, Class<T> targetDataClass) {
+ this.dataMapper = dataMapper;
+ this.targetDataClass = targetDataClass;
+ }
- @Override
- public void doMapping(CompositionEntityResponse<S> source,
- CompositionEntityResponseDto<T> target) {
- target.setId(source.getId());
- target.setSchema(source.getSchema());
- target.setData(dataMapper.applyMapping(source.getData(), targetDataClass));
- }
+ @Override
+ public void doMapping(CompositionEntityResponse<S> source, CompositionEntityResponseDto<T> target) {
+ target.setId(source.getId());
+ target.setSchema(source.getSchema());
+ target.setData(dataMapper.applyMapping(source.getData(), targetDataClass));
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapCompositionEntityValidationDataToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapCompositionEntityValidationDataToDto.java
index ee7a9f446e..00c5c2f266 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapCompositionEntityValidationDataToDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapCompositionEntityValidationDataToDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,29 +17,26 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
+import java.util.stream.Collectors;
import org.apache.commons.collections4.CollectionUtils;
import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityValidationData;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityValidationDataDto;
-import java.util.stream.Collectors;
+public class MapCompositionEntityValidationDataToDto extends MappingBase<CompositionEntityValidationData, CompositionEntityValidationDataDto> {
-public class MapCompositionEntityValidationDataToDto
- extends MappingBase<CompositionEntityValidationData, CompositionEntityValidationDataDto> {
- @Override
- public void doMapping(CompositionEntityValidationData source,
- CompositionEntityValidationDataDto target) {
- target.setEntityType(source.getEntityType());
- target.setEntityId(source.getEntityId());
- target.setEntityName(source.getEntityName());
- target.setErrors(source.getErrors());
- if (CollectionUtils.isNotEmpty(source.getSubEntitiesValidationData())) {
- target.setSubEntitiesValidationData(source.getSubEntitiesValidationData().stream()
- .map(sub -> applyMapping(sub, CompositionEntityValidationDataDto.class))
- .collect(Collectors.toList()));
+ @Override
+ public void doMapping(CompositionEntityValidationData source, CompositionEntityValidationDataDto target) {
+ target.setEntityType(source.getEntityType());
+ target.setEntityId(source.getEntityId());
+ target.setEntityName(source.getEntityName());
+ target.setErrors(source.getErrors());
+ if (CollectionUtils.isNotEmpty(source.getSubEntitiesValidationData())) {
+ target.setSubEntitiesValidationData(
+ source.getSubEntitiesValidationData().stream().map(sub -> applyMapping(sub, CompositionEntityValidationDataDto.class))
+ .collect(Collectors.toList()));
+ }
}
- }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComputeDataToComputeDetailsDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComputeDataToComputeDetailsDto.java
index 3bfecb93f5..a32f4fb076 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComputeDataToComputeDetailsDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComputeDataToComputeDetailsDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComputeData;
@@ -26,10 +25,9 @@ import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComputeDetailsDto;
public class MapComputeDataToComputeDetailsDto extends MappingBase<ComputeData, ComputeDetailsDto> {
- @Override
- public void doMapping(ComputeData source, ComputeDetailsDto target) {
-
- target.setName(source.getName());
- target.setDescription(source.getDescription());
- }
+ @Override
+ public void doMapping(ComputeData source, ComputeDetailsDto target) {
+ target.setName(source.getName());
+ target.setDescription(source.getDescription());
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComputeDetailsDtoToComputeEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComputeDetailsDtoToComputeEntity.java
index 93db7e3e76..835f5dd05d 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComputeDetailsDtoToComputeEntity.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComputeDetailsDtoToComputeEntity.java
@@ -21,13 +21,11 @@ import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComputeDescription;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComputeDetailsDto;
-public class MapComputeDetailsDtoToComputeEntity extends MappingBase<ComputeDetailsDto,
- ComputeEntity> {
+public class MapComputeDetailsDtoToComputeEntity extends MappingBase<ComputeDetailsDto, ComputeEntity> {
- @Override
- public void doMapping(ComputeDetailsDto source, ComputeEntity target) {
- ComputeDescription computeDesc = new ComputeDescription(source.getName(), source
- .getDescription());
- target.setCompositionData(JsonUtil.object2Json(computeDesc));
- }
+ @Override
+ public void doMapping(ComputeDetailsDto source, ComputeEntity target) {
+ ComputeDescription computeDesc = new ComputeDescription(source.getName(), source.getDescription());
+ target.setCompositionData(JsonUtil.object2Json(computeDesc));
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComputeEntityToComputeCreationDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComputeEntityToComputeCreationDto.java
index 4e1599d058..531c28b48a 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComputeEntityToComputeCreationDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComputeEntityToComputeCreationDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,17 +17,16 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComputeEntity;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComputeCreationDto;
-public class MapComputeEntityToComputeCreationDto extends
- MappingBase<ComputeEntity, ComputeCreationDto> {
- @Override
- public void doMapping(ComputeEntity source, ComputeCreationDto target) {
- target.setId(source.getId());
- }
+public class MapComputeEntityToComputeCreationDto extends MappingBase<ComputeEntity, ComputeCreationDto> {
+
+ @Override
+ public void doMapping(ComputeEntity source, ComputeCreationDto target) {
+ target.setId(source.getId());
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComputeEntityToComputeDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComputeEntityToComputeDto.java
index cd67d2444b..a2cdceb060 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComputeEntityToComputeDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComputeEntityToComputeDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.core.utilities.json.JsonUtil;
@@ -27,15 +26,15 @@ import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComputeDescription;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComputeDto;
public class MapComputeEntityToComputeDto extends MappingBase<ListComputeResponse, ComputeDto> {
- @Override
- public void doMapping(ListComputeResponse source, ComputeDto target) {
- target.setId(source.getComputeEntity().getId());
- if (source.getComputeEntity().getCompositionData() != null) {
- ComputeDescription desc = JsonUtil.json2Object(source.getComputeEntity().getCompositionData
- (), ComputeDescription.class);
- target.setName(desc.getName());
- target.setDescription(desc.getDescription());
- target.setAssociatedToDeploymentFlavor(source.isAssociatedWithDeploymentFlavor());
+
+ @Override
+ public void doMapping(ListComputeResponse source, ComputeDto target) {
+ target.setId(source.getComputeEntity().getId());
+ if (source.getComputeEntity().getCompositionData() != null) {
+ ComputeDescription desc = JsonUtil.json2Object(source.getComputeEntity().getCompositionData(), ComputeDescription.class);
+ target.setName(desc.getName());
+ target.setDescription(desc.getDescription());
+ target.setAssociatedToDeploymentFlavor(source.isAssociatedWithDeploymentFlavor());
+ }
}
- }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComputeEntityToVspComputeDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComputeEntityToVspComputeDto.java
index c75266f756..108d6438b5 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComputeEntityToVspComputeDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComputeEntityToVspComputeDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.core.utilities.json.JsonUtil;
@@ -27,14 +26,14 @@ import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComputeDescription;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspComputeDto;
public class MapComputeEntityToVspComputeDto extends MappingBase<ComputeEntity, VspComputeDto> {
- @Override
- public void doMapping(ComputeEntity source, VspComputeDto target) {
- target.setComputeFlavorId(source.getId());
- if (source.getCompositionData() != null) {
- ComputeDescription desc = JsonUtil.json2Object(source.getCompositionData(), ComputeDescription
- .class);
- target.setName(desc.getName());
- target.setComponentId(source.getComponentId());
+
+ @Override
+ public void doMapping(ComputeEntity source, VspComputeDto target) {
+ target.setComputeFlavorId(source.getId());
+ if (source.getCompositionData() != null) {
+ ComputeDescription desc = JsonUtil.json2Object(source.getCompositionData(), ComputeDescription.class);
+ target.setName(desc.getName());
+ target.setComponentId(source.getComponentId());
+ }
}
- }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapDeploymentFlavorEntityDeploymentFlavorToListResponse.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapDeploymentFlavorEntityDeploymentFlavorToListResponse.java
index 42ff7c9058..292ee88ef9 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapDeploymentFlavorEntityDeploymentFlavorToListResponse.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapDeploymentFlavorEntityDeploymentFlavorToListResponse.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.DeploymentFlavorEntity;
@@ -25,18 +24,15 @@ import org.openecomp.sdc.vendorsoftwareproduct.types.composition.DeploymentFlavo
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.DeploymentFlavorListResponseDto;
-public class MapDeploymentFlavorEntityDeploymentFlavorToListResponse extends
- MappingBase<DeploymentFlavorEntity, DeploymentFlavorListResponseDto> {
-
- @Override
- public void doMapping(DeploymentFlavorEntity source,
- DeploymentFlavorListResponseDto target) {
- target.setId(source.getId());
- DeploymentFlavor deploymentFlavor = source.getDeploymentFlavorCompositionData();
+public class MapDeploymentFlavorEntityDeploymentFlavorToListResponse extends MappingBase<DeploymentFlavorEntity, DeploymentFlavorListResponseDto> {
- if (deploymentFlavor != null) {
- target.setModel(deploymentFlavor.getModel());
- target.setDescription(deploymentFlavor.getDescription());
+ @Override
+ public void doMapping(DeploymentFlavorEntity source, DeploymentFlavorListResponseDto target) {
+ target.setId(source.getId());
+ DeploymentFlavor deploymentFlavor = source.getDeploymentFlavorCompositionData();
+ if (deploymentFlavor != null) {
+ target.setModel(deploymentFlavor.getModel());
+ target.setDescription(deploymentFlavor.getDescription());
+ }
}
- }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapDeploymentFlavorEntityToDeploymentFlavorCreationDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapDeploymentFlavorEntityToDeploymentFlavorCreationDto.java
index 05fa35d0ba..80b6649005 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapDeploymentFlavorEntityToDeploymentFlavorCreationDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapDeploymentFlavorEntityToDeploymentFlavorCreationDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,20 +17,16 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.DeploymentFlavorEntity;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.DeploymentFlavorCreationDto;
+public class MapDeploymentFlavorEntityToDeploymentFlavorCreationDto extends MappingBase<DeploymentFlavorEntity, DeploymentFlavorCreationDto> {
-public class MapDeploymentFlavorEntityToDeploymentFlavorCreationDto extends MappingBase<DeploymentFlavorEntity,
- DeploymentFlavorCreationDto> {
-
- @Override
- public void doMapping(DeploymentFlavorEntity source,
- DeploymentFlavorCreationDto target) {
- target.setDeploymentFlavorId(source.getId());
- }
+ @Override
+ public void doMapping(DeploymentFlavorEntity source, DeploymentFlavorCreationDto target) {
+ target.setDeploymentFlavorId(source.getId());
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapDeploymentFlavorEntityToDeploymentFlavorDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapDeploymentFlavorEntityToDeploymentFlavorDto.java
index 188ff82636..dbf9b2adf9 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapDeploymentFlavorEntityToDeploymentFlavorDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapDeploymentFlavorEntityToDeploymentFlavorDto.java
@@ -13,19 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
-
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.DeploymentFlavorEntity;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.DeploymentFlavorDto;
-public class MapDeploymentFlavorEntityToDeploymentFlavorDto extends
- MappingBase<DeploymentFlavorEntity, DeploymentFlavorDto> {
- @Override
- public void doMapping(DeploymentFlavorEntity source, DeploymentFlavorDto target) {
- target.setId(source.getId());
+public class MapDeploymentFlavorEntityToDeploymentFlavorDto extends MappingBase<DeploymentFlavorEntity, DeploymentFlavorDto> {
- }
+ @Override
+ public void doMapping(DeploymentFlavorEntity source, DeploymentFlavorDto target) {
+ target.setId(source.getId());
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapDeploymentFlavorRequestDtoToDeploymentFlavorEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapDeploymentFlavorRequestDtoToDeploymentFlavorEntity.java
index 97ccf28def..6bd60b81a2 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapDeploymentFlavorRequestDtoToDeploymentFlavorEntity.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapDeploymentFlavorRequestDtoToDeploymentFlavorEntity.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.DeploymentFlavorEntity;
@@ -25,16 +24,15 @@ import org.openecomp.sdc.vendorsoftwareproduct.types.composition.DeploymentFlavo
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.DeploymentFlavorRequestDto;
-public class MapDeploymentFlavorRequestDtoToDeploymentFlavorEntity
- extends MappingBase<DeploymentFlavorRequestDto, DeploymentFlavorEntity> {
+public class MapDeploymentFlavorRequestDtoToDeploymentFlavorEntity extends MappingBase<DeploymentFlavorRequestDto, DeploymentFlavorEntity> {
- @Override
- public void doMapping(DeploymentFlavorRequestDto source, DeploymentFlavorEntity target) {
- DeploymentFlavor deploymentFlavor = new DeploymentFlavor();
- deploymentFlavor.setModel(source.getModel());
- deploymentFlavor.setDescription(source.getDescription());
- deploymentFlavor.setFeatureGroupId(source.getFeatureGroupId());
- deploymentFlavor.setComponentComputeAssociations(source.getComponentComputeAssociations());
- target.setDeploymentFlavorCompositionData(deploymentFlavor);
- }
+ @Override
+ public void doMapping(DeploymentFlavorRequestDto source, DeploymentFlavorEntity target) {
+ DeploymentFlavor deploymentFlavor = new DeploymentFlavor();
+ deploymentFlavor.setModel(source.getModel());
+ deploymentFlavor.setDescription(source.getDescription());
+ deploymentFlavor.setFeatureGroupId(source.getFeatureGroupId());
+ deploymentFlavor.setComponentComputeAssociations(source.getComponentComputeAssociations());
+ target.setDeploymentFlavorCompositionData(deploymentFlavor);
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapDeploymentFlavorToDeploymentDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapDeploymentFlavorToDeploymentDto.java
index 06d299c805..b26669e511 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapDeploymentFlavorToDeploymentDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapDeploymentFlavorToDeploymentDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,20 +17,19 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.types.composition.DeploymentFlavor;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.DeploymentFlavorDto;
-
public class MapDeploymentFlavorToDeploymentDto extends MappingBase<DeploymentFlavor, DeploymentFlavorDto> {
- @Override
- public void doMapping(DeploymentFlavor source, DeploymentFlavorDto target) {
- target.setModel(source.getModel());
- target.setDescription(source.getDescription());
- target.setFeatureGroupId(source.getFeatureGroupId());
- target.setComponentComputeAssociations(source.getComponentComputeAssociations());
- }
+
+ @Override
+ public void doMapping(DeploymentFlavor source, DeploymentFlavorDto target) {
+ target.setModel(source.getModel());
+ target.setDescription(source.getDescription());
+ target.setFeatureGroupId(source.getFeatureGroupId());
+ target.setComponentComputeAssociations(source.getComponentComputeAssociations());
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapFilesDataStructureToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapFilesDataStructureToDto.java
index c8734ff8ee..a769a4ed1b 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapFilesDataStructureToDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapFilesDataStructureToDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,21 +17,19 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.types.candidateheat.FilesDataStructure;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.FileDataStructureDto;
-public class MapFilesDataStructureToDto
- extends MappingBase<FilesDataStructure, FileDataStructureDto> {
+public class MapFilesDataStructureToDto extends MappingBase<FilesDataStructure, FileDataStructureDto> {
- @Override
- public void doMapping(FilesDataStructure source, FileDataStructureDto target) {
- target.setModules(source.getModules());
- target.setArtifacts(source.getArtifacts());
- target.setNested(source.getNested());
- target.setUnassigned(source.getUnassigned());
- }
+ @Override
+ public void doMapping(FilesDataStructure source, FileDataStructureDto target) {
+ target.setModules(source.getModules());
+ target.setArtifacts(source.getArtifacts());
+ target.setNested(source.getNested());
+ target.setUnassigned(source.getUnassigned());
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapImageDataToImageDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapImageDataToImageDto.java
index 4df6eb3de9..005de5fe9c 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapImageDataToImageDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapImageDataToImageDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,25 +17,17 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ImageData;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ImageDto;
-
public class MapImageDataToImageDto extends MappingBase<ImageData, ImageDto> {
- @Override
- public void doMapping(ImageData source, ImageDto target) {
- target.setFileName(source.getFileName());
- target.setDescription(source.getDescription());
- }
+ @Override
+ public void doMapping(ImageData source, ImageDto target) {
+ target.setFileName(source.getFileName());
+ target.setDescription(source.getDescription());
+ }
}
-
-
-
-
-
-
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapImageEntityToImageCreationDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapImageEntityToImageCreationDto.java
index cc15ef0898..5a811b2228 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapImageEntityToImageCreationDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapImageEntityToImageCreationDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,18 +17,16 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ImageEntity;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ImageCreationDto;
-public class MapImageEntityToImageCreationDto extends MappingBase<ImageEntity,
- ImageCreationDto> {
+public class MapImageEntityToImageCreationDto extends MappingBase<ImageEntity, ImageCreationDto> {
- @Override
- public void doMapping(ImageEntity source, ImageCreationDto target) {
- target.setId(source.getId());
- }
+ @Override
+ public void doMapping(ImageEntity source, ImageCreationDto target) {
+ target.setId(source.getId());
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapImageEntityToImageDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapImageEntityToImageDto.java
index b35a0f2a38..d17735483f 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapImageEntityToImageDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapImageEntityToImageDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ImageEntity;
@@ -27,14 +26,14 @@ import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ImageDto;
public class MapImageEntityToImageDto extends MappingBase<ImageEntity, ImageDto> {
- @Override
- public void doMapping(ImageEntity source, ImageDto target) {
- target.setId(source.getId());
- Image image = source.getImageCompositionData();
- if (image != null) {
- ImageData imageData = new ImageData(image.getFileName(), image.getDescription());
- new MapImageDataToImageDto().doMapping(imageData, target);
+ @Override
+ public void doMapping(ImageEntity source, ImageDto target) {
+ target.setId(source.getId());
+ Image image = source.getImageCompositionData();
+ if (image != null) {
+ ImageData imageData = new ImageData(image.getFileName(), image.getDescription());
+ new MapImageDataToImageDto().doMapping(imageData, target);
+ }
}
- }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapImageRequestDtoToImageEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapImageRequestDtoToImageEntity.java
index 3e1c126226..fa2f432e89 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapImageRequestDtoToImageEntity.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapImageRequestDtoToImageEntity.java
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ImageEntity;
@@ -23,12 +22,11 @@ import org.openecomp.sdcrests.vendorsoftwareproducts.types.ImageRequestDto;
public class MapImageRequestDtoToImageEntity extends MappingBase<ImageRequestDto, ImageEntity> {
- @Override
- public void doMapping(ImageRequestDto source, ImageEntity target) {
- Image image = new Image();
- image.setFileName(source.getFileName());
- image.setDescription(source.getDescription());
- target.setImageCompositionData(image);
- }
-
+ @Override
+ public void doMapping(ImageRequestDto source, ImageEntity target) {
+ Image image = new Image();
+ image.setFileName(source.getFileName());
+ image.setDescription(source.getDescription());
+ target.setImageCompositionData(image);
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapItemToVspDetailsDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapItemToVspDetailsDto.java
index 926f1f0b25..e0966e8350 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapItemToVspDetailsDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapItemToVspDetailsDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.versioning.types.Item;
@@ -26,15 +25,16 @@ import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspDetailsDto;
import org.openecomp.sdcrests.vsp.rest.services.VspItemProperty;
public class MapItemToVspDetailsDto extends MappingBase<Item, VspDetailsDto> {
- @Override
- public void doMapping(Item source, VspDetailsDto target) {
- target.setId(source.getId());
- target.setName(source.getName());
- target.setDescription(source.getDescription());
- target.setVendorId((String) source.getProperties().get(VspItemProperty.VENDOR_ID));
- target.setVendorName((String) source.getProperties().get(VspItemProperty.VENDOR_NAME));
- target.setOnboardingMethod((String) source.getProperties().get(VspItemProperty.ONBOARDING_METHOD));
- target.setOwner(source.getOwner());
- target.setStatus(source.getStatus().name());
- }
+
+ @Override
+ public void doMapping(Item source, VspDetailsDto target) {
+ target.setId(source.getId());
+ target.setName(source.getName());
+ target.setDescription(source.getDescription());
+ target.setVendorId((String) source.getProperties().get(VspItemProperty.VENDOR_ID));
+ target.setVendorName((String) source.getProperties().get(VspItemProperty.VENDOR_NAME));
+ target.setOnboardingMethod((String) source.getProperties().get(VspItemProperty.ONBOARDING_METHOD));
+ target.setOwner(source.getOwner());
+ target.setStatus(source.getStatus().name());
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapMonitoringUploadStatusToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapMonitoringUploadStatusToDto.java
index 08d322dad0..08add59679 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapMonitoringUploadStatusToDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapMonitoringUploadStatusToDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,19 +17,18 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.MonitoringUploadStatus;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.MonitoringUploadStatusDto;
-public class MapMonitoringUploadStatusToDto
- extends MappingBase<MonitoringUploadStatus, MonitoringUploadStatusDto> {
- @Override
- public void doMapping(MonitoringUploadStatus source, MonitoringUploadStatusDto target) {
- target.setSnmpPoll(source.getSnmpPoll());
- target.setSnmpTrap(source.getSnmpTrap());
- target.setVesEvent(source.getVesEvent());
- }
+public class MapMonitoringUploadStatusToDto extends MappingBase<MonitoringUploadStatus, MonitoringUploadStatusDto> {
+
+ @Override
+ public void doMapping(MonitoringUploadStatus source, MonitoringUploadStatusDto target) {
+ target.setSnmpPoll(source.getSnmpPoll());
+ target.setSnmpTrap(source.getSnmpTrap());
+ target.setVesEvent(source.getVesEvent());
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkEntityToNetworkDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkEntityToNetworkDto.java
index 1d79f35769..cf2ced753e 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkEntityToNetworkDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkEntityToNetworkDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity;
@@ -26,12 +25,13 @@ import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.NetworkDto;
public class MapNetworkEntityToNetworkDto extends MappingBase<NetworkEntity, NetworkDto> {
- @Override
- public void doMapping(NetworkEntity source, NetworkDto target) {
- target.setId(source.getId());
- Network network = source.getNetworkCompositionData();
- if (network != null) {
- new MapNetworkToNetworkDto().doMapping(network, target);
+
+ @Override
+ public void doMapping(NetworkEntity source, NetworkDto target) {
+ target.setId(source.getId());
+ Network network = source.getNetworkCompositionData();
+ if (network != null) {
+ new MapNetworkToNetworkDto().doMapping(network, target);
+ }
}
- }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkRequestDtoToNetworkEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkRequestDtoToNetworkEntity.java
index 00395c4b99..4db9209c53 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkRequestDtoToNetworkEntity.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkRequestDtoToNetworkEntity.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity;
@@ -25,13 +24,13 @@ import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.NetworkRequestDto;
-public class MapNetworkRequestDtoToNetworkEntity
- extends MappingBase<NetworkRequestDto, NetworkEntity> {
- @Override
- public void doMapping(NetworkRequestDto source, NetworkEntity target) {
- Network network = new Network();
- network.setName(source.getName());
- network.setDhcp(source.isDhcp());
- target.setNetworkCompositionData(network);
- }
+public class MapNetworkRequestDtoToNetworkEntity extends MappingBase<NetworkRequestDto, NetworkEntity> {
+
+ @Override
+ public void doMapping(NetworkRequestDto source, NetworkEntity target) {
+ Network network = new Network();
+ network.setName(source.getName());
+ network.setDhcp(source.isDhcp());
+ target.setNetworkCompositionData(network);
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkToNetworkDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkToNetworkDto.java
index dd819de1a6..6cede067f1 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkToNetworkDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkToNetworkDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network;
@@ -25,9 +24,10 @@ import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.NetworkDto;
public class MapNetworkToNetworkDto extends MappingBase<Network, NetworkDto> {
- @Override
- public void doMapping(Network source, NetworkDto target) {
- target.setName(source.getName());
- target.setDhcp(source.isDhcp());
- }
+
+ @Override
+ public void doMapping(Network source, NetworkDto target) {
+ target.setName(source.getName());
+ target.setDhcp(source.isDhcp());
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicEntityToNicCreationResponseDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicEntityToNicCreationResponseDto.java
index 835ff0b7b9..a3be49e684 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicEntityToNicCreationResponseDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicEntityToNicCreationResponseDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,20 +17,16 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
-
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.NicCreationResponseDto;
-public class MapNicEntityToNicCreationResponseDto extends MappingBase<NicEntity,
- NicCreationResponseDto> {
-
+public class MapNicEntityToNicCreationResponseDto extends MappingBase<NicEntity, NicCreationResponseDto> {
- @Override
- public void doMapping(NicEntity source, NicCreationResponseDto target) {
- target.setNicId(source.getId());
- }
+ @Override
+ public void doMapping(NicEntity source, NicCreationResponseDto target) {
+ target.setNicId(source.getId());
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicEntityToNicDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicEntityToNicDto.java
index 2af7e2ff6b..ea56e73237 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicEntityToNicDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicEntityToNicDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity;
@@ -26,12 +25,13 @@ import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.NicDto;
public class MapNicEntityToNicDto extends MappingBase<NicEntity, NicDto> {
- @Override
- public void doMapping(NicEntity source, NicDto target) {
- target.setId(source.getId());
- Nic nic = source.getNicCompositionData();
- if (nic != null) {
- new MapNicToNicDto().doMapping(nic, target);
+
+ @Override
+ public void doMapping(NicEntity source, NicDto target) {
+ target.setId(source.getId());
+ Nic nic = source.getNicCompositionData();
+ if (nic != null) {
+ new MapNicToNicDto().doMapping(nic, target);
+ }
}
- }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicRequestDtoToNicEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicRequestDtoToNicEntity.java
index 7fd0253556..da2d7c8814 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicRequestDtoToNicEntity.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicRequestDtoToNicEntity.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity;
@@ -27,14 +26,15 @@ import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.NicRequestDto;
public class MapNicRequestDtoToNicEntity extends MappingBase<NicRequestDto, NicEntity> {
- @Override
- public void doMapping(NicRequestDto source, NicEntity target) {
- Nic nic = new Nic();
- nic.setName(source.getName());
- nic.setDescription(source.getDescription());
- nic.setNetworkId(source.getNetworkId());
- nic.setNetworkType(NetworkType.valueOf(source.getNetworkType()));
- nic.setNetworkDescription(source.getNetworkDescription());
- target.setNicCompositionData(nic);
- }
+
+ @Override
+ public void doMapping(NicRequestDto source, NicEntity target) {
+ Nic nic = new Nic();
+ nic.setName(source.getName());
+ nic.setDescription(source.getDescription());
+ nic.setNetworkId(source.getNetworkId());
+ nic.setNetworkType(NetworkType.valueOf(source.getNetworkType()));
+ nic.setNetworkDescription(source.getNetworkDescription());
+ target.setNicCompositionData(nic);
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicToNicDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicToNicDto.java
index 8c48f18b3d..4a22fb5f19 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicToNicDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicToNicDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic;
@@ -25,15 +24,16 @@ import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.NicDto;
public class MapNicToNicDto extends MappingBase<Nic, NicDto> {
- @Override
- public void doMapping(Nic source, NicDto target) {
- target.setName(source.getName());
- target.setDescription(source.getDescription());
- target.setNetworkId(source.getNetworkId());
- target.setNetworkName(source.getNetworkName());
- if (source.getNetworkType() != null) {
- target.setNetworkType(source.getNetworkType().name());
+
+ @Override
+ public void doMapping(Nic source, NicDto target) {
+ target.setName(source.getName());
+ target.setDescription(source.getDescription());
+ target.setNetworkId(source.getNetworkId());
+ target.setNetworkName(source.getNetworkName());
+ if (source.getNetworkType() != null) {
+ target.setNetworkType(source.getNetworkType().name());
+ }
+ target.setNetworkDescription(source.getNetworkDescription());
}
- target.setNetworkDescription(source.getNetworkDescription());
- }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapPackageInfoToPackageInfoDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapPackageInfoToPackageInfoDto.java
index 1bf13f8c3f..c6faa0361b 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapPackageInfoToPackageInfoDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapPackageInfoToPackageInfoDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.PackageInfo;
@@ -28,18 +27,19 @@ import org.openecomp.sdcrests.vendorsoftwareproducts.types.PackageInfoDto;
* Created by TALIO on 4/25/2016.
*/
public class MapPackageInfoToPackageInfoDto extends MappingBase<PackageInfo, PackageInfoDto> {
- @Override
- public void doMapping(PackageInfo source, PackageInfoDto target) {
- target.setVspName(source.getVspName());
- target.setPackageId(source.getVspId());
- target.setDescription(source.getVspDescription());
- target.setVersion(source.getVersion());
- target.setPackageType(source.getPackageType());
- target.setCategory(source.getCategory());
- target.setSubCategory(source.getSubCategory());
- target.setPackageChecksum(source.getPackageChecksum());
- target.setVendorRelease(source.getVendorRelease());
- target.setVendorName(source.getVendorName());
- target.setResourceType(source.getResourceType());
- }
+
+ @Override
+ public void doMapping(PackageInfo source, PackageInfoDto target) {
+ target.setVspName(source.getVspName());
+ target.setPackageId(source.getVspId());
+ target.setDescription(source.getVspDescription());
+ target.setVersion(source.getVersion());
+ target.setPackageType(source.getPackageType());
+ target.setCategory(source.getCategory());
+ target.setSubCategory(source.getSubCategory());
+ target.setPackageChecksum(source.getPackageChecksum());
+ target.setVendorRelease(source.getVendorRelease());
+ target.setVendorName(source.getVendorName());
+ target.setResourceType(source.getResourceType());
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapProcessEntityToProcessEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapProcessEntityToProcessEntityDto.java
index 96a67a9d87..6d6a6d29de 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapProcessEntityToProcessEntityDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapProcessEntityToProcessEntityDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,21 +17,20 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ProcessEntityDto;
-public class MapProcessEntityToProcessEntityDto
- extends MappingBase<ProcessEntity, ProcessEntityDto> {
- @Override
- public void doMapping(ProcessEntity source, ProcessEntityDto target) {
- target.setId(source.getId());
- target.setName(source.getName());
- target.setDescription(source.getDescription());
- target.setType(source.getType());
- target.setArtifactName(source.getArtifactName());
- }
+public class MapProcessEntityToProcessEntityDto extends MappingBase<ProcessEntity, ProcessEntityDto> {
+
+ @Override
+ public void doMapping(ProcessEntity source, ProcessEntityDto target) {
+ target.setId(source.getId());
+ target.setName(source.getName());
+ target.setDescription(source.getDescription());
+ target.setType(source.getType());
+ target.setArtifactName(source.getArtifactName());
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapProcessRequestDtoToProcessEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapProcessRequestDtoToProcessEntity.java
index d1a28d7145..2f53b24d25 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapProcessRequestDtoToProcessEntity.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapProcessRequestDtoToProcessEntity.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,19 +17,18 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ProcessRequestDto;
-public class MapProcessRequestDtoToProcessEntity
- extends MappingBase<ProcessRequestDto, ProcessEntity> {
- @Override
- public void doMapping(ProcessRequestDto source, ProcessEntity target) {
- target.setName(source.getName());
- target.setDescription(source.getDescription());
- target.setType(source.getType());
- }
+public class MapProcessRequestDtoToProcessEntity extends MappingBase<ProcessRequestDto, ProcessEntity> {
+
+ @Override
+ public void doMapping(ProcessRequestDto source, ProcessEntity target) {
+ target.setName(source.getName());
+ target.setDescription(source.getDescription());
+ target.setType(source.getType());
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapQuestionnaireResponseToQuestionnaireResponseDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapQuestionnaireResponseToQuestionnaireResponseDto.java
index 52252c0425..598596b030 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapQuestionnaireResponseToQuestionnaireResponseDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapQuestionnaireResponseToQuestionnaireResponseDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,20 +17,18 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.types.QuestionnaireResponse;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireResponseDto;
-public class MapQuestionnaireResponseToQuestionnaireResponseDto
- extends MappingBase<QuestionnaireResponse, QuestionnaireResponseDto> {
+public class MapQuestionnaireResponseToQuestionnaireResponseDto extends MappingBase<QuestionnaireResponse, QuestionnaireResponseDto> {
- @Override
- public void doMapping(QuestionnaireResponse source, QuestionnaireResponseDto target) {
- target.setData(source.getData());
- target.setSchema(source.getSchema());
- target.setErrorMessage(source.getErrorMessage());
- }
+ @Override
+ public void doMapping(QuestionnaireResponse source, QuestionnaireResponseDto target) {
+ target.setData(source.getData());
+ target.setSchema(source.getSchema());
+ target.setErrorMessage(source.getErrorMessage());
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapQuestionnaireToQuestionnaireDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapQuestionnaireToQuestionnaireDto.java
index fe8e3c5ea4..e846f0e047 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapQuestionnaireToQuestionnaireDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapQuestionnaireToQuestionnaireDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,25 +17,22 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
+import java.util.HashMap;
import org.openecomp.core.utilities.json.JsonUtil;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.CompositionEntity;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireDto;
-import java.util.HashMap;
-
/**
* Created by ayalaben on 9/26/2017
*/
-public class MapQuestionnaireToQuestionnaireDto extends
- MappingBase<CompositionEntity, QuestionnaireDto> {
+public class MapQuestionnaireToQuestionnaireDto extends MappingBase<CompositionEntity, QuestionnaireDto> {
- @Override
- public void doMapping(CompositionEntity source, QuestionnaireDto target) {
- target.setId(source.getId());
- target.setQuestionareData(JsonUtil.json2Object(source.getQuestionnaireData(), HashMap.class));
- }
+ @Override
+ public void doMapping(CompositionEntity source, QuestionnaireDto target) {
+ target.setId(source.getId());
+ target.setQuestionareData(JsonUtil.json2Object(source.getQuestionnaireData(), HashMap.class));
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapUploadFileResponseToUploadFileResponseDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapUploadFileResponseToUploadFileResponseDto.java
index 48053d053d..f78e2e0dee 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapUploadFileResponseToUploadFileResponseDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapUploadFileResponseToUploadFileResponseDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,10 +17,8 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
-
import org.openecomp.sdc.vendorsoftwareproduct.types.UploadFileResponse;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.UploadFileResponseDto;
@@ -28,13 +26,13 @@ import org.openecomp.sdcrests.vendorsoftwareproducts.types.UploadFileResponseDto
/**
* Created by TALIO on 4/27/2016.
*/
-public class MapUploadFileResponseToUploadFileResponseDto
- extends MappingBase<UploadFileResponse, UploadFileResponseDto> {
- @Override
- public void doMapping(UploadFileResponse source, UploadFileResponseDto target) {
- target.setStatus(source.getStatus());
- target.setErrors(source.getErrors());
- target.setOnboardingOrigin(source.getOnboardingType().toString());
- target.setNetworkPackageName(source.getNetworkPackageName());
- }
+public class MapUploadFileResponseToUploadFileResponseDto extends MappingBase<UploadFileResponse, UploadFileResponseDto> {
+
+ @Override
+ public void doMapping(UploadFileResponse source, UploadFileResponseDto target) {
+ target.setStatus(source.getStatus());
+ target.setErrors(source.getErrors());
+ target.setOnboardingOrigin(source.getOnboardingType().toString());
+ target.setNetworkPackageName(source.getNetworkPackageName());
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapValidationResponseToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapValidationResponseToDto.java
index b3fbe1e7c9..8048786f69 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapValidationResponseToDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapValidationResponseToDto.java
@@ -13,9 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import java.util.stream.Collectors;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections4.MapUtils;
import org.openecomp.sdc.common.errors.ErrorCode;
@@ -32,61 +38,47 @@ import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityVali
import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireValidationResultDto;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ValidationResponseDto;
-import java.util.*;
-import java.util.stream.Collectors;
+public class MapValidationResponseToDto extends MappingBase<ValidationResponse, ValidationResponseDto> {
-public class MapValidationResponseToDto
- extends MappingBase<ValidationResponse, ValidationResponseDto> {
- private static Map<String, List<ErrorMessageDto>> mapUploadDataErrors(
- Map<String, List<ErrorMessage>> uploadDataErrors) {
- if (MapUtils.isEmpty(uploadDataErrors)) {
- return null;
+ private static Map<String, List<ErrorMessageDto>> mapUploadDataErrors(Map<String, List<ErrorMessage>> uploadDataErrors) {
+ if (MapUtils.isEmpty(uploadDataErrors)) {
+ return null;
+ }
+ return uploadDataErrors.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, entry -> mapErrorMessages(entry.getValue())));
}
- return uploadDataErrors.entrySet().stream().collect(
- Collectors.toMap(Map.Entry::getKey, entry -> mapErrorMessages(entry.getValue())));
- }
- private static QuestionnaireValidationResultDto mapQuestionnaireValidationResult(
- QuestionnaireValidationResult questionnaireValidationResult) {
- if (Objects.isNull(questionnaireValidationResult)
- || Objects.isNull(questionnaireValidationResult.getValidationData())) {
- return null;
+ private static QuestionnaireValidationResultDto mapQuestionnaireValidationResult(QuestionnaireValidationResult questionnaireValidationResult) {
+ if (Objects.isNull(questionnaireValidationResult) || Objects.isNull(questionnaireValidationResult.getValidationData())) {
+ return null;
+ }
+ QuestionnaireValidationResultDto questionnaireValidationResultDto = new QuestionnaireValidationResultDto();
+ questionnaireValidationResultDto.setValid(questionnaireValidationResult.isValid());
+ Set<CompositionEntityValidationDataDto> validationDataDto = new HashSet<>();
+ for (CompositionEntityValidationData validationData : questionnaireValidationResult.getValidationData()) {
+ validationDataDto
+ .add(new MapCompositionEntityValidationDataToDto().applyMapping(validationData, CompositionEntityValidationDataDto.class));
+ }
+ questionnaireValidationResultDto.setValidationData(validationDataDto);
+ return questionnaireValidationResultDto;
}
- QuestionnaireValidationResultDto questionnaireValidationResultDto =
- new QuestionnaireValidationResultDto();
- questionnaireValidationResultDto.setValid(questionnaireValidationResult.isValid());
- Set<CompositionEntityValidationDataDto> validationDataDto = new HashSet<>();
- for (CompositionEntityValidationData validationData : questionnaireValidationResult
- .getValidationData()) {
- validationDataDto.add(new MapCompositionEntityValidationDataToDto().applyMapping(
- validationData, CompositionEntityValidationDataDto.class));
+ private static List<ErrorMessageDto> mapErrorMessages(List<ErrorMessage> errorMessages) {
+ return errorMessages == null ? null
+ : errorMessages.stream().map(errorMessage -> new MapErrorMessageToDto().applyMapping(errorMessage, ErrorMessageDto.class))
+ .collect(Collectors.toList());
}
- questionnaireValidationResultDto.setValidationData(validationDataDto);
- return questionnaireValidationResultDto;
- }
-
-
- private static List<ErrorMessageDto> mapErrorMessages(List<ErrorMessage> errorMessages) {
- return errorMessages == null ? null : errorMessages.stream().map(
- errorMessage -> new MapErrorMessageToDto()
- .applyMapping(errorMessage, ErrorMessageDto.class)).collect(Collectors.toList());
- }
-
- private static Collection<ErrorCodeDto> mapErrorCodes(Collection<ErrorCode> errorCodes) {
- return CollectionUtils.isEmpty(errorCodes) ? null : errorCodes.stream()
- .map(errorCode -> new MapErrorCodeToDto().applyMapping(errorCode, ErrorCodeDto.class))
- .collect(Collectors.toList());
- }
+ private static Collection<ErrorCodeDto> mapErrorCodes(Collection<ErrorCode> errorCodes) {
+ return CollectionUtils.isEmpty(errorCodes) ? null
+ : errorCodes.stream().map(errorCode -> new MapErrorCodeToDto().applyMapping(errorCode, ErrorCodeDto.class)).collect(Collectors.toList());
+ }
- @Override
- public void doMapping(ValidationResponse source, ValidationResponseDto target) {
- target.setValid(source.isValid());
- target.setVspErrors(mapErrorCodes(source.getVspErrors()));
- target.setLicensingDataErrors(mapErrorCodes(source.getLicensingDataErrors()));
- target.setUploadDataErrors(mapUploadDataErrors(source.getUploadDataErrors()));
- target.setQuestionnaireValidationResult(
- mapQuestionnaireValidationResult(source.getQuestionnaireValidationResult()));
- }
+ @Override
+ public void doMapping(ValidationResponse source, ValidationResponseDto target) {
+ target.setValid(source.isValid());
+ target.setVspErrors(mapErrorCodes(source.getVspErrors()));
+ target.setLicensingDataErrors(mapErrorCodes(source.getLicensingDataErrors()));
+ target.setUploadDataErrors(mapUploadDataErrors(source.getUploadDataErrors()));
+ target.setQuestionnaireValidationResult(mapQuestionnaireValidationResult(source.getQuestionnaireValidationResult()));
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDescriptionDtoToItem.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDescriptionDtoToItem.java
index 484b7c80bb..0543c20298 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDescriptionDtoToItem.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDescriptionDtoToItem.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.versioning.types.Item;
@@ -26,11 +25,12 @@ import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspDescriptionDto;
import org.openecomp.sdcrests.vsp.rest.services.VspItemProperty;
public class MapVspDescriptionDtoToItem extends MappingBase<VspDescriptionDto, Item> {
- @Override
- public void doMapping(VspDescriptionDto source, Item target) {
- target.setName(source.getName());
- target.setDescription(source.getDescription());
- target.addProperty(VspItemProperty.VENDOR_ID, source.getVendorId());
- target.addProperty(VspItemProperty.VENDOR_NAME, source.getVendorName());
- }
+
+ @Override
+ public void doMapping(VspDescriptionDto source, Item target) {
+ target.setName(source.getName());
+ target.setDescription(source.getDescription());
+ target.addProperty(VspItemProperty.VENDOR_ID, source.getVendorId());
+ target.addProperty(VspItemProperty.VENDOR_NAME, source.getVendorName());
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDescriptionDtoToVspDetails.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDescriptionDtoToVspDetails.java
index 3ab2667821..4c9c16df89 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDescriptionDtoToVspDetails.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDescriptionDtoToVspDetails.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.LicenseType;
@@ -29,27 +28,25 @@ import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspDescriptionDto;
public class MapVspDescriptionDtoToVspDetails extends MappingBase<VspDescriptionDto, VspDetails> {
- @Override
- public void doMapping(VspDescriptionDto source, VspDetails target) {
- target.setName(source.getName());
- target.setDescription(source.getDescription());
- target.setCategory(source.getCategory());
- target.setSubCategory(source.getSubCategory());
- target.setIcon(source.getIcon());
- target.setVendorName(source.getVendorName());
- target.setVendorId(source.getVendorId());
-
- if (source.getLicensingVersion() != null && source.getLicenseType() != LicenseType.EXTERNAL) {
- target.setVlmVersion(new Version(source.getLicensingVersion()));
- }
- if (source.getLicenseType() != null) {
- target.setLicenseType(source.getLicenseType().name());
- }
-
- LicensingData licensingData = source.getLicensingData();
- if (licensingData != null && source.getLicenseType() != LicenseType.EXTERNAL) {
- target.setLicenseAgreement(licensingData.getLicenseAgreement());
- target.setFeatureGroups(licensingData.getFeatureGroups());
+ @Override
+ public void doMapping(VspDescriptionDto source, VspDetails target) {
+ target.setName(source.getName());
+ target.setDescription(source.getDescription());
+ target.setCategory(source.getCategory());
+ target.setSubCategory(source.getSubCategory());
+ target.setIcon(source.getIcon());
+ target.setVendorName(source.getVendorName());
+ target.setVendorId(source.getVendorId());
+ if (source.getLicensingVersion() != null && source.getLicenseType() != LicenseType.EXTERNAL) {
+ target.setVlmVersion(new Version(source.getLicensingVersion()));
+ }
+ if (source.getLicenseType() != null) {
+ target.setLicenseType(source.getLicenseType().name());
+ }
+ LicensingData licensingData = source.getLicensingData();
+ if (licensingData != null && source.getLicenseType() != LicenseType.EXTERNAL) {
+ target.setLicenseAgreement(licensingData.getLicenseAgreement());
+ target.setFeatureGroups(licensingData.getFeatureGroups());
+ }
}
- }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDetailsToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDetailsToDto.java
index 1ba5d1355c..1605ab7218 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDetailsToDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDetailsToDto.java
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.apache.commons.lang3.StringUtils;
@@ -29,31 +28,29 @@ import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspDetailsDto;
public class MapVspDetailsToDto extends MappingBase<VspDetails, VspDetailsDto> {
- @Override
- public void doMapping(VspDetails source, VspDetailsDto target) {
- target.setId(source.getId());
- target.setVersion(source.getVersion() == null ? null : source.getVersion().getId());
- target.setName(source.getName());
- target.setDescription(source.getDescription());
- target.setIcon(source.getIcon());
- target.setCategory(source.getCategory());
- target.setSubCategory(source.getSubCategory());
- target.setVendorId(source.getVendorId());
- target.setVendorName(source.getVendorName());
- target.setLicensingVersion(
- source.getVlmVersion() == null ? null : source.getVlmVersion().getId());
- if (StringUtils.isNotBlank(source.getLicenseType())) {
- target.setLicenseType(LicenseType.valueOf(source.getLicenseType()));
- } else if (StringUtils.isNotBlank(target.getLicensingVersion())){
- target.setLicenseType(LicenseType.INTERNAL);
- }
- if (source.getLicenseAgreement() != null || source.getFeatureGroups() != null) {
- LicensingData licensingData = new LicensingData();
- licensingData.setLicenseAgreement(source.getLicenseAgreement());
- licensingData.setFeatureGroups(source.getFeatureGroups());
- target.setLicensingData(licensingData);
+ @Override
+ public void doMapping(VspDetails source, VspDetailsDto target) {
+ target.setId(source.getId());
+ target.setVersion(source.getVersion() == null ? null : source.getVersion().getId());
+ target.setName(source.getName());
+ target.setDescription(source.getDescription());
+ target.setIcon(source.getIcon());
+ target.setCategory(source.getCategory());
+ target.setSubCategory(source.getSubCategory());
+ target.setVendorId(source.getVendorId());
+ target.setVendorName(source.getVendorName());
+ target.setLicensingVersion(source.getVlmVersion() == null ? null : source.getVlmVersion().getId());
+ if (StringUtils.isNotBlank(source.getLicenseType())) {
+ target.setLicenseType(LicenseType.valueOf(source.getLicenseType()));
+ } else if (StringUtils.isNotBlank(target.getLicensingVersion())) {
+ target.setLicenseType(LicenseType.INTERNAL);
+ }
+ if (source.getLicenseAgreement() != null || source.getFeatureGroups() != null) {
+ LicensingData licensingData = new LicensingData();
+ licensingData.setLicenseAgreement(source.getLicenseAgreement());
+ licensingData.setFeatureGroups(source.getFeatureGroups());
+ target.setLicensingData(licensingData);
+ }
+ target.setOnboardingMethod(source.getOnboardingMethod());
}
-
- target.setOnboardingMethod(source.getOnboardingMethod());
- }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentDependenciesImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentDependenciesImpl.java
index becfac97b6..2357e94a95 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentDependenciesImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentDependenciesImpl.java
@@ -13,9 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.openecomp.sdcrests.vsp.rest.services;
+import java.util.Collection;
+import javax.inject.Named;
+import javax.ws.rs.core.Response;
import org.openecomp.sdc.vendorsoftwareproduct.ComponentDependencyModelManager;
import org.openecomp.sdc.vendorsoftwareproduct.ComponentDependencyModelManagerFactory;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentDependencyModelEntity;
@@ -31,103 +33,73 @@ import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
-import javax.inject.Named;
-import javax.ws.rs.core.Response;
-import java.util.Collection;
-
@Named
@Service("componentDependencies")
@Scope(value = "prototype")
public class ComponentDependenciesImpl implements ComponentDependencies {
- private final ComponentDependencyModelManager componentDependencyModelManager;
-
- public ComponentDependenciesImpl() {
- this.componentDependencyModelManager =
- ComponentDependencyModelManagerFactory.getInstance().createInterface();
- }
-
- public ComponentDependenciesImpl(ComponentDependencyModelManager componentDependencyModelManager) {
- this.componentDependencyModelManager = componentDependencyModelManager;
- }
-
- @Override
- public Response create(ComponentDependencyModel request, String vspId, String versionId,
- String user) {
- final Version version = new Version(versionId);
-
- ComponentDependencyModelEntity modelEntity =
- new MapComponentDependencyModelRequestToEntity().applyMapping(request,
- ComponentDependencyModelEntity.class);
-
- modelEntity.setVspId(vspId);
- modelEntity.setVersion(version);
-
- ComponentDependencyModelEntity componentDependency =
- componentDependencyModelManager.createComponentDependency(modelEntity, vspId, version);
-
- MapComponentDependencyEntityToCreationDto mapping =
- new MapComponentDependencyEntityToCreationDto();
- ComponentDependencyCreationDto createdComponentDependencyDto = mapping.applyMapping(
- componentDependency, ComponentDependencyCreationDto.class);
- return Response.ok(componentDependency != null ? createdComponentDependencyDto : null)
- .build();
- }
+ private final ComponentDependencyModelManager componentDependencyModelManager;
- @Override
- public Response list(String vspId, String versionId, String user) {
-
- Version vspVersion = new Version(versionId);
-
- Collection<ComponentDependencyModelEntity> componentDependencies =
- componentDependencyModelManager.list(vspId, vspVersion);
-
- MapComponentDependencyEntityToDto mapper = new MapComponentDependencyEntityToDto();
- GenericCollectionWrapper<ComponentDependencyResponseDto> results = new GenericCollectionWrapper
- <>();
- for (ComponentDependencyModelEntity entity : componentDependencies) {
- results.add(mapper.applyMapping(entity, ComponentDependencyResponseDto.class));
+ public ComponentDependenciesImpl() {
+ this.componentDependencyModelManager = ComponentDependencyModelManagerFactory.getInstance().createInterface();
}
- return Response.ok(results).build();
- }
-
- @Override
- public Response delete(String vspId, String versionId, String dependencyId, String user) {
-
- Version vspVersion = new Version(versionId);
- componentDependencyModelManager.delete(vspId, vspVersion, dependencyId);
- return Response.ok().build();
- }
-
- @Override
- public Response update(ComponentDependencyModel request, String vspId, String versionId, String
- dependencyId, String user) {
-
- final Version version = new Version(versionId);
- ComponentDependencyModelEntity modelEntity =
- new MapComponentDependencyModelRequestToEntity().applyMapping(request,
- ComponentDependencyModelEntity.class);
-
- modelEntity.setId(dependencyId);
- modelEntity.setVspId(vspId);
- modelEntity.setVersion(version);
- componentDependencyModelManager.update(modelEntity);
- return Response.ok().build();
- }
+ public ComponentDependenciesImpl(ComponentDependencyModelManager componentDependencyModelManager) {
+ this.componentDependencyModelManager = componentDependencyModelManager;
+ }
- @Override
- public Response get(String vspId, String version, String dependencyId, String user) {
+ @Override
+ public Response create(ComponentDependencyModel request, String vspId, String versionId, String user) {
+ final Version version = new Version(versionId);
+ ComponentDependencyModelEntity modelEntity = new MapComponentDependencyModelRequestToEntity()
+ .applyMapping(request, ComponentDependencyModelEntity.class);
+ modelEntity.setVspId(vspId);
+ modelEntity.setVersion(version);
+ ComponentDependencyModelEntity componentDependency = componentDependencyModelManager.createComponentDependency(modelEntity, vspId, version);
+ MapComponentDependencyEntityToCreationDto mapping = new MapComponentDependencyEntityToCreationDto();
+ ComponentDependencyCreationDto createdComponentDependencyDto = mapping
+ .applyMapping(componentDependency, ComponentDependencyCreationDto.class);
+ return Response.ok(componentDependency != null ? createdComponentDependencyDto : null).build();
+ }
- ComponentDependencyModelEntity componentDependencyModelEntity = componentDependencyModelManager
- .get(vspId, new Version(version), dependencyId);
+ @Override
+ public Response list(String vspId, String versionId, String user) {
+ Version vspVersion = new Version(versionId);
+ Collection<ComponentDependencyModelEntity> componentDependencies = componentDependencyModelManager.list(vspId, vspVersion);
+ MapComponentDependencyEntityToDto mapper = new MapComponentDependencyEntityToDto();
+ GenericCollectionWrapper<ComponentDependencyResponseDto> results = new GenericCollectionWrapper<>();
+ for (ComponentDependencyModelEntity entity : componentDependencies) {
+ results.add(mapper.applyMapping(entity, ComponentDependencyResponseDto.class));
+ }
+ return Response.ok(results).build();
+ }
- MapComponentDependencyEntityToDto mapper = new MapComponentDependencyEntityToDto();
- ComponentDependencyResponseDto componentDependencyResponseDto =
- mapper.applyMapping(componentDependencyModelEntity, ComponentDependencyResponseDto.class);
+ @Override
+ public Response delete(String vspId, String versionId, String dependencyId, String user) {
+ Version vspVersion = new Version(versionId);
+ componentDependencyModelManager.delete(vspId, vspVersion, dependencyId);
+ return Response.ok().build();
+ }
- return Response.ok(componentDependencyModelEntity != null ? componentDependencyResponseDto :
- null).build();
- }
+ @Override
+ public Response update(ComponentDependencyModel request, String vspId, String versionId, String dependencyId, String user) {
+ final Version version = new Version(versionId);
+ ComponentDependencyModelEntity modelEntity = new MapComponentDependencyModelRequestToEntity()
+ .applyMapping(request, ComponentDependencyModelEntity.class);
+ modelEntity.setId(dependencyId);
+ modelEntity.setVspId(vspId);
+ modelEntity.setVersion(version);
+ componentDependencyModelManager.update(modelEntity);
+ return Response.ok().build();
+ }
+ @Override
+ public Response get(String vspId, String version, String dependencyId, String user) {
+ ComponentDependencyModelEntity componentDependencyModelEntity = componentDependencyModelManager
+ .get(vspId, new Version(version), dependencyId);
+ MapComponentDependencyEntityToDto mapper = new MapComponentDependencyEntityToDto();
+ ComponentDependencyResponseDto componentDependencyResponseDto = mapper
+ .applyMapping(componentDependencyModelEntity, ComponentDependencyResponseDto.class);
+ return Response.ok(componentDependencyModelEntity != null ? componentDependencyResponseDto : null).build();
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentMonitoringUploadsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentMonitoringUploadsImpl.java
index 25c99b294b..64d36b95e0 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentMonitoringUploadsImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentMonitoringUploadsImpl.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,9 +17,11 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.services;
+import java.io.InputStream;
+import javax.inject.Named;
+import javax.ws.rs.core.Response;
import org.apache.cxf.jaxrs.ext.multipart.Attachment;
import org.openecomp.core.enrichment.types.MonitoringUploadType;
import org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder;
@@ -36,88 +38,67 @@ import org.openecomp.sdcrests.vsp.rest.mapping.MapMonitoringUploadStatusToDto;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
-import javax.inject.Named;
-import javax.ws.rs.core.Response;
-import java.io.InputStream;
-
/**
* @author katyr
* @since June 26, 2017
*/
-
@Named
@Service("componentMonitoringUploads")
@Scope(value = "prototype")
//@Validated
public class ComponentMonitoringUploadsImpl implements ComponentMonitoringUploads {
- private final MonitoringUploadsManager monitoringUploadsManager;
- private final ComponentManager componentManager;
-
- public ComponentMonitoringUploadsImpl() {
- this.monitoringUploadsManager = MonitoringUploadsManagerFactory.getInstance().createInterface();
- this.componentManager = ComponentManagerFactory.getInstance().createInterface();
- }
- public ComponentMonitoringUploadsImpl(MonitoringUploadsManager monitoringUploadsManager,
- ComponentManager componentManager) {
- this.monitoringUploadsManager = monitoringUploadsManager;
- this.componentManager = componentManager;
- }
+ private final MonitoringUploadsManager monitoringUploadsManager;
+ private final ComponentManager componentManager;
- @Override
- public Response upload(Attachment attachment,
- String vspId, String versionId, String componentId, String type,
- String user) throws Exception {
-
- Version version = new Version(versionId);
- componentManager.validateComponentExistence(vspId, version, componentId);
-
- MonitoringUploadType monitoringUploadType = getMonitoringUploadType(vspId, componentId, type);
- monitoringUploadsManager.upload(attachment.getObject(InputStream.class),
- attachment.getContentDisposition().getParameter("filename"), vspId, version, componentId,
- monitoringUploadType);
- return Response.ok().build();
- }
-
- private MonitoringUploadType getMonitoringUploadType(String vspId, String componentId,
- String type) throws Exception {
- MonitoringUploadType monitoringUploadType;
- try {
- monitoringUploadType = MonitoringUploadType.valueOf(type);
- } catch (IllegalArgumentException exception) {
- String errorWithParameters = ErrorMessagesFormatBuilder
- .getErrorWithParameters(Messages.ILLEGAL_MONITORING_ARTIFACT_TYPE.getErrorMessage(),
- componentId, vspId);
- throw new Exception(errorWithParameters, exception);
+ public ComponentMonitoringUploadsImpl() {
+ this.monitoringUploadsManager = MonitoringUploadsManagerFactory.getInstance().createInterface();
+ this.componentManager = ComponentManagerFactory.getInstance().createInterface();
}
- return monitoringUploadType;
- }
-
- @Override
- public Response delete(String vspId, String versionId, String componentId,
- String type, String user) throws Exception {
-
- MonitoringUploadType monitoringUploadType = getMonitoringUploadType(vspId, componentId, type);
- Version version = new Version(versionId);
- componentManager.validateComponentExistence(vspId, version, componentId);
- monitoringUploadsManager.delete(vspId, version, componentId, monitoringUploadType);
- return Response.ok().build();
- }
+ public ComponentMonitoringUploadsImpl(MonitoringUploadsManager monitoringUploadsManager, ComponentManager componentManager) {
+ this.monitoringUploadsManager = monitoringUploadsManager;
+ this.componentManager = componentManager;
+ }
- @Override
- public Response list(String vspId, String versionId, String componentId,
- String user) {
+ @Override
+ public Response upload(Attachment attachment, String vspId, String versionId, String componentId, String type, String user) throws Exception {
+ Version version = new Version(versionId);
+ componentManager.validateComponentExistence(vspId, version, componentId);
+ MonitoringUploadType monitoringUploadType = getMonitoringUploadType(vspId, componentId, type);
+ monitoringUploadsManager
+ .upload(attachment.getObject(InputStream.class), attachment.getContentDisposition().getParameter("filename"), vspId, version, componentId,
+ monitoringUploadType);
+ return Response.ok().build();
+ }
- Version version = new Version(versionId);
- componentManager.validateComponentExistence(vspId, version, componentId);
+ private MonitoringUploadType getMonitoringUploadType(String vspId, String componentId, String type) throws Exception {
+ MonitoringUploadType monitoringUploadType;
+ try {
+ monitoringUploadType = MonitoringUploadType.valueOf(type);
+ } catch (IllegalArgumentException exception) {
+ String errorWithParameters = ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.ILLEGAL_MONITORING_ARTIFACT_TYPE.getErrorMessage(), componentId, vspId);
+ throw new Exception(errorWithParameters, exception);
+ }
+ return monitoringUploadType;
+ }
- MonitoringUploadStatus response =
- monitoringUploadsManager.listFilenames(vspId, version, componentId);
+ @Override
+ public Response delete(String vspId, String versionId, String componentId, String type, String user) throws Exception {
+ MonitoringUploadType monitoringUploadType = getMonitoringUploadType(vspId, componentId, type);
+ Version version = new Version(versionId);
+ componentManager.validateComponentExistence(vspId, version, componentId);
+ monitoringUploadsManager.delete(vspId, version, componentId, monitoringUploadType);
+ return Response.ok().build();
+ }
- MonitoringUploadStatusDto returnEntity =
- new MapMonitoringUploadStatusToDto()
- .applyMapping(response, MonitoringUploadStatusDto.class);
- return Response.status(Response.Status.OK).entity(returnEntity).build();
- }
+ @Override
+ public Response list(String vspId, String versionId, String componentId, String user) {
+ Version version = new Version(versionId);
+ componentManager.validateComponentExistence(vspId, version, componentId);
+ MonitoringUploadStatus response = monitoringUploadsManager.listFilenames(vspId, version, componentId);
+ MonitoringUploadStatusDto returnEntity = new MapMonitoringUploadStatusToDto().applyMapping(response, MonitoringUploadStatusDto.class);
+ return Response.status(Response.Status.OK).entity(returnEntity).build();
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentProcessesImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentProcessesImpl.java
index 4e4d7d5d9e..ab0ad04075 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentProcessesImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentProcessesImpl.java
@@ -13,9 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.openecomp.sdcrests.vsp.rest.services;
+import java.io.File;
+import java.io.InputStream;
+import java.util.Collection;
+import javax.inject.Named;
+import javax.ws.rs.core.Response;
import org.apache.cxf.jaxrs.ext.multipart.Attachment;
import org.openecomp.sdc.activitylog.ActivityLogManager;
import org.openecomp.sdc.activitylog.ActivityLogManagerFactory;
@@ -37,165 +41,124 @@ import org.openecomp.sdcrests.wrappers.StringWrapperResponse;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
-import javax.inject.Named;
-import javax.ws.rs.core.Response;
-import java.io.File;
-import java.io.InputStream;
-import java.util.Collection;
-
@Named
@Service("componentProcesses")
@Scope(value = "prototype")
public class ComponentProcessesImpl implements ComponentProcesses {
- private final ProcessManager processManager;
- private final ComponentManager componentManager;
- private final ActivityLogManager activityLogManager;
-
- public ComponentProcessesImpl() {
- this.processManager = ProcessManagerFactory.getInstance().createInterface();
- this.componentManager = ComponentManagerFactory.getInstance().createInterface();
- this.activityLogManager = ActivityLogManagerFactory.getInstance().createInterface();
- }
-
- public ComponentProcessesImpl(ProcessManager processManager,
- ComponentManager componentManager, ActivityLogManager activityLogManager) {
- this.processManager = processManager;
- this.componentManager = componentManager;
- this.activityLogManager = activityLogManager;
- }
-
- @Override
- public Response list(String vspId, String versionId, String componentId, String user) {
+ private final ProcessManager processManager;
+ private final ComponentManager componentManager;
+ private final ActivityLogManager activityLogManager;
- Version version = new Version(versionId);
- validateComponentExistence(vspId, version, componentId, user);
- Collection<ProcessEntity> processes = processManager.listProcesses(vspId, version, componentId);
-
- MapProcessEntityToProcessEntityDto mapper = new MapProcessEntityToProcessEntityDto();
- GenericCollectionWrapper<ProcessEntityDto> results = new GenericCollectionWrapper<>();
- for (ProcessEntity process : processes) {
- results.add(mapper.applyMapping(process, ProcessEntityDto.class));
+ public ComponentProcessesImpl() {
+ this.processManager = ProcessManagerFactory.getInstance().createInterface();
+ this.componentManager = ComponentManagerFactory.getInstance().createInterface();
+ this.activityLogManager = ActivityLogManagerFactory.getInstance().createInterface();
}
- return Response.ok(results).build();
- }
-
- @Override
- public Response deleteList(String vspId, String versionId, String componentId, String user) {
-
- Version version = new Version(versionId);
- validateComponentExistence(vspId, version, componentId, user);
- processManager.deleteProcesses(vspId, version, componentId);
-
- return Response.ok().build();
- }
-
- @Override
- public Response create(ProcessRequestDto request, String vspId, String versionId,
- String componentId, String user) {
-
- ProcessEntity process =
- new MapProcessRequestDtoToProcessEntity().applyMapping(request, ProcessEntity.class);
- process.setVspId(vspId);
- process.setVersion(new Version(versionId));
- process.setComponentId(componentId);
-
- validateComponentExistence(vspId, process.getVersion(), componentId, user);
- ProcessEntity createdProcess = processManager.createProcess(process);
-
- return Response
- .ok(createdProcess != null ? new StringWrapperResponse(createdProcess.getId()) : null)
- .build();
- }
-
- @Override
- public Response get(String vspId, String versionId, String componentId, String processId,
- String user) {
-
- Version version = new Version(versionId);
- validateComponentExistence(vspId, version, componentId, user);
- ProcessEntity process = processManager.getProcess(vspId, version, componentId, processId);
- ProcessEntityDto result =
- new MapProcessEntityToProcessEntityDto().applyMapping(process, ProcessEntityDto.class);
- return Response.ok(result).build();
- }
-
- @Override
- public Response delete(String vspId, String versionId, String componentId, String processId,
- String user) {
-
- Version version = new Version(versionId);
- validateComponentExistence(vspId, version, componentId, user);
- processManager.deleteProcess(vspId, version, componentId, processId);
- return Response.ok().build();
- }
-
- @Override
- public Response update(ProcessRequestDto request, String vspId, String versionId,
- String componentId,
- String processId, String user) {
-
- ProcessEntity process =
- new MapProcessRequestDtoToProcessEntity().applyMapping(request, ProcessEntity.class);
- process.setVspId(vspId);
- process.setVersion(new Version(versionId));
- process.setComponentId(componentId);
- process.setId(processId);
- validateComponentExistence(vspId, process.getVersion(), componentId, user);
- processManager.updateProcess(process);
- return Response.ok().build();
- }
+ public ComponentProcessesImpl(ProcessManager processManager, ComponentManager componentManager, ActivityLogManager activityLogManager) {
+ this.processManager = processManager;
+ this.componentManager = componentManager;
+ this.activityLogManager = activityLogManager;
+ }
- @Override
- public Response getUploadedFile(String vspId, String versionId, String componentId,
- String processId, String user) {
+ @Override
+ public Response list(String vspId, String versionId, String componentId, String user) {
+ Version version = new Version(versionId);
+ validateComponentExistence(vspId, version, componentId, user);
+ Collection<ProcessEntity> processes = processManager.listProcesses(vspId, version, componentId);
+ MapProcessEntityToProcessEntityDto mapper = new MapProcessEntityToProcessEntityDto();
+ GenericCollectionWrapper<ProcessEntityDto> results = new GenericCollectionWrapper<>();
+ for (ProcessEntity process : processes) {
+ results.add(mapper.applyMapping(process, ProcessEntityDto.class));
+ }
+ return Response.ok(results).build();
+ }
- Version vspVersion = new Version(versionId);
- validateComponentExistence(vspId, vspVersion, componentId, user);
- File file = processManager.getProcessArtifact(vspId, vspVersion, componentId, processId);
+ @Override
+ public Response deleteList(String vspId, String versionId, String componentId, String user) {
+ Version version = new Version(versionId);
+ validateComponentExistence(vspId, version, componentId, user);
+ processManager.deleteProcesses(vspId, version, componentId);
+ return Response.ok().build();
+ }
- Response.ResponseBuilder response = Response.ok(file);
- if (file == null) {
- return Response.status(Response.Status.NOT_FOUND).build();
+ @Override
+ public Response create(ProcessRequestDto request, String vspId, String versionId, String componentId, String user) {
+ ProcessEntity process = new MapProcessRequestDtoToProcessEntity().applyMapping(request, ProcessEntity.class);
+ process.setVspId(vspId);
+ process.setVersion(new Version(versionId));
+ process.setComponentId(componentId);
+ validateComponentExistence(vspId, process.getVersion(), componentId, user);
+ ProcessEntity createdProcess = processManager.createProcess(process);
+ return Response.ok(createdProcess != null ? new StringWrapperResponse(createdProcess.getId()) : null).build();
}
- response.header("Content-Disposition", "attachment; filename=" + file.getName());
- return response.build();
- }
- @Override
- public Response deleteUploadedFile(String vspId, String versionId, String componentId,
- String processId,
- String user) {
+ @Override
+ public Response get(String vspId, String versionId, String componentId, String processId, String user) {
+ Version version = new Version(versionId);
+ validateComponentExistence(vspId, version, componentId, user);
+ ProcessEntity process = processManager.getProcess(vspId, version, componentId, processId);
+ ProcessEntityDto result = new MapProcessEntityToProcessEntityDto().applyMapping(process, ProcessEntityDto.class);
+ return Response.ok(result).build();
+ }
- Version version = new Version(versionId);
- validateComponentExistence(vspId, version, componentId, user);
- processManager.deleteProcessArtifact(vspId, version, componentId, processId);
- return Response.ok().build();
- }
+ @Override
+ public Response delete(String vspId, String versionId, String componentId, String processId, String user) {
+ Version version = new Version(versionId);
+ validateComponentExistence(vspId, version, componentId, user);
+ processManager.deleteProcess(vspId, version, componentId, processId);
+ return Response.ok().build();
+ }
- @Override
- public Response uploadFile(Attachment attachment, String vspId, String versionId,
- String componentId,
- String processId, String user) {
+ @Override
+ public Response update(ProcessRequestDto request, String vspId, String versionId, String componentId, String processId, String user) {
+ ProcessEntity process = new MapProcessRequestDtoToProcessEntity().applyMapping(request, ProcessEntity.class);
+ process.setVspId(vspId);
+ process.setVersion(new Version(versionId));
+ process.setComponentId(componentId);
+ process.setId(processId);
+ validateComponentExistence(vspId, process.getVersion(), componentId, user);
+ processManager.updateProcess(process);
+ return Response.ok().build();
+ }
- Version version = new Version(versionId);
- validateComponentExistence(vspId, version, componentId, user);
- processManager.uploadProcessArtifact(attachment.getObject(InputStream.class),
- attachment.getContentDisposition().getParameter("filename"), vspId, version, componentId,
- processId);
- activityLogManager.logActivity(new ActivityLogEntity(vspId, version,
- ActivityType.Upload_Artifact, user, true, "", ""));
+ @Override
+ public Response getUploadedFile(String vspId, String versionId, String componentId, String processId, String user) {
+ Version vspVersion = new Version(versionId);
+ validateComponentExistence(vspId, vspVersion, componentId, user);
+ File file = processManager.getProcessArtifact(vspId, vspVersion, componentId, processId);
+ Response.ResponseBuilder response = Response.ok(file);
+ if (file == null) {
+ return Response.status(Response.Status.NOT_FOUND).build();
+ }
+ response.header("Content-Disposition", "attachment; filename=" + file.getName());
+ return response.build();
+ }
- return Response.ok().build();
- }
+ @Override
+ public Response deleteUploadedFile(String vspId, String versionId, String componentId, String processId, String user) {
+ Version version = new Version(versionId);
+ validateComponentExistence(vspId, version, componentId, user);
+ processManager.deleteProcessArtifact(vspId, version, componentId, processId);
+ return Response.ok().build();
+ }
+ @Override
+ public Response uploadFile(Attachment attachment, String vspId, String versionId, String componentId, String processId, String user) {
+ Version version = new Version(versionId);
+ validateComponentExistence(vspId, version, componentId, user);
+ processManager
+ .uploadProcessArtifact(attachment.getObject(InputStream.class), attachment.getContentDisposition().getParameter("filename"), vspId,
+ version, componentId, processId);
+ activityLogManager.logActivity(new ActivityLogEntity(vspId, version, ActivityType.Upload_Artifact, user, true, "", ""));
+ return Response.ok().build();
+ }
- private void validateComponentExistence(String vspId, Version version, String componentId,
- String user) {
- if (componentId == null) {
- return;
+ private void validateComponentExistence(String vspId, Version version, String componentId, String user) {
+ if (componentId == null) {
+ return;
+ }
+ componentManager.validateComponentExistence(vspId, version, componentId);
}
- componentManager.validateComponentExistence(vspId, version, componentId);
- }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentsImpl.java
index fefa52842e..9f2cbd36b7 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentsImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentsImpl.java
@@ -17,9 +17,11 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.services;
+import java.util.Collection;
+import javax.inject.Named;
+import javax.ws.rs.core.Response;
import org.apache.commons.collections4.CollectionUtils;
import org.openecomp.sdc.vendorsoftwareproduct.ComponentManager;
import org.openecomp.sdc.vendorsoftwareproduct.ComponentManagerFactory;
@@ -29,122 +31,104 @@ import org.openecomp.sdc.vendorsoftwareproduct.types.QuestionnaireResponse;
import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData;
import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityValidationData;
import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdcrests.vendorsoftwareproducts.types.*;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentCreationDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentRequestDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityResponseDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityValidationDataDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireResponseDto;
import org.openecomp.sdcrests.vsp.rest.Components;
-import org.openecomp.sdcrests.vsp.rest.mapping.*;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapComponentDataToComponentDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapComponentEntityToComponentCreationDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapComponentEntityToComponentDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapComponentRequestDtoToComponentEntity;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapCompositionEntityResponseToDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapCompositionEntityValidationDataToDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapQuestionnaireResponseToQuestionnaireResponseDto;
import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
-import javax.inject.Named;
-import javax.ws.rs.core.Response;
-import java.util.Collection;
-
@Named
@Service("components")
@Scope(value = "prototype")
public class ComponentsImpl implements Components {
- private final ComponentManager componentManager;
-
- public ComponentsImpl() {
- this.componentManager = ComponentManagerFactory.getInstance().createInterface();
- }
-
- public ComponentsImpl(ComponentManager componentManager) {
- this.componentManager = componentManager;
- }
- @Override
- public Response list(String vspId, String versionId, String user) {
+ private final ComponentManager componentManager;
- Collection<ComponentEntity> components =
- componentManager.listComponents(vspId, new Version(versionId));
-
- MapComponentEntityToComponentDto mapper = new MapComponentEntityToComponentDto();
- GenericCollectionWrapper<ComponentDto> results = new GenericCollectionWrapper<>();
- for (ComponentEntity component : components) {
- results.add(mapper.applyMapping(component, ComponentDto.class));
+ public ComponentsImpl() {
+ this.componentManager = ComponentManagerFactory.getInstance().createInterface();
}
- return Response.ok(results).build();
- }
-
- @Override
- public Response deleteList(String vspId, String versionId, String user) {
- componentManager.deleteComponents(vspId, new Version(versionId));
- return Response.ok().build();
- }
-
- @Override
- public Response create(ComponentRequestDto request, String vspId, String versionId, String user) {
-
- ComponentEntity component =
- new MapComponentRequestDtoToComponentEntity().applyMapping(request, ComponentEntity.class);
- component.setVspId(vspId);
- component.setVersion(new Version(versionId));
-
- ComponentEntity createdComponent = componentManager.createComponent(component);
- MapComponentEntityToComponentCreationDto mapping =
- new MapComponentEntityToComponentCreationDto();
- ComponentCreationDto createdComponentDto = mapping.applyMapping(createdComponent,
- ComponentCreationDto.class);
- return Response
- .ok(createdComponent != null ? createdComponentDto : null)
- .build();
- }
-
- @Override
- public Response get(String vspId, String versionId, String componentId, String user) {
+ public ComponentsImpl(ComponentManager componentManager) {
+ this.componentManager = componentManager;
+ }
- CompositionEntityResponse<ComponentData> response =
- componentManager.getComponent(vspId, new Version(versionId), componentId);
+ @Override
+ public Response list(String vspId, String versionId, String user) {
+ Collection<ComponentEntity> components = componentManager.listComponents(vspId, new Version(versionId));
+ MapComponentEntityToComponentDto mapper = new MapComponentEntityToComponentDto();
+ GenericCollectionWrapper<ComponentDto> results = new GenericCollectionWrapper<>();
+ for (ComponentEntity component : components) {
+ results.add(mapper.applyMapping(component, ComponentDto.class));
+ }
+ return Response.ok(results).build();
+ }
- CompositionEntityResponseDto<ComponentDto> responseDto = new CompositionEntityResponseDto<>();
- new MapCompositionEntityResponseToDto<>(new MapComponentDataToComponentDto(),
- ComponentDto.class).doMapping(response, responseDto);
- return Response.ok(responseDto).build();
- }
+ @Override
+ public Response deleteList(String vspId, String versionId, String user) {
+ componentManager.deleteComponents(vspId, new Version(versionId));
+ return Response.ok().build();
+ }
- @Override
- public Response delete(String vspId, String versionId, String componentId, String user) {
- componentManager.deleteComponent(vspId, new Version(versionId), componentId);
- return Response.ok().build();
- }
+ @Override
+ public Response create(ComponentRequestDto request, String vspId, String versionId, String user) {
+ ComponentEntity component = new MapComponentRequestDtoToComponentEntity().applyMapping(request, ComponentEntity.class);
+ component.setVspId(vspId);
+ component.setVersion(new Version(versionId));
+ ComponentEntity createdComponent = componentManager.createComponent(component);
+ MapComponentEntityToComponentCreationDto mapping = new MapComponentEntityToComponentCreationDto();
+ ComponentCreationDto createdComponentDto = mapping.applyMapping(createdComponent, ComponentCreationDto.class);
+ return Response.ok(createdComponent != null ? createdComponentDto : null).build();
+ }
- @Override
- public Response update(ComponentRequestDto request, String vspId, String versionId,
- String componentId,
- String user) {
- ComponentEntity componentEntity =
- new MapComponentRequestDtoToComponentEntity().applyMapping(request, ComponentEntity.class);
- componentEntity.setVspId(vspId);
- componentEntity.setVersion(new Version(versionId));
- componentEntity.setId(componentId);
+ @Override
+ public Response get(String vspId, String versionId, String componentId, String user) {
+ CompositionEntityResponse<ComponentData> response = componentManager.getComponent(vspId, new Version(versionId), componentId);
+ CompositionEntityResponseDto<ComponentDto> responseDto = new CompositionEntityResponseDto<>();
+ new MapCompositionEntityResponseToDto<>(new MapComponentDataToComponentDto(), ComponentDto.class).doMapping(response, responseDto);
+ return Response.ok(responseDto).build();
+ }
- CompositionEntityValidationData validationData =
- componentManager.updateComponent(componentEntity);
- return validationData != null && CollectionUtils.isNotEmpty(validationData.getErrors())
- ? Response.status(Response.Status.EXPECTATION_FAILED).entity(
- new MapCompositionEntityValidationDataToDto().applyMapping(validationData,
- CompositionEntityValidationDataDto.class)).build() : Response.ok().build();
- }
+ @Override
+ public Response delete(String vspId, String versionId, String componentId, String user) {
+ componentManager.deleteComponent(vspId, new Version(versionId), componentId);
+ return Response.ok().build();
+ }
- @Override
- public Response getQuestionnaire(String vspId, String versionId, String componentId,
- String user) {
- QuestionnaireResponse questionnaireResponse =
- componentManager.getQuestionnaire(vspId, new Version(versionId), componentId);
+ @Override
+ public Response update(ComponentRequestDto request, String vspId, String versionId, String componentId, String user) {
+ ComponentEntity componentEntity = new MapComponentRequestDtoToComponentEntity().applyMapping(request, ComponentEntity.class);
+ componentEntity.setVspId(vspId);
+ componentEntity.setVersion(new Version(versionId));
+ componentEntity.setId(componentId);
+ CompositionEntityValidationData validationData = componentManager.updateComponent(componentEntity);
+ return validationData != null && CollectionUtils.isNotEmpty(validationData.getErrors()) ? Response.status(Response.Status.EXPECTATION_FAILED)
+ .entity(new MapCompositionEntityValidationDataToDto().applyMapping(validationData, CompositionEntityValidationDataDto.class)).build()
+ : Response.ok().build();
+ }
- QuestionnaireResponseDto result = new MapQuestionnaireResponseToQuestionnaireResponseDto()
- .applyMapping(questionnaireResponse, QuestionnaireResponseDto.class);
- return Response.ok(result).build();
- }
+ @Override
+ public Response getQuestionnaire(String vspId, String versionId, String componentId, String user) {
+ QuestionnaireResponse questionnaireResponse = componentManager.getQuestionnaire(vspId, new Version(versionId), componentId);
+ QuestionnaireResponseDto result = new MapQuestionnaireResponseToQuestionnaireResponseDto()
+ .applyMapping(questionnaireResponse, QuestionnaireResponseDto.class);
+ return Response.ok(result).build();
+ }
- @Override
- public Response updateQuestionnaire(String questionnaireData, String vspId, String versionId,
- String componentId, String user) {
- componentManager
- .updateQuestionnaire(vspId, new Version(versionId), componentId, questionnaireData);
- return Response.ok().build();
- }
+ @Override
+ public Response updateQuestionnaire(String questionnaireData, String vspId, String versionId, String componentId, String user) {
+ componentManager.updateQuestionnaire(vspId, new Version(versionId), componentId, questionnaireData);
+ return Response.ok().build();
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComputeImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComputeImpl.java
index 1eea42803b..8c06629849 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComputeImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComputeImpl.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,9 +17,11 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.services;
+import java.util.Collection;
+import javax.inject.Named;
+import javax.ws.rs.core.Response;
import org.apache.commons.collections4.CollectionUtils;
import org.openecomp.sdc.vendorsoftwareproduct.ComponentManager;
import org.openecomp.sdc.vendorsoftwareproduct.ComponentManagerFactory;
@@ -32,137 +34,116 @@ import org.openecomp.sdc.vendorsoftwareproduct.types.QuestionnaireResponse;
import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityValidationData;
import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComputeData;
import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdcrests.vendorsoftwareproducts.types.*;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityResponseDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityValidationDataDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComputeCreationDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComputeDetailsDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComputeDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireResponseDto;
import org.openecomp.sdcrests.vsp.rest.Compute;
-import org.openecomp.sdcrests.vsp.rest.mapping.*;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapCompositionEntityResponseToDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapCompositionEntityValidationDataToDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapComputeDataToComputeDetailsDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapComputeDetailsDtoToComputeEntity;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapComputeEntityToComputeCreationDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapComputeEntityToComputeDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapQuestionnaireResponseToQuestionnaireResponseDto;
import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
-import javax.inject.Named;
-import javax.ws.rs.core.Response;
-import java.util.Collection;
-
@Named
@Service("computes")
@Scope(value = "prototype")
public class ComputeImpl implements Compute {
- private final ComputeManager computetManager;
- private final ComponentManager componentManager;
- public ComputeImpl() {
- this.computetManager = ComputeManagerFactory.getInstance().createInterface();
- this.componentManager = ComponentManagerFactory.getInstance().createInterface();
- }
+ private final ComputeManager computetManager;
+ private final ComponentManager componentManager;
- public ComputeImpl(ComputeManager computetManager, ComponentManager componentManager) {
- this.computetManager = computetManager;
- this.componentManager = componentManager;
- }
-
- @Override
- public Response list(String vspId, String versionId, String componentId, String user) {
-
- Version version = new Version(versionId);
- componentManager.validateComponentExistence(vspId, version, componentId);
- Collection<ListComputeResponse> computes =
- computetManager.listComputes(vspId, version, componentId);
-
- MapComputeEntityToComputeDto mapper = new MapComputeEntityToComputeDto();
- GenericCollectionWrapper<ComputeDto> results = new GenericCollectionWrapper<>();
- for (ListComputeResponse compute : computes) {
- results.add(mapper.applyMapping(compute, ComputeDto.class));
+ public ComputeImpl() {
+ this.computetManager = ComputeManagerFactory.getInstance().createInterface();
+ this.componentManager = ComponentManagerFactory.getInstance().createInterface();
}
- return Response.ok(results).build();
- }
-
- @Override
- public Response get(String vspId, String versionId, String componentId, String computeId,
- String user) {
-
- Version version = new Version(versionId);
- componentManager.validateComponentExistence(vspId, version, componentId);
- CompositionEntityResponse<ComputeData> response =
- computetManager.getCompute(vspId, version, componentId, computeId);
-
- CompositionEntityResponseDto<ComputeDetailsDto> responseDto = new
- CompositionEntityResponseDto<>();
- new MapCompositionEntityResponseToDto<>(new MapComputeDataToComputeDetailsDto(),
- ComputeDetailsDto.class).doMapping(response, responseDto);
- return Response.ok(responseDto).build();
- }
-
- @Override
- public Response create(ComputeDetailsDto request, String vspId, String versionId,
- String componentId, String user) {
-
- ComputeEntity compute = new MapComputeDetailsDtoToComputeEntity().applyMapping(request,
- ComputeEntity.class);
- compute.setVspId(vspId);
- compute.setVersion(new Version(versionId));
- compute.setComponentId(componentId);
- componentManager.validateComponentExistence(vspId, compute.getVersion(), componentId);
-
- ComputeEntity createdCompute = computetManager.createCompute(compute);
-
- MapComputeEntityToComputeCreationDto mapper = new MapComputeEntityToComputeCreationDto();
- ComputeCreationDto createdComputeDto =
- mapper.applyMapping(createdCompute, ComputeCreationDto.class);
- return Response.ok(createdComputeDto != null ? createdComputeDto : null).build();
- }
-
- @Override
- public Response update(ComputeDetailsDto request, String vspId, String versionId,
- String componentId, String computeFlavorId, String user) {
-
- ComputeEntity compute =
- new MapComputeDetailsDtoToComputeEntity().applyMapping(request, ComputeEntity.class);
- compute.setVspId(vspId);
- compute.setVersion(new Version(versionId));
- compute.setComponentId(componentId);
- compute.setId(computeFlavorId);
-
- componentManager.validateComponentExistence(vspId, compute.getVersion(), componentId);
- CompositionEntityValidationData validationData = computetManager.updateCompute(compute);
- return validationData != null && CollectionUtils.isNotEmpty(validationData.getErrors())
- ? Response.status(Response.Status.EXPECTATION_FAILED).entity(
- new MapCompositionEntityValidationDataToDto().applyMapping(validationData,
- CompositionEntityValidationDataDto.class)).build() : Response.ok().build();
- }
+ public ComputeImpl(ComputeManager computetManager, ComponentManager componentManager) {
+ this.computetManager = computetManager;
+ this.componentManager = componentManager;
+ }
- @Override
- public Response delete(String vspId, String versionId, String componentId, String computeFlavorId,
- String user) {
+ @Override
+ public Response list(String vspId, String versionId, String componentId, String user) {
+ Version version = new Version(versionId);
+ componentManager.validateComponentExistence(vspId, version, componentId);
+ Collection<ListComputeResponse> computes = computetManager.listComputes(vspId, version, componentId);
+ MapComputeEntityToComputeDto mapper = new MapComputeEntityToComputeDto();
+ GenericCollectionWrapper<ComputeDto> results = new GenericCollectionWrapper<>();
+ for (ListComputeResponse compute : computes) {
+ results.add(mapper.applyMapping(compute, ComputeDto.class));
+ }
+ return Response.ok(results).build();
+ }
- Version version = new Version(versionId);
- componentManager.validateComponentExistence(vspId, version, componentId);
- computetManager.deleteCompute(vspId, version, componentId, computeFlavorId);
- return Response.ok().build();
- }
+ @Override
+ public Response get(String vspId, String versionId, String componentId, String computeId, String user) {
+ Version version = new Version(versionId);
+ componentManager.validateComponentExistence(vspId, version, componentId);
+ CompositionEntityResponse<ComputeData> response = computetManager.getCompute(vspId, version, componentId, computeId);
+ CompositionEntityResponseDto<ComputeDetailsDto> responseDto = new CompositionEntityResponseDto<>();
+ new MapCompositionEntityResponseToDto<>(new MapComputeDataToComputeDetailsDto(), ComputeDetailsDto.class).doMapping(response, responseDto);
+ return Response.ok(responseDto).build();
+ }
- @Override
- public Response getQuestionnaire(String vspId, String versionId, String componentId,
- String computeFlavorId, String user) {
+ @Override
+ public Response create(ComputeDetailsDto request, String vspId, String versionId, String componentId, String user) {
+ ComputeEntity compute = new MapComputeDetailsDtoToComputeEntity().applyMapping(request, ComputeEntity.class);
+ compute.setVspId(vspId);
+ compute.setVersion(new Version(versionId));
+ compute.setComponentId(componentId);
+ componentManager.validateComponentExistence(vspId, compute.getVersion(), componentId);
+ ComputeEntity createdCompute = computetManager.createCompute(compute);
+ MapComputeEntityToComputeCreationDto mapper = new MapComputeEntityToComputeCreationDto();
+ ComputeCreationDto createdComputeDto = mapper.applyMapping(createdCompute, ComputeCreationDto.class);
+ return Response.ok(createdComputeDto != null ? createdComputeDto : null).build();
+ }
- Version version = new Version(versionId);
- componentManager.validateComponentExistence(vspId, version, componentId);
- QuestionnaireResponse questionnaireResponse =
- computetManager.getComputeQuestionnaire(vspId, version, componentId, computeFlavorId);
+ @Override
+ public Response update(ComputeDetailsDto request, String vspId, String versionId, String componentId, String computeFlavorId, String user) {
+ ComputeEntity compute = new MapComputeDetailsDtoToComputeEntity().applyMapping(request, ComputeEntity.class);
+ compute.setVspId(vspId);
+ compute.setVersion(new Version(versionId));
+ compute.setComponentId(componentId);
+ compute.setId(computeFlavorId);
+ componentManager.validateComponentExistence(vspId, compute.getVersion(), componentId);
+ CompositionEntityValidationData validationData = computetManager.updateCompute(compute);
+ return validationData != null && CollectionUtils.isNotEmpty(validationData.getErrors()) ? Response.status(Response.Status.EXPECTATION_FAILED)
+ .entity(new MapCompositionEntityValidationDataToDto().applyMapping(validationData, CompositionEntityValidationDataDto.class)).build()
+ : Response.ok().build();
+ }
- QuestionnaireResponseDto result = new MapQuestionnaireResponseToQuestionnaireResponseDto()
- .applyMapping(questionnaireResponse, QuestionnaireResponseDto.class);
- return Response.ok(result).build();
- }
+ @Override
+ public Response delete(String vspId, String versionId, String componentId, String computeFlavorId, String user) {
+ Version version = new Version(versionId);
+ componentManager.validateComponentExistence(vspId, version, componentId);
+ computetManager.deleteCompute(vspId, version, componentId, computeFlavorId);
+ return Response.ok().build();
+ }
- @Override
- public Response updateQuestionnaire(String questionnaireData, String vspId, String versionId,
- String componentId, String computeFlavorId, String user) {
+ @Override
+ public Response getQuestionnaire(String vspId, String versionId, String componentId, String computeFlavorId, String user) {
+ Version version = new Version(versionId);
+ componentManager.validateComponentExistence(vspId, version, componentId);
+ QuestionnaireResponse questionnaireResponse = computetManager.getComputeQuestionnaire(vspId, version, componentId, computeFlavorId);
+ QuestionnaireResponseDto result = new MapQuestionnaireResponseToQuestionnaireResponseDto()
+ .applyMapping(questionnaireResponse, QuestionnaireResponseDto.class);
+ return Response.ok(result).build();
+ }
- Version version = new Version(versionId);
- componentManager.validateComponentExistence(vspId, version, componentId);
- computetManager.updateComputeQuestionnaire(vspId, version, componentId, computeFlavorId,
- questionnaireData);
- return Response.ok().build();
- }
+ @Override
+ public Response updateQuestionnaire(String questionnaireData, String vspId, String versionId, String componentId, String computeFlavorId,
+ String user) {
+ Version version = new Version(versionId);
+ componentManager.validateComponentExistence(vspId, version, componentId);
+ computetManager.updateComputeQuestionnaire(vspId, version, componentId, computeFlavorId, questionnaireData);
+ return Response.ok().build();
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/DeploymentFlavorsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/DeploymentFlavorsImpl.java
index 13851e72e1..1f022aee18 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/DeploymentFlavorsImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/DeploymentFlavorsImpl.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,9 +17,11 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.services;
+import java.util.Collection;
+import javax.inject.Named;
+import javax.ws.rs.core.Response;
import org.apache.commons.collections4.CollectionUtils;
import org.openecomp.sdc.vendorsoftwareproduct.DeploymentFlavorManager;
import org.openecomp.sdc.vendorsoftwareproduct.DeploymentFlavorManagerFactory;
@@ -28,108 +30,93 @@ import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityResponse;
import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityValidationData;
import org.openecomp.sdc.vendorsoftwareproduct.types.composition.DeploymentFlavor;
import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdcrests.vendorsoftwareproducts.types.*;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityResponseDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityValidationDataDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.DeploymentFlavorCreationDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.DeploymentFlavorDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.DeploymentFlavorListResponseDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.DeploymentFlavorRequestDto;
import org.openecomp.sdcrests.vsp.rest.DeploymentFlavors;
-import org.openecomp.sdcrests.vsp.rest.mapping.*;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapCompositionEntityResponseToDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapCompositionEntityValidationDataToDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapDeploymentFlavorEntityDeploymentFlavorToListResponse;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapDeploymentFlavorEntityToDeploymentFlavorCreationDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapDeploymentFlavorRequestDtoToDeploymentFlavorEntity;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapDeploymentFlavorToDeploymentDto;
import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
-import javax.inject.Named;
-import javax.ws.rs.core.Response;
-import java.util.Collection;
-
@Named
@Service("deploymentFlavors")
@Scope(value = "prototype")
public class DeploymentFlavorsImpl implements DeploymentFlavors {
- private final DeploymentFlavorManager deploymentFlavorManager;
-
- public DeploymentFlavorsImpl() {
- this.deploymentFlavorManager =
- DeploymentFlavorManagerFactory.getInstance().createInterface();
- }
-
- public DeploymentFlavorsImpl(DeploymentFlavorManager deploymentFlavorManager) {
- this.deploymentFlavorManager = deploymentFlavorManager;
- }
- @Override
- public Response create(DeploymentFlavorRequestDto request, String vspId, String versionId,
- String user) {
- DeploymentFlavorEntity deploymentFlavorEntity =
- new MapDeploymentFlavorRequestDtoToDeploymentFlavorEntity()
- .applyMapping(request, DeploymentFlavorEntity.class);
- deploymentFlavorEntity.setVspId(vspId);
- deploymentFlavorEntity.setVersion(new Version(versionId));
- DeploymentFlavorEntity createdDeploymentFlavor =
- deploymentFlavorManager.createDeploymentFlavor(deploymentFlavorEntity);
- MapDeploymentFlavorEntityToDeploymentFlavorCreationDto mapping =
- new MapDeploymentFlavorEntityToDeploymentFlavorCreationDto();
- DeploymentFlavorCreationDto deploymentFlavorCreatedDto = mapping.applyMapping
- (createdDeploymentFlavor, DeploymentFlavorCreationDto.class);
- return Response
- .ok(createdDeploymentFlavor != null ? deploymentFlavorCreatedDto : null)
- .build();
- }
+ private final DeploymentFlavorManager deploymentFlavorManager;
- @Override
- public Response list(String vspId, String versionId, String user) {
- Collection<DeploymentFlavorEntity> deploymentFlavors =
- deploymentFlavorManager.listDeploymentFlavors(vspId, new Version(versionId));
+ public DeploymentFlavorsImpl() {
+ this.deploymentFlavorManager = DeploymentFlavorManagerFactory.getInstance().createInterface();
+ }
- MapDeploymentFlavorEntityDeploymentFlavorToListResponse mapper = new
- MapDeploymentFlavorEntityDeploymentFlavorToListResponse();
- GenericCollectionWrapper<DeploymentFlavorListResponseDto> results =
- new GenericCollectionWrapper<>();
- for (DeploymentFlavorEntity deploymentFlavor : deploymentFlavors) {
- results.add(mapper.applyMapping(deploymentFlavor, DeploymentFlavorListResponseDto.class));
+ public DeploymentFlavorsImpl(DeploymentFlavorManager deploymentFlavorManager) {
+ this.deploymentFlavorManager = deploymentFlavorManager;
}
- return Response.ok(results).build();
- }
- @Override
- public Response get(String vspId, String versionId, String deploymentFlavorId, String user) {
- CompositionEntityResponse<DeploymentFlavor> response = deploymentFlavorManager
- .getDeploymentFlavor(vspId, new Version(versionId), deploymentFlavorId);
+ @Override
+ public Response create(DeploymentFlavorRequestDto request, String vspId, String versionId, String user) {
+ DeploymentFlavorEntity deploymentFlavorEntity = new MapDeploymentFlavorRequestDtoToDeploymentFlavorEntity()
+ .applyMapping(request, DeploymentFlavorEntity.class);
+ deploymentFlavorEntity.setVspId(vspId);
+ deploymentFlavorEntity.setVersion(new Version(versionId));
+ DeploymentFlavorEntity createdDeploymentFlavor = deploymentFlavorManager.createDeploymentFlavor(deploymentFlavorEntity);
+ MapDeploymentFlavorEntityToDeploymentFlavorCreationDto mapping = new MapDeploymentFlavorEntityToDeploymentFlavorCreationDto();
+ DeploymentFlavorCreationDto deploymentFlavorCreatedDto = mapping.applyMapping(createdDeploymentFlavor, DeploymentFlavorCreationDto.class);
+ return Response.ok(createdDeploymentFlavor != null ? deploymentFlavorCreatedDto : null).build();
+ }
- CompositionEntityResponseDto<DeploymentFlavorDto> responseDto = new
- CompositionEntityResponseDto<>();
- new MapCompositionEntityResponseToDto<>(new MapDeploymentFlavorToDeploymentDto(),
- DeploymentFlavorDto.class)
- .doMapping(response, responseDto);
- return Response.ok(responseDto).build();
- }
+ @Override
+ public Response list(String vspId, String versionId, String user) {
+ Collection<DeploymentFlavorEntity> deploymentFlavors = deploymentFlavorManager.listDeploymentFlavors(vspId, new Version(versionId));
+ MapDeploymentFlavorEntityDeploymentFlavorToListResponse mapper = new MapDeploymentFlavorEntityDeploymentFlavorToListResponse();
+ GenericCollectionWrapper<DeploymentFlavorListResponseDto> results = new GenericCollectionWrapper<>();
+ for (DeploymentFlavorEntity deploymentFlavor : deploymentFlavors) {
+ results.add(mapper.applyMapping(deploymentFlavor, DeploymentFlavorListResponseDto.class));
+ }
+ return Response.ok(results).build();
+ }
- @Override
- public Response getSchema(String vspId, String versionId, String user) {
- CompositionEntityResponse<DeploymentFlavor> response = deploymentFlavorManager
- .getDeploymentFlavorSchema(vspId, new Version(versionId));
- return Response.ok(response).build();
- }
+ @Override
+ public Response get(String vspId, String versionId, String deploymentFlavorId, String user) {
+ CompositionEntityResponse<DeploymentFlavor> response = deploymentFlavorManager
+ .getDeploymentFlavor(vspId, new Version(versionId), deploymentFlavorId);
+ CompositionEntityResponseDto<DeploymentFlavorDto> responseDto = new CompositionEntityResponseDto<>();
+ new MapCompositionEntityResponseToDto<>(new MapDeploymentFlavorToDeploymentDto(), DeploymentFlavorDto.class).doMapping(response, responseDto);
+ return Response.ok(responseDto).build();
+ }
- @Override
- public Response delete(String vspId, String versionId, String deploymentFlavorId, String user) {
- Version version = new Version(versionId);
- deploymentFlavorManager.deleteDeploymentFlavor(vspId, version, deploymentFlavorId);
- return Response.ok().build();
- }
+ @Override
+ public Response getSchema(String vspId, String versionId, String user) {
+ CompositionEntityResponse<DeploymentFlavor> response = deploymentFlavorManager.getDeploymentFlavorSchema(vspId, new Version(versionId));
+ return Response.ok(response).build();
+ }
- @Override
- public Response update(DeploymentFlavorRequestDto request, String vspId, String versionId,
- String deploymentFlavorId, String user) {
- DeploymentFlavorEntity deploymentFlavorEntity =
- new MapDeploymentFlavorRequestDtoToDeploymentFlavorEntity().applyMapping(request,
- DeploymentFlavorEntity.class);
- deploymentFlavorEntity.setVspId(vspId);
- deploymentFlavorEntity.setVersion(new Version(versionId));
- deploymentFlavorEntity.setId(deploymentFlavorId);
+ @Override
+ public Response delete(String vspId, String versionId, String deploymentFlavorId, String user) {
+ Version version = new Version(versionId);
+ deploymentFlavorManager.deleteDeploymentFlavor(vspId, version, deploymentFlavorId);
+ return Response.ok().build();
+ }
- CompositionEntityValidationData validationData =
- deploymentFlavorManager.updateDeploymentFlavor(deploymentFlavorEntity);
- return validationData != null && CollectionUtils.isNotEmpty(validationData.getErrors())
- ? Response.status(Response.Status.EXPECTATION_FAILED).entity(
- new MapCompositionEntityValidationDataToDto().applyMapping(validationData,
- CompositionEntityValidationDataDto.class)).build() : Response.ok().build();
- }
+ @Override
+ public Response update(DeploymentFlavorRequestDto request, String vspId, String versionId, String deploymentFlavorId, String user) {
+ DeploymentFlavorEntity deploymentFlavorEntity = new MapDeploymentFlavorRequestDtoToDeploymentFlavorEntity()
+ .applyMapping(request, DeploymentFlavorEntity.class);
+ deploymentFlavorEntity.setVspId(vspId);
+ deploymentFlavorEntity.setVersion(new Version(versionId));
+ deploymentFlavorEntity.setId(deploymentFlavorId);
+ CompositionEntityValidationData validationData = deploymentFlavorManager.updateDeploymentFlavor(deploymentFlavorEntity);
+ return validationData != null && CollectionUtils.isNotEmpty(validationData.getErrors()) ? Response.status(Response.Status.EXPECTATION_FAILED)
+ .entity(new MapCompositionEntityValidationDataToDto().applyMapping(validationData, CompositionEntityValidationDataDto.class)).build()
+ : Response.ok().build();
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ImagesImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ImagesImpl.java
index 7971b48427..350630c0aa 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ImagesImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ImagesImpl.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,10 +17,11 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.services;
-
+import java.util.Collection;
+import javax.inject.Named;
+import javax.ws.rs.core.Response;
import org.apache.commons.collections.CollectionUtils;
import org.openecomp.sdc.vendorsoftwareproduct.ComponentManager;
import org.openecomp.sdc.vendorsoftwareproduct.ComponentManagerFactory;
@@ -32,135 +33,116 @@ import org.openecomp.sdc.vendorsoftwareproduct.types.QuestionnaireResponse;
import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityValidationData;
import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Image;
import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdcrests.vendorsoftwareproducts.types.*;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityValidationDataDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ImageCreationDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ImageDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ImageRequestDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireResponseDto;
import org.openecomp.sdcrests.vsp.rest.Images;
-import org.openecomp.sdcrests.vsp.rest.mapping.*;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapCompositionEntityValidationDataToDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapImageEntityToImageCreationDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapImageEntityToImageDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapImageRequestDtoToImageEntity;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapQuestionnaireResponseToQuestionnaireResponseDto;
import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
-import javax.inject.Named;
-import javax.ws.rs.core.Response;
-import java.util.Collection;
-
-
@Named
@Service("images")
@Scope(value = "prototype")
public class ImagesImpl implements Images {
- private final ImageManager imageManager;
- private final ComponentManager componentManager;
-
- public ImagesImpl() {
- this.imageManager = ImageManagerFactory.getInstance().createInterface();
- this.componentManager =
- ComponentManagerFactory.getInstance().createInterface();
- }
-
- public ImagesImpl(ImageManager imageManager, ComponentManager componentManager) {
- this.imageManager = imageManager;
- this.componentManager = componentManager;
- }
-
- @Override
- public Response create(ImageRequestDto request, String vspId, String versionId,
- String componentId, String user) {
- ImageEntity image =
- new MapImageRequestDtoToImageEntity().applyMapping(request, ImageEntity.class);
- image.setVspId(vspId);
- image.setComponentId(componentId);
- image.setVersion(new Version(versionId));
- componentManager.validateComponentExistence(vspId, image.getVersion(), componentId);
- ImageEntity createdImage = imageManager.createImage(image);
- MapImageEntityToImageCreationDto mapping = new MapImageEntityToImageCreationDto();
- ImageCreationDto createdImageDto = mapping.applyMapping(createdImage, ImageCreationDto.class);
- return Response
- .ok(createdImage != null ? createdImageDto : null)
- .build();
- }
+ private final ImageManager imageManager;
+ private final ComponentManager componentManager;
- @Override
- public Response getImageSchema(String vspId, String versionId, String componentId, String user) {
- CompositionEntityResponse<Image> response = imageManager.getImageSchema(vspId);
- return Response.ok(response).build();
- }
-
- @Override
- public Response get(String vspId, String versionId, String componentId, String imageId,
- String user) {
- Version version = new Version(versionId);
- componentManager.validateComponentExistence(vspId, version, componentId);
- CompositionEntityResponse<Image> response =
- imageManager.getImage(vspId, version, componentId, imageId);
-
- return Response.ok(response).build();
- }
-
- @Override
- public Response list(String vspId, String versionId, String componentId, String user) {
- Version vspVersion = new Version(versionId);
- componentManager.validateComponentExistence(vspId, vspVersion, componentId);
- Collection<ImageEntity> images = imageManager.listImages(vspId, vspVersion, componentId);
-
- MapImageEntityToImageDto mapper = new MapImageEntityToImageDto();
- GenericCollectionWrapper<ImageDto> results = new GenericCollectionWrapper<>();
- for (ImageEntity image : images) {
- results.add(mapper.applyMapping(image, ImageDto.class));
+ public ImagesImpl() {
+ this.imageManager = ImageManagerFactory.getInstance().createInterface();
+ this.componentManager = ComponentManagerFactory.getInstance().createInterface();
}
- return Response.ok(results).build();
- }
+ public ImagesImpl(ImageManager imageManager, ComponentManager componentManager) {
+ this.imageManager = imageManager;
+ this.componentManager = componentManager;
+ }
- @Override
- public Response delete(String vspId, String versionId, String componentId, String imageId,
- String user) {
- Version vspVersion = new Version(versionId);
- componentManager.validateComponentExistence(vspId, vspVersion, componentId);
- imageManager.deleteImage(vspId, vspVersion, componentId, imageId);
- return Response.ok().build();
- }
+ @Override
+ public Response create(ImageRequestDto request, String vspId, String versionId, String componentId, String user) {
+ ImageEntity image = new MapImageRequestDtoToImageEntity().applyMapping(request, ImageEntity.class);
+ image.setVspId(vspId);
+ image.setComponentId(componentId);
+ image.setVersion(new Version(versionId));
+ componentManager.validateComponentExistence(vspId, image.getVersion(), componentId);
+ ImageEntity createdImage = imageManager.createImage(image);
+ MapImageEntityToImageCreationDto mapping = new MapImageEntityToImageCreationDto();
+ ImageCreationDto createdImageDto = mapping.applyMapping(createdImage, ImageCreationDto.class);
+ return Response.ok(createdImage != null ? createdImageDto : null).build();
+ }
- @Override
- public Response update(ImageRequestDto request, String vspId, String versionId,
- String componentId, String imageId, String user) {
- ImageEntity imageEntity = new MapImageRequestDtoToImageEntity().applyMapping(request,
- ImageEntity.class);
- imageEntity.setVspId(vspId);
- imageEntity.setVersion(new Version(versionId));
- imageEntity.setComponentId(componentId);
- imageEntity.setId(imageId);
- componentManager.validateComponentExistence(vspId, imageEntity.getVersion(), componentId);
+ @Override
+ public Response getImageSchema(String vspId, String versionId, String componentId, String user) {
+ CompositionEntityResponse<Image> response = imageManager.getImageSchema(vspId);
+ return Response.ok(response).build();
+ }
- CompositionEntityValidationData validationData = imageManager.updateImage(imageEntity);
- return validationData != null && CollectionUtils.isNotEmpty(validationData.getErrors())
- ? Response.status(Response.Status.EXPECTATION_FAILED).entity(
- new MapCompositionEntityValidationDataToDto()
- .applyMapping(validationData, CompositionEntityValidationDataDto.class)).build() :
- Response.ok().build();
- }
+ @Override
+ public Response get(String vspId, String versionId, String componentId, String imageId, String user) {
+ Version version = new Version(versionId);
+ componentManager.validateComponentExistence(vspId, version, componentId);
+ CompositionEntityResponse<Image> response = imageManager.getImage(vspId, version, componentId, imageId);
+ return Response.ok(response).build();
+ }
- @Override
- public Response getQuestionnaire(String vspId, String versionId, String componentId,
- String imageId, String user) {
- Version vspVersion = new Version(versionId);
- componentManager.validateComponentExistence(vspId, vspVersion, componentId);
- QuestionnaireResponse questionnaireResponse =
- imageManager.getImageQuestionnaire(vspId, vspVersion, componentId, imageId);
+ @Override
+ public Response list(String vspId, String versionId, String componentId, String user) {
+ Version vspVersion = new Version(versionId);
+ componentManager.validateComponentExistence(vspId, vspVersion, componentId);
+ Collection<ImageEntity> images = imageManager.listImages(vspId, vspVersion, componentId);
+ MapImageEntityToImageDto mapper = new MapImageEntityToImageDto();
+ GenericCollectionWrapper<ImageDto> results = new GenericCollectionWrapper<>();
+ for (ImageEntity image : images) {
+ results.add(mapper.applyMapping(image, ImageDto.class));
+ }
+ return Response.ok(results).build();
+ }
- QuestionnaireResponseDto result = new MapQuestionnaireResponseToQuestionnaireResponseDto()
- .applyMapping(questionnaireResponse, QuestionnaireResponseDto.class);
- return Response.ok(result).build();
+ @Override
+ public Response delete(String vspId, String versionId, String componentId, String imageId, String user) {
+ Version vspVersion = new Version(versionId);
+ componentManager.validateComponentExistence(vspId, vspVersion, componentId);
+ imageManager.deleteImage(vspId, vspVersion, componentId, imageId);
+ return Response.ok().build();
+ }
- }
+ @Override
+ public Response update(ImageRequestDto request, String vspId, String versionId, String componentId, String imageId, String user) {
+ ImageEntity imageEntity = new MapImageRequestDtoToImageEntity().applyMapping(request, ImageEntity.class);
+ imageEntity.setVspId(vspId);
+ imageEntity.setVersion(new Version(versionId));
+ imageEntity.setComponentId(componentId);
+ imageEntity.setId(imageId);
+ componentManager.validateComponentExistence(vspId, imageEntity.getVersion(), componentId);
+ CompositionEntityValidationData validationData = imageManager.updateImage(imageEntity);
+ return validationData != null && CollectionUtils.isNotEmpty(validationData.getErrors()) ? Response.status(Response.Status.EXPECTATION_FAILED)
+ .entity(new MapCompositionEntityValidationDataToDto().applyMapping(validationData, CompositionEntityValidationDataDto.class)).build()
+ : Response.ok().build();
+ }
- @Override
- public Response updateQuestionnaire(String questionnaireData, String vspId, String versionId,
- String componentId, String imageId, String user) {
- Version version = new Version(versionId);
- componentManager.validateComponentExistence(vspId, version, componentId);
- imageManager.updateImageQuestionnaire(vspId, version, componentId, imageId, questionnaireData);
- return Response.ok().build();
- }
+ @Override
+ public Response getQuestionnaire(String vspId, String versionId, String componentId, String imageId, String user) {
+ Version vspVersion = new Version(versionId);
+ componentManager.validateComponentExistence(vspId, vspVersion, componentId);
+ QuestionnaireResponse questionnaireResponse = imageManager.getImageQuestionnaire(vspId, vspVersion, componentId, imageId);
+ QuestionnaireResponseDto result = new MapQuestionnaireResponseToQuestionnaireResponseDto()
+ .applyMapping(questionnaireResponse, QuestionnaireResponseDto.class);
+ return Response.ok(result).build();
+ }
+ @Override
+ public Response updateQuestionnaire(String questionnaireData, String vspId, String versionId, String componentId, String imageId, String user) {
+ Version version = new Version(versionId);
+ componentManager.validateComponentExistence(vspId, version, componentId);
+ imageManager.updateImageQuestionnaire(vspId, version, componentId, imageId, questionnaireData);
+ return Response.ok().build();
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/NetworksImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/NetworksImpl.java
index 6a6cbd0e60..e25ef8e324 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/NetworksImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/NetworksImpl.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,9 +17,11 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.services;
+import java.util.Collection;
+import javax.inject.Named;
+import javax.ws.rs.core.Response;
import org.apache.commons.collections4.CollectionUtils;
import org.openecomp.sdc.vendorsoftwareproduct.NetworkManager;
import org.openecomp.sdc.vendorsoftwareproduct.NetworkManagerFactory;
@@ -33,93 +35,74 @@ import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityVali
import org.openecomp.sdcrests.vendorsoftwareproducts.types.NetworkDto;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.NetworkRequestDto;
import org.openecomp.sdcrests.vsp.rest.Networks;
-import org.openecomp.sdcrests.vsp.rest.mapping.*;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapCompositionEntityResponseToDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapCompositionEntityValidationDataToDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapNetworkEntityToNetworkDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapNetworkRequestDtoToNetworkEntity;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapNetworkToNetworkDto;
import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper;
import org.openecomp.sdcrests.wrappers.StringWrapperResponse;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
-import javax.inject.Named;
-import javax.ws.rs.core.Response;
-import java.util.Collection;
-
@Named
@Service("networks")
@Scope(value = "prototype")
public class NetworksImpl implements Networks {
- private final NetworkManager networkManager;
-
- public NetworksImpl(NetworkManager networkManager) {
- this.networkManager = networkManager;
- }
+ private final NetworkManager networkManager;
- public NetworksImpl() {
- this(NetworkManagerFactory.getInstance().createInterface());
- }
-
- @Override
- public Response list(String vspId, String versionId, String user) {
- Collection<NetworkEntity> networks =
- networkManager.listNetworks(vspId, new Version(versionId));
-
- MapNetworkEntityToNetworkDto mapper = new MapNetworkEntityToNetworkDto();
- GenericCollectionWrapper<NetworkDto> results = new GenericCollectionWrapper<>();
- for (NetworkEntity network : networks) {
- results.add(mapper.applyMapping(network, NetworkDto.class));
+ public NetworksImpl(NetworkManager networkManager) {
+ this.networkManager = networkManager;
}
- return Response.ok(results).build();
- }
-
- @Override
- public Response create(NetworkRequestDto request, String vspId, String versionId, String user) {
- NetworkEntity network =
- new MapNetworkRequestDtoToNetworkEntity().applyMapping(request, NetworkEntity.class);
- network.setVspId(vspId);
- network.setVersion(new Version(versionId));
- NetworkEntity createdNetwork = networkManager.createNetwork(network);
- return Response
- .ok(createdNetwork != null ? new StringWrapperResponse(createdNetwork.getId()) : null)
- .build();
- }
+ public NetworksImpl() {
+ this(NetworkManagerFactory.getInstance().createInterface());
+ }
- @Override
- public Response get(String vspId, String versionId, String networkId, String user) {
- CompositionEntityResponse<Network> response =
- networkManager.getNetwork(vspId,
- new Version(versionId), networkId
- );
+ @Override
+ public Response list(String vspId, String versionId, String user) {
+ Collection<NetworkEntity> networks = networkManager.listNetworks(vspId, new Version(versionId));
+ MapNetworkEntityToNetworkDto mapper = new MapNetworkEntityToNetworkDto();
+ GenericCollectionWrapper<NetworkDto> results = new GenericCollectionWrapper<>();
+ for (NetworkEntity network : networks) {
+ results.add(mapper.applyMapping(network, NetworkDto.class));
+ }
+ return Response.ok(results).build();
+ }
- CompositionEntityResponseDto<NetworkDto> responseDto = new CompositionEntityResponseDto<>();
- new MapCompositionEntityResponseToDto<>(new MapNetworkToNetworkDto(), NetworkDto.class)
- .doMapping(response, responseDto);
- return Response.ok(responseDto).build();
- }
+ @Override
+ public Response create(NetworkRequestDto request, String vspId, String versionId, String user) {
+ NetworkEntity network = new MapNetworkRequestDtoToNetworkEntity().applyMapping(request, NetworkEntity.class);
+ network.setVspId(vspId);
+ network.setVersion(new Version(versionId));
+ NetworkEntity createdNetwork = networkManager.createNetwork(network);
+ return Response.ok(createdNetwork != null ? new StringWrapperResponse(createdNetwork.getId()) : null).build();
+ }
- @Override
- public Response delete(String vspId, String versionId, String networkId, String user) {
- networkManager
- .deleteNetwork(vspId, new Version(versionId),
- networkId);
- return Response.ok().build();
- }
+ @Override
+ public Response get(String vspId, String versionId, String networkId, String user) {
+ CompositionEntityResponse<Network> response = networkManager.getNetwork(vspId, new Version(versionId), networkId);
+ CompositionEntityResponseDto<NetworkDto> responseDto = new CompositionEntityResponseDto<>();
+ new MapCompositionEntityResponseToDto<>(new MapNetworkToNetworkDto(), NetworkDto.class).doMapping(response, responseDto);
+ return Response.ok(responseDto).build();
+ }
- @Override
- public Response update(NetworkRequestDto request, String vspId, String versionId,
- String networkId, String user) {
- NetworkEntity networkEntity =
- new MapNetworkRequestDtoToNetworkEntity().applyMapping(request, NetworkEntity.class);
- networkEntity.setVspId(vspId);
- networkEntity.setVersion(new Version(versionId));
- networkEntity.setId(networkId);
+ @Override
+ public Response delete(String vspId, String versionId, String networkId, String user) {
+ networkManager.deleteNetwork(vspId, new Version(versionId), networkId);
+ return Response.ok().build();
+ }
- CompositionEntityValidationData validationData =
- networkManager.updateNetwork(networkEntity);
- return validationData != null && CollectionUtils.isNotEmpty(validationData.getErrors())
- ? Response.status(Response.Status.EXPECTATION_FAILED).entity(
- new MapCompositionEntityValidationDataToDto()
- .applyMapping(validationData, CompositionEntityValidationDataDto.class)).build() :
- Response.ok().build();
- }
+ @Override
+ public Response update(NetworkRequestDto request, String vspId, String versionId, String networkId, String user) {
+ NetworkEntity networkEntity = new MapNetworkRequestDtoToNetworkEntity().applyMapping(request, NetworkEntity.class);
+ networkEntity.setVspId(vspId);
+ networkEntity.setVersion(new Version(versionId));
+ networkEntity.setId(networkId);
+ CompositionEntityValidationData validationData = networkManager.updateNetwork(networkEntity);
+ return validationData != null && CollectionUtils.isNotEmpty(validationData.getErrors()) ? Response.status(Response.Status.EXPECTATION_FAILED)
+ .entity(new MapCompositionEntityValidationDataToDto().applyMapping(validationData, CompositionEntityValidationDataDto.class)).build()
+ : Response.ok().build();
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/NicsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/NicsImpl.java
index 11ed508286..9784015089 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/NicsImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/NicsImpl.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,9 +17,11 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.services;
+import java.util.Collection;
+import javax.inject.Named;
+import javax.ws.rs.core.Response;
import org.apache.commons.collections4.CollectionUtils;
import org.openecomp.sdc.vendorsoftwareproduct.ComponentManager;
import org.openecomp.sdc.vendorsoftwareproduct.ComponentManagerFactory;
@@ -31,131 +33,115 @@ import org.openecomp.sdc.vendorsoftwareproduct.types.QuestionnaireResponse;
import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityValidationData;
import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic;
import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdcrests.vendorsoftwareproducts.types.*;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityResponseDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityValidationDataDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.NicCreationResponseDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.NicDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.NicRequestDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireResponseDto;
import org.openecomp.sdcrests.vsp.rest.Nics;
-import org.openecomp.sdcrests.vsp.rest.mapping.*;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapCompositionEntityResponseToDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapCompositionEntityValidationDataToDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapNicEntityToNicCreationResponseDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapNicEntityToNicDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapNicRequestDtoToNicEntity;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapNicToNicDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapQuestionnaireResponseToQuestionnaireResponseDto;
import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
-import javax.inject.Named;
-import javax.ws.rs.core.Response;
-import java.util.Collection;
-
@Named
@Service("nics")
@Scope(value = "prototype")
public class NicsImpl implements Nics {
- private final NicManager nicManager;
- private final ComponentManager componentManager;
-
- public NicsImpl() {
- this.nicManager = NicManagerFactory.getInstance().createInterface();
- this.componentManager = ComponentManagerFactory.getInstance().createInterface();
- }
- public NicsImpl(NicManager nicManager, ComponentManager componentManager) {
- this.nicManager = nicManager;
- this.componentManager = componentManager;
- }
+ private final NicManager nicManager;
+ private final ComponentManager componentManager;
- @Override
- public Response list(String vspId, String versionId, String componentId, String user) {
- Version vspVersion = new Version(versionId);
- componentManager.validateComponentExistence(vspId, vspVersion, componentId);
- Collection<NicEntity> nics = nicManager.listNics(vspId, vspVersion, componentId);
-
- MapNicEntityToNicDto mapper = new MapNicEntityToNicDto();
- GenericCollectionWrapper<NicDto> results = new GenericCollectionWrapper<>();
- for (NicEntity nic : nics) {
- results.add(mapper.applyMapping(nic, NicDto.class));
+ public NicsImpl() {
+ this.nicManager = NicManagerFactory.getInstance().createInterface();
+ this.componentManager = ComponentManagerFactory.getInstance().createInterface();
}
- return Response.ok(results).build();
- }
-
- @Override
- public Response create(NicRequestDto request, String vspId, String versionId, String componentId,
- String user) {
- NicEntity nic = new MapNicRequestDtoToNicEntity().applyMapping(request, NicEntity.class);
- nic.setVspId(vspId);
- nic.setVersion(new Version(versionId));
- nic.setComponentId(componentId);
- componentManager.validateComponentExistence(vspId, nic.getVersion(), componentId);
-
- NicEntity createdNic = nicManager.createNic(nic);
- MapNicEntityToNicCreationResponseDto mapping =
- new MapNicEntityToNicCreationResponseDto();
- NicCreationResponseDto createdNicDto = mapping.applyMapping(createdNic,
- NicCreationResponseDto.class);
- return Response.ok(createdNic != null ? createdNicDto : null)
- .build();
- }
-
- @Override
- public Response get(String vspId, String versionId, String componentId, String nicId,
- String user) {
- Version vspVersion = new Version(versionId);
- componentManager.validateComponentExistence(vspId, vspVersion, componentId);
- CompositionEntityResponse<Nic> response =
- nicManager.getNic(vspId, vspVersion, componentId, nicId);
+ public NicsImpl(NicManager nicManager, ComponentManager componentManager) {
+ this.nicManager = nicManager;
+ this.componentManager = componentManager;
+ }
- CompositionEntityResponseDto<NicDto> responseDto = new CompositionEntityResponseDto<>();
- new MapCompositionEntityResponseToDto<>(new MapNicToNicDto(), NicDto.class)
- .doMapping(response, responseDto);
- return Response.ok(responseDto).build();
- }
+ @Override
+ public Response list(String vspId, String versionId, String componentId, String user) {
+ Version vspVersion = new Version(versionId);
+ componentManager.validateComponentExistence(vspId, vspVersion, componentId);
+ Collection<NicEntity> nics = nicManager.listNics(vspId, vspVersion, componentId);
+ MapNicEntityToNicDto mapper = new MapNicEntityToNicDto();
+ GenericCollectionWrapper<NicDto> results = new GenericCollectionWrapper<>();
+ for (NicEntity nic : nics) {
+ results.add(mapper.applyMapping(nic, NicDto.class));
+ }
+ return Response.ok(results).build();
+ }
- @Override
- public Response delete(String vspId, String versionId, String componentId, String nicId,
- String user) {
- Version vspVersion = new Version(versionId);
- componentManager.validateComponentExistence(vspId, vspVersion, componentId);
- nicManager.deleteNic(vspId, vspVersion, componentId, nicId);
- return Response.ok().build();
- }
+ @Override
+ public Response create(NicRequestDto request, String vspId, String versionId, String componentId, String user) {
+ NicEntity nic = new MapNicRequestDtoToNicEntity().applyMapping(request, NicEntity.class);
+ nic.setVspId(vspId);
+ nic.setVersion(new Version(versionId));
+ nic.setComponentId(componentId);
+ componentManager.validateComponentExistence(vspId, nic.getVersion(), componentId);
+ NicEntity createdNic = nicManager.createNic(nic);
+ MapNicEntityToNicCreationResponseDto mapping = new MapNicEntityToNicCreationResponseDto();
+ NicCreationResponseDto createdNicDto = mapping.applyMapping(createdNic, NicCreationResponseDto.class);
+ return Response.ok(createdNic != null ? createdNicDto : null).build();
+ }
- @Override
- public Response update(NicRequestDto request, String vspId, String versionId, String componentId,
- String nicId,
- String user) {
- NicEntity nicEntity = new MapNicRequestDtoToNicEntity().applyMapping(request, NicEntity.class);
- nicEntity.setVspId(vspId);
- nicEntity.setVersion(new Version(versionId));
- nicEntity.setComponentId(componentId);
- nicEntity.setId(nicId);
+ @Override
+ public Response get(String vspId, String versionId, String componentId, String nicId, String user) {
+ Version vspVersion = new Version(versionId);
+ componentManager.validateComponentExistence(vspId, vspVersion, componentId);
+ CompositionEntityResponse<Nic> response = nicManager.getNic(vspId, vspVersion, componentId, nicId);
+ CompositionEntityResponseDto<NicDto> responseDto = new CompositionEntityResponseDto<>();
+ new MapCompositionEntityResponseToDto<>(new MapNicToNicDto(), NicDto.class).doMapping(response, responseDto);
+ return Response.ok(responseDto).build();
+ }
- componentManager.validateComponentExistence(vspId, nicEntity.getVersion(), componentId);
- CompositionEntityValidationData validationData =
- nicManager.updateNic(nicEntity);
- return validationData != null && CollectionUtils.isNotEmpty(validationData.getErrors())
- ? Response.status(Response.Status.EXPECTATION_FAILED).entity(
- new MapCompositionEntityValidationDataToDto()
- .applyMapping(validationData, CompositionEntityValidationDataDto.class)).build() :
- Response.ok().build();
- }
+ @Override
+ public Response delete(String vspId, String versionId, String componentId, String nicId, String user) {
+ Version vspVersion = new Version(versionId);
+ componentManager.validateComponentExistence(vspId, vspVersion, componentId);
+ nicManager.deleteNic(vspId, vspVersion, componentId, nicId);
+ return Response.ok().build();
+ }
- @Override
- public Response getQuestionnaire(String vspId, String versionId, String componentId, String nicId,
- String user) {
- Version vspVersion = new Version(versionId);
- componentManager.validateComponentExistence(vspId, vspVersion, componentId);
- QuestionnaireResponse questionnaireResponse =
- nicManager.getNicQuestionnaire(vspId, vspVersion, componentId, nicId);
+ @Override
+ public Response update(NicRequestDto request, String vspId, String versionId, String componentId, String nicId, String user) {
+ NicEntity nicEntity = new MapNicRequestDtoToNicEntity().applyMapping(request, NicEntity.class);
+ nicEntity.setVspId(vspId);
+ nicEntity.setVersion(new Version(versionId));
+ nicEntity.setComponentId(componentId);
+ nicEntity.setId(nicId);
+ componentManager.validateComponentExistence(vspId, nicEntity.getVersion(), componentId);
+ CompositionEntityValidationData validationData = nicManager.updateNic(nicEntity);
+ return validationData != null && CollectionUtils.isNotEmpty(validationData.getErrors()) ? Response.status(Response.Status.EXPECTATION_FAILED)
+ .entity(new MapCompositionEntityValidationDataToDto().applyMapping(validationData, CompositionEntityValidationDataDto.class)).build()
+ : Response.ok().build();
+ }
- QuestionnaireResponseDto result = new MapQuestionnaireResponseToQuestionnaireResponseDto()
- .applyMapping(questionnaireResponse, QuestionnaireResponseDto.class);
- return Response.ok(result).build();
- }
+ @Override
+ public Response getQuestionnaire(String vspId, String versionId, String componentId, String nicId, String user) {
+ Version vspVersion = new Version(versionId);
+ componentManager.validateComponentExistence(vspId, vspVersion, componentId);
+ QuestionnaireResponse questionnaireResponse = nicManager.getNicQuestionnaire(vspId, vspVersion, componentId, nicId);
+ QuestionnaireResponseDto result = new MapQuestionnaireResponseToQuestionnaireResponseDto()
+ .applyMapping(questionnaireResponse, QuestionnaireResponseDto.class);
+ return Response.ok(result).build();
+ }
- @Override
- public Response updateQuestionnaire(String questionnaireData, String vspId, String versionId,
- String componentId,
- String nicId, String user) {
- Version vspVersion = new Version(versionId);
- componentManager.validateComponentExistence(vspId, vspVersion, componentId);
- nicManager
- .updateNicQuestionnaire(vspId, vspVersion, componentId, nicId, questionnaireData);
- return Response.ok().build();
- }
+ @Override
+ public Response updateQuestionnaire(String questionnaireData, String vspId, String versionId, String componentId, String nicId, String user) {
+ Version vspVersion = new Version(versionId);
+ componentManager.validateComponentExistence(vspId, vspVersion, componentId);
+ nicManager.updateNicQuestionnaire(vspId, vspVersion, componentId, nicId, questionnaireData);
+ return Response.ok().build();
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/OrchestrationTemplateCandidateException.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/OrchestrationTemplateCandidateException.java
index a7e65a7e6f..1e20d1ced7 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/OrchestrationTemplateCandidateException.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/OrchestrationTemplateCandidateException.java
@@ -19,9 +19,9 @@
*/
package org.openecomp.sdcrests.vsp.rest.services;
-public class OrchestrationTemplateCandidateException extends Exception{
+public class OrchestrationTemplateCandidateException extends Exception {
- public OrchestrationTemplateCandidateException(String message, Throwable t){
+ public OrchestrationTemplateCandidateException(String message, Throwable t) {
super(message, t);
}
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/OrchestrationTemplateCandidateImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/OrchestrationTemplateCandidateImpl.java
index b393153ece..48ad75d09c 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/OrchestrationTemplateCandidateImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/OrchestrationTemplateCandidateImpl.java
@@ -18,7 +18,6 @@
* Modifications copyright (c) 2019 Nokia
* ================================================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.services;
import static org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder.getErrorWithParameters;
@@ -74,56 +73,47 @@ import org.springframework.stereotype.Service;
@Service("orchestrationTemplateCandidate")
@Scope(value = "prototype")
public class OrchestrationTemplateCandidateImpl implements OrchestrationTemplateCandidate {
- private static final Logger LOGGER =
- LoggerFactory.getLogger(OrchestrationTemplateCandidateImpl.class);
- private final OrchestrationTemplateCandidateManager candidateManager;
-
- private final VendorSoftwareProductManager vendorSoftwareProductManager;
- private final ActivityLogManager activityLogManager;
-
-
- public OrchestrationTemplateCandidateImpl() {
- this.candidateManager = OrchestrationTemplateCandidateManagerFactory.getInstance().createInterface();
- this.vendorSoftwareProductManager = VspManagerFactory.getInstance().createInterface();
- this.activityLogManager = ActivityLogManagerFactory.getInstance().createInterface();
- }
-
- // Constructor used in test to avoid mock static
- public OrchestrationTemplateCandidateImpl(
- OrchestrationTemplateCandidateManager candidateManager,
- VendorSoftwareProductManager vendorSoftwareProductManager,
- ActivityLogManager activityLogManager) {
- this.candidateManager = candidateManager;
- this.vendorSoftwareProductManager = vendorSoftwareProductManager;
- this.activityLogManager = activityLogManager;
- }
-
- @Override
- public Response upload(final String vspId, final String versionId,
- final Attachment fileToUpload, final String user) {
- final byte[] fileToUploadBytes = fileToUpload.getObject(byte[].class);
- final DataHandler dataHandler = fileToUpload.getDataHandler();
- final String filename = ValidationUtils.sanitizeInputString(dataHandler.getName());
-
- final OnboardingPackageProcessor onboardingPackageProcessor = new OnboardingPackageProcessor(filename, fileToUploadBytes);
- if (onboardingPackageProcessor.hasErrors()) {
- final UploadFileResponseDto uploadFileResponseDto =
- buildUploadResponseWithError(onboardingPackageProcessor.getErrorMessages().toArray(new ErrorMessage[0]));
- return Response.status(Status.NOT_ACCEPTABLE).entity(uploadFileResponseDto).build();
- }
- final OnboardPackageInfo onboardPackageInfo = onboardingPackageProcessor.getOnboardPackageInfo().orElse(null);
+ private static final Logger LOGGER = LoggerFactory.getLogger(OrchestrationTemplateCandidateImpl.class);
+ private final OrchestrationTemplateCandidateManager candidateManager;
+ private final VendorSoftwareProductManager vendorSoftwareProductManager;
+ private final ActivityLogManager activityLogManager;
- if (onboardPackageInfo == null) {
- final UploadFileResponseDto uploadFileResponseDto = buildUploadResponseWithError(
- new ErrorMessage(ErrorLevel.ERROR, Messages.PACKAGE_PROCESS_ERROR.formatMessage(filename)));
- return Response.ok(uploadFileResponseDto).build();
+ public OrchestrationTemplateCandidateImpl() {
+ this.candidateManager = OrchestrationTemplateCandidateManagerFactory.getInstance().createInterface();
+ this.vendorSoftwareProductManager = VspManagerFactory.getInstance().createInterface();
+ this.activityLogManager = ActivityLogManagerFactory.getInstance().createInterface();
}
- final VspDetails vspDetails = new VspDetails(ValidationUtils.sanitizeInputString(vspId),
- new Version(ValidationUtils.sanitizeInputString(versionId)));
- return processOnboardPackage(onboardPackageInfo, vspDetails);
- }
+ // Constructor used in test to avoid mock static
+ public OrchestrationTemplateCandidateImpl(OrchestrationTemplateCandidateManager candidateManager,
+ VendorSoftwareProductManager vendorSoftwareProductManager, ActivityLogManager activityLogManager) {
+ this.candidateManager = candidateManager;
+ this.vendorSoftwareProductManager = vendorSoftwareProductManager;
+ this.activityLogManager = activityLogManager;
+ }
+
+ @Override
+ public Response upload(final String vspId, final String versionId, final Attachment fileToUpload, final String user) {
+ final byte[] fileToUploadBytes = fileToUpload.getObject(byte[].class);
+ final DataHandler dataHandler = fileToUpload.getDataHandler();
+ final String filename = ValidationUtils.sanitizeInputString(dataHandler.getName());
+ final OnboardingPackageProcessor onboardingPackageProcessor = new OnboardingPackageProcessor(filename, fileToUploadBytes);
+ if (onboardingPackageProcessor.hasErrors()) {
+ final UploadFileResponseDto uploadFileResponseDto = buildUploadResponseWithError(
+ onboardingPackageProcessor.getErrorMessages().toArray(new ErrorMessage[0]));
+ return Response.status(Status.NOT_ACCEPTABLE).entity(uploadFileResponseDto).build();
+ }
+ final OnboardPackageInfo onboardPackageInfo = onboardingPackageProcessor.getOnboardPackageInfo().orElse(null);
+ if (onboardPackageInfo == null) {
+ final UploadFileResponseDto uploadFileResponseDto = buildUploadResponseWithError(
+ new ErrorMessage(ErrorLevel.ERROR, Messages.PACKAGE_PROCESS_ERROR.formatMessage(filename)));
+ return Response.ok(uploadFileResponseDto).build();
+ }
+ final VspDetails vspDetails = new VspDetails(ValidationUtils.sanitizeInputString(vspId),
+ new Version(ValidationUtils.sanitizeInputString(versionId)));
+ return processOnboardPackage(onboardPackageInfo, vspDetails);
+ }
private Response processOnboardPackage(final OnboardPackageInfo onboardPackageInfo, final VspDetails vspDetails) {
final UploadFileResponse uploadFileResponse = candidateManager.upload(vspDetails, onboardPackageInfo);
@@ -132,108 +122,89 @@ public class OrchestrationTemplateCandidateImpl implements OrchestrationTemplate
return Response.ok(uploadFileResponseDto).build();
}
- private UploadFileResponseDto buildUploadResponseWithError(final ErrorMessage... errorMessages) {
- final UploadFileResponseDto uploadFileResponseDto = new UploadFileResponseDto();
- final Map<String, List<ErrorMessage>> errorMap = new HashMap<>();
- final List<ErrorMessage> errorMessageList = new ArrayList<>();
- Collections.addAll(errorMessageList, errorMessages);
- errorMap.put(SdcCommon.UPLOAD_FILE, errorMessageList);
- uploadFileResponseDto.setErrors(errorMap);
- return uploadFileResponseDto;
- }
-
- @Override
- public Response get(String vspId, String versionId, String user) throws IOException {
- Optional<Pair<String, byte[]>> zipFile = candidateManager.get(vspId, new Version(versionId));
- String fileName;
- if (zipFile.isPresent()) {
- fileName = "Candidate." + zipFile.get().getLeft();
- } else {
- zipFile = vendorSoftwareProductManager.get(vspId, new Version((versionId)));
-
- if (!zipFile.isPresent()) {
- ErrorMessage errorMessage = new ErrorMessage(ErrorLevel.ERROR,
- getErrorWithParameters(
- Messages.NO_FILE_WAS_UPLOADED_OR_FILE_NOT_EXIST.getErrorMessage(),
- ""));
- LOGGER.error(errorMessage.getMessage());
- return Response.status(Response.Status.NOT_FOUND).build();
- }
- fileName = "Processed." + zipFile.get().getLeft();
+ private UploadFileResponseDto buildUploadResponseWithError(final ErrorMessage... errorMessages) {
+ final UploadFileResponseDto uploadFileResponseDto = new UploadFileResponseDto();
+ final Map<String, List<ErrorMessage>> errorMap = new HashMap<>();
+ final List<ErrorMessage> errorMessageList = new ArrayList<>();
+ Collections.addAll(errorMessageList, errorMessages);
+ errorMap.put(SdcCommon.UPLOAD_FILE, errorMessageList);
+ uploadFileResponseDto.setErrors(errorMap);
+ return uploadFileResponseDto;
}
- Response.ResponseBuilder response = Response.ok(zipFile.get().getRight());
- response.header("Content-Disposition", "attachment; filename=" + fileName);
- return response.build();
- }
-
- @Override
- public Response abort(String vspId, String versionId) {
- candidateManager.abort(vspId, new Version(versionId));
- return Response.ok().build();
- }
-
- @Override
- public Response process(String vspId, String versionId, String user) {
-
- Version version = new Version(versionId);
- OrchestrationTemplateActionResponse response = candidateManager.process(vspId, version);
-
- activityLogManager.logActivity(new ActivityLogEntity(vspId, version,
- ActivityType.Upload_Network_Package, user, true, "", ""));
-
- OrchestrationTemplateActionResponseDto responseDto = copyOrchestrationTemplateActionResponseToDto(response);
- return Response.ok(responseDto).build();
- }
-
- @Override
- public Response updateFilesDataStructure(
- String vspId, String versionId, FileDataStructureDto fileDataStructureDto, String user) {
-
- FilesDataStructure fileDataStructure = copyFilesDataStructureDtoToFilesDataStructure(fileDataStructureDto);
+ @Override
+ public Response get(String vspId, String versionId, String user) throws IOException {
+ Optional<Pair<String, byte[]>> zipFile = candidateManager.get(vspId, new Version(versionId));
+ String fileName;
+ if (zipFile.isPresent()) {
+ fileName = "Candidate." + zipFile.get().getLeft();
+ } else {
+ zipFile = vendorSoftwareProductManager.get(vspId, new Version((versionId)));
+ if (!zipFile.isPresent()) {
+ ErrorMessage errorMessage = new ErrorMessage(ErrorLevel.ERROR,
+ getErrorWithParameters(Messages.NO_FILE_WAS_UPLOADED_OR_FILE_NOT_EXIST.getErrorMessage(), ""));
+ LOGGER.error(errorMessage.getMessage());
+ return Response.status(Response.Status.NOT_FOUND).build();
+ }
+ fileName = "Processed." + zipFile.get().getLeft();
+ }
+ Response.ResponseBuilder response = Response.ok(zipFile.get().getRight());
+ response.header("Content-Disposition", "attachment; filename=" + fileName);
+ return response.build();
+ }
- ValidationResponse response = candidateManager
- .updateFilesDataStructure(vspId, new Version(versionId), fileDataStructure);
+ @Override
+ public Response abort(String vspId, String versionId) {
+ candidateManager.abort(vspId, new Version(versionId));
+ return Response.ok().build();
+ }
- if (!response.isValid()) {
- return Response.status(Response.Status.EXPECTATION_FAILED).entity(
- new MapValidationResponseToDto()
- .applyMapping(response, ValidationResponseDto.class)).build();
+ @Override
+ public Response process(String vspId, String versionId, String user) {
+ Version version = new Version(versionId);
+ OrchestrationTemplateActionResponse response = candidateManager.process(vspId, version);
+ activityLogManager.logActivity(new ActivityLogEntity(vspId, version, ActivityType.Upload_Network_Package, user, true, "", ""));
+ OrchestrationTemplateActionResponseDto responseDto = copyOrchestrationTemplateActionResponseToDto(response);
+ return Response.ok(responseDto).build();
}
- return Response.ok(fileDataStructureDto).build();
- }
-
- @Override
- public Response getFilesDataStructure(String vspId, String versionId, String user) {
- Optional<FilesDataStructure> filesDataStructure =
- candidateManager.getFilesDataStructure(vspId, new Version(versionId));
- if (!filesDataStructure.isPresent()) {
- filesDataStructure = vendorSoftwareProductManager.getOrchestrationTemplateStructure(vspId,
- new Version(versionId));
+
+ @Override
+ public Response updateFilesDataStructure(String vspId, String versionId, FileDataStructureDto fileDataStructureDto, String user) {
+ FilesDataStructure fileDataStructure = copyFilesDataStructureDtoToFilesDataStructure(fileDataStructureDto);
+ ValidationResponse response = candidateManager.updateFilesDataStructure(vspId, new Version(versionId), fileDataStructure);
+ if (!response.isValid()) {
+ return Response.status(Response.Status.EXPECTATION_FAILED)
+ .entity(new MapValidationResponseToDto().applyMapping(response, ValidationResponseDto.class)).build();
+ }
+ return Response.ok(fileDataStructureDto).build();
}
- FileDataStructureDto fileDataStructureDto =
- filesDataStructure.map(dataStructure -> new MapFilesDataStructureToDto()
- .applyMapping(dataStructure, FileDataStructureDto.class))
+ @Override
+ public Response getFilesDataStructure(String vspId, String versionId, String user) {
+ Optional<FilesDataStructure> filesDataStructure = candidateManager.getFilesDataStructure(vspId, new Version(versionId));
+ if (!filesDataStructure.isPresent()) {
+ filesDataStructure = vendorSoftwareProductManager.getOrchestrationTemplateStructure(vspId, new Version(versionId));
+ }
+ FileDataStructureDto fileDataStructureDto = filesDataStructure
+ .map(dataStructure -> new MapFilesDataStructureToDto().applyMapping(dataStructure, FileDataStructureDto.class))
.orElse(new FileDataStructureDto());
- return Response.ok(fileDataStructureDto).build();
- }
-
- private OrchestrationTemplateActionResponseDto copyOrchestrationTemplateActionResponseToDto(OrchestrationTemplateActionResponse response){
- OrchestrationTemplateActionResponseDto result = new OrchestrationTemplateActionResponseDto();
- result.setErrors(response.getErrors());
- result.setFileNames(response.getFileNames());
- result.setStatus(response.getStatus());
- return result;
- }
-
- private FilesDataStructure copyFilesDataStructureDtoToFilesDataStructure(FileDataStructureDto fileDataStructureDto){
- FilesDataStructure filesDataStructure = new FilesDataStructure();
- filesDataStructure.setArtifacts(fileDataStructureDto.getArtifacts());
- filesDataStructure.setModules(fileDataStructureDto.getModules());
- filesDataStructure.setNested(fileDataStructureDto.getNested());
- filesDataStructure.setUnassigned(fileDataStructureDto.getUnassigned());
- return filesDataStructure;
- }
+ return Response.ok(fileDataStructureDto).build();
+ }
+
+ private OrchestrationTemplateActionResponseDto copyOrchestrationTemplateActionResponseToDto(OrchestrationTemplateActionResponse response) {
+ OrchestrationTemplateActionResponseDto result = new OrchestrationTemplateActionResponseDto();
+ result.setErrors(response.getErrors());
+ result.setFileNames(response.getFileNames());
+ result.setStatus(response.getStatus());
+ return result;
+ }
+ private FilesDataStructure copyFilesDataStructureDtoToFilesDataStructure(FileDataStructureDto fileDataStructureDto) {
+ FilesDataStructure filesDataStructure = new FilesDataStructure();
+ filesDataStructure.setArtifacts(fileDataStructureDto.getArtifacts());
+ filesDataStructure.setModules(fileDataStructureDto.getModules());
+ filesDataStructure.setNested(fileDataStructureDto.getNested());
+ filesDataStructure.setUnassigned(fileDataStructureDto.getUnassigned());
+ return filesDataStructure;
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ProcessesImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ProcessesImpl.java
index 3a03b1f73b..2d6efcda88 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ProcessesImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ProcessesImpl.java
@@ -7,9 +7,9 @@
* 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.
@@ -19,9 +19,10 @@
* Modifications copyright (c) 2019 Nokia
* ================================================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.services;
+import javax.inject.Named;
+import javax.ws.rs.core.Response;
import org.apache.cxf.jaxrs.ext.multipart.Attachment;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ProcessRequestDto;
import org.openecomp.sdcrests.vsp.rest.ComponentProcesses;
@@ -30,66 +31,60 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
-import javax.inject.Named;
-import javax.ws.rs.core.Response;
-
@Named
@Service("processes")
@Scope(value = "prototype")
public class ProcessesImpl implements Processes {
- private final ComponentProcesses componentProcesses;
+ private final ComponentProcesses componentProcesses;
- @Autowired
- public ProcessesImpl(ComponentProcesses componentProcesses) {
- this.componentProcesses = componentProcesses;
- }
+ @Autowired
+ public ProcessesImpl(ComponentProcesses componentProcesses) {
+ this.componentProcesses = componentProcesses;
+ }
- @Override
- public Response list(String vspId, String versionId, String user) {
- return componentProcesses.list(vspId, versionId, null, user);
- }
+ @Override
+ public Response list(String vspId, String versionId, String user) {
+ return componentProcesses.list(vspId, versionId, null, user);
+ }
- @Override
- public Response deleteList(String vspId, String versionId, String user) {
- return componentProcesses.deleteList(vspId, versionId, null, user);
- }
+ @Override
+ public Response deleteList(String vspId, String versionId, String user) {
+ return componentProcesses.deleteList(vspId, versionId, null, user);
+ }
- @Override
- public Response create(ProcessRequestDto request, String vspId, String versionId, String user) {
- return componentProcesses.create(request, vspId, versionId, null, user);
- }
+ @Override
+ public Response create(ProcessRequestDto request, String vspId, String versionId, String user) {
+ return componentProcesses.create(request, vspId, versionId, null, user);
+ }
- @Override
- public Response get(String vspId, String versionId, String processId, String user) {
- return componentProcesses.get(vspId, versionId, null, processId, user);
- }
+ @Override
+ public Response get(String vspId, String versionId, String processId, String user) {
+ return componentProcesses.get(vspId, versionId, null, processId, user);
+ }
- @Override
- public Response delete(String vspId, String versionId, String processId, String user) {
- return componentProcesses.delete(vspId, versionId, null, processId, user);
- }
+ @Override
+ public Response delete(String vspId, String versionId, String processId, String user) {
+ return componentProcesses.delete(vspId, versionId, null, processId, user);
+ }
- @Override
- public Response update(ProcessRequestDto request, String vspId, String versionId,
- String processId, String user) {
- return componentProcesses.update(request, vspId, versionId, null, processId, user);
- }
+ @Override
+ public Response update(ProcessRequestDto request, String vspId, String versionId, String processId, String user) {
+ return componentProcesses.update(request, vspId, versionId, null, processId, user);
+ }
- @Override
- public Response getUploadedFile(String vspId, String versionId, String processId, String user) {
- return componentProcesses.getUploadedFile(vspId, versionId, null, processId, user);
- }
+ @Override
+ public Response getUploadedFile(String vspId, String versionId, String processId, String user) {
+ return componentProcesses.getUploadedFile(vspId, versionId, null, processId, user);
+ }
- @Override
- public Response deleteUploadedFile(String vspId, String versionId, String processId,
- String user) {
- return componentProcesses.deleteUploadedFile(vspId, versionId, null, processId, user);
- }
+ @Override
+ public Response deleteUploadedFile(String vspId, String versionId, String processId, String user) {
+ return componentProcesses.deleteUploadedFile(vspId, versionId, null, processId, user);
+ }
- @Override
- public Response uploadFile(Attachment attachment, String vspId, String versionId,
- String processId, String user) {
- return componentProcesses.uploadFile(attachment, vspId, versionId, null, processId, user);
- }
+ @Override
+ public Response uploadFile(Attachment attachment, String vspId, String versionId, String processId, String user) {
+ return componentProcesses.uploadFile(attachment, vspId, versionId, null, processId, user);
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VendorSoftwareProductsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VendorSoftwareProductsImpl.java
index 91c1959c86..74d2fde097 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VendorSoftwareProductsImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VendorSoftwareProductsImpl.java
@@ -13,9 +13,32 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.openecomp.sdcrests.vsp.rest.services;
+import static javax.ws.rs.core.HttpHeaders.CONTENT_DISPOSITION;
+import static org.openecomp.sdc.itempermissions.notifications.NotificationConstants.PERMISSION_USER;
+import static org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME;
+import static org.openecomp.sdc.vendorsoftwareproduct.dao.type.OnboardingMethod.NetworkPackage;
+import static org.openecomp.sdc.versioning.VersioningNotificationConstansts.ITEM_ID;
+import static org.openecomp.sdc.versioning.VersioningNotificationConstansts.ITEM_NAME;
+import static org.openecomp.sdc.versioning.VersioningNotificationConstansts.SUBMIT_DESCRIPTION;
+import static org.openecomp.sdc.versioning.VersioningNotificationConstansts.VERSION_ID;
+import static org.openecomp.sdc.versioning.VersioningNotificationConstansts.VERSION_NAME;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.function.Predicate;
+import java.util.stream.Collectors;
+import javax.inject.Named;
+import javax.ws.rs.core.Response;
import org.apache.commons.collections4.MapUtils;
import org.openecomp.core.dao.UniqueValueDaoFactory;
import org.openecomp.core.util.UniqueValueUtil;
@@ -40,7 +63,12 @@ import org.openecomp.sdc.notification.services.NotificationPropagationManager;
import org.openecomp.sdc.vendorsoftwareproduct.OrchestrationTemplateCandidateManagerFactory;
import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductManager;
import org.openecomp.sdc.vendorsoftwareproduct.VspManagerFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.*;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComputeEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.OnboardingMethod;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.OrchestrationTemplateCandidateData;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.OrchestrationTemplateEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.PackageInfo;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
import org.openecomp.sdc.vendorsoftwareproduct.errors.CreatePackageForNonFinalVendorSoftwareProductErrorBuilder;
import org.openecomp.sdc.vendorsoftwareproduct.errors.OnboardingMethodErrorBuilder;
import org.openecomp.sdc.vendorsoftwareproduct.errors.PackageNotFoundErrorBuilder;
@@ -59,27 +87,28 @@ import org.openecomp.sdc.versioning.types.NotificationEventTypes;
import org.openecomp.sdcrests.item.rest.mapping.MapVersionToDto;
import org.openecomp.sdcrests.item.types.ItemCreationDto;
import org.openecomp.sdcrests.item.types.VersionDto;
-import org.openecomp.sdcrests.vendorsoftwareproducts.types.*;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.PackageInfoDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireResponseDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ValidationResponseDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.VendorSoftwareProductAction;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.VersionSoftwareProductActionRequestDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspComputeDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspDescriptionDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspDetailsDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspRequestDto;
import org.openecomp.sdcrests.vsp.rest.VendorSoftwareProducts;
-import org.openecomp.sdcrests.vsp.rest.mapping.*;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapComputeEntityToVspComputeDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapItemToVspDetailsDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapPackageInfoToPackageInfoDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapQuestionnaireResponseToQuestionnaireResponseDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapValidationResponseToDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapVspDescriptionDtoToItem;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapVspDescriptionDtoToVspDetails;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapVspDetailsToDto;
import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
-import javax.inject.Named;
-import javax.ws.rs.core.Response;
-import java.io.File;
-import java.io.IOException;
-import java.util.*;
-import java.util.function.Predicate;
-import java.util.stream.Collectors;
-
-import static javax.ws.rs.core.HttpHeaders.CONTENT_DISPOSITION;
-import static org.openecomp.sdc.itempermissions.notifications.NotificationConstants.PERMISSION_USER;
-import static org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME;
-import static org.openecomp.sdc.vendorsoftwareproduct.dao.type.OnboardingMethod.NetworkPackage;
-import static org.openecomp.sdc.versioning.VersioningNotificationConstansts.*;
-
@Named
@Service("vendorSoftwareProducts")
@Scope(value = "prototype")
@@ -89,28 +118,17 @@ public class VendorSoftwareProductsImpl implements VendorSoftwareProducts {
private static final String VALIDATION_VSP_USER = "validationOnlyVspUser";
private static final String SUBMIT_ITEM_ACTION = "Submit_Item";
private static final String ATTACHMENT_FILENAME = "attachment; filename=";
- private static final String SUBMIT_HEALED_VERSION_ERROR =
- "VSP Id %s: Error while submitting version %s created based on Certified version %s for healing purpose.";
+ private static final String SUBMIT_HEALED_VERSION_ERROR = "VSP Id %s: Error while submitting version %s created based on Certified version %s for healing purpose.";
private static final Logger LOGGER = LoggerFactory.getLogger(VendorSoftwareProductsImpl.class);
private static final Object VALIDATION_VSP_CACHE_LOCK = new Object();
-
private static ItemCreationDto cachedValidationVsp;
-
- private final AsdcItemManager itemManager = AsdcItemManagerFactory.getInstance()
- .createInterface();
- private final PermissionsManager permissionsManager =
- PermissionsManagerFactory.getInstance().createInterface();
- private final VersioningManager versioningManager =
- VersioningManagerFactory.getInstance().createInterface();
- private final VendorSoftwareProductManager vendorSoftwareProductManager =
- VspManagerFactory.getInstance().createInterface();
- private final ActivityLogManager activityLogManager =
- ActivityLogManagerFactory.getInstance().createInterface();
- private final NotificationPropagationManager notifier =
- NotificationPropagationManagerFactory.getInstance().createInterface();
- private final UniqueValueUtil uniqueValueUtil = new UniqueValueUtil(UniqueValueDaoFactory
- .getInstance().createInterface());
-
+ private final AsdcItemManager itemManager = AsdcItemManagerFactory.getInstance().createInterface();
+ private final PermissionsManager permissionsManager = PermissionsManagerFactory.getInstance().createInterface();
+ private final VersioningManager versioningManager = VersioningManagerFactory.getInstance().createInterface();
+ private final VendorSoftwareProductManager vendorSoftwareProductManager = VspManagerFactory.getInstance().createInterface();
+ private final ActivityLogManager activityLogManager = ActivityLogManagerFactory.getInstance().createInterface();
+ private final NotificationPropagationManager notifier = NotificationPropagationManagerFactory.getInstance().createInterface();
+ private final UniqueValueUtil uniqueValueUtil = new UniqueValueUtil(UniqueValueDaoFactory.getInstance().createInterface());
@Override
public Response createVsp(VspRequestDto vspRequestDto, String user) {
@@ -119,74 +137,55 @@ public class VendorSoftwareProductsImpl implements VendorSoftwareProducts {
}
private ItemCreationDto createVspItem(VspRequestDto vspRequestDto, String user) {
-
OnboardingMethod onboardingMethod = null;
-
try {
onboardingMethod = OnboardingMethod.valueOf(vspRequestDto.getOnboardingMethod());
} catch (IllegalArgumentException e) {
LOGGER.error("Error while creating VSP. Message: " + e.getMessage());
throwUnknownOnboardingMethodException(e);
}
-
ItemCreationDto itemCreationDto = null;
- if (onboardingMethod == NetworkPackage
- || onboardingMethod == OnboardingMethod.Manual) {
+ if (onboardingMethod == NetworkPackage || onboardingMethod == OnboardingMethod.Manual) {
itemCreationDto = createItem(vspRequestDto, user, onboardingMethod);
-
} else {
- throwUnknownOnboardingMethodException(
- new IllegalArgumentException("Wrong parameter Onboarding Method"));
+ throwUnknownOnboardingMethodException(new IllegalArgumentException("Wrong parameter Onboarding Method"));
}
-
return itemCreationDto;
}
private ItemCreationDto createItem(VspRequestDto vspRequestDto, String user, OnboardingMethod onboardingMethod) {
-
Item item = new MapVspDescriptionDtoToItem().applyMapping(vspRequestDto, Item.class);
item.setType(ItemType.vsp.name());
item.setOwner(user);
item.setStatus(ItemStatus.ACTIVE);
item.addProperty(VspItemProperty.ONBOARDING_METHOD, onboardingMethod.name());
-
uniqueValueUtil.validateUniqueValue(VENDOR_SOFTWARE_PRODUCT_NAME, item.getName());
item = itemManager.create(item);
uniqueValueUtil.createUniqueValue(VENDOR_SOFTWARE_PRODUCT_NAME, item.getName());
-
Version version = versioningManager.create(item.getId(), new Version(), null);
-
- VspDetails vspDetails =
- new MapVspDescriptionDtoToVspDetails().applyMapping(vspRequestDto, VspDetails.class);
+ VspDetails vspDetails = new MapVspDescriptionDtoToVspDetails().applyMapping(vspRequestDto, VspDetails.class);
vspDetails.setId(item.getId());
vspDetails.setVersion(version);
vspDetails.setOnboardingMethod(vspRequestDto.getOnboardingMethod());
-
vendorSoftwareProductManager.createVsp(vspDetails);
versioningManager.publish(item.getId(), version, "Initial vsp:" + vspDetails.getName());
ItemCreationDto itemCreationDto = new ItemCreationDto();
itemCreationDto.setItemId(item.getId());
itemCreationDto.setVersion(new MapVersionToDto().applyMapping(version, VersionDto.class));
- activityLogManager.logActivity(new ActivityLogEntity(vspDetails.getId(), version,
- ActivityType.Create, user, true, "", ""));
+ activityLogManager.logActivity(new ActivityLogEntity(vspDetails.getId(), version, ActivityType.Create, user, true, "", ""));
return itemCreationDto;
}
private void throwUnknownOnboardingMethodException(IllegalArgumentException e) {
- ErrorCode onboardingMethodUpdateErrorCode = OnboardingMethodErrorBuilder
- .getInvalidOnboardingMethodErrorBuilder();
+ ErrorCode onboardingMethodUpdateErrorCode = OnboardingMethodErrorBuilder.getInvalidOnboardingMethodErrorBuilder();
throw new CoreException(onboardingMethodUpdateErrorCode, e);
}
@Override
public Response listVsps(String versionStatus, String itemStatus, String user) {
-
GenericCollectionWrapper<VspDetailsDto> results = new GenericCollectionWrapper<>();
MapItemToVspDetailsDto mapper = new MapItemToVspDetailsDto();
-
- getVspList(versionStatus, itemStatus, user)
- .forEach(vspItem -> results.add(mapper.applyMapping(vspItem, VspDetailsDto.class)));
-
+ getVspList(versionStatus, itemStatus, user).forEach(vspItem -> results.add(mapper.applyMapping(vspItem, VspDetailsDto.class)));
return Response.ok(results).build();
}
@@ -194,23 +193,18 @@ public class VendorSoftwareProductsImpl implements VendorSoftwareProducts {
public Response getVsp(String vspId, String versionId, String user) {
Version version = versioningManager.get(vspId, new Version(versionId));
VspDetails vspDetails = vendorSoftwareProductManager.getVsp(vspId, version);
-
try {
- HealingManagerFactory.getInstance().createInterface()
- .healItemVersion(vspId, version, ItemType.vsp, false)
- .ifPresent(healedVersion -> {
- vspDetails.setVersion(healedVersion);
- if (version.getStatus() == VersionStatus.Certified) {
- submitHealedVersion(vspDetails, versionId, user);
- }
- });
+ HealingManagerFactory.getInstance().createInterface().healItemVersion(vspId, version, ItemType.vsp, false).ifPresent(healedVersion -> {
+ vspDetails.setVersion(healedVersion);
+ if (version.getStatus() == VersionStatus.Certified) {
+ submitHealedVersion(vspDetails, versionId, user);
+ }
+ });
} catch (Exception e) {
LOGGER.error(String.format("Error while auto healing VSP with Id %s and version %s", vspId, versionId), e);
}
-
VspDetailsDto vspDetailsDto = new MapVspDetailsToDto().applyMapping(vspDetails, VspDetailsDto.class);
addNetworkPackageInfo(vspId, vspDetails.getVersion(), vspDetailsDto);
-
return Response.ok(vspDetailsDto).build();
}
@@ -220,88 +214,63 @@ public class VendorSoftwareProductsImpl implements VendorSoftwareProducts {
// sync vlm if not exists on user space
versioningManager.get(vspDetails.getVendorId(), vspDetails.getVlmVersion());
}
-
- submit(vspDetails.getId(), vspDetails.getVersion(), "Submit healed Vsp", user)
- .ifPresent(validationResponse -> {
- throw new IllegalStateException("Certified vsp after healing failed on validation");
- });
+ submit(vspDetails.getId(), vspDetails.getVersion(), "Submit healed Vsp", user).ifPresent(validationResponse -> {
+ throw new IllegalStateException("Certified vsp after healing failed on validation");
+ });
vendorSoftwareProductManager.createPackage(vspDetails.getId(), vspDetails.getVersion());
} catch (Exception ex) {
- LOGGER.error(String.format(SUBMIT_HEALED_VERSION_ERROR, vspDetails.getId(), vspDetails.getVersion().getId(),
- baseVersionId), ex);
+ LOGGER.error(String.format(SUBMIT_HEALED_VERSION_ERROR, vspDetails.getId(), vspDetails.getVersion().getId(), baseVersionId), ex);
}
}
@Override
- public Response updateVsp(String vspId, String versionId, VspDescriptionDto vspDescriptionDto,
- String user) {
- VspDetails vspDetails =
- new MapVspDescriptionDtoToVspDetails().applyMapping(vspDescriptionDto, VspDetails.class);
+ public Response updateVsp(String vspId, String versionId, VspDescriptionDto vspDescriptionDto, String user) {
+ VspDetails vspDetails = new MapVspDescriptionDtoToVspDetails().applyMapping(vspDescriptionDto, VspDetails.class);
vspDetails.setId(vspId);
vspDetails.setVersion(new Version(versionId));
-
vendorSoftwareProductManager.updateVsp(vspDetails);
-
- updateVspItem(vspId,vspDescriptionDto);
-
+ updateVspItem(vspId, vspDescriptionDto);
return Response.ok().build();
}
@Override
public Response deleteVsp(String vspId, String user) {
Item vsp = itemManager.get(vspId);
-
if (!vsp.getType().equals(ItemType.vsp.name())) {
- throw new CoreException((new ErrorCode.ErrorCodeBuilder()
- .withMessage(String.format("Vsp with id %s does not exist.",
- vspId)).build()));
+ throw new CoreException((new ErrorCode.ErrorCodeBuilder().withMessage(String.format("Vsp with id %s does not exist.", vspId)).build()));
}
-
Integer certifiedVersionsCounter = vsp.getVersionStatusCounters().get(VersionStatus.Certified);
if (Objects.isNull(certifiedVersionsCounter) || certifiedVersionsCounter == 0) {
- versioningManager.list(vspId)
- .forEach(version -> vendorSoftwareProductManager.deleteVsp(vspId, version));
+ versioningManager.list(vspId).forEach(version -> vendorSoftwareProductManager.deleteVsp(vspId, version));
itemManager.delete(vsp);
permissionsManager.deleteItemPermissions(vspId);
uniqueValueUtil.deleteUniqueValue(VENDOR_SOFTWARE_PRODUCT_NAME, vsp.getName());
- notifyUsers(vspId, vsp.getName(), null, null, user,
- NotificationEventTypes.DELETE);
-
+ notifyUsers(vspId, vsp.getName(), null, null, user, NotificationEventTypes.DELETE);
return Response.ok().build();
} else {
- return Response.status(Response.Status.FORBIDDEN)
- .entity(new Exception(Messages.DELETE_VSP_ERROR.getErrorMessage())).build();
+ return Response.status(Response.Status.FORBIDDEN).entity(new Exception(Messages.DELETE_VSP_ERROR.getErrorMessage())).build();
}
}
@Override
- public Response actOnVendorSoftwareProduct(VersionSoftwareProductActionRequestDto request,
- String vspId, String versionId,
- String user) throws IOException {
+ public Response actOnVendorSoftwareProduct(VersionSoftwareProductActionRequestDto request, String vspId, String versionId, String user)
+ throws IOException {
Version version = new Version(versionId);
-
if (request.getAction() == VendorSoftwareProductAction.Submit) {
if (!permissionsManager.isAllowed(vspId, user, SUBMIT_ITEM_ACTION)) {
- return Response.status(Response.Status.FORBIDDEN)
- .entity(new Exception(Messages.PERMISSIONS_ERROR.getErrorMessage())).build();
+ return Response.status(Response.Status.FORBIDDEN).entity(new Exception(Messages.PERMISSIONS_ERROR.getErrorMessage())).build();
}
- String message = request.getSubmitRequest() == null ? "Submit"
- : request.getSubmitRequest().getMessage();
+ String message = request.getSubmitRequest() == null ? "Submit" : request.getSubmitRequest().getMessage();
Optional<ValidationResponse> validationResponse = submit(vspId, version, message, user);
-
if (validationResponse.isPresent()) {
ValidationResponseDto validationResponseDto = new MapValidationResponseToDto()
- .applyMapping(validationResponse.get(), ValidationResponseDto.class);
- return Response.status(Response.Status.EXPECTATION_FAILED).entity(validationResponseDto)
- .build();
+ .applyMapping(validationResponse.get(), ValidationResponseDto.class);
+ return Response.status(Response.Status.EXPECTATION_FAILED).entity(validationResponseDto).build();
}
-
notifyUsers(vspId, null, version, message, user, NotificationEventTypes.SUBMIT);
-
} else if (request.getAction() == VendorSoftwareProductAction.Create_Package) {
return createPackage(vspId, version);
}
-
return Response.ok().build();
}
@@ -312,35 +281,24 @@ public class VendorSoftwareProductsImpl implements VendorSoftwareProducts {
}
private ItemCreationDto retrieveValidationVsp() {
-
synchronized (VALIDATION_VSP_CACHE_LOCK) {
-
if (cachedValidationVsp != null) {
return cachedValidationVsp;
}
-
VspRequestDto validationVspRequest = new VspRequestDto();
validationVspRequest.setOnboardingMethod(NetworkPackage.toString());
validationVspRequest.setName(VALIDATION_VSP_NAME);
-
try {
-
cachedValidationVsp = createVspItem(validationVspRequest, VALIDATION_VSP_USER);
return cachedValidationVsp;
-
} catch (CoreException vspCreateException) {
LOGGER.debug("Failed to create validation VSP", vspCreateException);
- Predicate<Item> validationVspFilter = item -> ItemType.vsp.name().equals(item.getType())
- && VALIDATION_VSP_NAME.equals(item.getName());
- String validationVspId = itemManager.list(validationVspFilter).stream().findFirst()
- .orElseThrow(() -> new IllegalStateException(
- "Vsp with name " + VALIDATION_VSP_NAME +
- " does not exist even though the name exists according to " +
- "unique value util"))
- .getId();
-
+ Predicate<Item> validationVspFilter = item -> ItemType.vsp.name().equals(item.getType()) && VALIDATION_VSP_NAME
+ .equals(item.getName());
+ String validationVspId = itemManager.list(validationVspFilter).stream().findFirst().orElseThrow(() -> new IllegalStateException(
+ "Vsp with name " + VALIDATION_VSP_NAME + " does not exist even though the name exists according to " + "unique value util"))
+ .getId();
Version validationVspVersion = versioningManager.list(validationVspId).iterator().next();
-
cachedValidationVsp = new ItemCreationDto();
cachedValidationVsp.setItemId(validationVspId);
cachedValidationVsp.setVersion(new MapVersionToDto().applyMapping(validationVspVersion, VersionDto.class));
@@ -351,9 +309,7 @@ public class VendorSoftwareProductsImpl implements VendorSoftwareProducts {
@Override
public Response getOrchestrationTemplate(String vspId, String versionId, String user) {
- byte[] orchestrationTemplateFile =
- vendorSoftwareProductManager.getOrchestrationTemplateFile(vspId, new Version(versionId));
-
+ byte[] orchestrationTemplateFile = vendorSoftwareProductManager.getOrchestrationTemplateFile(vspId, new Version(versionId));
if (orchestrationTemplateFile == null || orchestrationTemplateFile.length == 0) {
return Response.status(Response.Status.NOT_FOUND).build();
}
@@ -364,21 +320,12 @@ public class VendorSoftwareProductsImpl implements VendorSoftwareProducts {
@Override
public Response listPackages(String status, String category, String subCategory, String user) {
-
- List<String> vspsIds =
- getVspList(null, status != null ? ItemStatus.valueOf(status).name() : null, user)
- .stream().map(Item::getId).collect(Collectors.toList());
-
- List<PackageInfo> packageInfoList =
- vendorSoftwareProductManager.listPackages(category, subCategory);
-
- packageInfoList = packageInfoList.stream().
- filter(packageInfo -> vspsIds.contains(packageInfo.getVspId()))
- .collect(Collectors.toList());
-
+ List<String> vspsIds = getVspList(null, status != null ? ItemStatus.valueOf(status).name() : null, user).stream().map(Item::getId)
+ .collect(Collectors.toList());
+ List<PackageInfo> packageInfoList = vendorSoftwareProductManager.listPackages(category, subCategory);
+ packageInfoList = packageInfoList.stream().filter(packageInfo -> vspsIds.contains(packageInfo.getVspId())).collect(Collectors.toList());
GenericCollectionWrapper<PackageInfoDto> results = new GenericCollectionWrapper<>();
MapPackageInfoToPackageInfoDto mapper = new MapPackageInfoToPackageInfoDto();
-
if (packageInfoList != null) {
for (PackageInfo packageInfo : packageInfoList) {
results.add(mapper.applyMapping(packageInfo, PackageInfoDto.class));
@@ -393,90 +340,71 @@ public class VendorSoftwareProductsImpl implements VendorSoftwareProducts {
Version version;
if (versionName == null) {
version = versions.stream().filter(ver -> VersionStatus.Certified == ver.getStatus())
- .max(Comparator.comparingDouble(o -> Double.parseDouble(o.getName())))
- .orElseThrow(() -> new CoreException(new PackageNotFoundErrorBuilder(vspId).build()));
+ .max(Comparator.comparingDouble(o -> Double.parseDouble(o.getName())))
+ .orElseThrow(() -> new CoreException(new PackageNotFoundErrorBuilder(vspId).build()));
} else {
- version = versions.stream().filter(ver -> versionName.equals(ver.getName()))
- .findFirst()
- .orElseThrow(() -> new CoreException(new PackageNotFoundErrorBuilder(vspId).build()));
-
+ version = versions.stream().filter(ver -> versionName.equals(ver.getName())).findFirst()
+ .orElseThrow(() -> new CoreException(new PackageNotFoundErrorBuilder(vspId).build()));
if (version.getStatus() != VersionStatus.Certified) {
throw new CoreException(new RequestedVersionInvalidErrorBuilder().build());
}
}
-
File zipFile = vendorSoftwareProductManager.getTranslatedFile(vspId, version);
-
Response.ResponseBuilder response = Response.ok(zipFile);
if (zipFile == null) {
return Response.status(Response.Status.NOT_FOUND).build();
}
response.header(CONTENT_DISPOSITION, ATTACHMENT_FILENAME + zipFile.getName());
-
return response.build();
}
@Override
public Response getQuestionnaire(String vspId, String versionId, String user) {
- QuestionnaireResponse questionnaireResponse =
- vendorSoftwareProductManager.getVspQuestionnaire(vspId, new Version(versionId));
-
+ QuestionnaireResponse questionnaireResponse = vendorSoftwareProductManager.getVspQuestionnaire(vspId, new Version(versionId));
if (questionnaireResponse.getErrorMessage() != null) {
- return Response.status(Response.Status.EXPECTATION_FAILED).entity(
- new MapQuestionnaireResponseToQuestionnaireResponseDto()
- .applyMapping(questionnaireResponse, QuestionnaireResponseDto.class)).build();
+ return Response.status(Response.Status.EXPECTATION_FAILED)
+ .entity(new MapQuestionnaireResponseToQuestionnaireResponseDto().applyMapping(questionnaireResponse, QuestionnaireResponseDto.class))
+ .build();
}
-
QuestionnaireResponseDto result = new MapQuestionnaireResponseToQuestionnaireResponseDto()
- .applyMapping(questionnaireResponse, QuestionnaireResponseDto.class);
+ .applyMapping(questionnaireResponse, QuestionnaireResponseDto.class);
return Response.ok(result).build();
}
@Override
- public Response updateQuestionnaire(String questionnaireData, String vspId, String
- versionId, String user) {
- vendorSoftwareProductManager
- .updateVspQuestionnaire(vspId, new Version(versionId), questionnaireData);
+ public Response updateQuestionnaire(String questionnaireData, String vspId, String versionId, String user) {
+ vendorSoftwareProductManager.updateVspQuestionnaire(vspId, new Version(versionId), questionnaireData);
return Response.ok().build();
}
@Override
public Response heal(String vspId, String versionId, String user) {
- HealingManagerFactory.getInstance().createInterface()
- .healItemVersion(vspId, new Version(versionId), ItemType.vsp, true);
+ HealingManagerFactory.getInstance().createInterface().healItemVersion(vspId, new Version(versionId), ItemType.vsp, true);
return Response.ok().build();
}
@Override
public Response getVspInformationArtifact(String vspId, String versionId, String user) {
- File textInformationArtifact =
- vendorSoftwareProductManager.getInformationArtifact(vspId, new Version(versionId));
-
+ File textInformationArtifact = vendorSoftwareProductManager.getInformationArtifact(vspId, new Version(versionId));
Response.ResponseBuilder response = Response.ok(textInformationArtifact);
if (textInformationArtifact == null) {
return Response.status(Response.Status.NOT_FOUND).build();
}
- response
- .header(CONTENT_DISPOSITION, ATTACHMENT_FILENAME + textInformationArtifact.getName());
+ response.header(CONTENT_DISPOSITION, ATTACHMENT_FILENAME + textInformationArtifact.getName());
return response.build();
}
@Override
public Response listComputes(String vspId, String version, String user) {
-
- Collection<ComputeEntity> computes =
- vendorSoftwareProductManager.getComputeByVsp(vspId, new Version(version));
-
+ Collection<ComputeEntity> computes = vendorSoftwareProductManager.getComputeByVsp(vspId, new Version(version));
MapComputeEntityToVspComputeDto mapper = new MapComputeEntityToVspComputeDto();
GenericCollectionWrapper<VspComputeDto> results = new GenericCollectionWrapper<>();
for (ComputeEntity compute : computes) {
results.add(mapper.applyMapping(compute, VspComputeDto.class));
}
-
return Response.ok(results).build();
}
-
private void updateVspItem(String vspId, VspDescriptionDto vspDescriptionDto) {
Item retrievedItem = itemManager.get(vspId);
Item item = new MapVspDescriptionDtoToItem().applyMapping(vspDescriptionDto, Item.class);
@@ -487,52 +415,37 @@ public class VendorSoftwareProductsImpl implements VendorSoftwareProducts {
item.setVersionStatusCounters(retrievedItem.getVersionStatusCounters());
item.setCreationTime(retrievedItem.getCreationTime());
item.setModificationTime(new Date());
- item.addProperty(VspItemProperty.ONBOARDING_METHOD,
- retrievedItem.getProperties().get(VspItemProperty.ONBOARDING_METHOD));
-
+ item.addProperty(VspItemProperty.ONBOARDING_METHOD, retrievedItem.getProperties().get(VspItemProperty.ONBOARDING_METHOD));
itemManager.update(item);
}
- private Optional<ValidationResponse> submit(String vspId, Version version, String message,
- String user) throws IOException {
-
+ private Optional<ValidationResponse> submit(String vspId, Version version, String message, String user) throws IOException {
VspDetails vspDetails = vendorSoftwareProductManager.getVsp(vspId, version);
if (vspDetails.getVlmVersion() != null) {
vspDetails.setVlmVersion(versioningManager.get(vspDetails.getVendorId(), vspDetails.getVlmVersion()));
}
ValidationResponse validationResponse = vendorSoftwareProductManager.validate(vspDetails);
- Map<String, List<ErrorMessage>> compilationErrors =
- vendorSoftwareProductManager.compile(vspId, version);
+ Map<String, List<ErrorMessage>> compilationErrors = vendorSoftwareProductManager.compile(vspId, version);
if (!validationResponse.isValid() || MapUtils.isNotEmpty(compilationErrors)) {
- activityLogManager.logActivity(
- new ActivityLogEntity(vspId, version, ActivityType.Submit, user, false,
- "Failed on validation before submit", ""));
+ activityLogManager
+ .logActivity(new ActivityLogEntity(vspId, version, ActivityType.Submit, user, false, "Failed on validation before submit", ""));
return Optional.of(validationResponse);
}
-
versioningManager.submit(vspId, version, message);
- activityLogManager.logActivity(
- new ActivityLogEntity(vspId, version, ActivityType.Submit, user, true, "", message));
+ activityLogManager.logActivity(new ActivityLogEntity(vspId, version, ActivityType.Submit, user, true, "", message));
return Optional.empty();
}
- private void notifyUsers(String itemId, String itemName, Version version, String message,
- String userName, NotificationEventTypes eventType) {
+ private void notifyUsers(String itemId, String itemName, Version version, String message, String userName, NotificationEventTypes eventType) {
Map<String, Object> eventProperties = new HashMap<>();
- eventProperties
- .put(ITEM_NAME, itemName == null ? itemManager.get(itemId).getName() : itemName);
+ eventProperties.put(ITEM_NAME, itemName == null ? itemManager.get(itemId).getName() : itemName);
eventProperties.put(ITEM_ID, itemId);
-
if (version != null) {
- eventProperties.put(VERSION_NAME, version.getName() == null
- ? versioningManager.get(itemId, version).getName()
- : version.getName());
+ eventProperties.put(VERSION_NAME, version.getName() == null ? versioningManager.get(itemId, version).getName() : version.getName());
eventProperties.put(VERSION_ID, version.getId());
}
-
eventProperties.put(SUBMIT_DESCRIPTION, message);
eventProperties.put(PERMISSION_USER, userName);
-
Event syncEvent = new SyncEvent(eventType.getEventName(), itemId, eventProperties, itemId);
try {
notifier.notifySubscribers(syncEvent, userName);
@@ -544,91 +457,68 @@ public class VendorSoftwareProductsImpl implements VendorSoftwareProducts {
private Response createPackage(String vspId, Version version) throws IOException {
Version retrievedVersion = versioningManager.get(vspId, version);
if (retrievedVersion.getStatus() != VersionStatus.Certified) {
- throw new CoreException(
- new CreatePackageForNonFinalVendorSoftwareProductErrorBuilder(vspId, version)
- .build());
+ throw new CoreException(new CreatePackageForNonFinalVendorSoftwareProductErrorBuilder(vspId, version).build());
}
- PackageInfo packageInfo =
- vendorSoftwareProductManager.createPackage(vspId, retrievedVersion);
- return Response.ok(packageInfo == null
- ? null
- : new MapPackageInfoToPackageInfoDto().applyMapping(packageInfo, PackageInfoDto.class))
- .build();
+ PackageInfo packageInfo = vendorSoftwareProductManager.createPackage(vspId, retrievedVersion);
+ return Response.ok(packageInfo == null ? null : new MapPackageInfoToPackageInfoDto().applyMapping(packageInfo, PackageInfoDto.class)).build();
}
- private void addNetworkPackageInfo(String vspId, Version version, VspDetailsDto vspDetailsDto) {
- Optional<OrchestrationTemplateCandidateData> candidateInfo =
- OrchestrationTemplateCandidateManagerFactory.getInstance().createInterface()
+ private void addNetworkPackageInfo(String vspId, Version version, VspDetailsDto vspDetailsDto) {
+ Optional<OrchestrationTemplateCandidateData> candidateInfo = OrchestrationTemplateCandidateManagerFactory.getInstance().createInterface()
.getInfo(vspId, version);
- if (candidateInfo.isPresent()) {
- if (candidateInfo.get().getValidationDataStructure() != null) {
- vspDetailsDto.setValidationData(candidateInfo.get().getValidationDataStructure());
- }
- vspDetailsDto.setNetworkPackageName(candidateInfo.get().getFileName());
- vspDetailsDto.setCandidateOnboardingOrigin(candidateInfo.get().getFileSuffix());
- } else {
- OrchestrationTemplateEntity orchestrationTemplateInfo =
- vendorSoftwareProductManager.getOrchestrationTemplateInfo(vspId, version);
- if (Objects.nonNull(orchestrationTemplateInfo) && Objects.nonNull(orchestrationTemplateInfo
- .getFileSuffix())) {
- if (orchestrationTemplateInfo.getValidationDataStructure() != null) {
- vspDetailsDto.setValidationData(orchestrationTemplateInfo.getValidationDataStructure());
+ if (candidateInfo.isPresent()) {
+ if (candidateInfo.get().getValidationDataStructure() != null) {
+ vspDetailsDto.setValidationData(candidateInfo.get().getValidationDataStructure());
+ }
+ vspDetailsDto.setNetworkPackageName(candidateInfo.get().getFileName());
+ vspDetailsDto.setCandidateOnboardingOrigin(candidateInfo.get().getFileSuffix());
+ } else {
+ OrchestrationTemplateEntity orchestrationTemplateInfo = vendorSoftwareProductManager.getOrchestrationTemplateInfo(vspId, version);
+ if (Objects.nonNull(orchestrationTemplateInfo) && Objects.nonNull(orchestrationTemplateInfo.getFileSuffix())) {
+ if (orchestrationTemplateInfo.getValidationDataStructure() != null) {
+ vspDetailsDto.setValidationData(orchestrationTemplateInfo.getValidationDataStructure());
+ }
+ vspDetailsDto.setNetworkPackageName(orchestrationTemplateInfo.getFileName());
+ vspDetailsDto.setOnboardingOrigin(orchestrationTemplateInfo.getFileSuffix());
+ }
}
- vspDetailsDto.setNetworkPackageName(orchestrationTemplateInfo.getFileName());
- vspDetailsDto.setOnboardingOrigin(orchestrationTemplateInfo.getFileSuffix());
- }
}
- }
-
- private boolean userHasPermission(String itemId, String userId) {
- return permissionsManager.getUserItemPermission(itemId, userId)
- .map(permission -> permission
- .matches(PermissionTypes.Contributor.name() + "|" + PermissionTypes.Owner.name()))
- .orElse(false);
- }
-
- private Predicate<Item> createItemPredicate(String versionStatus,
- String itemStatus,
- String user) {
- Predicate<Item> itemPredicate = item -> ItemType.vsp.name().equals(item.getType());
+ private boolean userHasPermission(String itemId, String userId) {
+ return permissionsManager.getUserItemPermission(itemId, userId)
+ .map(permission -> permission.matches(PermissionTypes.Contributor.name() + "|" + PermissionTypes.Owner.name())).orElse(false);
+ }
+
+ private Predicate<Item> createItemPredicate(String versionStatus, String itemStatus, String user) {
+ Predicate<Item> itemPredicate = item -> ItemType.vsp.name().equals(item.getType());
if (ItemStatus.ARCHIVED.name().equals(itemStatus)) {
itemPredicate = itemPredicate.and(item -> ItemStatus.ARCHIVED.equals(item.getStatus()));
} else {
itemPredicate = itemPredicate.and(item -> ItemStatus.ACTIVE.equals(item.getStatus()));
-
if (VersionStatus.Certified.name().equals(versionStatus)) {
- itemPredicate = itemPredicate
- .and(item -> item.getVersionStatusCounters().containsKey(VersionStatus.Certified));
-
+ itemPredicate = itemPredicate.and(item -> item.getVersionStatusCounters().containsKey(VersionStatus.Certified));
} else if (VersionStatus.Draft.name().equals(versionStatus)) {
- itemPredicate = itemPredicate.and(
- item -> item.getVersionStatusCounters().containsKey(VersionStatus.Draft)
- && userHasPermission(item.getId(), user));
+ itemPredicate = itemPredicate
+ .and(item -> item.getVersionStatusCounters().containsKey(VersionStatus.Draft) && userHasPermission(item.getId(), user));
}
}
return itemPredicate;
}
private List<Item> getVspList(String versionStatus, String itemStatus, String user) {
-
Predicate<Item> itemPredicate = createItemPredicate(versionStatus, itemStatus, user);
-
- return itemManager.list(itemPredicate).stream()
- .sorted((o1, o2) -> o2.getModificationTime().compareTo(o1.getModificationTime())).
- collect(Collectors.toList());
+ return itemManager.list(itemPredicate).stream().sorted((o1, o2) -> o2.getModificationTime().compareTo(o1.getModificationTime()))
+ .collect(Collectors.toList());
}
private class SyncEvent implements Event {
private final String eventType;
-
private final String originatorId;
private final Map<String, Object> attributes;
private final String entityId;
- SyncEvent(String eventType, String originatorId,
- Map<String, Object> attributes, String entityId) {
+ SyncEvent(String eventType, String originatorId, Map<String, Object> attributes, String entityId) {
this.eventType = eventType;
this.originatorId = originatorId;
this.attributes = attributes;
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VspItemProperty.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VspItemProperty.java
index c958ea7c79..87ac7d8fd2 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VspItemProperty.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VspItemProperty.java
@@ -13,15 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.openecomp.sdcrests.vsp.rest.services;
public final class VspItemProperty {
- public static final String VENDOR_ID = "vendorId";
- public static final String VENDOR_NAME = "vendorName";
- public static final String ONBOARDING_METHOD = "onboardingMethod";
- private VspItemProperty() {
+ public static final String VENDOR_ID = "vendorId";
+ public static final String VENDOR_NAME = "vendorName";
+ public static final String ONBOARDING_METHOD = "onboardingMethod";
- }
+ private VspItemProperty() {
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VspUniqueTypeProvider.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VspUniqueTypeProvider.java
index cb7c136969..b06f4cc383 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VspUniqueTypeProvider.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VspUniqueTypeProvider.java
@@ -15,20 +15,18 @@
*/
package org.openecomp.sdcrests.vsp.rest.services;
-import org.openecomp.sdcrests.uniquevalue.types.UniqueTypesProvider;
+import static org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME;
import java.util.Collections;
import java.util.Map;
-
-import static org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME;
+import org.openecomp.sdcrests.uniquevalue.types.UniqueTypesProvider;
public class VspUniqueTypeProvider implements UniqueTypesProvider {
- private static final Map<String, String> uniqueTypes =
- Collections.singletonMap("VspName", VENDOR_SOFTWARE_PRODUCT_NAME);
+ private static final Map<String, String> uniqueTypes = Collections.singletonMap("VspName", VENDOR_SOFTWARE_PRODUCT_NAME);
- @Override
- public Map<String, String> listUniqueTypes() {
- return uniqueTypes;
- }
+ @Override
+ public Map<String, String> listUniqueTypes() {
+ return uniqueTypes;
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentCreationDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentCreationDto.java
index f633e2cbbb..3af2c9460a 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentCreationDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentCreationDto.java
@@ -1,24 +1,24 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
import lombok.Data;
@Data
public class ComponentCreationDto {
+
private String vfcId;
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDependencyCreationDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDependencyCreationDto.java
index 50bd66f0a8..148549dda9 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDependencyCreationDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDependencyCreationDto.java
@@ -1,24 +1,24 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
import lombok.Data;
@Data
public class ComponentDependencyCreationDto {
+
private String id;
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDependencyModel.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDependencyModel.java
index b3a0620cc0..d05c4cde9c 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDependencyModel.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDependencyModel.java
@@ -1,19 +1,18 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
import lombok.Data;
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDependencyModelRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDependencyModelRequestDto.java
index 7a1d154bc1..66d641fb94 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDependencyModelRequestDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDependencyModelRequestDto.java
@@ -1,29 +1,25 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
-
-import lombok.Data;
-
import java.util.List;
+import lombok.Data;
@Data
public class ComponentDependencyModelRequestDto {
private List<ComponentDependencyModel> componentDependencyModels;
-
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDependencyResponseDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDependencyResponseDto.java
index 4874efb287..e43e73899c 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDependencyResponseDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDependencyResponseDto.java
@@ -1,25 +1,25 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
import lombok.Data;
@Data
public class ComponentDependencyResponseDto {
+
private String sourceId;
private String targetId;
private String relationType;
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDto.java
index f9651e69e0..432c49cf31 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDto.java
@@ -1,24 +1,24 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
import lombok.Data;
@Data
public class ComponentDto extends ComponentRequestDto implements CompositionDataEntityDto {
+
private String id;
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentRelationType.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentRelationType.java
index bf9e3f3b76..f6655aa071 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentRelationType.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentRelationType.java
@@ -1,22 +1,18 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
-public enum ComponentRelationType {
- dependsOn,
- other
-}
+public enum ComponentRelationType {dependsOn, other}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentRequestDto.java
index a14e0825ca..b5fb60c6c3 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentRequestDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentRequestDto.java
@@ -1,25 +1,23 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
-import lombok.Data;
-
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
+import lombok.Data;
@Data
public class ComponentRequestDto {
@@ -29,5 +27,4 @@ public class ComponentRequestDto {
@Size(min = 1, max = 30, message = "VFC displayName length should be between 1 and 30.")
private String displayName;
private String description;
-
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentValidationResultDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentValidationResultDto.java
index 1270212e4a..e02d64fb9a 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentValidationResultDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentValidationResultDto.java
@@ -1,28 +1,26 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
-
-import lombok.Data;
-
import java.util.Set;
+import lombok.Data;
@Data
public class ComponentValidationResultDto {
+
private boolean valid;
private Set<CompositionEntityValidationDataDto> validationData;
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionDataEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionDataEntityDto.java
index 3e6607e0ea..1aa5d797c2 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionDataEntityDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionDataEntityDto.java
@@ -13,8 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
public interface CompositionDataEntityDto {
+
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionEntityResponseDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionEntityResponseDto.java
index 31bbfc2085..1c1f91e962 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionEntityResponseDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionEntityResponseDto.java
@@ -1,25 +1,25 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
import lombok.Data;
@Data
public class CompositionEntityResponseDto<T extends CompositionDataEntityDto> {
+
private String id;
private String schema;
private T data;
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionEntityValidationDataDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionEntityValidationDataDto.java
index 1848276706..5f2b85deb8 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionEntityValidationDataDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionEntityValidationDataDto.java
@@ -1,28 +1,27 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+import java.util.Collection;
import lombok.Data;
import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType;
-import java.util.Collection;
-
@Data
public class CompositionEntityValidationDataDto {
+
private CompositionEntityType entityType;
private String entityId;
private String entityName;
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComputeCreationDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComputeCreationDto.java
index 3601d54a06..71358b8980 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComputeCreationDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComputeCreationDto.java
@@ -1,24 +1,24 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
import lombok.Data;
@Data
public class ComputeCreationDto {
+
private String id;
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComputeDescription.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComputeDescription.java
index 2bc27314fd..3320ab0dbb 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComputeDescription.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComputeDescription.java
@@ -1,25 +1,25 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
import lombok.Data;
@Data
public class ComputeDescription {
+
private String name;
private String description;
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComputeDetailsDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComputeDetailsDto.java
index 5e0de75a3a..843c5d5426 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComputeDetailsDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComputeDetailsDto.java
@@ -1,32 +1,30 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+import javax.validation.constraints.Size;
import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;
-import javax.validation.constraints.Size;
-
@Data
public class ComputeDetailsDto implements CompositionDataEntityDto {
+
@NotBlank(message = "is mandatory and should not be empty")
@Size(min = 0, max = 30, message = "length should not exceed 30 characters.")
private String name;
@Size(min = 0, max = 300, message = "length should not exceed 300 characters.")
private String description;
-
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComputeDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComputeDto.java
index 6f9aaa1571..e2c34dc23e 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComputeDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComputeDto.java
@@ -1,25 +1,25 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
import lombok.Data;
@Data
public class ComputeDto {
+
private String name;
private String id;
private String description;
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/DeploymentFlavorCreationDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/DeploymentFlavorCreationDto.java
index 1fb65c4e09..e0e97db0f8 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/DeploymentFlavorCreationDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/DeploymentFlavorCreationDto.java
@@ -1,24 +1,24 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
import lombok.Data;
@Data
public class DeploymentFlavorCreationDto {
+
private String deploymentFlavorId;
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/DeploymentFlavorDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/DeploymentFlavorDto.java
index e4eb4af3af..8a0d1059c6 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/DeploymentFlavorDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/DeploymentFlavorDto.java
@@ -1,24 +1,24 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
import lombok.Data;
@Data
public class DeploymentFlavorDto extends DeploymentFlavorRequestDto implements CompositionDataEntityDto {
+
private String id;
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/DeploymentFlavorListResponseDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/DeploymentFlavorListResponseDto.java
index db6850a6a9..b180ed5759 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/DeploymentFlavorListResponseDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/DeploymentFlavorListResponseDto.java
@@ -1,25 +1,25 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
import lombok.Data;
@Data
public class DeploymentFlavorListResponseDto {
+
private String model;
private String description;
private String id;
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/DeploymentFlavorRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/DeploymentFlavorRequestDto.java
index 2b34858ec1..3d29deb60b 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/DeploymentFlavorRequestDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/DeploymentFlavorRequestDto.java
@@ -1,31 +1,29 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
-
+import java.util.List;
+import javax.validation.constraints.Size;
import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;
import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentComputeAssociation;
-import javax.validation.constraints.Size;
-import java.util.List;
-
@Data
public class DeploymentFlavorRequestDto {
+
@NotBlank(message = "is mandatory and should not be empty")
@Size(min = 0, max = 30, message = "length should not exceed 30 characters.")
private String model;
@@ -33,5 +31,4 @@ public class DeploymentFlavorRequestDto {
private String description;
private String featureGroupId;
private List<ComponentComputeAssociation> componentComputeAssociations;
-
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/DeploymentFlavorValidationResultDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/DeploymentFlavorValidationResultDto.java
index 7029bfcd4c..833636cccc 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/DeploymentFlavorValidationResultDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/DeploymentFlavorValidationResultDto.java
@@ -1,28 +1,26 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
-
-import lombok.Data;
-
import java.util.Set;
+import lombok.Data;
@Data
public class DeploymentFlavorValidationResultDto {
+
private boolean valid;
private Set<CompositionEntityValidationDataDto> validationData;
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/FileDataStructureDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/FileDataStructureDto.java
index 166efec6fa..a98c515815 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/FileDataStructureDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/FileDataStructureDto.java
@@ -1,33 +1,31 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+import java.util.List;
import lombok.Data;
import org.openecomp.sdc.vendorsoftwareproduct.types.candidateheat.Module;
-import java.util.List;
-
/**
* @author Avrahamg
* @since November 07, 2016
*/
-
@Data
public class FileDataStructureDto {
+
private List<Module> modules;
private List<String> unassigned;
private List<String> artifacts;
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ImageCreationDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ImageCreationDto.java
index 96775a669b..b0af65c3d5 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ImageCreationDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ImageCreationDto.java
@@ -1,24 +1,24 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
import lombok.Data;
@Data
public class ImageCreationDto {
+
private String id;
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ImageDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ImageDto.java
index 40105a6c47..0cfb9249ef 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ImageDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ImageDto.java
@@ -1,24 +1,24 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
import lombok.Data;
@Data
public class ImageDto extends ImageRequestDto implements CompositionDataEntityDto {
+
private String id;
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ImageRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ImageRequestDto.java
index 6081a32635..6a4f1a2702 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ImageRequestDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ImageRequestDto.java
@@ -1,19 +1,18 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
import lombok.Data;
@@ -25,5 +24,4 @@ public class ImageRequestDto implements CompositionDataEntityDto {
@NotBlank(message = "is mandatory and should not be empty")
private String fileName;
private String description;
-
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/MonitoringUploadStatusDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/MonitoringUploadStatusDto.java
index a8c1c58a71..b2512fa7b9 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/MonitoringUploadStatusDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/MonitoringUploadStatusDto.java
@@ -1,27 +1,26 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
import lombok.Data;
@Data
public class MonitoringUploadStatusDto {
+
private String snmpTrap;
private String snmpPoll;
private String vesEvent;
-
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NetworkDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NetworkDto.java
index b944970d8b..4495d539d2 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NetworkDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NetworkDto.java
@@ -1,24 +1,24 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
import lombok.Data;
@Data
public class NetworkDto extends NetworkRequestDto implements CompositionDataEntityDto {
+
private String id;
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NetworkRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NetworkRequestDto.java
index 28cfbaa06d..f3e6d780dc 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NetworkRequestDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NetworkRequestDto.java
@@ -1,24 +1,22 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
-import lombok.Data;
-
import javax.validation.constraints.NotNull;
+import lombok.Data;
@Data
public class NetworkRequestDto {
@@ -27,5 +25,4 @@ public class NetworkRequestDto {
private String name;
@NotNull
private boolean dhcp;
-
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NicCreationResponseDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NicCreationResponseDto.java
index 47b57e8175..874e0dc054 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NicCreationResponseDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NicCreationResponseDto.java
@@ -1,24 +1,24 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
import lombok.Data;
@Data
public class NicCreationResponseDto {
+
private String nicId;
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NicDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NicDto.java
index 025e494ed0..578b2ec62a 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NicDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NicDto.java
@@ -1,25 +1,25 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
import lombok.Data;
@Data
public class NicDto extends NicRequestDto implements CompositionDataEntityDto {
+
private String id;
private String networkName;
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NicRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NicRequestDto.java
index 73246fd7ec..1bef41df40 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NicRequestDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NicRequestDto.java
@@ -1,27 +1,25 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+import javax.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.validation.ValidateString;
-import javax.validation.constraints.NotNull;
-
@Data
public class NicRequestDto {
@@ -30,9 +28,7 @@ public class NicRequestDto {
private String description;
private String networkId;
@NotNull
- @ValidateString(acceptedValues = {"External", "Internal"}, message = "doesn't "
- + "meet the expected attribute value.", isCaseSensitive = true)
+ @ValidateString(acceptedValues = {"External", "Internal"}, message = "doesn't " + "meet the expected attribute value.", isCaseSensitive = true)
private String networkType;
-
private String networkDescription;
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/OrchestrationTemplateAction.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/OrchestrationTemplateAction.java
index e883913bb1..0478afecc0 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/OrchestrationTemplateAction.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/OrchestrationTemplateAction.java
@@ -1,24 +1,21 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
/**
* Created by Talio on 11/13/2016.
*/
-public enum OrchestrationTemplateAction {
- Process
-}
+public enum OrchestrationTemplateAction {Process}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/OrchestrationTemplateActionResponseDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/OrchestrationTemplateActionResponseDto.java
index 36588e0f51..75683649e3 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/OrchestrationTemplateActionResponseDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/OrchestrationTemplateActionResponseDto.java
@@ -1,33 +1,32 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+import java.util.List;
+import java.util.Map;
import lombok.Data;
import org.openecomp.sdc.datatypes.error.ErrorMessage;
import org.openecomp.sdc.vendorsoftwareproduct.types.UploadFileStatus;
-import java.util.List;
-import java.util.Map;
-
/**
* Created by TALIO on 4/27/2016.
*/
@Data
public class OrchestrationTemplateActionResponseDto {
+
private List<String> fileNames;
private Map<String, List<ErrorMessage>> errors;
private UploadFileStatus status;
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/PackageInfoDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/PackageInfoDto.java
index 12c29888ee..5650ac8670 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/PackageInfoDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/PackageInfoDto.java
@@ -1,19 +1,18 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
import lombok.Data;
@@ -36,5 +35,4 @@ public class PackageInfoDto {
private String packageChecksum;
private String packageType;
private String resourceType;
-
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ProcessEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ProcessEntityDto.java
index fcea252fb9..642cbb6c46 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ProcessEntityDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ProcessEntityDto.java
@@ -1,25 +1,25 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
import lombok.Data;
@Data
public class ProcessEntityDto extends ProcessRequestDto {
+
private String id;
private String artifactName;
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ProcessRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ProcessRequestDto.java
index 3379dee8ca..d57a293ee4 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ProcessRequestDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ProcessRequestDto.java
@@ -1,26 +1,24 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+import javax.validation.constraints.NotNull;
import lombok.Data;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessType;
-import javax.validation.constraints.NotNull;
-
@Data
public class ProcessRequestDto {
@@ -28,5 +26,4 @@ public class ProcessRequestDto {
private String name;
private String description;
private ProcessType type;
-
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/QuestionnaireDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/QuestionnaireDto.java
index 763ff71388..3fe9461bcc 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/QuestionnaireDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/QuestionnaireDto.java
@@ -1,24 +1,22 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
-import lombok.Data;
-
import java.util.HashMap;
+import lombok.Data;
/**
* Created by ayalaben on 9/26/2017
@@ -32,6 +30,4 @@ public class QuestionnaireDto {
public HashMap<String, String> getQuestionareData() {
return questionareData;
}
-
-
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/QuestionnaireResponseDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/QuestionnaireResponseDto.java
index 763737f36f..f40091ea12 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/QuestionnaireResponseDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/QuestionnaireResponseDto.java
@@ -1,19 +1,18 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
import lombok.Data;
@@ -21,8 +20,8 @@ import org.openecomp.sdc.datatypes.error.ErrorMessage;
@Data
public class QuestionnaireResponseDto {
+
private String schema;
private String data;
private ErrorMessage errorMessage;
-
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/QuestionnaireValidationResultDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/QuestionnaireValidationResultDto.java
index f431d18a9f..4c98b6e7a8 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/QuestionnaireValidationResultDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/QuestionnaireValidationResultDto.java
@@ -1,28 +1,26 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
-import lombok.Data;
-
import java.util.Set;
+import lombok.Data;
@Data
public class QuestionnaireValidationResultDto {
+
private boolean valid;
private Set<CompositionEntityValidationDataDto> validationData;
-
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/TranslatedFileDataDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/TranslatedFileDataDto.java
index 23c4f75d74..ab9dae40f1 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/TranslatedFileDataDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/TranslatedFileDataDto.java
@@ -1,19 +1,18 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
import lombok.Data;
@@ -32,5 +31,4 @@ public class TranslatedFileDataDto {
private String vendorRelease;
private String packageChecksum;
private String packageType;
-
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/UploadFileResponseDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/UploadFileResponseDto.java
index 7ff8af341d..f45884e21e 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/UploadFileResponseDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/UploadFileResponseDto.java
@@ -1,36 +1,34 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+import java.util.List;
+import java.util.Map;
import lombok.Data;
import org.openecomp.sdc.datatypes.error.ErrorMessage;
import org.openecomp.sdc.vendorsoftwareproduct.types.UploadFileStatus;
-import java.util.List;
-import java.util.Map;
-
/**
* Created by TALIO on 4/27/2016.
*/
@Data
public class UploadFileResponseDto {
+
private Map<String, List<ErrorMessage>> errors;
private UploadFileStatus status;
private String onboardingOrigin;
private String networkPackageName;
-
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ValidationResponseDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ValidationResponseDto.java
index 6122e43ec2..4f548736df 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ValidationResponseDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ValidationResponseDto.java
@@ -1,31 +1,30 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
-import lombok.Data;
-import org.openecomp.sdcrests.common.types.ErrorCodeDto;
-import org.openecomp.sdcrests.common.types.ErrorMessageDto;
-
import java.util.Collection;
import java.util.List;
import java.util.Map;
+import lombok.Data;
+import org.openecomp.sdcrests.common.types.ErrorCodeDto;
+import org.openecomp.sdcrests.common.types.ErrorMessageDto;
@Data
public class ValidationResponseDto {
+
private boolean valid;
private Collection<ErrorCodeDto> vspErrors;
private Collection<ErrorCodeDto> licensingDataErrors;
@@ -33,5 +32,4 @@ public class ValidationResponseDto {
private QuestionnaireValidationResultDto questionnaireValidationResult;
private ComponentValidationResultDto componentValidationResult;
private DeploymentFlavorValidationResultDto deploymentFlavorValidationResult;
-
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VendorSoftwareProductAction.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VendorSoftwareProductAction.java
index eec79aab81..afe1d76309 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VendorSoftwareProductAction.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VendorSoftwareProductAction.java
@@ -1,22 +1,18 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
-public enum VendorSoftwareProductAction {
- Submit,
- Create_Package
-}
+public enum VendorSoftwareProductAction {Submit, Create_Package}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VersionSoftwareProductActionRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VersionSoftwareProductActionRequestDto.java
index 6c5b26ec5a..76f1f9313e 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VersionSoftwareProductActionRequestDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VersionSoftwareProductActionRequestDto.java
@@ -1,19 +1,18 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
import lombok.Data;
@@ -24,7 +23,7 @@ import org.openecomp.sdcrests.item.types.SubmitRequestDto;
*/
@Data
public class VersionSoftwareProductActionRequestDto {
+
private VendorSoftwareProductAction action;
private SubmitRequestDto submitRequest;
-
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VmSizing.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VmSizing.java
index a4d923d369..5001828db8 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VmSizing.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VmSizing.java
@@ -1,29 +1,28 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
-import lombok.Data;
-import org.openecomp.sdcrests.vendorsoftwareproducts.types.validation.ValidateString;
-
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
+import lombok.Data;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.validation.ValidateString;
@Data
public class VmSizing {
+
@Min(value = 1, message = "should be integer and > 0")
@Max(value = 16, message = "should be integer and <= 16")
private int numOfCPUs;
@@ -33,11 +32,8 @@ public class VmSizing {
private int persistentStorageVolumeSize;
@Min(value = 1, message = "should be integer and > 0")
private int ioOperationsPerSec;
- @ValidateString(acceptedValues = {"1:1", "4:1", "16:1"}, message = "doesn't meet the expected "
- + "attribute value.")
+ @ValidateString(acceptedValues = {"1:1", "4:1", "16:1"}, message = "doesn't meet the expected " + "attribute value.")
private String cpuOverSubscriptionRatio;
- @ValidateString(acceptedValues = {"1", "2", "4", "8"}, message = "doesn't meet the expected "
- + "attribute value.")
+ @ValidateString(acceptedValues = {"1", "2", "4", "8"}, message = "doesn't meet the expected " + "attribute value.")
private String memoryRAM;
-
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspComputeDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspComputeDto.java
index 467f5e9329..0c8fb1938a 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspComputeDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspComputeDto.java
@@ -1,25 +1,25 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
import lombok.Data;
@Data
public class VspComputeDto {
+
private String name;
private String componentId;
private String computeFlavorId;
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspDescriptionDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspDescriptionDto.java
index 3cddb5d4e3..010e0d3818 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspDescriptionDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspDescriptionDto.java
@@ -1,29 +1,28 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+import javax.validation.constraints.NotNull;
import lombok.Data;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.LicenseType;
import org.openecomp.sdc.vendorsoftwareproduct.types.LicensingData;
-import javax.validation.constraints.NotNull;
-
@Data
public class VspDescriptionDto {
+
@NotNull
private String name;
@NotNull
@@ -37,6 +36,7 @@ public class VspDescriptionDto {
private String vendorName;
@NotNull
private String vendorId; // this will be populated with vlm id
+
private String licensingVersion; // this will be populated with vlm version
private LicenseType licenseType;
private LicensingData licensingData;
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspDetailsDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspDetailsDto.java
index fbc51a414b..2acc27e95a 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspDetailsDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspDetailsDto.java
@@ -1,19 +1,18 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
import io.swagger.v3.oas.annotations.media.Schema;
@@ -23,17 +22,16 @@ import org.openecomp.sdc.heat.datatypes.structure.ValidationStructureList;
/**
* Created by TALIO on 4/25/2016.
*/
-
@Data
@Schema(description = "VspDetails")
public class VspDetailsDto extends VspRequestDto {
- private String id;
- private String version;
- private ValidationStructureList validationData;
- private String candidateOnboardingOrigin;
- private String onboardingOrigin;
- private String networkPackageName;
- private String owner;
- private String status;
+ private String id;
+ private String version;
+ private ValidationStructureList validationData;
+ private String candidateOnboardingOrigin;
+ private String onboardingOrigin;
+ private String networkPackageName;
+ private String owner;
+ private String status;
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspRequestDto.java
index 59b565a669..13e21ba760 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspRequestDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspRequestDto.java
@@ -1,28 +1,26 @@
/*
-* Copyright © 2016-2018 European Support Limited
-*
-* 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.
-*/
-
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.
+ */
package org.openecomp.sdcrests.vendorsoftwareproducts.types;
-import lombok.Data;
-
import javax.validation.constraints.NotNull;
+import lombok.Data;
@Data
public class VspRequestDto extends VspDescriptionDto {
+
@NotNull
private String onboardingMethod;
-
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/CustomJsonValidator.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/CustomJsonValidator.java
index 9e0b08bd0d..aa17db257c 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/CustomJsonValidator.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/CustomJsonValidator.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,25 +17,20 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vendorsoftwareproducts.types.validation;
-import org.openecomp.core.utilities.json.JsonUtil;
-
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
-
+import org.openecomp.core.utilities.json.JsonUtil;
public class CustomJsonValidator implements ConstraintValidator<IsValidJson, String> {
- @Override
- public void initialize(IsValidJson stringEnumeration) {
- }
-
-
- @Override
- public boolean isValid(String json, ConstraintValidatorContext context) {
- return JsonUtil.isValidJson(json);
- }
+ @Override
+ public void initialize(IsValidJson stringEnumeration) {
+ }
+ @Override
+ public boolean isValid(String json, ConstraintValidatorContext context) {
+ return JsonUtil.isValidJson(json);
+ }
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/IsValidJson.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/IsValidJson.java
index 27c6d65ba5..e775802b9d 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/IsValidJson.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/IsValidJson.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,23 +17,24 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vendorsoftwareproducts.types.validation;
-
/**
* @since July 13, 2016
*/
-import org.openecomp.sdcrests.common.RestConstants;
+import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
+import static java.lang.annotation.ElementType.CONSTRUCTOR;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
-import javax.validation.Constraint;
-import javax.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
-
-import static java.lang.annotation.ElementType.*;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import javax.validation.Constraint;
+import javax.validation.Payload;
+import org.openecomp.sdcrests.common.RestConstants;
/**
* The interface Is valid json.
@@ -43,31 +44,30 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
@Target({METHOD, FIELD, ANNOTATION_TYPE, PARAMETER, CONSTRUCTOR})
@Retention(RUNTIME)
public @interface IsValidJson {
- /**
- * The constant message.
- */
- String message = RestConstants.INVALID_JSON_ERROR_MESSAGE;
- /**
- * Message string.
- *
- * @return the string
- */
- String message() default RestConstants.INVALID_JSON_ERROR_MESSAGE;
+ /**
+ * The constant message.
+ */
+ String message = RestConstants.INVALID_JSON_ERROR_MESSAGE;
- /**
- * Groups class [ ].
- *
- * @return the class [ ]
- */
- Class<?>[] groups() default {};
-
- /**
- * Payload class [ ].
- *
- * @return the class [ ]
- */
- Class<? extends Payload>[] payload() default {};
-}
+ /**
+ * Message string.
+ *
+ * @return the string
+ */
+ String message() default RestConstants.INVALID_JSON_ERROR_MESSAGE;
+ /**
+ * Groups class [ ].
+ *
+ * @return the class [ ]
+ */
+ Class<?>[] groups() default {};
+ /**
+ * Payload class [ ].
+ *
+ * @return the class [ ]
+ */
+ Class<? extends Payload>[] payload() default {};
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/StringValidator.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/StringValidator.java
index c163fedec5..919f5df4c1 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/StringValidator.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/StringValidator.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,40 +17,38 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vendorsoftwareproducts.types.validation;
-import javax.validation.ConstraintValidator;
-import javax.validation.ConstraintValidatorContext;
import java.util.ArrayList;
import java.util.List;
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
public class StringValidator implements ConstraintValidator<ValidateString, String> {
- private List<String> valueList;
- boolean isCaseSensitive;
+ boolean isCaseSensitive;
+ private List<String> valueList;
- @Override
- public void initialize(ValidateString constraintAnnotation) {
- valueList = new ArrayList<String>();
- isCaseSensitive = constraintAnnotation.isCaseSensitive();
- for (String val : constraintAnnotation.acceptedValues()) {
- if (!isCaseSensitive) {
- val = val.toUpperCase();
- }
- valueList.add(val);
+ @Override
+ public void initialize(ValidateString constraintAnnotation) {
+ valueList = new ArrayList<String>();
+ isCaseSensitive = constraintAnnotation.isCaseSensitive();
+ for (String val : constraintAnnotation.acceptedValues()) {
+ if (!isCaseSensitive) {
+ val = val.toUpperCase();
+ }
+ valueList.add(val);
+ }
}
- }
- @Override
- public boolean isValid(String value, ConstraintValidatorContext context) {
- if (!isCaseSensitive) {
- value = value.toUpperCase();
- }
- if (value != null && !valueList.contains(value)) {
- return false;
+ @Override
+ public boolean isValid(String value, ConstraintValidatorContext context) {
+ if (!isCaseSensitive) {
+ value = value.toUpperCase();
+ }
+ if (value != null && !valueList.contains(value)) {
+ return false;
+ }
+ return true;
}
- return true;
- }
-
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/ValidateString.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/ValidateString.java
index 4073463eaf..533fc6897a 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/ValidateString.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/ValidateString.java
@@ -7,9 +7,9 @@
* 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.
@@ -20,14 +20,18 @@
package org.openecomp.sdcrests.vendorsoftwareproducts.types.validation;
-import javax.validation.Constraint;
-import javax.validation.Payload;
+import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
+import static java.lang.annotation.ElementType.CONSTRUCTOR;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
-
-import static java.lang.annotation.ElementType.*;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import javax.validation.Constraint;
+import javax.validation.Payload;
/**
* The interface Validate string.
@@ -37,24 +41,25 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
@Target({METHOD, FIELD, ANNOTATION_TYPE, PARAMETER, CONSTRUCTOR})
@Retention(RUNTIME)
public @interface ValidateString {
- /**
- * The constant message.
- */
- String message = "";
- /**
- * Accepted values string [ ].
- *
- * @return the string [ ]
- */
- String[] acceptedValues();
+ /**
+ * The constant message.
+ */
+ String message = "";
+
+ /**
+ * Accepted values string [ ].
+ *
+ * @return the string [ ]
+ */
+ String[] acceptedValues();
- String message() default "{org.openecomp.sdcrests.vendorsoftwareproducts.types.validation"
- + ".message}";
+ String message() default "{org.openecomp.sdcrests.vendorsoftwareproducts.types.validation"
+ + ".message}";
- boolean isCaseSensitive() default false;
+ boolean isCaseSensitive() default false;
- Class<?>[] groups() default {};
+ Class<?>[] groups() default {};
- Class<? extends Payload>[] payload() default {};
+ Class<? extends Payload>[] payload() default {};
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vnf-repository-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VnfPackageRepository.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vnf-repository-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VnfPackageRepository.java
index 9617c61836..1412c332cb 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vnf-repository-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VnfPackageRepository.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vnf-repository-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VnfPackageRepository.java
@@ -13,12 +13,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.openecomp.sdcrests.vsp.rest;
import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import java.io.File;
import javax.validation.constraints.NotNull;
import javax.ws.rs.Consumes;
@@ -30,15 +36,6 @@ import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
-import io.swagger.v3.oas.annotations.media.Content;
-import io.swagger.v3.oas.annotations.media.Schema;
-import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import io.swagger.v3.oas.annotations.tags.Tags;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.UploadFileResponseDto;
import org.springframework.validation.annotation.Validated;
@@ -52,31 +49,23 @@ public interface VnfPackageRepository extends VspEntities {
@GET
@Path("/vnfpackages")
@Produces(MediaType.APPLICATION_OCTET_STREAM)
- @Operation(description = "Get VNF packages from VNF Repository",
- summary = "Call VNF Repository to get VNF package details", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = File.class))))
- Response getVnfPackages(@PathParam("vspId") String vspId,
- @Parameter(description= "Version Id") @PathParam("versionId") String versionId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user) throws Exception;
+ @Operation(description = "Get VNF packages from VNF Repository", summary = "Call VNF Repository to get VNF package details", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = File.class))))
+ Response getVnfPackages(@PathParam("vspId") String vspId, @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user) throws Exception;
@GET
@Path("/vnfpackage/{csarId}/download")
@Produces(MediaType.APPLICATION_OCTET_STREAM)
- @Operation(description = "Download VNF package from VNF Repository",
- summary = "Download VNF package from VNF repository and send to client", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = File.class))))
- Response downloadVnfPackage(@PathParam("vspId") String vspId,
- @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @PathParam("csarId") String csarId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user) throws Exception;
+ @Operation(description = "Download VNF package from VNF Repository", summary = "Download VNF package from VNF repository and send to client", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = File.class))))
+ Response downloadVnfPackage(@PathParam("vspId") String vspId, @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @PathParam("csarId") String csarId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user) throws Exception;
@POST
@Path("/vnfpackage/{csarId}/import")
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "Import VNF package from VNF Repository",
- summary = "Call VNF Repository to download VNF package, validate it and send the response",
- responses = @ApiResponse(content = @Content(schema = @Schema(implementation = UploadFileResponseDto.class))))
- Response importVnfPackage(@PathParam("vspId") String vspId,
- @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
- @PathParam("csarId") String csarId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user) throws Exception;
-
+ @Operation(description = "Import VNF package from VNF Repository", summary = "Call VNF Repository to download VNF package, validate it and send the response", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = UploadFileResponseDto.class))))
+ Response importVnfPackage(@PathParam("vspId") String vspId, @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
+ @PathParam("csarId") String csarId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user) throws Exception;
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vnf-repository-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VnfPackageRepositoryImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vnf-repository-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VnfPackageRepositoryImpl.java
index 9ee86889f5..88ee6fa43d 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vnf-repository-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VnfPackageRepositoryImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vnf-repository-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VnfPackageRepositoryImpl.java
@@ -14,9 +14,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.openecomp.sdcrests.vsp.rest.services;
+import static javax.ws.rs.core.HttpHeaders.CONTENT_DISPOSITION;
+import static org.openecomp.core.utilities.file.FileUtils.getFileExtension;
+import static org.openecomp.core.utilities.file.FileUtils.getNetworkPackageName;
+
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.security.KeyManagementException;
@@ -54,10 +57,6 @@ import org.openecomp.sdcrests.vsp.rest.mapping.MapUploadFileResponseToUploadFile
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
-import static javax.ws.rs.core.HttpHeaders.CONTENT_DISPOSITION;
-import static org.openecomp.core.utilities.file.FileUtils.getFileExtension;
-import static org.openecomp.core.utilities.file.FileUtils.getNetworkPackageName;
-
/**
* Enables integration API interface with VNF Repository (VNFSDK).
* <ol>
@@ -80,20 +79,23 @@ public class VnfPackageRepositoryImpl implements VnfPackageRepository {
try {
SSLContext sslcontext = SSLContext.getInstance("TLS");
sslcontext.init(null, new TrustManager[]{new X509TrustManager() {
- public void checkClientTrusted(X509Certificate[] c, String s) {}
- public void checkServerTrusted(X509Certificate[] c, String s) {}
- public X509Certificate[] getAcceptedIssuers() { return new X509Certificate[0]; }
- }}, new java.security.SecureRandom());
+ public void checkClientTrusted(X509Certificate[] c, String s) {
+ }
+
+ public void checkServerTrusted(X509Certificate[] c, String s) {
+ }
- return ClientBuilder.newBuilder()
- .sslContext(sslcontext)
- .hostnameVerifier((a, b) -> true)
- .build();
+ public X509Certificate[] getAcceptedIssuers() {
+ return new X509Certificate[0];
+ }
+ }}, new java.security.SecureRandom());
+ return ClientBuilder.newBuilder().sslContext(sslcontext).hostnameVerifier((a, b) -> true).build();
} catch (NoSuchAlgorithmException | KeyManagementException e) {
LOGGER.error("Failed to initialize SSL unsecure context", e);
}
return ClientBuilder.newClient();
}
+
private final Configuration config;
public VnfPackageRepositoryImpl(Configuration config) {
@@ -120,35 +122,28 @@ public class VnfPackageRepositoryImpl implements VnfPackageRepository {
public Response importVnfPackage(String vspId, String versionId, String csarId, String user) {
LOGGER.debug("Import VNF Packages from Repository: {}", csarId);
final String downloadPackageUri = String.format(config.getDownloadUri(), csarId);
-
Response remoteResponse = CLIENT.target(downloadPackageUri).request().get();
if (remoteResponse.getStatus() != Response.Status.OK.getStatusCode()) {
return handleUnexpectedStatus("downloading VNF package", downloadPackageUri, remoteResponse);
}
-
LOGGER.debug("Response from VNF Repository for download package is success. URI={}", downloadPackageUri);
byte[] payload = remoteResponse.readEntity(String.class).getBytes(StandardCharsets.ISO_8859_1);
return uploadVnfPackage(vspId, versionId, csarId, payload);
}
- private Response uploadVnfPackage(final String vspId, final String versionId,
- final String csarId, final byte[] payload) {
+ private Response uploadVnfPackage(final String vspId, final String versionId, final String csarId, final byte[] payload) {
try {
- final OrchestrationTemplateCandidateManager candidateManager =
- OrchestrationTemplateCandidateManagerFactory.getInstance().createInterface();
+ final OrchestrationTemplateCandidateManager candidateManager = OrchestrationTemplateCandidateManagerFactory.getInstance()
+ .createInterface();
final String filename = formatFilename(csarId);
final String fileExtension = getFileExtension(filename);
- final OnboardPackageInfo onboardPackageInfo =
- new OnboardPackageInfo(getNetworkPackageName(filename), fileExtension, ByteBuffer.wrap(payload),
- OnboardingTypesEnum.getOnboardingTypesEnum(fileExtension));
+ final OnboardPackageInfo onboardPackageInfo = new OnboardPackageInfo(getNetworkPackageName(filename), fileExtension,
+ ByteBuffer.wrap(payload), OnboardingTypesEnum.getOnboardingTypesEnum(fileExtension));
final VspDetails vspDetails = new VspDetails(vspId, getVersion(vspId, versionId));
final UploadFileResponse response = candidateManager.upload(vspDetails, onboardPackageInfo);
- final UploadFileResponseDto uploadFileResponse =
- new MapUploadFileResponseToUploadFileResponseDto()
- .applyMapping(response, UploadFileResponseDto.class);
-
+ final UploadFileResponseDto uploadFileResponse = new MapUploadFileResponseToUploadFileResponseDto()
+ .applyMapping(response, UploadFileResponseDto.class);
return Response.ok(uploadFileResponse).build();
-
} catch (final Exception e) {
ErrorCode error = new GeneralErrorBuilder().build();
LOGGER.error("Exception while uploading package received from VNF Repository", new CoreException(error, e));
@@ -160,16 +155,13 @@ public class VnfPackageRepositoryImpl implements VnfPackageRepository {
public Response downloadVnfPackage(String vspId, String versionId, String csarId, String user) {
LOGGER.debug("Download VNF package from repository: csarId={}", csarId);
final String downloadPackageUri = String.format(config.getDownloadUri(), csarId);
-
Response remoteResponse = CLIENT.target(downloadPackageUri).request().get();
if (remoteResponse.getStatus() != Response.Status.OK.getStatusCode()) {
return handleUnexpectedStatus("downloading VNF package", downloadPackageUri, remoteResponse);
}
-
byte[] payload = remoteResponse.readEntity(String.class).getBytes(StandardCharsets.ISO_8859_1);
Response.ResponseBuilder response = Response.ok(payload);
response.header(CONTENT_DISPOSITION, "attachment; filename=" + formatFilename(csarId));
-
LOGGER.debug("Response from VNF Repository for download package is success. URI={}", downloadPackageUri);
return response.build();
}
@@ -184,15 +176,12 @@ public class VnfPackageRepositoryImpl implements VnfPackageRepository {
}
private static Response handleUnexpectedStatus(String action, String uri, Response response) {
-
ErrorCode error = new GeneralErrorBuilder().build();
-
if (LOGGER.isErrorEnabled()) {
String body = response.hasEntity() ? response.readEntity(String.class) : "";
- LOGGER.error("Unexpected response status while {}: URI={}, status={}, body={}", action, uri,
- response.getStatus(), body, new CoreException(error));
+ LOGGER.error("Unexpected response status while {}: URI={}, status={}, body={}", action, uri, response.getStatus(), body,
+ new CoreException(error));
}
-
return generateInternalServerError(error);
}
@@ -206,7 +195,9 @@ public class VnfPackageRepositoryImpl implements VnfPackageRepository {
}
interface Configuration {
+
String getGetUri();
+
String getDownloadUri();
}
@@ -225,16 +216,12 @@ public class VnfPackageRepositoryImpl implements VnfPackageRepository {
private static class LazyFileConfiguration implements Configuration {
private static final String CONFIG_NAMESPACE = "vnfrepo";
-
private static final String DEFAULT_HOST = "localhost";
private static final String DEFAULT_PORT = "8702";
-
private static final String DEFAULT_URI_PREFIX = "/onapapi/vnfsdk-marketplace/v1/PackageResource/csars";
private static final String DEFAULT_LIST_URI = DEFAULT_URI_PREFIX + "/";
private static final String DEFAULT_DOWNLOAD_URI = DEFAULT_URI_PREFIX + "/%s/files";
-
private static final LazyFileConfiguration INSTANCE = new LazyFileConfiguration();
-
private final String getUri;
private final String downloadUri;
@@ -253,8 +240,7 @@ public class VnfPackageRepositoryImpl implements VnfPackageRepository {
String value = config.getAsString(CONFIG_NAMESPACE, key);
return (value == null) ? defaultValue : value;
} catch (Exception e) {
- LOGGER.error("Failed to read VNF repository configuration key '{}', default value '{}' will be used",
- key, defaultValue, e);
+ LOGGER.error("Failed to read VNF repository configuration key '{}', default value '{}' will be used", key, defaultValue, e);
return defaultValue;
}
}