diff options
author | talig <talig@amdocs.com> | 2018-07-08 14:43:18 +0300 |
---|---|---|
committer | talig <talig@amdocs.com> | 2018-07-08 14:43:18 +0300 |
commit | fbb1e44c2e189569bffdc23504b643257808397d (patch) | |
tree | 6dcd81ada2a9c3798d66fdf7794cc16ca22402a9 /openecomp-be/lib/openecomp-core-lib | |
parent | c108dee7bd25a976dc4fa88eef3ec859facdf5d2 (diff) |
Add commands to clean zusammen data
Expose REST to clean item version data of specific user.
Add 2 commands to zusammen tool:
1. clean item data of specific user
2. delete public version
Change-Id: I8630142bf34846359153eacc1556b10acecefa05
Issue-ID: SDC-1444
Signed-off-by: talig <talig@amdocs.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-core-lib')
4 files changed, 20 insertions, 0 deletions
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-api/src/main/java/org/openecomp/core/zusammen/api/ZusammenAdaptor.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-api/src/main/java/org/openecomp/core/zusammen/api/ZusammenAdaptor.java index 23eddadbf7..ca37b2200a 100644 --- a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-api/src/main/java/org/openecomp/core/zusammen/api/ZusammenAdaptor.java +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-api/src/main/java/org/openecomp/core/zusammen/api/ZusammenAdaptor.java @@ -62,6 +62,8 @@ public interface ZusammenAdaptor { void forceSyncVersion(SessionContext context, Id itemId, Id versionId); + void cleanVersion(SessionContext context, Id itemId, Id versionId); + Optional<ElementInfo> getElementInfo(SessionContext context, ElementContext elementContext, Id elementId); diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java/org/openecomp/core/zusammen/db/ZusammenConnector.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java/org/openecomp/core/zusammen/db/ZusammenConnector.java index 1589c1a25b..fd44073bb9 100644 --- a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java/org/openecomp/core/zusammen/db/ZusammenConnector.java +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java/org/openecomp/core/zusammen/db/ZusammenConnector.java @@ -65,6 +65,8 @@ public interface ZusammenConnector { void forceSyncVersion(SessionContext context, Id itemId, Id versionId); + void cleanVersion(SessionContext context, Id itemId, Id versionId); + ItemVersionConflict getVersionConflict(SessionContext context, Id itemId, Id versionId); diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java/org/openecomp/core/zusammen/db/impl/ZusammenConnectorImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java/org/openecomp/core/zusammen/db/impl/ZusammenConnectorImpl.java index 83bbc5b49a..f8b048ce92 100644 --- a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java/org/openecomp/core/zusammen/db/impl/ZusammenConnectorImpl.java +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java/org/openecomp/core/zusammen/db/impl/ZusammenConnectorImpl.java @@ -290,6 +290,17 @@ public class ZusammenConnectorImpl implements ZusammenConnector { } @Override + public void cleanVersion(SessionContext context, Id itemId, Id versionId) { + Response<Void> response = + versionAdaptorFactory.createInterface(context).delete(context, itemId, versionId); + if (!response.isSuccessful()) { + throw new SdcRuntimeException(String.format( + "failed to clean item Version. ItemId: %s, versionId: %s, message: %s", + itemId.getValue(), versionId.getValue(), response.getReturnCode().toString())); + } + } + + @Override public ItemVersionConflict getVersionConflict(SessionContext context, Id itemId, Id versionId) { Response<ItemVersionConflict> response = versionAdaptorFactory.createInterface(context).getConflict(context, itemId, versionId); diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java/org/openecomp/core/zusammen/impl/ZusammenAdaptorImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java/org/openecomp/core/zusammen/impl/ZusammenAdaptorImpl.java index 968ff28963..1c63ff8e2e 100644 --- a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java/org/openecomp/core/zusammen/impl/ZusammenAdaptorImpl.java +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java/org/openecomp/core/zusammen/impl/ZusammenAdaptorImpl.java @@ -277,6 +277,11 @@ public class ZusammenAdaptorImpl implements ZusammenAdaptor { } @Override + public void cleanVersion(SessionContext context, Id itemId, Id versionId) { + connector.cleanVersion(context, itemId, versionId); + } + + @Override public void revert(SessionContext context, Id itemId, Id versionId, Id revisionId) { connector.revertVersionRevision(context, itemId, versionId, revisionId); } |