diff options
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-versioning-lib')
4 files changed, 27 insertions, 0 deletions
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 ee58902a49..c83ebff818 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 @@ -17,4 +17,6 @@ public interface ItemManager { void updateVersionStatus(String itemId, VersionStatus addedVersionStatus, VersionStatus removedVersionStatus); + 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/types/Item.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/Item.java index 2a95c05f49..d572373d44 100644 --- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/Item.java +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/Item.java @@ -11,6 +11,7 @@ public class Item { private String id; private String type; private String name; + private String owner; private String description; private Map<String, Object> properties = new HashMap<>(); private Map<VersionStatus, Integer> versionStatusCounters = new EnumMap<>(VersionStatus.class); @@ -41,6 +42,14 @@ public class Item { this.name = name; } + public String getOwner() { + return owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + public String getDescription() { return description; } 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); + } } |