From da603323ec3cdf4257707ac1cb4d5d657783ae9f Mon Sep 17 00:00:00 2001 From: ayalaben Date: Sun, 11 Feb 2018 11:11:00 +0200 Subject: Delete Item Draft Change-Id: I13767ab6a7be82ae89f80d50b5857aabe6e55906 Issue-ID: SDC-1014 Signed-off-by: ayalaben --- .../src/main/java/org/openecomp/sdc/versioning/ItemManager.java | 2 ++ .../src/main/java/org/openecomp/sdc/versioning/dao/ItemDao.java | 2 ++ .../org/openecomp/sdc/versioning/types/NotificationEventTypes.java | 1 + .../sdc/versioning/dao/impl/zusammen/ItemZusammenDaoImpl.java | 5 +++++ .../main/java/org/openecomp/sdc/versioning/impl/ItemManagerImpl.java | 5 +++++ 5 files changed, 15 insertions(+) (limited to 'openecomp-be/lib/openecomp-sdc-versioning-lib') 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 c83ebff818..885d96a132 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 @@ -19,4 +19,6 @@ public interface ItemManager { void updateOwner(String itemId, String owner); + void delete(Item item); + } diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/ItemDao.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/ItemDao.java index f1edc1e0c0..9bc1d894b6 100644 --- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/ItemDao.java +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/ItemDao.java @@ -11,5 +11,7 @@ public interface ItemDao { Item create(Item item); + 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/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 b62f7b53e1..336db6496c 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 @@ -6,6 +6,7 @@ package org.openecomp.sdc.versioning.types; */ public enum NotificationEventTypes { SUBMIT("submit"), + DELETE("delete"), COMMIT("commit"); private String eventName; diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/zusammen/ItemZusammenDaoImpl.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/zusammen/ItemZusammenDaoImpl.java index 6352508e0c..5a212afc8e 100644 --- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/zusammen/ItemZusammenDaoImpl.java +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/zusammen/ItemZusammenDaoImpl.java @@ -41,6 +41,11 @@ public class ItemZusammenDaoImpl implements ItemDao { return item; } + @Override + public void delete(Item item){ + zusammenAdaptor.deleteItem(ZusammenUtil.createSessionContext(),new Id(item.getId())); + } + @Override public void update(Item item) { zusammenAdaptor diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/ItemManagerImpl.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/ItemManagerImpl.java index e46037373f..ba51b17575 100644 --- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/ItemManagerImpl.java +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/ItemManagerImpl.java @@ -76,4 +76,9 @@ public class ItemManagerImpl implements ItemManager { item.setOwner(owner); itemDao.update(item); } + + @Override + public void delete(Item item) { + itemDao.delete(item); + } } -- cgit 1.2.3-korg