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-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 ++++ 23 files changed, 1333 insertions(+) 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/vendor-license-rest-types') 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