From 00e935fc6b8baae4d9b9ffef2c748202a60b66b4 Mon Sep 17 00:00:00 2001
From: avigaffa <avi.gaffa@amdocs.com>
Date: Sun, 10 Sep 2017 08:58:51 +0300
Subject: Add latest bug fixes to master

Change-Id: Ieddc2330ad4e093984f14a69b52f2ca5cb465a10
Issue-ID: SDC-293
Signed-off-by: avigaffa <avi.gaffa@amdocs.com>
---
 .../sdc/vendorlicense/dao/types/LimitEntity.java   | 65 +++++++++++++---------
 .../sdc/vendorlicense/healing/HealingService.java  |  3 +-
 2 files changed, 41 insertions(+), 27 deletions(-)

(limited to 'openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main')

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/LimitEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LimitEntity.java
index e40b2988b3..58ccd5e608 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LimitEntity.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LimitEntity.java
@@ -20,6 +20,9 @@ public class LimitEntity implements VersionableEntity {
   private String unit;
   private AggregationFunction aggregationFunction;
   private String time;
+  //Defined and used only to find parent(EP/LKG) of Limit. Not to be persisted in DB and License
+  // Xmls
+  private String parent;
 
   public LimitEntity() {
   }
@@ -44,7 +47,7 @@ public class LimitEntity implements VersionableEntity {
   }
 
   public void setAggregationFunction(
-      AggregationFunction aggregationFunction) {
+          AggregationFunction aggregationFunction) {
     this.aggregationFunction = aggregationFunction;
   }
 
@@ -143,10 +146,20 @@ public class LimitEntity implements VersionableEntity {
     this.value = value;
   }
 
-   @Override
+  //Defined and used only to find parent(EP/LKG) of Limit. Not to be persisted in DB and License
+  // Xmls
+  public String getParent() {
+    return parent;
+  }
+
+  public void setParent(String parent) {
+    this.parent = parent;
+  }
+
+  @Override
   public int hashCode() {
     return Objects.hash(vendorLicenseModelId, version, epLkgId, id, name, description, type,
-        metric, unit, time, aggregationFunction, value);
+            metric, unit, time, aggregationFunction, value);
   }
 
   @Override
@@ -159,35 +172,35 @@ public class LimitEntity implements VersionableEntity {
     }
     LimitEntity that = (LimitEntity) obj;
     return Objects.equals(that.unit, unit)
-        && Objects.equals(that.value, value)
-        && Objects.equals(vendorLicenseModelId, that.vendorLicenseModelId)
-        && Objects.equals(epLkgId, that.epLkgId)
-        && Objects.equals(id, that.id)
-        && Objects.equals(name, that.name)
-        && Objects.equals(description, that.description)
-        && Objects.equals(type, that.type)
-        && Objects.equals(metric, that.metric)
-        && Objects.equals(aggregationFunction, that.aggregationFunction);
+            && Objects.equals(that.value, value)
+            && Objects.equals(vendorLicenseModelId, that.vendorLicenseModelId)
+            && Objects.equals(epLkgId, that.epLkgId)
+            && Objects.equals(id, that.id)
+            && Objects.equals(name, that.name)
+            && Objects.equals(description, that.description)
+            && Objects.equals(type, that.type)
+            && Objects.equals(metric, that.metric)
+            && Objects.equals(aggregationFunction, that.aggregationFunction);
 
   }
 
   @Override
   public String toString() {
     return "LimitEntity{"
-        + "vendorLicenseModelId='" + vendorLicenseModelId + '\''
-        + ", version=" + version
-        + ", epLkgId=" + epLkgId
-        + ", id='" + id + '\''
-        + ", name='" + name + '\''
-        + ", description='" + description + '\''
-        + ", type=" + type
-        + ", metric=" + metric
-        + ", value='" + value + '\''
-        + ", unit='" + unit + '\''
-        + ", aggregationFunction=" + aggregationFunction
-        + ", time=" + time
-
-        + '}';
+            + "vendorLicenseModelId='" + vendorLicenseModelId + '\''
+            + ", version=" + version
+            + ", epLkgId=" + epLkgId
+            + ", id='" + id + '\''
+            + ", name='" + name + '\''
+            + ", description='" + description + '\''
+            + ", type=" + type
+            + ", metric=" + metric
+            + ", value='" + value + '\''
+            + ", unit='" + unit + '\''
+            + ", aggregationFunction=" + aggregationFunction
+            + ", time=" + time
+
+            + '}';
   }
 
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/healing/HealingService.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/healing/HealingService.java
index 027cb1e5be..6ae2de1a63 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/healing/HealingService.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/healing/HealingService.java
@@ -24,8 +24,9 @@ import org.openecomp.sdc.versioning.dao.types.VersionableEntity;
 
 public interface HealingService {
 
-  //    VersionableEntity heal(VersionableEntity toHeal, String user);
   VersionableEntity heal(VersionableEntity toHeal, String user);
+
+  void persistNoHealing(VersionableEntity alreadyHealed);
 }
 
 
-- 
cgit 1.2.3-korg