From f5f13c4f6b6fe3b4d98e349dfd7db59339803436 Mon Sep 17 00:00:00 2001 From: Michael Lando Date: Sun, 19 Feb 2017 12:35:04 +0200 Subject: push addional code Change-Id: Ia427bb3460cda3a896f8faced2de69eaf3807b74 Signed-off-by: Michael Lando --- .../vendor-license-rest/pom.xml | 24 +++ .../vendor-license-rest-services/pom.xml | 133 +++++++++++++++ .../vendorlicense/rest/EntitlementPools.java | 105 ++++++++++++ .../sdcrests/vendorlicense/rest/FeatureGroups.java | 108 ++++++++++++ .../vendorlicense/rest/LicenseAgreements.java | 109 ++++++++++++ .../vendorlicense/rest/LicenseKeyGroups.java | 104 ++++++++++++ .../vendorlicense/rest/VendorLicenseModels.java | 111 ++++++++++++ .../MapChoiceOrOtherDtoToChoiceOrOther.java | 36 ++++ .../MapChoiceOrOtherToChoiceOrOtherDto.java | 35 ++++ ...lementPoolEntityToEntitlementPoolEntityDto.java | 53 ++++++ ...ementPoolRequestDtoToEntitlementPoolEntity.java | 51 ++++++ ...tureGroupDescriptorDtoToFeatureGroupEntity.java | 36 ++++ ...tureGroupEntityToFeatureGroupDescriptorDto.java | 35 ++++ ...ementDescriptorDtoToLicenseAgreementEntity.java | 38 +++++ ...ementEntityToLicenseAgreementDescriptorDto.java | 38 +++++ ...seKeyGroupEntityToLicenseKeyGroupEntityDto.java | 40 +++++ ...eKeyGroupRequestDtoToLicenseKeyGroupEntity.java | 38 +++++ ...pMultiChoiceOrOtherDtoToMultiChoiceOrOther.java | 36 ++++ ...pMultiChoiceOrOtherToMultiChoiceOrOtherDto.java | 35 ++++ ...eModelRequestDtoToVendorLicenseModelEntity.java | 36 ++++ ...rLicenseModelToVendorLicenseModelEntityDto.java | 60 +++++++ .../rest/services/EntitlementPoolsImpl.java | 157 +++++++++++++++++ .../rest/services/FeatureGroupsImpl.java | 169 +++++++++++++++++++ .../rest/services/LicenseAgreementsImpl.java | 186 +++++++++++++++++++++ .../rest/services/LicenseKeyGroupsImpl.java | 159 ++++++++++++++++++ .../rest/services/VendorLicenseModelsImpl.java | 135 +++++++++++++++ .../vendor-license-rest-types/pom.xml | 30 ++++ .../vendorlicense/types/ChoiceOrOtherDto.java | 75 +++++++++ .../types/EntitlementPoolEntityDto.java | 48 ++++++ .../types/EntitlementPoolRequestDto.java | 144 ++++++++++++++++ .../types/FeatureGroupDescriptorDto.java | 59 +++++++ .../vendorlicense/types/FeatureGroupEntityDto.java | 69 ++++++++ .../vendorlicense/types/FeatureGroupModelDto.java | 66 ++++++++ .../types/FeatureGroupRequestDto.java | 48 ++++++ .../types/FeatureGroupUpdateRequestDto.java | 48 ++++++ .../types/LicenseAgreementDescriptorDto.java | 74 ++++++++ .../types/LicenseAgreementEntityDto.java | 51 ++++++ .../types/LicenseAgreementModelDto.java | 47 ++++++ .../types/LicenseAgreementRequestDto.java | 39 +++++ .../types/LicenseAgreementUpdateRequestDto.java | 38 +++++ .../types/LicenseKeyGroupEntityDto.java | 45 +++++ .../types/LicenseKeyGroupRequestDto.java | 74 ++++++++ .../vendorlicense/types/MultiChoiceOrOtherDto.java | 79 +++++++++ .../types/VendorLicenseModelActionRequestDto.java | 36 ++++ .../types/VendorLicenseModelEntityDto.java | 85 ++++++++++ .../types/VendorLicenseModelRequestDto.java | 62 +++++++ .../validation/ChoiceOrOtherSequenceProvider.java | 45 +++++ .../MultiChoiceOrOtherSequenceProvider.java | 47 ++++++ .../types/validation/OtherChoiceValidation.java | 24 +++ 49 files changed, 3400 insertions(+) create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/pom.xml create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/pom.xml create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/EntitlementPools.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/FeatureGroups.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/LicenseAgreements.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/LicenseKeyGroups.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/VendorLicenseModels.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapChoiceOrOtherDtoToChoiceOrOther.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapChoiceOrOtherToChoiceOrOtherDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolEntityToEntitlementPoolEntityDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolRequestDtoToEntitlementPoolEntity.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapFeatureGroupDescriptorDtoToFeatureGroupEntity.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapFeatureGroupEntityToFeatureGroupDescriptorDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseAgreementDescriptorDtoToLicenseAgreementEntity.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseAgreementEntityToLicenseAgreementDescriptorDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseKeyGroupRequestDtoToLicenseKeyGroupEntity.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapMultiChoiceOrOtherDtoToMultiChoiceOrOther.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapMultiChoiceOrOtherToMultiChoiceOrOtherDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapVendorLicenseModelRequestDtoToVendorLicenseModelEntity.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapVersionedVendorLicenseModelToVendorLicenseModelEntityDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/EntitlementPoolsImpl.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/FeatureGroupsImpl.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/LicenseAgreementsImpl.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/LicenseKeyGroupsImpl.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/VendorLicenseModelsImpl.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/pom.xml create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/ChoiceOrOtherDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/EntitlementPoolEntityDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/EntitlementPoolRequestDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupDescriptorDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupEntityDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupModelDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupRequestDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupUpdateRequestDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementDescriptorDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementEntityDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementModelDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementRequestDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementUpdateRequestDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseKeyGroupEntityDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseKeyGroupRequestDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/MultiChoiceOrOtherDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelActionRequestDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelEntityDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelRequestDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/validation/ChoiceOrOtherSequenceProvider.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/validation/MultiChoiceOrOtherSequenceProvider.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/validation/OtherChoiceValidation.java (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest') diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/pom.xml new file mode 100644 index 0000000000..6c8a7376a2 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/pom.xml @@ -0,0 +1,24 @@ + + 4.0.0 + + + org.openecomp.sdc + openecomp-sdc-rest-webapp + 1.0.0-SNAPSHOT + ../ + + + org.openecomp.sdc.onboarding + vendor-license-rest + vendor-license-rest + pom + + + + + /vendor-license-rest-services + /vendor-license-rest-types + + + \ No newline at end of file diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/pom.xml new file mode 100644 index 0000000000..86f7ebde14 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/pom.xml @@ -0,0 +1,133 @@ + + 4.0.0 + + + org.openecomp.sdc.onboarding + vendor-license-rest + 1.0.0-SNAPSHOT + ../ + + + vendor-license-rest-services + vendor-license-rest-services + + + + + + ${project.build.directory}/generated-sources/error-codes + + + + + ${project.groupId} + vendor-license-rest-types + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-vendor-license-api + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-vendor-license-manager + ${project.version} + + + + + + org.springframework + spring-core + ${spring.framework.version} + + + org.springframework + spring-context + ${spring.framework.version} + + + org.springframework + spring-context-support + ${spring.framework.version} + + + org.springframework + spring-web + ${spring.framework.version} + + + org.springframework + spring-beans + ${spring.framework.version} + + + + + org.apache.cxf + cxf-rt-frontend-jaxrs + ${cxf.version} + + + + org.apache.httpcomponents + httpclient + ${http.client.version} + + + org.apache.httpcomponents + httpcore + ${http.client.version} + + + + javax.ws.rs + javax.ws.rs-api + ${ws.rs.version} + + + + + cglib + cglib-nodep + ${cglib.nodep.version} + runtime + + + + + javax.inject + javax.inject + ${javax.inject.version} + provided + + + org.openecomp.sdc + openecomp-sdc-vendor-software-product-manager + ${project.version} + + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + test/core/unittest/offline/** + + true + + + + + + + + + \ No newline at end of file diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/EntitlementPools.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/EntitlementPools.java new file mode 100644 index 0000000000..9dea767f7d --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/EntitlementPools.java @@ -0,0 +1,105 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.rest; + +import static org.openecomp.sdcrests.common.RestConstants.USER_HEADER_PARAM; +import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolEntityDto; +import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolRequestDto; +import org.springframework.validation.annotation.Validated; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Pattern; +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; + +@Path("/v1.0/vendor-license-models/{vlmId}/entitlement-pools") +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +@Api(value = "Vendor License Model - Entitlement Pools") +@Validated +public interface EntitlementPools { + @GET + @Path("/") + @ApiOperation(value = "List vendor entitlement pools", + response = EntitlementPoolEntityDto.class, + responseContainer = "List") + Response listEntitlementPools( + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId, + @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG) + @QueryParam("version") String version, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user); + + @POST + @Path("/") + @ApiOperation(value = "Create vendor entitlement pool") + Response createEntitlementPool(@Valid EntitlementPoolRequestDto request, + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") + String vlmId, + @NotNull(message = USER_MISSING_ERROR_MSG) + @HeaderParam(USER_HEADER_PARAM) String user); + + @PUT + @Path("/{entitlementPoolId}") + @ApiOperation(value = "Update vendor entitlement pool") + Response updateEntitlementPool(@Valid EntitlementPoolRequestDto request, + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") + String vlmId, + @NotNull(message = USER_MISSING_ERROR_MSG) + @PathParam("entitlementPoolId") String entitlementPoolId, + @HeaderParam(USER_HEADER_PARAM) String user); + + @GET + @Path("/{entitlementPoolId}") + @ApiOperation(value = "Get vendor entitlement pool", + response = EntitlementPoolEntityDto.class) + Response getEntitlementPool( + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId, + @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG) + @QueryParam("version") String version, + @PathParam("entitlementPoolId") String entitlementPoolId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user); + + @DELETE + @Path("/{entitlementPoolId}") + @ApiOperation(value = "Delete vendor entitlement pool") + Response deleteEntitlementPool( + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId, + @PathParam("entitlementPoolId") String entitlementPoolId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user); + +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/FeatureGroups.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/FeatureGroups.java new file mode 100644 index 0000000000..f5ad973cb0 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/FeatureGroups.java @@ -0,0 +1,108 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.rest; + +import static org.openecomp.sdcrests.common.RestConstants.USER_HEADER_PARAM; +import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupEntityDto; +import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupModelDto; +import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupRequestDto; +import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupUpdateRequestDto; +import org.springframework.validation.annotation.Validated; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Pattern; +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; + +@Path("/v1.0/vendor-license-models/{vlmId}/feature-groups") +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +@Api(value = "Vendor License Model - Feature Groups") +@Validated +public interface FeatureGroups { + + @GET + @Path("/") + @ApiOperation(value = "List vendor feature groups", + response = FeatureGroupEntityDto.class, + responseContainer = "List") + Response listFeatureGroups( + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId, + @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG) + @QueryParam("version") String version, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user); + + @POST + @Path("/") + @ApiOperation(value = "Create vendor feature group") + Response createFeatureGroup(@Valid FeatureGroupRequestDto request, + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") + String vlmId, + @NotNull(message = USER_MISSING_ERROR_MSG) + @HeaderParam(USER_HEADER_PARAM) String user); + + @PUT + @Path("/{featureGroupId}") + @ApiOperation(value = "Update vendor feature group") + Response updateFeatureGroup(@Valid FeatureGroupUpdateRequestDto request, + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") + String vlmId, + @PathParam("featureGroupId") String featureGroupId, + @NotNull(message = USER_MISSING_ERROR_MSG) + @HeaderParam(USER_HEADER_PARAM) String user); + + @GET + @Path("/{featureGroupId}") + @ApiOperation(value = "Get vendor feature group", + response = FeatureGroupModelDto.class) + Response getFeatureGroup( + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId, + @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG) + @QueryParam("version") String version, + @PathParam("featureGroupId") String featureGroupId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user); + + @DELETE + @Path("/{featureGroupId}") + @ApiOperation(value = "Delete vendor feature group") + Response deleteFeatureGroup( + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId, + @PathParam("featureGroupId") String featureGroupId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user); + +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/LicenseAgreements.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/LicenseAgreements.java new file mode 100644 index 0000000000..28d9f5a32f --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/LicenseAgreements.java @@ -0,0 +1,109 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.rest; + +import static org.openecomp.sdcrests.common.RestConstants.USER_HEADER_PARAM; +import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdcrests.vendorlicense.types.LicenseAgreementEntityDto; +import org.openecomp.sdcrests.vendorlicense.types.LicenseAgreementModelDto; +import org.openecomp.sdcrests.vendorlicense.types.LicenseAgreementRequestDto; +import org.openecomp.sdcrests.vendorlicense.types.LicenseAgreementUpdateRequestDto; +import org.springframework.validation.annotation.Validated; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Pattern; +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; + +@Path("/v1.0/vendor-license-models/{vlmId}/license-agreements") +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +@Api(value = "Vendor License Model - License Agreements") +@Validated + +public interface LicenseAgreements { + + @GET + @Path("/") + @ApiOperation(value = "List vendor license agreements", + response = LicenseAgreementEntityDto.class, + responseContainer = "List") + Response listLicenseAgreements( + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId, + @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG) + @QueryParam("version") String version, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user); + + @POST + @Path("/") + @ApiOperation(value = "Create vendor license agreement") + Response createLicenseAgreement(@Valid LicenseAgreementRequestDto request, + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") + String vlmId, + @NotNull(message = USER_MISSING_ERROR_MSG) + @HeaderParam(USER_HEADER_PARAM) String user); + + @PUT + @Path("/{licenseAgreementId}") + @ApiOperation(value = "Update vendor license agreement") + Response updateLicenseAgreement(@Valid LicenseAgreementUpdateRequestDto request, + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") + String vlmId, + @PathParam("licenseAgreementId") String licenseAgreementId, + @NotNull(message = USER_MISSING_ERROR_MSG) + @HeaderParam(USER_HEADER_PARAM) String user); + + @GET + @Path("/{licenseAgreementId}") + @ApiOperation(value = "Get vendor license agreement", + response = LicenseAgreementModelDto.class) + Response getLicenseAgreement( + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId, + @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG) + @QueryParam("version") String version, + @PathParam("licenseAgreementId") String licenseAgreementId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user); + + @DELETE + @Path("/{licenseAgreementId}") + @ApiOperation(value = "Delete vendor license agreement") + Response deleteLicenseAgreement( + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId, + @PathParam("licenseAgreementId") String licenseAgreementId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user); + +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/LicenseKeyGroups.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/LicenseKeyGroups.java new file mode 100644 index 0000000000..d66945d63c --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/LicenseKeyGroups.java @@ -0,0 +1,104 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.rest; + +import static org.openecomp.sdcrests.common.RestConstants.USER_HEADER_PARAM; +import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdcrests.vendorlicense.types.LicenseKeyGroupEntityDto; +import org.openecomp.sdcrests.vendorlicense.types.LicenseKeyGroupRequestDto; +import org.springframework.validation.annotation.Validated; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Pattern; +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; + +@Path("/v1.0/vendor-license-models/{vlmId}/license-key-groups") +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +@Api(value = "Vendor License Model - License Key Groups") +@Validated +public interface LicenseKeyGroups { + @GET + @Path("/") + @ApiOperation(value = "List vendor license key groups", + response = LicenseKeyGroupEntityDto.class, + responseContainer = "List") + Response listLicenseKeyGroups( + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId, + @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG) + @QueryParam("version") String version, + @HeaderParam(USER_HEADER_PARAM) String user); + + @POST + @Path("/") + @ApiOperation(value = "Create vendor license key group") + Response createLicenseKeyGroup(@Valid LicenseKeyGroupRequestDto request, + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") + String vlmId, + @NotNull(message = USER_MISSING_ERROR_MSG) + @HeaderParam(USER_HEADER_PARAM) String user); + + @PUT + @Path("/{licenseKeyGroupId}") + @ApiOperation(value = "Update vendor license key group") + Response updateLicenseKeyGroup(@Valid LicenseKeyGroupRequestDto request, + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") + String vlmId, + @PathParam("licenseKeyGroupId") String licenseKeyGroupId, + @NotNull(message = USER_MISSING_ERROR_MSG) + @HeaderParam(USER_HEADER_PARAM) String user); + + @GET + @Path("/{licenseKeyGroupId}") + @ApiOperation(value = "Get vendor license key group", + response = LicenseKeyGroupEntityDto.class) + Response getLicenseKeyGroup( + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId, + @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG) + @QueryParam("version") String version, + @PathParam("licenseKeyGroupId") String licenseKeyGroupId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user); + + @DELETE + @Path("/{licenseKeyGroupId}") + @ApiOperation(value = "Delete vendor license key group") + Response deleteLicenseKeyGroup( + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId, + @PathParam("licenseKeyGroupId") String licenseKeyGroupId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user); +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/VendorLicenseModels.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/VendorLicenseModels.java new file mode 100644 index 0000000000..15fc9bf0d9 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/VendorLicenseModels.java @@ -0,0 +1,111 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.rest; + +import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdcrests.common.RestConstants; +import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelActionRequestDto; +import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelEntityDto; +import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelRequestDto; +import org.springframework.validation.annotation.Validated; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Pattern; +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; + +@Path("/v1.0/vendor-license-models") +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +@Api(value = "Vendor License Models") +@Validated +public interface VendorLicenseModels { + + @GET + @Path("/") + @ApiOperation(value = "List vendor license models", + response = VendorLicenseModelEntityDto.class, + responseContainer = "List") + Response listLicenseModels(@ApiParam( + value = "Currently supported value: 'Final' - only vendor License models with final versions " + + "will be return - with their latest final version") + @QueryParam("versionFilter") String versionFilter, + @NotNull(message = USER_MISSING_ERROR_MSG) + @HeaderParam(RestConstants.USER_HEADER_PARAM) String user); + + @POST + @Path("/") + @ApiOperation(value = "Create vendor license model") + Response createLicenseModel(@Valid VendorLicenseModelRequestDto request, + @NotNull(message = USER_MISSING_ERROR_MSG) + @HeaderParam(RestConstants.USER_HEADER_PARAM) String user); + + @PUT + @Path("/{vlmId}") + @ApiOperation(value = "Update vendor license model") + Response updateLicenseModel(@Valid VendorLicenseModelRequestDto request, + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") + String vlmId, @NotNull(message = USER_MISSING_ERROR_MSG) + @HeaderParam(RestConstants.USER_HEADER_PARAM) String user); + + @GET + @Path("/{vlmId}") + @ApiOperation(value = "Get vendor license model", + response = VendorLicenseModelEntityDto.class) + Response getLicenseModel( + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId, + @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG) + @QueryParam("version") String version, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(RestConstants.USER_HEADER_PARAM) + String user); + + @DELETE + @Path("/{vlmId}") + @ApiOperation(value = "Delete vendor license model") + Response deleteLicenseModel( + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(RestConstants.USER_HEADER_PARAM) + String user); + + @PUT + @Path("/{vlmId}/actions") + @ApiOperation(value = "Update vendor license model") + Response actOnLicenseModel(@Valid VendorLicenseModelActionRequestDto request, + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") + String vlmId, @NotNull(message = USER_MISSING_ERROR_MSG) + @HeaderParam(RestConstants.USER_HEADER_PARAM) String user); +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapChoiceOrOtherDtoToChoiceOrOther.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapChoiceOrOtherDtoToChoiceOrOther.java new file mode 100644 index 0000000000..28eeb29018 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapChoiceOrOtherDtoToChoiceOrOther.java @@ -0,0 +1,36 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.rest.mapping; + +import org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorlicense.types.ChoiceOrOtherDto; + +public class MapChoiceOrOtherDtoToChoiceOrOther + extends MappingBase { + + @Override + public void doMapping(ChoiceOrOtherDto source, ChoiceOrOther target) { + target.setChoice(source.getChoice()); + target.setOther(source.getOther()); + target.setResult(null); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapChoiceOrOtherToChoiceOrOtherDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapChoiceOrOtherToChoiceOrOtherDto.java new file mode 100644 index 0000000000..2d686110d5 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapChoiceOrOtherToChoiceOrOtherDto.java @@ -0,0 +1,35 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.rest.mapping; + +import org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorlicense.types.ChoiceOrOtherDto; + +public class MapChoiceOrOtherToChoiceOrOtherDto + extends MappingBase { + + @Override + public void doMapping(ChoiceOrOther source, ChoiceOrOtherDto target) { + target.setChoice(source.getChoice()); + target.setOther(source.getOther()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolEntityToEntitlementPoolEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolEntityToEntitlementPoolEntityDto.java new file mode 100644 index 0000000000..c9f4ab894b --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolEntityToEntitlementPoolEntityDto.java @@ -0,0 +1,53 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.rest.mapping; + +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorlicense.types.ChoiceOrOtherDto; +import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolEntityDto; +import org.openecomp.sdcrests.vendorlicense.types.MultiChoiceOrOtherDto; + +public class MapEntitlementPoolEntityToEntitlementPoolEntityDto + extends MappingBase { + @Override + public void doMapping(EntitlementPoolEntity source, EntitlementPoolEntityDto target) { + target.setId(source.getId()); + target.setName(source.getName()); + target.setDescription(source.getDescription()); + target.setThresholdValue(source.getThresholdValue()); + target.setThresholdUnits(source.getThresholdUnit()); + target.setIncrements(source.getIncrements()); + + MapChoiceOrOtherToChoiceOrOtherDto choiceOrOtherMapper = + new MapChoiceOrOtherToChoiceOrOtherDto(); + target.setEntitlementMetric( + choiceOrOtherMapper.applyMapping(source.getEntitlementMetric(), ChoiceOrOtherDto.class)); + target.setAggregationFunction( + choiceOrOtherMapper.applyMapping(source.getAggregationFunction(), ChoiceOrOtherDto.class)); + target.setOperationalScope(new MapMultiChoiceOrOtherToMultiChoiceOrOtherDto() + .applyMapping(source.getOperationalScope(), MultiChoiceOrOtherDto.class)); + target.setTime(choiceOrOtherMapper.applyMapping(source.getTime(), ChoiceOrOtherDto.class)); + target.setManufacturerReferenceNumber(source.getManufacturerReferenceNumber()); + + target.setReferencingFeatureGroups(source.getReferencingFeatureGroups()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolRequestDtoToEntitlementPoolEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolRequestDtoToEntitlementPoolEntity.java new file mode 100644 index 0000000000..fe626e374c --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolRequestDtoToEntitlementPoolEntity.java @@ -0,0 +1,51 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.rest.mapping; + +import org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther; +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity; +import org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolRequestDto; + +public class MapEntitlementPoolRequestDtoToEntitlementPoolEntity + extends MappingBase { + @Override + public void doMapping(EntitlementPoolRequestDto source, EntitlementPoolEntity target) { + target.setName(source.getName()); + target.setDescription(source.getDescription()); + target.setThresholdValue(source.getThresholdValue()); + target.setThresholdUnit(source.getThresholdUnits()); + target.setIncrements(source.getIncrements()); + + MapChoiceOrOtherDtoToChoiceOrOther choiceOrOtherMapper = + new MapChoiceOrOtherDtoToChoiceOrOther(); + target.setEntitlementMetric( + choiceOrOtherMapper.applyMapping(source.getEntitlementMetric(), ChoiceOrOther.class)); + target.setAggregationFunction( + choiceOrOtherMapper.applyMapping(source.getAggregationFunction(), ChoiceOrOther.class)); + target.setOperationalScope(new MapMultiChoiceOrOtherDtoToMultiChoiceOrOther() + .applyMapping(source.getOperationalScope(), MultiChoiceOrOther.class)); + target.setTime(choiceOrOtherMapper.applyMapping(source.getTime(), ChoiceOrOther.class)); + + target.setManufacturerReferenceNumber(source.getManufacturerReferenceNumber()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapFeatureGroupDescriptorDtoToFeatureGroupEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapFeatureGroupDescriptorDtoToFeatureGroupEntity.java new file mode 100644 index 0000000000..91239e2655 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapFeatureGroupDescriptorDtoToFeatureGroupEntity.java @@ -0,0 +1,36 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.rest.mapping; + +import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupDescriptorDto; + + +public class MapFeatureGroupDescriptorDtoToFeatureGroupEntity + extends MappingBase { + @Override + public void doMapping(FeatureGroupDescriptorDto source, FeatureGroupEntity target) { + target.setName(source.getName()); + target.setDescription(source.getDescription()); + target.setPartNumber(source.getPartNumber()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapFeatureGroupEntityToFeatureGroupDescriptorDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapFeatureGroupEntityToFeatureGroupDescriptorDto.java new file mode 100644 index 0000000000..70f5666bcb --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapFeatureGroupEntityToFeatureGroupDescriptorDto.java @@ -0,0 +1,35 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.rest.mapping; + +import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupDescriptorDto; + +public class MapFeatureGroupEntityToFeatureGroupDescriptorDto + extends MappingBase { + @Override + public void doMapping(FeatureGroupEntity source, FeatureGroupDescriptorDto target) { + target.setName(source.getName()); + target.setDescription(source.getDescription()); + target.setPartNumber(source.getPartNumber()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseAgreementDescriptorDtoToLicenseAgreementEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseAgreementDescriptorDtoToLicenseAgreementEntity.java new file mode 100644 index 0000000000..f5ea8414d5 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseAgreementDescriptorDtoToLicenseAgreementEntity.java @@ -0,0 +1,38 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.rest.mapping; + +import org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorlicense.types.LicenseAgreementDescriptorDto; + +public class MapLicenseAgreementDescriptorDtoToLicenseAgreementEntity + extends MappingBase { + @Override + public void doMapping(LicenseAgreementDescriptorDto source, LicenseAgreementEntity target) { + target.setName(source.getName()); + target.setDescription(source.getDescription()); + target.setLicenseTerm(new MapChoiceOrOtherDtoToChoiceOrOther() + .applyMapping(source.getLicenseTerm(), ChoiceOrOther.class)); + target.setRequirementsAndConstrains(source.getRequirementsAndConstrains()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseAgreementEntityToLicenseAgreementDescriptorDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseAgreementEntityToLicenseAgreementDescriptorDto.java new file mode 100644 index 0000000000..2fd4f669cf --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseAgreementEntityToLicenseAgreementDescriptorDto.java @@ -0,0 +1,38 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.rest.mapping; + +import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorlicense.types.ChoiceOrOtherDto; +import org.openecomp.sdcrests.vendorlicense.types.LicenseAgreementDescriptorDto; + +public class MapLicenseAgreementEntityToLicenseAgreementDescriptorDto + extends MappingBase { + @Override + public void doMapping(LicenseAgreementEntity source, LicenseAgreementDescriptorDto target) { + target.setName(source.getName()); + target.setDescription(source.getDescription()); + target.setLicenseTerm(new MapChoiceOrOtherToChoiceOrOtherDto() + .applyMapping(source.getLicenseTerm(), ChoiceOrOtherDto.class)); + target.setRequirementsAndConstrains(source.getRequirementsAndConstrains()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto.java new file mode 100644 index 0000000000..38384711b1 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto.java @@ -0,0 +1,40 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.rest.mapping; + +import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorlicense.types.LicenseKeyGroupEntityDto; +import org.openecomp.sdcrests.vendorlicense.types.MultiChoiceOrOtherDto; + +public class MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto + extends MappingBase { + @Override + public void doMapping(LicenseKeyGroupEntity source, LicenseKeyGroupEntityDto target) { + target.setId(source.getId()); + target.setName(source.getName()); + target.setDescription(source.getDescription()); + target.setType(source.getType()); + target.setOperationalScope(new MapMultiChoiceOrOtherToMultiChoiceOrOtherDto() + .applyMapping(source.getOperationalScope(), MultiChoiceOrOtherDto.class)); + target.setReferencingFeatureGroups(source.getReferencingFeatureGroups()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseKeyGroupRequestDtoToLicenseKeyGroupEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseKeyGroupRequestDtoToLicenseKeyGroupEntity.java new file mode 100644 index 0000000000..aee27c8521 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseKeyGroupRequestDtoToLicenseKeyGroupEntity.java @@ -0,0 +1,38 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.rest.mapping; + +import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity; +import org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorlicense.types.LicenseKeyGroupRequestDto; + +public class MapLicenseKeyGroupRequestDtoToLicenseKeyGroupEntity + extends MappingBase { + @Override + public void doMapping(LicenseKeyGroupRequestDto source, LicenseKeyGroupEntity target) { + target.setName(source.getName()); + target.setDescription(source.getDescription()); + target.setType(source.getType()); + target.setOperationalScope(new MapMultiChoiceOrOtherDtoToMultiChoiceOrOther() + .applyMapping(source.getOperationalScope(), MultiChoiceOrOther.class)); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapMultiChoiceOrOtherDtoToMultiChoiceOrOther.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapMultiChoiceOrOtherDtoToMultiChoiceOrOther.java new file mode 100644 index 0000000000..320bf67bdf --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapMultiChoiceOrOtherDtoToMultiChoiceOrOther.java @@ -0,0 +1,36 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.rest.mapping; + +import org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorlicense.types.MultiChoiceOrOtherDto; + +public class MapMultiChoiceOrOtherDtoToMultiChoiceOrOther + extends MappingBase { + + @Override + public void doMapping(MultiChoiceOrOtherDto source, MultiChoiceOrOther target) { + target.setChoices(source.getChoices()); + target.setOther(source.getOther()); + target.setResults(null); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapMultiChoiceOrOtherToMultiChoiceOrOtherDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapMultiChoiceOrOtherToMultiChoiceOrOtherDto.java new file mode 100644 index 0000000000..9649053fb4 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapMultiChoiceOrOtherToMultiChoiceOrOtherDto.java @@ -0,0 +1,35 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.rest.mapping; + +import org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorlicense.types.MultiChoiceOrOtherDto; + +public class MapMultiChoiceOrOtherToMultiChoiceOrOtherDto + extends MappingBase { + + @Override + public void doMapping(MultiChoiceOrOther source, MultiChoiceOrOtherDto target) { + target.setChoices(source.getChoices()); + target.setOther(source.getOther()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapVendorLicenseModelRequestDtoToVendorLicenseModelEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapVendorLicenseModelRequestDtoToVendorLicenseModelEntity.java new file mode 100644 index 0000000000..1117a2db9f --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapVendorLicenseModelRequestDtoToVendorLicenseModelEntity.java @@ -0,0 +1,36 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.rest.mapping; + +import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelRequestDto; + + +public class MapVendorLicenseModelRequestDtoToVendorLicenseModelEntity + extends MappingBase { + @Override + public void doMapping(VendorLicenseModelRequestDto source, VendorLicenseModelEntity target) { + target.setVendorName(source.getVendorName()); + target.setDescription(source.getDescription()); + target.setIconRef(source.getIconRef()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapVersionedVendorLicenseModelToVendorLicenseModelEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapVersionedVendorLicenseModelToVendorLicenseModelEntityDto.java new file mode 100644 index 0000000000..a53d5c9e36 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapVersionedVendorLicenseModelToVendorLicenseModelEntityDto.java @@ -0,0 +1,60 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.rest.mapping; + +import org.openecomp.core.utilities.CommonMethods; +import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity; +import org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.types.VersionInfo; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelEntityDto; + +import java.util.stream.Collectors; + +public class MapVersionedVendorLicenseModelToVendorLicenseModelEntityDto + extends MappingBase { + @Override + public void doMapping(VersionedVendorLicenseModel source, VendorLicenseModelEntityDto target) { + VendorLicenseModelEntity sourceVlm = source.getVendorLicenseModel(); + target.setId(sourceVlm.getId()); + target.setVendorName(sourceVlm.getVendorName()); + target.setDescription(sourceVlm.getDescription()); + target.setIconRef(sourceVlm.getIconRef()); + + VersionInfo versionInfo = source.getVersionInfo(); + if (versionInfo != null) { + target.setVersion(versionInfo.getActiveVersion().toString()); + target.setStatus(versionInfo.getStatus()); + target.setLockingUser(versionInfo.getLockingUser()); + + if (!CommonMethods.isEmpty(versionInfo.getViewableVersions())) { + target.setViewableVersions(versionInfo.getViewableVersions().stream().map(Version::toString) + .collect(Collectors.toList())); + } + + if (!CommonMethods.isEmpty(versionInfo.getFinalVersions())) { + target.setFinalVersions(versionInfo.getFinalVersions().stream().map(Version::toString) + .collect(Collectors.toList())); + } + } + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/EntitlementPoolsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/EntitlementPoolsImpl.java new file mode 100644 index 0000000000..ab9800e612 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/EntitlementPoolsImpl.java @@ -0,0 +1,157 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.rest.services; + +import org.openecomp.sdc.vendorlicense.VendorLicenseManager; +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity; +import org.openecomp.sdc.versioning.dao.types.Version; + +import org.openecomp.sdcrests.vendorlicense.rest.EntitlementPools; +import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapEntitlementPoolEntityToEntitlementPoolEntityDto; +import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapEntitlementPoolRequestDtoToEntitlementPoolEntity; +import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolEntityDto; +import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolRequestDto; +import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper; +import org.openecomp.sdcrests.wrappers.StringWrapperResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Service; + +import java.util.Collection; +import javax.inject.Named; +import javax.ws.rs.core.Response; + +@Named +@Service("entitlementPools") +@Scope(value = "prototype") +public class EntitlementPoolsImpl implements EntitlementPools { + + @Autowired + private VendorLicenseManager vendorLicenseManager; + + /** + * List entitlement pools response. + * + * @param vlmId the vlm id + * @param version the version + * @param user the user + * @return the response + */ + public Response listEntitlementPools(String vlmId, String version, String user) { + Collection entitlementPools = + vendorLicenseManager.listEntitlementPools(vlmId, Version.valueOf(version), user); + + GenericCollectionWrapper result = new GenericCollectionWrapper<>(); + MapEntitlementPoolEntityToEntitlementPoolEntityDto outputMapper = + new MapEntitlementPoolEntityToEntitlementPoolEntityDto(); + for (EntitlementPoolEntity ep : entitlementPools) { + result.add(outputMapper.applyMapping(ep, EntitlementPoolEntityDto.class)); + } + + return Response.ok(result).build(); + } + + /** + * Create entitlement pool response. + * + * @param request the request + * @param vlmId the vlm id + * @param user the user + * @return the response + */ + public Response createEntitlementPool(EntitlementPoolRequestDto request, String vlmId, + String user) { + EntitlementPoolEntity entitlementPoolEntity = + new MapEntitlementPoolRequestDtoToEntitlementPoolEntity() + .applyMapping(request, EntitlementPoolEntity.class); + entitlementPoolEntity.setVendorLicenseModelId(vlmId); + + EntitlementPoolEntity createdEntitlementPool = + vendorLicenseManager.createEntitlementPool(entitlementPoolEntity, user); + StringWrapperResponse result = + createdEntitlementPool != null ? new StringWrapperResponse(createdEntitlementPool.getId()) + : null; + + return Response.ok(result).build(); + } + + /** + * Update entitlement pool response. + * + * @param request the request + * @param vlmId the vlm id + * @param entitlementPoolId the entitlement pool id + * @param user the user + * @return the response + */ + public Response updateEntitlementPool(EntitlementPoolRequestDto request, String vlmId, + String entitlementPoolId, String user) { + EntitlementPoolEntity entitlementPoolEntity = + new MapEntitlementPoolRequestDtoToEntitlementPoolEntity() + .applyMapping(request, EntitlementPoolEntity.class); + + entitlementPoolEntity.setVendorLicenseModelId(vlmId); + entitlementPoolEntity.setId(entitlementPoolId); + + vendorLicenseManager.updateEntitlementPool(entitlementPoolEntity, user); + return Response.ok().build(); + } + + /** + * Gets entitlement pool. + * + * @param vlmId the vlm id + * @param version the version + * @param entitlementPoolId the entitlement pool id + * @param user the user + * @return the entitlement pool + */ + public Response getEntitlementPool(String vlmId, String version, String entitlementPoolId, + String user) { + EntitlementPoolEntity epInput = new EntitlementPoolEntity(); + epInput.setVendorLicenseModelId(vlmId); + epInput.setVersion(Version.valueOf(version)); + epInput.setId(entitlementPoolId); + EntitlementPoolEntity entitlementPool = vendorLicenseManager.getEntitlementPool(epInput, user); + + EntitlementPoolEntityDto entitlementPoolEntityDto = entitlementPool == null ? null : + new MapEntitlementPoolEntityToEntitlementPoolEntityDto() + .applyMapping(entitlementPool, EntitlementPoolEntityDto.class); + return Response.ok(entitlementPoolEntityDto).build(); + } + + /** + * Delete entitlement pool response. + * + * @param vlmId the vlm id + * @param entitlementPoolId the entitlement pool id + * @param user the user + * @return the response + */ + public Response deleteEntitlementPool(String vlmId, String entitlementPoolId, String user) { + EntitlementPoolEntity epInput = new EntitlementPoolEntity(); + epInput.setVendorLicenseModelId(vlmId); + epInput.setId(entitlementPoolId); + vendorLicenseManager.deleteEntitlementPool(epInput, user); + return Response.ok().build(); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/FeatureGroupsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/FeatureGroupsImpl.java new file mode 100644 index 0000000000..daf35f9ee6 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/FeatureGroupsImpl.java @@ -0,0 +1,169 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.rest.services; + +import org.openecomp.core.utilities.CommonMethods; +import org.openecomp.sdc.vendorlicense.VendorLicenseManager; +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity; +import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity; +import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupModel; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdcrests.vendorlicense.rest.FeatureGroups; +import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapEntitlementPoolEntityToEntitlementPoolEntityDto; +import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapFeatureGroupDescriptorDtoToFeatureGroupEntity; +import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapFeatureGroupEntityToFeatureGroupDescriptorDto; +import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto; +import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolEntityDto; +import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupEntityDto; +import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupModelDto; +import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupRequestDto; +import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupUpdateRequestDto; +import org.openecomp.sdcrests.vendorlicense.types.LicenseKeyGroupEntityDto; +import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper; +import org.openecomp.sdcrests.wrappers.StringWrapperResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Service; + +import java.util.Collection; +import java.util.HashSet; +import javax.inject.Named; +import javax.ws.rs.core.Response; + + +@Named +@Service("featureGroups") +@Scope(value = "prototype") +public class FeatureGroupsImpl implements FeatureGroups { + + @Autowired + private VendorLicenseManager vendorLicenseManager; + + @Override + public Response listFeatureGroups(String vlmId, String version, String user) { + Collection featureGroupEntities = + vendorLicenseManager.listFeatureGroups(vlmId, Version.valueOf(version), user); + + MapFeatureGroupEntityToFeatureGroupDescriptorDto outputMapper = + new MapFeatureGroupEntityToFeatureGroupDescriptorDto(); + GenericCollectionWrapper results = new GenericCollectionWrapper<>(); + + for (FeatureGroupEntity fg : featureGroupEntities) { + FeatureGroupEntityDto fgDto = new FeatureGroupEntityDto(); + fgDto.setId(fg.getId()); + fgDto.setLicenseKeyGroupsIds(fg.getLicenseKeyGroupIds()); + fgDto.setEntitlementPoolsIds(fg.getEntitlementPoolIds()); + fgDto.setReferencingLicenseAgreements(fg.getReferencingLicenseAgreements()); + outputMapper.doMapping(fg, fgDto); + results.add(fgDto); + } + + return Response.ok(results).build(); + } + + @Override + public Response createFeatureGroup(FeatureGroupRequestDto request, String vlmId, String user) { + FeatureGroupEntity featureGroupEntity = new MapFeatureGroupDescriptorDtoToFeatureGroupEntity() + .applyMapping(request, FeatureGroupEntity.class); + featureGroupEntity.setVendorLicenseModelId(vlmId); + featureGroupEntity.setLicenseKeyGroupIds(request.getAddedLicenseKeyGroupsIds()); + featureGroupEntity.setEntitlementPoolIds(request.getAddedEntitlementPoolsIds()); + + FeatureGroupEntity createdFeatureGroup = + vendorLicenseManager.createFeatureGroup(featureGroupEntity, user); + + StringWrapperResponse result = + createdFeatureGroup != null ? new StringWrapperResponse(createdFeatureGroup.getId()) : null; + return Response.ok(result).build(); + } + + @Override + public Response updateFeatureGroup(FeatureGroupUpdateRequestDto request, String vlmId, + String featureGroupId, String user) { + FeatureGroupEntity featureGroupEntity = new MapFeatureGroupDescriptorDtoToFeatureGroupEntity() + .applyMapping(request, FeatureGroupEntity.class); + featureGroupEntity.setVendorLicenseModelId(vlmId); + featureGroupEntity.setId(featureGroupId); + + vendorLicenseManager + .updateFeatureGroup(featureGroupEntity, request.getAddedLicenseKeyGroupsIds(), + request.getRemovedLicenseKeyGroupsIds(), request.getAddedEntitlementPoolsIds(), + request.getRemovedEntitlementPoolsIds(), user); + return Response.ok().build(); + } + + @Override + public Response getFeatureGroup(String vlmId, String version, String featureGroupId, + String user) { + FeatureGroupEntity fgInput = new FeatureGroupEntity(); + fgInput.setVendorLicenseModelId(vlmId); + fgInput.setVersion(Version.valueOf(version)); + fgInput.setId(featureGroupId); + FeatureGroupModel featureGroupModel = vendorLicenseManager.getFeatureGroupModel(fgInput, user); + + if (featureGroupModel == null) { + return Response.ok().build(); + } + + FeatureGroupModelDto fgmDto = new FeatureGroupModelDto(); + fgmDto.setId(featureGroupModel.getFeatureGroup().getId()); + fgmDto.setReferencingLicenseAgreements( + featureGroupModel.getFeatureGroup().getReferencingLicenseAgreements()); + new MapFeatureGroupEntityToFeatureGroupDescriptorDto() + .doMapping(featureGroupModel.getFeatureGroup(), fgmDto); + + if (!CommonMethods.isEmpty(featureGroupModel.getLicenseKeyGroups())) { + fgmDto.setLicenseKeyGroups(new HashSet<>()); + + MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto lkgMapper = + new MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto(); + for (LicenseKeyGroupEntity lkg : featureGroupModel.getLicenseKeyGroups()) { + fgmDto.getLicenseKeyGroups() + .add(lkgMapper.applyMapping(lkg, LicenseKeyGroupEntityDto.class)); + } + } + + if (!CommonMethods.isEmpty(featureGroupModel.getEntitlementPools())) { + fgmDto.setEntitlementPools(new HashSet<>()); + + MapEntitlementPoolEntityToEntitlementPoolEntityDto epMapper = + new MapEntitlementPoolEntityToEntitlementPoolEntityDto(); + for (EntitlementPoolEntity ep : featureGroupModel.getEntitlementPools()) { + fgmDto.getEntitlementPools().add(epMapper.applyMapping(ep, EntitlementPoolEntityDto.class)); + + } + } + + return Response.ok(fgmDto).build(); + } + + @Override + public Response deleteFeatureGroup(String vlmId, String featureGroupId, String user) { + FeatureGroupEntity fgInput = new FeatureGroupEntity(); + fgInput.setVendorLicenseModelId(vlmId); + fgInput.setId(featureGroupId); + vendorLicenseManager.deleteFeatureGroup(fgInput, user); + return Response.ok().build(); + } + +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/LicenseAgreementsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/LicenseAgreementsImpl.java new file mode 100644 index 0000000000..d87be05998 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/LicenseAgreementsImpl.java @@ -0,0 +1,186 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.rest.services; + +import org.openecomp.core.utilities.CommonMethods; +import org.openecomp.sdc.vendorlicense.VendorLicenseManager; +import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementModel; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdcrests.vendorlicense.rest.LicenseAgreements; +import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapFeatureGroupEntityToFeatureGroupDescriptorDto; +import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapLicenseAgreementDescriptorDtoToLicenseAgreementEntity; +import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapLicenseAgreementEntityToLicenseAgreementDescriptorDto; +import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupEntityDto; +import org.openecomp.sdcrests.vendorlicense.types.LicenseAgreementEntityDto; +import org.openecomp.sdcrests.vendorlicense.types.LicenseAgreementModelDto; +import org.openecomp.sdcrests.vendorlicense.types.LicenseAgreementRequestDto; +import org.openecomp.sdcrests.vendorlicense.types.LicenseAgreementUpdateRequestDto; +import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper; +import org.openecomp.sdcrests.wrappers.StringWrapperResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Service; + +import java.util.Collection; +import java.util.HashSet; +import javax.inject.Named; +import javax.ws.rs.core.Response; + +@Named +@Service("licenseAgreements") +@Scope(value = "prototype") +public class LicenseAgreementsImpl implements LicenseAgreements { + + @Autowired + private VendorLicenseManager vendorLicenseManager; + + /** + * List license agreements response. + * + * @param vlmId the vlm id + * @param version the version + * @param user the user + * @return the response + */ + public Response listLicenseAgreements(String vlmId, String version, String user) { + Collection licenseAgreements = + vendorLicenseManager.listLicenseAgreements(vlmId, Version.valueOf(version), user); + + GenericCollectionWrapper results = new GenericCollectionWrapper<>(); + MapLicenseAgreementEntityToLicenseAgreementDescriptorDto outputMapper = + new MapLicenseAgreementEntityToLicenseAgreementDescriptorDto(); + for (LicenseAgreementEntity lae : licenseAgreements) { + LicenseAgreementEntityDto laeDto = new LicenseAgreementEntityDto(); + laeDto.setId(lae.getId()); + laeDto.setFeatureGroupsIds(lae.getFeatureGroupIds()); + outputMapper.doMapping(lae, laeDto); + results.add(laeDto); + } + + return Response.ok(results).build(); + } + + /** + * Create license agreement response. + * + * @param request the request + * @param vlmId the vlm id + * @param user the user + * @return the response + */ + public Response createLicenseAgreement(LicenseAgreementRequestDto request, String vlmId, + String user) { + LicenseAgreementEntity licenseAgreementEntity = + new MapLicenseAgreementDescriptorDtoToLicenseAgreementEntity() + .applyMapping(request, LicenseAgreementEntity.class); + licenseAgreementEntity.setVendorLicenseModelId(vlmId); + licenseAgreementEntity.setFeatureGroupIds(request.getAddedFeatureGroupsIds()); + + LicenseAgreementEntity createdLicenseAgreement = + vendorLicenseManager.createLicenseAgreement(licenseAgreementEntity, user); + StringWrapperResponse result = + createdLicenseAgreement != null ? new StringWrapperResponse(createdLicenseAgreement.getId()) + : null; + + return Response.ok(result).build(); + } + + /** + * Update license agreement response. + * + * @param request the request + * @param vlmId the vlm id + * @param licenseAgreementId the license agreement id + * @param user the user + * @return the response + */ + public Response updateLicenseAgreement(LicenseAgreementUpdateRequestDto request, String vlmId, + String licenseAgreementId, String user) { + LicenseAgreementEntity licenseAgreementEntity = + new MapLicenseAgreementDescriptorDtoToLicenseAgreementEntity() + .applyMapping(request, LicenseAgreementEntity.class); + licenseAgreementEntity.setVendorLicenseModelId(vlmId); + licenseAgreementEntity.setId(licenseAgreementId); + + vendorLicenseManager + .updateLicenseAgreement(licenseAgreementEntity, request.getAddedFeatureGroupsIds(), + request.getRemovedFeatureGroupsIds(), user); + return Response.ok().build(); + } + + /** + * Gets license agreement. + * + * @param vlmId the vlm id + * @param version the version + * @param licenseAgreementId the license agreement id + * @param user the user + * @return the license agreement + */ + public Response getLicenseAgreement(String vlmId, String version, String licenseAgreementId, + String user) { + LicenseAgreementModel licenseAgreementModel = vendorLicenseManager + .getLicenseAgreementModel(vlmId, Version.valueOf(version), licenseAgreementId, user); + + if (licenseAgreementModel == null) { + return Response.ok().build(); + } + + LicenseAgreementModelDto lamDto = new LicenseAgreementModelDto(); + lamDto.setId(licenseAgreementModel.getLicenseAgreement().getId()); + new MapLicenseAgreementEntityToLicenseAgreementDescriptorDto() + .doMapping(licenseAgreementModel.getLicenseAgreement(), lamDto); + + if (!CommonMethods.isEmpty(licenseAgreementModel.getFeatureGroups())) { + lamDto.setFeatureGroups(new HashSet<>()); + + MapFeatureGroupEntityToFeatureGroupDescriptorDto fgMapper = + new MapFeatureGroupEntityToFeatureGroupDescriptorDto(); + for (FeatureGroupEntity fg : licenseAgreementModel.getFeatureGroups()) { + FeatureGroupEntityDto fgeDto = new FeatureGroupEntityDto(); + fgeDto.setId(fg.getId()); + fgeDto.setEntitlementPoolsIds(fg.getEntitlementPoolIds()); + fgeDto.setLicenseKeyGroupsIds(fg.getLicenseKeyGroupIds()); + fgMapper.doMapping(fg, fgeDto); + + lamDto.getFeatureGroups().add(fgeDto); + } + } + + return Response.ok(lamDto).build(); + } + + /** + * Delete license agreement response. + * + * @param vlmId the vlm id + * @param licenseAgreementId the license agreement id + * @param user the user + * @return the response + */ + public Response deleteLicenseAgreement(String vlmId, String licenseAgreementId, String user) { + vendorLicenseManager.deleteLicenseAgreement(vlmId, licenseAgreementId, user); + return Response.ok().build(); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/LicenseKeyGroupsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/LicenseKeyGroupsImpl.java new file mode 100644 index 0000000000..6ef7e194b8 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/LicenseKeyGroupsImpl.java @@ -0,0 +1,159 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.rest.services; + +import org.openecomp.sdc.vendorlicense.VendorLicenseManager; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity; +import org.openecomp.sdc.versioning.dao.types.Version; + +import org.openecomp.sdcrests.vendorlicense.rest.LicenseKeyGroups; +import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto; +import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapLicenseKeyGroupRequestDtoToLicenseKeyGroupEntity; +import org.openecomp.sdcrests.vendorlicense.types.LicenseKeyGroupEntityDto; +import org.openecomp.sdcrests.vendorlicense.types.LicenseKeyGroupRequestDto; +import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper; +import org.openecomp.sdcrests.wrappers.StringWrapperResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +import java.util.Collection; +import javax.inject.Named; +import javax.ws.rs.core.Response; + +@Named +@Service("licenseKeyGroups") +@Scope(value = "prototype") +@Validated +public class LicenseKeyGroupsImpl implements LicenseKeyGroups { + + @Autowired + private VendorLicenseManager vendorLicenseManager; + + /** + * List license key groups response. + * + * @param vlmId the vlm id + * @param version the version + * @param user the user + * @return the response + */ + public Response listLicenseKeyGroups(String vlmId, String version, String user) { + Collection licenseKeyGroups = + vendorLicenseManager.listLicenseKeyGroups(vlmId, Version.valueOf(version), user); + + GenericCollectionWrapper result = new GenericCollectionWrapper<>(); + MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto outputMapper = + new MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto(); + for (LicenseKeyGroupEntity ep : licenseKeyGroups) { + result.add(outputMapper.applyMapping(ep, LicenseKeyGroupEntityDto.class)); + } + + return Response.ok(result).build(); + } + + /** + * Create license key group response. + * + * @param request the request + * @param vlmId the vlm id + * @param user the user + * @return the response + */ + public Response createLicenseKeyGroup(LicenseKeyGroupRequestDto request, String vlmId, + String user) { + LicenseKeyGroupEntity licenseKeyGroupEntity = + new MapLicenseKeyGroupRequestDtoToLicenseKeyGroupEntity() + .applyMapping(request, LicenseKeyGroupEntity.class); + licenseKeyGroupEntity.setVendorLicenseModelId(vlmId); + + LicenseKeyGroupEntity createdLicenseKeyGroup = + vendorLicenseManager.createLicenseKeyGroup(licenseKeyGroupEntity, user); + StringWrapperResponse result = + createdLicenseKeyGroup != null ? new StringWrapperResponse(createdLicenseKeyGroup.getId()) + : null; + + return Response.ok(result).build(); + } + + /** + * Update license key group response. + * + * @param request the request + * @param vlmId the vlm id + * @param licenseKeyGroupId the license key group id + * @param user the user + * @return the response + */ + public Response updateLicenseKeyGroup(LicenseKeyGroupRequestDto request, String vlmId, + String licenseKeyGroupId, String user) { + LicenseKeyGroupEntity licenseKeyGroupEntity = + new MapLicenseKeyGroupRequestDtoToLicenseKeyGroupEntity() + .applyMapping(request, LicenseKeyGroupEntity.class); + + licenseKeyGroupEntity.setVendorLicenseModelId(vlmId); + licenseKeyGroupEntity.setId(licenseKeyGroupId); + + vendorLicenseManager.updateLicenseKeyGroup(licenseKeyGroupEntity, user); + return Response.ok().build(); + } + + /** + * Gets license key group. + * + * @param vlmId the vlm id + * @param version the version + * @param licenseKeyGroupId the license key group id + * @param user the user + * @return the license key group + */ + public Response getLicenseKeyGroup(String vlmId, String version, String licenseKeyGroupId, + String user) { + LicenseKeyGroupEntity lkgInput = new LicenseKeyGroupEntity(); + lkgInput.setVendorLicenseModelId(vlmId); + lkgInput.setVersion(Version.valueOf(version)); + lkgInput.setId(licenseKeyGroupId); + LicenseKeyGroupEntity licenseKeyGroup = vendorLicenseManager.getLicenseKeyGroup(lkgInput, user); + + LicenseKeyGroupEntityDto licenseKeyGroupEntityDto = licenseKeyGroup == null ? null : + new MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto() + .applyMapping(licenseKeyGroup, LicenseKeyGroupEntityDto.class); + return Response.ok(licenseKeyGroupEntityDto).build(); + } + + /** + * Delete license key group response. + * + * @param vlmId the vlm id + * @param licenseKeyGroupId the license key group id + * @param user the user + * @return the response + */ + public Response deleteLicenseKeyGroup(String vlmId, String licenseKeyGroupId, String user) { + LicenseKeyGroupEntity lkgInput = new LicenseKeyGroupEntity(); + lkgInput.setVendorLicenseModelId(vlmId); + lkgInput.setId(licenseKeyGroupId); + vendorLicenseManager.deleteLicenseKeyGroup(lkgInput, user); + return Response.ok().build(); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/VendorLicenseModelsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/VendorLicenseModelsImpl.java new file mode 100644 index 0000000000..c63da86e7a --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/VendorLicenseModelsImpl.java @@ -0,0 +1,135 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.rest.services; + +import org.openecomp.sdc.vendorlicense.VendorLicenseManager; +import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity; +import org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdcrests.vendorlicense.rest.VendorLicenseModels; +import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapVendorLicenseModelRequestDtoToVendorLicenseModelEntity; +import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapVersionedVendorLicenseModelToVendorLicenseModelEntityDto; +import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelActionRequestDto; +import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelEntityDto; +import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelRequestDto; +import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper; +import org.openecomp.sdcrests.wrappers.StringWrapperResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +import java.util.Collection; +import javax.inject.Named; +import javax.ws.rs.core.Response; + + + +@Named +@Service("vendorLicenseModels") +@Scope(value = "prototype") +@Validated +public class VendorLicenseModelsImpl implements VendorLicenseModels { + + @Autowired + private VendorLicenseManager vendorLicenseManager; + + @Override + public Response listLicenseModels(String versionFilter, String user) { + Collection versionedVendorLicenseModels = + vendorLicenseManager.listVendorLicenseModels(versionFilter, user); + + GenericCollectionWrapper results = + new GenericCollectionWrapper<>(); + MapVersionedVendorLicenseModelToVendorLicenseModelEntityDto outputMapper = + new MapVersionedVendorLicenseModelToVendorLicenseModelEntityDto(); + for (VersionedVendorLicenseModel versionedVlm : versionedVendorLicenseModels) { + results.add(outputMapper.applyMapping(versionedVlm, VendorLicenseModelEntityDto.class)); + } + + return Response.ok(results).build(); + } + + @Override + public Response createLicenseModel(VendorLicenseModelRequestDto request, String user) { + VendorLicenseModelEntity vendorLicenseModelEntity = + new MapVendorLicenseModelRequestDtoToVendorLicenseModelEntity() + .applyMapping(request, VendorLicenseModelEntity.class); + VendorLicenseModelEntity createdVendorLicenseModel = + vendorLicenseManager.createVendorLicenseModel(vendorLicenseModelEntity, user); + StringWrapperResponse result = createdVendorLicenseModel != null ? new StringWrapperResponse( + createdVendorLicenseModel.getId()) : null; + + return Response.ok(result).build(); + } + + @Override + public Response updateLicenseModel(VendorLicenseModelRequestDto request, String vlmId, + String user) { + VendorLicenseModelEntity vendorLicenseModelEntity = + new MapVendorLicenseModelRequestDtoToVendorLicenseModelEntity() + .applyMapping(request, VendorLicenseModelEntity.class); + vendorLicenseModelEntity.setId(vlmId); + + vendorLicenseManager.updateVendorLicenseModel(vendorLicenseModelEntity, user); + return Response.ok().build(); + } + + @Override + public Response getLicenseModel(String vlmId, String version, String user) { + VersionedVendorLicenseModel versionedVlm = + vendorLicenseManager.getVendorLicenseModel(vlmId, Version.valueOf(version), user); + + VendorLicenseModelEntityDto vlmDto = versionedVlm == null ? null : + new MapVersionedVendorLicenseModelToVendorLicenseModelEntityDto() + .applyMapping(versionedVlm, VendorLicenseModelEntityDto.class); + return Response.ok(vlmDto).build(); + } + + @Override + public Response deleteLicenseModel(String vlmId, String user) { + vendorLicenseManager.deleteVendorLicenseModel(vlmId, user); + return Response.ok().build(); + } + + @Override + public Response actOnLicenseModel(VendorLicenseModelActionRequestDto request, String vlmId, + String user) { + + switch (request.getAction()) { + case Checkout: + vendorLicenseManager.checkout(vlmId, user); + break; + case Undo_Checkout: + vendorLicenseManager.undoCheckout(vlmId, user); + break; + case Checkin: + vendorLicenseManager.checkin(vlmId, user); + break; + case Submit: + vendorLicenseManager.submit(vlmId, user); + break; + default: + } + + return Response.ok().build(); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/pom.xml new file mode 100644 index 0000000000..1b0319dcf3 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/pom.xml @@ -0,0 +1,30 @@ + + 4.0.0 + + + org.openecomp.sdc.onboarding + vendor-license-rest + 1.0.0-SNAPSHOT + ../ + + + vendor-license-rest-types + vendor-license-rest-types + + + + + + org.openecomp.sdc + openecomp-sdc-common-rest + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-vendor-license-manager + ${project.version} + + + + \ No newline at end of file diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/ChoiceOrOtherDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/ChoiceOrOtherDto.java new file mode 100644 index 0000000000..ba8f57f79f --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/ChoiceOrOtherDto.java @@ -0,0 +1,75 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.types; + +import org.hibernate.validator.group.GroupSequenceProvider; +import org.openecomp.sdcrests.vendorlicense.types.validation.ChoiceOrOtherSequenceProvider; +import org.openecomp.sdcrests.vendorlicense.types.validation.OtherChoiceValidation; + +import javax.validation.constraints.NotNull; + +@GroupSequenceProvider(value = ChoiceOrOtherSequenceProvider.class) +public class ChoiceOrOtherDto> { + @NotNull + private E choice; + @NotNull(message = "may not be null when choice is set to 'Other'.", + groups = OtherChoiceValidation.class) + private String other; + + public E getChoice() { + return choice; + } + + public void setChoice(E choice) { + this.choice = choice; + } + + public String getOther() { + return other; + } + + public void setOther(String other) { + this.other = other; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null || getClass() != obj.getClass()) { + return false; + } + + ChoiceOrOtherDto that = (ChoiceOrOtherDto) obj; + + return choice != null ? choice.equals(that.choice) + : that.choice == null && (other != null ? other.equals(that.other) : that.other == null); + + } + + @Override + public int hashCode() { + int result = choice != null ? choice.hashCode() : 0; + result = 31 * result + (other != null ? other.hashCode() : 0); + return result; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/EntitlementPoolEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/EntitlementPoolEntityDto.java new file mode 100644 index 0000000000..5ed40b00b7 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/EntitlementPoolEntityDto.java @@ -0,0 +1,48 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.types; + + +import io.swagger.annotations.ApiModel; + +import java.util.Set; + +@ApiModel(value = "EntitlementPoolEntity") +public class EntitlementPoolEntityDto extends EntitlementPoolRequestDto { + private String id; + private Set referencingFeatureGroups; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Set getReferencingFeatureGroups() { + return referencingFeatureGroups; + } + + public void setReferencingFeatureGroups(Set referencingFeatureGroups) { + this.referencingFeatureGroups = referencingFeatureGroups; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/EntitlementPoolRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/EntitlementPoolRequestDto.java new file mode 100644 index 0000000000..b70504e20e --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/EntitlementPoolRequestDto.java @@ -0,0 +1,144 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.types; + +import io.swagger.annotations.ApiModel; +import org.openecomp.sdc.vendorlicense.dao.types.AggregationFunction; +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementMetric; +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementTime; +import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope; +import org.openecomp.sdc.vendorlicense.dao.types.ThresholdUnit; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; + +@ApiModel(value = "EntitlementPoolRequest") +public class EntitlementPoolRequestDto { + + @NotNull + @Size(max = 120) + private String name; + @NotNull + @Size(max = 1000) + private String description; + @NotNull + private int thresholdValue; + @NotNull + private ThresholdUnit thresholdUnits; + @NotNull + @Valid + private ChoiceOrOtherDto entitlementMetric; + @Size(max = 120) + private String increments; + @NotNull + @Valid + private ChoiceOrOtherDto aggregationFunction; + @NotNull + @Valid + private MultiChoiceOrOtherDto operationalScope; + @NotNull + @Valid + private ChoiceOrOtherDto time; + @NotNull + @Size(max = 100) + private String manufacturerReferenceNumber; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public int getThresholdValue() { + return thresholdValue; + } + + public void setThresholdValue(int thresholdValue) { + this.thresholdValue = thresholdValue; + } + + public ThresholdUnit getThresholdUnits() { + return thresholdUnits; + } + + public void setThresholdUnits(ThresholdUnit thresholdUnits) { + this.thresholdUnits = thresholdUnits; + } + + public ChoiceOrOtherDto getEntitlementMetric() { + return entitlementMetric; + } + + public void setEntitlementMetric(ChoiceOrOtherDto entitlementMetric) { + this.entitlementMetric = entitlementMetric; + } + + public String getIncrements() { + return increments; + } + + public void setIncrements(String increments) { + this.increments = increments; + } + + public ChoiceOrOtherDto getAggregationFunction() { + return aggregationFunction; + } + + public void setAggregationFunction(ChoiceOrOtherDto aggregationFunction) { + this.aggregationFunction = aggregationFunction; + } + + public MultiChoiceOrOtherDto getOperationalScope() { + return operationalScope; + } + + public void setOperationalScope(MultiChoiceOrOtherDto operationalScope) { + this.operationalScope = operationalScope; + } + + public ChoiceOrOtherDto getTime() { + return time; + } + + public void setTime(ChoiceOrOtherDto time) { + this.time = time; + } + + public String getManufacturerReferenceNumber() { + return manufacturerReferenceNumber; + } + + public void setManufacturerReferenceNumber(String manufacturerReferenceNumber) { + this.manufacturerReferenceNumber = manufacturerReferenceNumber; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupDescriptorDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupDescriptorDto.java new file mode 100644 index 0000000000..5c1f8f2cfc --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupDescriptorDto.java @@ -0,0 +1,59 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.types; + +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; + +public class FeatureGroupDescriptorDto { + @NotNull + @Size(max = 120) + private String name; + @NotNull + @Size(max = 1000) + private String description; + @NotNull + private String partNumber; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getPartNumber() { + return partNumber; + } + + public void setPartNumber(String partNumber) { + this.partNumber = partNumber; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupEntityDto.java new file mode 100644 index 0000000000..a1d1edddcf --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupEntityDto.java @@ -0,0 +1,69 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.types; + +import io.swagger.annotations.ApiModel; + +import java.util.Set; + +import javax.validation.constraints.Size; + + +@ApiModel(value = "FeatureGroupEntity") +public class FeatureGroupEntityDto extends FeatureGroupDescriptorDto { + private String id; + private Set licenseKeyGroupsIds; + @Size(min = 1) + private Set entitlementPoolsIds; + private Set referencingLicenseAgreements; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Set getLicenseKeyGroupsIds() { + return licenseKeyGroupsIds; + } + + public void setLicenseKeyGroupsIds(Set licenseKeyGroupsIds) { + this.licenseKeyGroupsIds = licenseKeyGroupsIds; + } + + public Set getEntitlementPoolsIds() { + return entitlementPoolsIds; + } + + public void setEntitlementPoolsIds(Set entitlementPoolsIds) { + this.entitlementPoolsIds = entitlementPoolsIds; + } + + public Set getReferencingLicenseAgreements() { + return referencingLicenseAgreements; + } + + public void setReferencingLicenseAgreements(Set referencingLicenseAgreements) { + this.referencingLicenseAgreements = referencingLicenseAgreements; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupModelDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupModelDto.java new file mode 100644 index 0000000000..1572320bb1 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupModelDto.java @@ -0,0 +1,66 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.types; + +import io.swagger.annotations.ApiModel; + +import java.util.Collection; +import java.util.Set; + +@ApiModel(value = "FeatureGroupModel") +public class FeatureGroupModelDto extends FeatureGroupDescriptorDto { + private String id; + private Set referencingLicenseAgreements; + private Collection licenseKeyGroups; + private Collection entitlementPools; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Set getReferencingLicenseAgreements() { + return referencingLicenseAgreements; + } + + public void setReferencingLicenseAgreements(Set referencingLicenseAgreements) { + this.referencingLicenseAgreements = referencingLicenseAgreements; + } + + public Collection getLicenseKeyGroups() { + return licenseKeyGroups; + } + + public void setLicenseKeyGroups(Collection licenseKeyGroups) { + this.licenseKeyGroups = licenseKeyGroups; + } + + public Collection getEntitlementPools() { + return entitlementPools; + } + + public void setEntitlementPools(Collection entitlementPools) { + this.entitlementPools = entitlementPools; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupRequestDto.java new file mode 100644 index 0000000000..282e797f1b --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupRequestDto.java @@ -0,0 +1,48 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.types; + +import io.swagger.annotations.ApiModel; + +import java.util.Set; + +@ApiModel(value = "FeatureGroupRequest") +public class FeatureGroupRequestDto extends FeatureGroupDescriptorDto { + + private Set addedLicenseKeyGroupsIds; + private Set addedEntitlementPoolsIds; + + public Set getAddedLicenseKeyGroupsIds() { + return addedLicenseKeyGroupsIds; + } + + public void setAddedLicenseKeyGroupsIds(Set addedLicenseKeyGroupsIds) { + this.addedLicenseKeyGroupsIds = addedLicenseKeyGroupsIds; + } + + public Set getAddedEntitlementPoolsIds() { + return addedEntitlementPoolsIds; + } + + public void setAddedEntitlementPoolsIds(Set addedEntitlementPoolsIds) { + this.addedEntitlementPoolsIds = addedEntitlementPoolsIds; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupUpdateRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupUpdateRequestDto.java new file mode 100644 index 0000000000..002e48bb2c --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupUpdateRequestDto.java @@ -0,0 +1,48 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.types; + +import io.swagger.annotations.ApiModel; + +import java.util.Set; + +@ApiModel(value = "FeatureGroupUpdateRequest") +public class FeatureGroupUpdateRequestDto extends FeatureGroupRequestDto { + + private Set removedLicenseKeyGroupsIds; + private Set removedEntitlementPoolsIds; + + public Set getRemovedLicenseKeyGroupsIds() { + return removedLicenseKeyGroupsIds; + } + + public void setRemovedLicenseKeyGroupsIds(Set removedLicenseKeyGroupsIds) { + this.removedLicenseKeyGroupsIds = removedLicenseKeyGroupsIds; + } + + public Set getRemovedEntitlementPoolsIds() { + return removedEntitlementPoolsIds; + } + + public void setRemovedEntitlementPoolsIds(Set removedEntitlementPoolsIds) { + this.removedEntitlementPoolsIds = removedEntitlementPoolsIds; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementDescriptorDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementDescriptorDto.java new file mode 100644 index 0000000000..acfc130ed1 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementDescriptorDto.java @@ -0,0 +1,74 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.types; + +import org.openecomp.sdc.vendorlicense.dao.types.LicenseTerm; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; + +public class LicenseAgreementDescriptorDto { + + @NotNull + @Size(max = 120) + private String name; + @NotNull + @Size(max = 1000) + private String description; + @NotNull + @Valid + private ChoiceOrOtherDto licenseTerm; + @Size(max = 1000) + private String requirementsAndConstrains; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public ChoiceOrOtherDto getLicenseTerm() { + return licenseTerm; + } + + public void setLicenseTerm(ChoiceOrOtherDto licenseTerm) { + this.licenseTerm = licenseTerm; + } + + public String getRequirementsAndConstrains() { + return requirementsAndConstrains; + } + + public void setRequirementsAndConstrains(String requirementsAndConstrains) { + this.requirementsAndConstrains = requirementsAndConstrains; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementEntityDto.java new file mode 100644 index 0000000000..b0a8f65995 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementEntityDto.java @@ -0,0 +1,51 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.types; + + +import io.swagger.annotations.ApiModel; + +import java.util.Set; +import javax.validation.constraints.Size; + + +@ApiModel(value = "LicenseAgreementEntity") +public class LicenseAgreementEntityDto extends LicenseAgreementDescriptorDto { + private String id; + @Size(min = 1) + private Set featureGroupsIds; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Set getFeatureGroupsIds() { + return featureGroupsIds; + } + + public void setFeatureGroupsIds(Set featureGroupsIds) { + this.featureGroupsIds = featureGroupsIds; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementModelDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementModelDto.java new file mode 100644 index 0000000000..a3460c321f --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementModelDto.java @@ -0,0 +1,47 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.types; + +import io.swagger.annotations.ApiModel; + +import java.util.Set; + +@ApiModel(value = "LicenseAgreementModel") +public class LicenseAgreementModelDto extends LicenseAgreementDescriptorDto { + private String id; + private Set featureGroups; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Set getFeatureGroups() { + return featureGroups; + } + + public void setFeatureGroups(Set featureGroups) { + this.featureGroups = featureGroups; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementRequestDto.java new file mode 100644 index 0000000000..3830bdb713 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementRequestDto.java @@ -0,0 +1,39 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.types; + +import io.swagger.annotations.ApiModel; + +import java.util.Set; + +@ApiModel(value = "LicenseAgreementRequest") +public class LicenseAgreementRequestDto extends LicenseAgreementDescriptorDto { + + private Set addedFeatureGroupsIds; + + public Set getAddedFeatureGroupsIds() { + return addedFeatureGroupsIds; + } + + public void setAddedFeatureGroupsIds(Set addedFeatureGroupsIds) { + this.addedFeatureGroupsIds = addedFeatureGroupsIds; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementUpdateRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementUpdateRequestDto.java new file mode 100644 index 0000000000..2590bcf519 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementUpdateRequestDto.java @@ -0,0 +1,38 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.types; + +import io.swagger.annotations.ApiModel; + +import java.util.Set; + +@ApiModel(value = "LicenseAgreementUpdateRequest") +public class LicenseAgreementUpdateRequestDto extends LicenseAgreementRequestDto { + private Set removedFeatureGroupsIds; + + public Set getRemovedFeatureGroupsIds() { + return removedFeatureGroupsIds; + } + + public void setRemovedFeatureGroupsIds(Set removedFeatureGroupsIds) { + this.removedFeatureGroupsIds = removedFeatureGroupsIds; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseKeyGroupEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseKeyGroupEntityDto.java new file mode 100644 index 0000000000..9fab60fe27 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseKeyGroupEntityDto.java @@ -0,0 +1,45 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.types; + + +import java.util.Set; + +public class LicenseKeyGroupEntityDto extends LicenseKeyGroupRequestDto { + private String id; + private Set referencingFeatureGroups; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Set getReferencingFeatureGroups() { + return referencingFeatureGroups; + } + + public void setReferencingFeatureGroups(Set referencingFeatureGroups) { + this.referencingFeatureGroups = referencingFeatureGroups; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseKeyGroupRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseKeyGroupRequestDto.java new file mode 100644 index 0000000000..0df2e3251f --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseKeyGroupRequestDto.java @@ -0,0 +1,74 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.types; + +import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyType; +import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; + +public class LicenseKeyGroupRequestDto { + @NotNull + @Size(max = 120) + private String name; + @NotNull + @Size(max = 1000) + private String description; + @NotNull + private LicenseKeyType type; + @NotNull + @Valid + private MultiChoiceOrOtherDto operationalScope; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public LicenseKeyType getType() { + return type; + } + + public void setType(LicenseKeyType type) { + this.type = type; + } + + public MultiChoiceOrOtherDto getOperationalScope() { + return operationalScope; + } + + public void setOperationalScope(MultiChoiceOrOtherDto operationalScope) { + this.operationalScope = operationalScope; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/MultiChoiceOrOtherDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/MultiChoiceOrOtherDto.java new file mode 100644 index 0000000000..5a88e4c72f --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/MultiChoiceOrOtherDto.java @@ -0,0 +1,79 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.types; + +import org.hibernate.validator.group.GroupSequenceProvider; +import org.openecomp.sdcrests.vendorlicense.types.validation.MultiChoiceOrOtherSequenceProvider; +import org.openecomp.sdcrests.vendorlicense.types.validation.OtherChoiceValidation; + +import java.util.Set; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; + + +@GroupSequenceProvider(value = MultiChoiceOrOtherSequenceProvider.class) +public class MultiChoiceOrOtherDto> { + @NotNull + @Size(min = 1, message = "must contain at least 1 choice.") + private Set choices; + @NotNull(message = "may not be null when choices is set to 'Other'.", + groups = OtherChoiceValidation.class) + private String other; + + public Set getChoices() { + return choices; + } + + public void setChoices(Set choices) { + this.choices = choices; + } + + public String getOther() { + return other; + } + + public void setOther(String other) { + this.other = other; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null || getClass() != obj.getClass()) { + return false; + } + + MultiChoiceOrOtherDto that = (MultiChoiceOrOtherDto) obj; + + return choices != null ? choices.equals(that.choices) + : that.choices == null && (other != null ? other.equals(that.other) : that.other == null); + + } + + @Override + public int hashCode() { + int result = choices != null ? choices.hashCode() : 0; + result = 31 * result + (other != null ? other.hashCode() : 0); + return result; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelActionRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelActionRequestDto.java new file mode 100644 index 0000000000..cfae94ce35 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelActionRequestDto.java @@ -0,0 +1,36 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.types; + +import org.openecomp.sdcrests.versioning.types.VersioningAction; + +public class VendorLicenseModelActionRequestDto { + + private VersioningAction action; + + public VersioningAction getAction() { + return action; + } + + public void setAction(VersioningAction action) { + this.action = action; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelEntityDto.java new file mode 100644 index 0000000000..6c10f8fbe2 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelEntityDto.java @@ -0,0 +1,85 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.types; + +import io.swagger.annotations.ApiModel; +import org.openecomp.sdc.versioning.dao.types.VersionStatus; + + +import java.util.List; + +@ApiModel(value = "VendorLicenseModelEntity") +public class VendorLicenseModelEntityDto extends VendorLicenseModelRequestDto { + private String id; + private String version; + private VersionStatus status; + private String lockingUser; + private List viewableVersions; + private List finalVersions; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public VersionStatus getStatus() { + return status; + } + + public void setStatus(VersionStatus status) { + this.status = status; + } + + public String getLockingUser() { + return lockingUser; + } + + public void setLockingUser(String lockingUser) { + this.lockingUser = lockingUser; + } + + public List getViewableVersions() { + return viewableVersions; + } + + public void setViewableVersions(List viewableVersions) { + this.viewableVersions = viewableVersions; + } + + public List getFinalVersions() { + return finalVersions; + } + + public void setFinalVersions(List finalVersions) { + this.finalVersions = finalVersions; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelRequestDto.java new file mode 100644 index 0000000000..57b936a57f --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelRequestDto.java @@ -0,0 +1,62 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.types; + +import io.swagger.annotations.ApiModel; + +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; + +@ApiModel(value = "VendorLicenseModelRequest") +public class VendorLicenseModelRequestDto { + @NotNull + @Size(max = 25) + private String vendorName; + @NotNull + @Size(max = 1000) + private String description; + @NotNull + private String iconRef; + + public String getVendorName() { + return vendorName; + } + + public void setVendorName(String vendorName) { + this.vendorName = vendorName; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getIconRef() { + return iconRef; + } + + public void setIconRef(String iconRef) { + this.iconRef = iconRef; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/validation/ChoiceOrOtherSequenceProvider.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/validation/ChoiceOrOtherSequenceProvider.java new file mode 100644 index 0000000000..8be0ba3231 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/validation/ChoiceOrOtherSequenceProvider.java @@ -0,0 +1,45 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.types.validation; + +import org.hibernate.validator.spi.group.DefaultGroupSequenceProvider; +import org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther; +import org.openecomp.sdcrests.vendorlicense.types.ChoiceOrOtherDto; + +import java.util.ArrayList; +import java.util.List; + +public class ChoiceOrOtherSequenceProvider + implements DefaultGroupSequenceProvider { + + @Override + public List> getValidationGroups(ChoiceOrOtherDto choiceOrOther) { + List> sequence = new ArrayList<>(); + sequence.add(ChoiceOrOtherDto.class); + + if (choiceOrOther != null && choiceOrOther.getChoice() != null + && ChoiceOrOther.OTHER_ENUM_VALUE.equals(choiceOrOther.getChoice().name())) { + sequence.add(OtherChoiceValidation.class); + } + + return sequence; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/validation/MultiChoiceOrOtherSequenceProvider.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/validation/MultiChoiceOrOtherSequenceProvider.java new file mode 100644 index 0000000000..7cc9bbd2a2 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/validation/MultiChoiceOrOtherSequenceProvider.java @@ -0,0 +1,47 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.types.validation; + +import org.hibernate.validator.spi.group.DefaultGroupSequenceProvider; +import org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther; +import org.openecomp.sdcrests.vendorlicense.types.MultiChoiceOrOtherDto; + +import java.util.ArrayList; +import java.util.List; + +public class MultiChoiceOrOtherSequenceProvider + implements DefaultGroupSequenceProvider { + + @Override + public List> getValidationGroups(MultiChoiceOrOtherDto multiChoiceOrOther) { + List> sequence = new ArrayList<>(); + sequence.add(MultiChoiceOrOtherDto.class); + + if (multiChoiceOrOther != null && multiChoiceOrOther.getChoices() != null + && multiChoiceOrOther.getChoices().size() == 1 + && MultiChoiceOrOther.OTHER_ENUM_VALUE + .equals((((Enum) (multiChoiceOrOther.getChoices().iterator().next())).name()))) { + sequence.add(OtherChoiceValidation.class); + } + + return sequence; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/validation/OtherChoiceValidation.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/validation/OtherChoiceValidation.java new file mode 100644 index 0000000000..ff682dd8b5 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/validation/OtherChoiceValidation.java @@ -0,0 +1,24 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdcrests.vendorlicense.types.validation; + +public interface OtherChoiceValidation { +} -- cgit 1.2.3-korg