summaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src
diff options
context:
space:
mode:
authortalig <talig@amdocs.com>2017-12-20 14:30:43 +0200
committerVitaly Emporopulo <Vitaliy.Emporopulo@amdocs.com>2017-12-21 11:12:33 +0000
commit8e9c0653dd6c6862123c9609ae34e1206d86456e (patch)
tree5eeef00ec0677133baa439ca8d7ffd7aca4804b6 /openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src
parent785ebcc95de3e064e843bec04ba7a209d854fc7c (diff)
Add collaboration feature
Issue-ID: SDC-767 Change-Id: I14fb4c1f54086ed03a56a7ff7fab9ecd40381795 Signed-off-by: talig <talig@amdocs.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src')
-rw-r--r--openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/api/HealingManager.java14
-rw-r--r--openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/dao/HealingDao.java13
-rw-r--r--openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/factory/HealingManagerFactory.java2
-rw-r--r--openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/interfaces/Healer.java4
-rw-r--r--openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/types/ConfigConstants.java5
-rw-r--r--openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/types/HealerType.java6
-rw-r--r--openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/types/HealingContext.java41
7 files changed, 38 insertions, 47 deletions
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/api/HealingManager.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/api/HealingManager.java
index 211d9a21b2..ca0a3c79d7 100644
--- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/api/HealingManager.java
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/api/HealingManager.java
@@ -20,16 +20,24 @@
package org.openecomp.sdc.healing.api;
+import org.openecomp.sdc.datatypes.model.ItemType;
import org.openecomp.sdc.healing.types.HealCode;
+import org.openecomp.sdc.healing.types.HealerType;
+import org.openecomp.sdc.versioning.dao.types.Version;
-import java.util.Map;
import java.util.Optional;
/**
* Created by Talio on 11/29/2016.
*/
public interface HealingManager {
- Object heal(HealCode code, Map<String, Object> healParameters);
- Optional<String> healAll(Map<String, Object> healParameters);
+ /**
+ * @return healed version, if healing was not performed - Optional.empty.
+ */
+ Optional<Version> healItemVersion(String itemId, Version version, ItemType itemType,
+ boolean force);
+
+ Object heal(String itemId, Version version, HealerType healerType, HealCode code,
+ ItemType itemType);
}
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/dao/HealingDao.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/dao/HealingDao.java
new file mode 100644
index 0000000000..b766bd8d88
--- /dev/null
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/dao/HealingDao.java
@@ -0,0 +1,13 @@
+package org.openecomp.sdc.healing.dao;
+
+import java.util.Optional;
+
+/**
+ * Created by ayalaben on 10/17/2017
+ */
+public interface HealingDao {
+
+ Optional<Boolean> getItemHealingFlag(String space, String itemId, String versionId);
+
+ void setItemHealingFlag(boolean healingNeededFlag, String space, String itemId, String versionId);
+}
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/factory/HealingManagerFactory.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/factory/HealingManagerFactory.java
index 8e8d633b42..5e375ee046 100644
--- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/factory/HealingManagerFactory.java
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/factory/HealingManagerFactory.java
@@ -20,9 +20,9 @@
package org.openecomp.sdc.healing.factory;
-import org.openecomp.sdc.healing.api.HealingManager;
import org.openecomp.core.factory.api.AbstractComponentFactory;
import org.openecomp.core.factory.api.AbstractFactory;
+import org.openecomp.sdc.healing.api.HealingManager;
/**
* Created by Talio on 11/29/2016.
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/interfaces/Healer.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/interfaces/Healer.java
index eb2f9a74d2..38afd1342a 100644
--- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/interfaces/Healer.java
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/interfaces/Healer.java
@@ -20,11 +20,11 @@
package org.openecomp.sdc.healing.interfaces;
-import java.util.Map;
+import org.openecomp.sdc.versioning.dao.types.Version;
/**
* Created by Talio on 11/29/2016.
*/
public interface Healer {
- Object heal(Map<String, Object> healingParams) throws Exception;
+ Object heal(String itemId, Version version) throws Exception;
}
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/types/ConfigConstants.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/types/ConfigConstants.java
new file mode 100644
index 0000000000..06301279a9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/types/ConfigConstants.java
@@ -0,0 +1,5 @@
+package org.openecomp.sdc.healing.types;
+
+public class ConfigConstants {
+ public static final String HEALING_NAMESPACE = "healing";
+}
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/types/HealerType.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/types/HealerType.java
new file mode 100644
index 0000000000..3355a3cd92
--- /dev/null
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/types/HealerType.java
@@ -0,0 +1,6 @@
+package org.openecomp.sdc.healing.types;
+
+public enum HealerType {
+ data,
+ structure
+}
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/types/HealingContext.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/types/HealingContext.java
deleted file mode 100644
index 2ad143a0ec..0000000000
--- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/types/HealingContext.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package org.openecomp.sdc.healing.types;
-import org.openecomp.sdc.versioning.dao.types.Version;
-
-/**
- * Created by TALIO on 7/3/2017.
- */
-public class HealingContext {
- private String vspId;
- private Version version;
- private String user;
-
- public HealingContext(String vspId, Version version, String user) {
- this.vspId = vspId;
- this.version = version;
- this.user = user;
- }
-
- public String getVspId() {
- return vspId;
- }
-
- public void setVspId(String vspId) {
- this.vspId = vspId;
- }
-
- public Version getVersion() {
- return version;
- }
-
- public void setVersion(Version version) {
- this.version = version;
- }
-
- public String getUser() {
- return user;
- }
-
- public void setUser(String user) {
- this.user = user;
- }
-}