From 705fc2b672d5802696074be94b446a89d228b94d Mon Sep 17 00:00:00 2001 From: ayalaben Date: Thu, 15 Mar 2018 15:59:25 +0200 Subject: Archive Item Change-Id: Idd5eedc3b0ca9e3cc72f7de9fd432cdbbf77631d Issue-ID: SDC-1086 Signed-off-by: ayalaben --- .../openecomp/sdc/versioning/AsdcItemManager.java | 22 ++-------------------- .../org/openecomp/sdc/versioning/ItemManager.java | 6 ++++-- .../sdc/versioning/dao/types/Version.java | 2 +- .../org/openecomp/sdc/versioning/types/Item.java | 9 +++++++++ .../openecomp/sdc/versioning/types/ItemStatus.java | 6 ++++++ .../versioning/types/NotificationEventTypes.java | 2 ++ 6 files changed, 24 insertions(+), 23 deletions(-) create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/ItemStatus.java (limited to 'openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java') diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/AsdcItemManager.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/AsdcItemManager.java index a4ea65fa08..ad3d1f304c 100644 --- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/AsdcItemManager.java +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/AsdcItemManager.java @@ -16,25 +16,7 @@ package org.openecomp.sdc.versioning; -import java.util.Collection; -import java.util.function.Predicate; -import org.openecomp.sdc.versioning.dao.types.VersionStatus; -import org.openecomp.sdc.versioning.types.Item; +public interface AsdcItemManager extends ItemManager { -public interface AsdcItemManager { - - Collection list(Predicate predicate); - - Item get(String itemId); - - Item create(Item item); - - void updateVersionStatus(String itemId, VersionStatus addedVersionStatus, - VersionStatus removedVersionStatus); - - void updateOwner(String itemId, String owner); - - void updateName(String itemId, String name); - - void delete(Item item); + void updateOwner(String itemId, String owner); } diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/ItemManager.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/ItemManager.java index 41a2c12058..0448ee782f 100644 --- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/ItemManager.java +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/ItemManager.java @@ -32,9 +32,11 @@ public interface ItemManager { void updateVersionStatus(String itemId, VersionStatus addedVersionStatus, VersionStatus removedVersionStatus); - void delete(Item item); + void archive(Item item); + + void restore(Item item); - void updateName(String itemId, String name); + void delete(Item item); void update(Item item); } diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/Version.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/Version.java index b1f0b71d90..4d4c194972 100644 --- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/Version.java +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/Version.java @@ -209,7 +209,7 @@ public class Version { return major == version.major && minor == version.minor; } - public int compateTo(Version other){ + public int compareTo(Version other){ if (this.major>other.major) { return 1; } else if(this.major properties = new HashMap<>(); private Map versionStatusCounters = new EnumMap<>(VersionStatus.class); @@ -50,6 +51,14 @@ public class Item { this.owner = owner; } + public ItemStatus getStatus() { + return status; + } + + public void setStatus(ItemStatus status) { + this.status = status; + } + public String getDescription() { return description; } diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/ItemStatus.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/ItemStatus.java new file mode 100644 index 0000000000..413c5a7f29 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/ItemStatus.java @@ -0,0 +1,6 @@ +package org.openecomp.sdc.versioning.types; + +public enum ItemStatus { + ACTIVE, + ARCHIVED +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/NotificationEventTypes.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/NotificationEventTypes.java index 336db6496c..da53d8d6ed 100644 --- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/NotificationEventTypes.java +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/NotificationEventTypes.java @@ -7,6 +7,8 @@ package org.openecomp.sdc.versioning.types; public enum NotificationEventTypes { SUBMIT("submit"), DELETE("delete"), + ARCHIVE("archive"), + RESTORE("restore"), COMMIT("commit"); private String eventName; -- cgit 1.2.3-korg