diff options
author | 2017-07-18 19:45:38 +0300 | |
---|---|---|
committer | 2017-07-18 19:45:38 +0300 | |
commit | b8e2faf476202b6ffe61bc3a9a37df1304881d40 (patch) | |
tree | f78b8c0517d8e16c5ae610bf8b49f68ea8a312a1 /openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java | |
parent | 75aacbbe1acf78fa53378f07f0a8c7769449a17e (diff) |
[SDC] Onboarding 1710 rebase.
Change-Id: If3b6b81d221fde13908f1e8160db6f7d9433c535
Signed-off-by: Avi Ziv <avi.ziv@amdocs.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java')
4 files changed, 35 insertions, 9 deletions
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 f746d706e1..6381b2efd2 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 @@ -3,6 +3,7 @@ package org.openecomp.core.zusammen.db; import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element; import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo; import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement; +import com.amdocs.zusammen.commons.health.data.HealthInfo; import com.amdocs.zusammen.datatypes.Id; import com.amdocs.zusammen.datatypes.SessionContext; import com.amdocs.zusammen.datatypes.item.ElementContext; @@ -48,4 +49,8 @@ public interface ZusammenConnector { Optional<Element> saveElement(SessionContext context, ElementContext elementContext, ZusammenElement element, String message); + + Collection<HealthInfo> checkHealth(SessionContext sessionContext); + + String getVersion(SessionContext sessionContext); } diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java/org/openecomp/core/zusammen/db/impl/ZusammenConnectorFactoryImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java/org/openecomp/core/zusammen/db/impl/ZusammenConnectorFactoryImpl.java index f3916521dd..e6f9380c2b 100644 --- a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java/org/openecomp/core/zusammen/db/impl/ZusammenConnectorFactoryImpl.java +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java/org/openecomp/core/zusammen/db/impl/ZusammenConnectorFactoryImpl.java @@ -20,6 +20,7 @@ package org.openecomp.core.zusammen.db.impl; +import com.amdocs.zusammen.adaptor.inbound.api.health.HealthAdaptorFactory; import com.amdocs.zusammen.adaptor.inbound.api.item.ElementAdaptorFactory; import com.amdocs.zusammen.adaptor.inbound.api.item.ItemAdaptorFactory; import com.amdocs.zusammen.adaptor.inbound.api.item.ItemVersionAdaptorFactory; @@ -30,7 +31,7 @@ public class ZusammenConnectorFactoryImpl extends ZusammenConnectorFactory { private static final ZusammenConnector INSTANCE = new ZusammenConnectorImpl(ItemAdaptorFactory.getInstance(), ItemVersionAdaptorFactory.getInstance(), - ElementAdaptorFactory.getInstance()); + ElementAdaptorFactory.getInstance(), HealthAdaptorFactory.getInstance()); @Override public ZusammenConnector createInterface() { 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 8aa8e129df..fa08ba49a8 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 @@ -3,9 +3,11 @@ package org.openecomp.core.zusammen.db.impl; import com.amdocs.zusammen.adaptor.inbound.api.item.ElementAdaptorFactory; import com.amdocs.zusammen.adaptor.inbound.api.item.ItemAdaptorFactory; import com.amdocs.zusammen.adaptor.inbound.api.item.ItemVersionAdaptorFactory; +import com.amdocs.zusammen.adaptor.inbound.api.health.HealthAdaptorFactory; import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element; import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo; import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement; +import com.amdocs.zusammen.commons.health.data.HealthInfo; import com.amdocs.zusammen.datatypes.Id; import com.amdocs.zusammen.datatypes.SessionContext; import com.amdocs.zusammen.datatypes.Space; @@ -33,18 +35,30 @@ public class ZusammenConnectorImpl implements ZusammenConnector { private ItemAdaptorFactory itemAdaptorFactory; private ItemVersionAdaptorFactory versionAdaptorFactory; private ElementAdaptorFactory elementAdaptorFactory; - + private HealthAdaptorFactory healthAdaptorFactory; public ZusammenConnectorImpl( ItemAdaptorFactory itemAdaptorFactory, ItemVersionAdaptorFactory versionAdaptorFactory, - ElementAdaptorFactory elementAdaptorFactory) { + ElementAdaptorFactory elementAdaptorFactory, + HealthAdaptorFactory healthAdaptorFactory) { this.itemAdaptorFactory = itemAdaptorFactory; this.versionAdaptorFactory = versionAdaptorFactory; this.elementAdaptorFactory = elementAdaptorFactory; + this.healthAdaptorFactory = healthAdaptorFactory; CassandraConnectionInitializer.setCassandraConnectionPropertiesToSystem(); } @Override + public Collection<HealthInfo> checkHealth(SessionContext sessionContext) { + return healthAdaptorFactory.createInterface(sessionContext).getHealthStatus(sessionContext); + } + + @Override + public String getVersion(SessionContext sessionContext) { + return healthAdaptorFactory.createInterface(sessionContext).getVersion(); + } + + @Override public Collection<Item> listItems(SessionContext context) { Response<Collection<Item>> response = itemAdaptorFactory.createInterface(context).list(context); 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 ad4839bd00..41ce0283a1 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 @@ -3,14 +3,10 @@ package org.openecomp.core.zusammen.impl; import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element; import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo; import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement; +import com.amdocs.zusammen.commons.health.data.HealthInfo; import com.amdocs.zusammen.datatypes.Id; import com.amdocs.zusammen.datatypes.SessionContext; -import com.amdocs.zusammen.datatypes.item.Action; -import com.amdocs.zusammen.datatypes.item.ElementContext; -import com.amdocs.zusammen.datatypes.item.Info; -import com.amdocs.zusammen.datatypes.item.Item; -import com.amdocs.zusammen.datatypes.item.ItemVersion; -import com.amdocs.zusammen.datatypes.item.ItemVersionData; +import com.amdocs.zusammen.datatypes.item.*; import com.amdocs.zusammen.datatypes.itemversion.Tag; import com.amdocs.zusammen.datatypes.response.Response; import com.amdocs.zusammen.datatypes.response.ReturnCode; @@ -219,10 +215,20 @@ public class ZusammenAdaptorImpl implements ZusammenAdaptor { connector.updateItem(context, itemId, info); } + + @Override + public Collection<HealthInfo> checkHealth(SessionContext context) { + return connector.checkHealth(context); + } + private static void sortItemVersionListByModificationTimeDescOrder( List<ItemVersion> itemVersions) { itemVersions.sort((o1, o2) -> ((Integer)o2.getId().getValue().length()) .compareTo( (o1.getId().getValue().length()))); } + @Override + public String getVersion(SessionContext sessionContext) { + return connector.getVersion(sessionContext); + } } |