diff options
author | Ben David, Elad (eb7504) <eb7504@intl.att.com> | 2020-03-17 18:12:17 +0200 |
---|---|---|
committer | Ofir Sonsino <ofir.sonsino@intl.att.com> | 2020-03-23 08:06:19 +0000 |
commit | ec7da6aea30a1b73d1e0f5f75d2b6119ed8fa251 (patch) | |
tree | de325ed98badf0aa456b52d3f10257dec26a8228 /openecomp-be/lib | |
parent | 1a64c83fc436e17f93e468f7d46ff9f5fcb081ce (diff) |
Entitlement Pool - Support Type Field
Change-Id: Ibd9996cce04849332bd23dd62e6143386cdd9a70
Issue-ID: SDC-2820
Signed-off-by: Ben David, Elad (eb7504) <eb7504@intl.att.com>
Diffstat (limited to 'openecomp-be/lib')
4 files changed, 50 insertions, 1 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolEntity.java index 4c2435a3a5..4d3c1d63a7 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolEntity.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolEntity.java @@ -57,6 +57,7 @@ public class EntitlementPoolEntity implements VersionableEntity { private String id; private String name; private String description; + private EntitlementPoolType type; @Column(name = "threshold") private Integer thresholdValue; @@ -179,6 +180,14 @@ public class EntitlementPoolEntity implements VersionableEntity { this.description = description; } + public EntitlementPoolType getType() { + return type; + } + + public void setType(EntitlementPoolType type) { + this.type = type; + } + public Integer getThresholdValue() { return thresholdValue; } @@ -311,7 +320,7 @@ public class EntitlementPoolEntity implements VersionableEntity { @Override public int hashCode() { return Objects - .hash(vendorLicenseModelId, version, id, name, description, thresholdValue, thresholdUnit, + .hash(vendorLicenseModelId, version, id, name, description, type, thresholdValue, thresholdUnit, increments, operationalScope, referencingFeatureGroups, startDate, expiryDate); } @@ -329,6 +338,7 @@ public class EntitlementPoolEntity implements VersionableEntity { && Objects.equals(id, that.id) && Objects.equals(name, that.name) && Objects.equals(description, that.description) + && type == that.type && Objects.equals(thresholdUnit, that.thresholdUnit) && Objects.equals(increments, that.increments) && Objects.equals(that.operationalScope, operationalScope) @@ -346,6 +356,7 @@ public class EntitlementPoolEntity implements VersionableEntity { + ", id='" + id + '\'' + ", name='" + name + '\'' + ", description='" + description + '\'' + + ", type=" + type + ", thresholdValue=" + thresholdValue + ", thresholdUnit='" + thresholdUnit + '\'' + ", increments='" + increments + '\'' diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolType.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolType.java new file mode 100644 index 0000000000..3b66fab110 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolType.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.sdc.vendorlicense.dao.types; + +public enum EntitlementPoolType { + Universal, + Unique, + One_Time; + + public static EntitlementPoolType permissiveValueOf(String name) { + if (name == null){ + return null; + } else { + return EntitlementPoolType.valueOf(name); + } + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/EntitlementPoolZusammenDaoImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/EntitlementPoolZusammenDaoImpl.java index aa9c249007..e084cf1c1b 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/EntitlementPoolZusammenDaoImpl.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/EntitlementPoolZusammenDaoImpl.java @@ -238,6 +238,7 @@ public class EntitlementPoolZusammenDaoImpl implements EntitlementPoolDao { info.setDescription(entitlementPool.getDescription()); info.addProperty(ElementPropertyName.elementType.name(), ElementType.EntitlementPool); info.addProperty("version_uuid", entitlementPool.getVersionUuId()); + info.addProperty("EntitlementPoolType", entitlementPool.getType()); info.addProperty("thresholdValue", entitlementPool.getThresholdValue()); info.addProperty("threshold_unit", entitlementPool.getThresholdUnit()); info.addProperty("increments", entitlementPool.getIncrements()); diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToEntitlementPoolConvertor.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToEntitlementPoolConvertor.java index 258886c601..2f06b9b0d0 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToEntitlementPoolConvertor.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToEntitlementPoolConvertor.java @@ -25,6 +25,7 @@ import com.amdocs.zusammen.datatypes.item.Info; import com.amdocs.zusammen.datatypes.item.Relation; import org.openecomp.convertor.ElementConvertor; import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity; +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolType; import org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther; import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope; import org.openecomp.sdc.vendorlicense.dao.types.ThresholdUnit; @@ -78,6 +79,7 @@ public class ElementToEntitlementPoolConvertor extends ElementConvertor { entitlementPool.setName(info.getName()); entitlementPool.setDescription(info.getDescription()); entitlementPool.setVersionUuId(info.getProperty("version_uuid")); + entitlementPool.setType(EntitlementPoolType.permissiveValueOf(info.getProperty("EntitlementPoolType"))); entitlementPool.setThresholdValue(toInteger(info.getProperty("thresholdValue"))); String thresholdUnit = info.getProperty("threshold_unit"); entitlementPool |