From 8e9c0653dd6c6862123c9609ae34e1206d86456e Mon Sep 17 00:00:00 2001 From: talig Date: Wed, 20 Dec 2017 14:30:43 +0200 Subject: Add collaboration feature Issue-ID: SDC-767 Change-Id: I14fb4c1f54086ed03a56a7ff7fab9ecd40381795 Signed-off-by: talig --- .../openecomp/sdc/healing/api/HealingManager.java | 14 ++++++-- .../org/openecomp/sdc/healing/dao/HealingDao.java | 13 +++++++ .../sdc/healing/factory/HealingManagerFactory.java | 2 +- .../openecomp/sdc/healing/interfaces/Healer.java | 4 +-- .../sdc/healing/types/ConfigConstants.java | 5 +++ .../openecomp/sdc/healing/types/HealerType.java | 6 ++++ .../sdc/healing/types/HealingContext.java | 41 ---------------------- 7 files changed, 38 insertions(+), 47 deletions(-) create mode 100644 openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/dao/HealingDao.java create mode 100644 openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/types/ConfigConstants.java create mode 100644 openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/types/HealerType.java delete mode 100644 openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/types/HealingContext.java (limited to 'openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src') 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 healParameters); - Optional healAll(Map healParameters); + /** + * @return healed version, if healing was not performed - Optional.empty. + */ + Optional 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 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 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; - } -} -- cgit 1.2.3-korg