aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src
diff options
context:
space:
mode:
authorayalaben <Ayala.Benzvi@Amdocs.Com>2017-12-27 12:05:35 +0200
committerAvi Gaffa <avi.gaffa@amdocs.com>2017-12-31 08:08:20 +0000
commit5eb33aa2b4a62c60c7296e17e165b8bdf2a81016 (patch)
tree2dabefac3eef14969a533213689be24d6b5f11fc /openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src
parented9d494caf774e4340bf9ac0fbf4e4436ef9750e (diff)
Add Item Owner to item
Change-Id: I91ce289159057bd5c179c64131d74a24aa83ac9f Issue-ID: SDC-800 Signed-off-by: ayalaben <ayala.benzvi@amdocs.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src')
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/zusammen/ItemZusammenDaoImpl.java5
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/ItemManagerImpl.java11
2 files changed, 16 insertions, 0 deletions
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 8fdcf71d59..6352508e0c 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
@@ -70,6 +70,9 @@ public class ItemZusammenDaoImpl implements ItemDao {
case InfoPropertyName.ITEM_TYPE:
item.setType((String) propertyValue);
break;
+ case InfoPropertyName.ITEM_OWNER:
+ item.setOwner((String) propertyValue);
+ break;
case InfoPropertyName.ITEM_VERSIONS_STATUSES:
for (Map.Entry<String, Number> statusCounter :
((Map<String, Number>) propertyValue).entrySet()) {
@@ -87,6 +90,7 @@ public class ItemZusammenDaoImpl implements ItemDao {
info.setName(item.getName());
info.setDescription(item.getDescription());
info.addProperty(InfoPropertyName.ITEM_TYPE, item.getType());
+ info.addProperty(InfoPropertyName.ITEM_OWNER,item.getOwner());
info.addProperty(InfoPropertyName.ITEM_VERSIONS_STATUSES, item.getVersionStatusCounters());
item.getProperties().entrySet()
.forEach(property -> info.addProperty(property.getKey(), property.getValue()));
@@ -96,6 +100,7 @@ public class ItemZusammenDaoImpl implements ItemDao {
private static final class InfoPropertyName {
private static final String ITEM_TYPE = "item_type";
private static final String ITEM_VERSIONS_STATUSES = "item_versions_statuses";
+ private static final String ITEM_OWNER = "Owner";
private InfoPropertyName() {
throw new IllegalStateException("Constants class");
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 79284542fb..3e85a53ac2 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
@@ -65,4 +65,15 @@ public class ItemManagerImpl implements ItemManager {
}
itemDao.update(item);
}
+
+ @Override
+ public void updateOwner(String itemId, String owner){
+ Item item = get(itemId);
+ if (item == null) {
+ return;
+ }
+
+ item.setOwner(owner);
+ itemDao.update(item);
+ }
}