aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api')
-rw-r--r--openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/pom.xml22
-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
8 files changed, 60 insertions, 47 deletions
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/pom.xml b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/pom.xml
index 2900785b55..fa3533fde9 100644
--- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/pom.xml
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/pom.xml
@@ -14,6 +14,23 @@
<dependencies>
<dependency>
+ <groupId>org.openecomp.sdc.common</groupId>
+ <artifactId>openecomp-configuration-management-core</artifactId>
+ <version>${openecomp.sdc.common.version}</version>
+ <scope>runtime</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc.common</groupId>
+ <artifactId>openecomp-configuration-management-api</artifactId>
+ <version>${openecomp.sdc.common.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.openecomp.sdc.core</groupId>
<artifactId>openecomp-facade-core</artifactId>
<version>${project.version}</version>
@@ -33,6 +50,11 @@
<artifactId>openecomp-sdc-versioning-api</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-item-permissions-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
</dependencies>
</project>
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;
- }
-}