summaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin
diff options
context:
space:
mode:
authorAvi Ziv <avi.ziv@amdocs.com>2017-07-18 19:45:38 +0300
committerAvi Ziv <avi.ziv@amdocs.com>2017-07-18 19:45:38 +0300
commitb8e2faf476202b6ffe61bc3a9a37df1304881d40 (patch)
treef78b8c0517d8e16c5ae610bf8b49f68ea8a312a1 /openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin
parent75aacbbe1acf78fa53378f07f0a8c7769449a17e (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-plugin')
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/pom.xml8
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/ElementCollaborationStore.java4
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/ElementRepository.java2
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/CassandraElementRepository.java9
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/main/CassandraCollaborationStorePluginImpl.java12
5 files changed, 30 insertions, 5 deletions
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/pom.xml b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/pom.xml
index 57f92f1b09..b3bd790bd5 100644
--- a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/pom.xml
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/pom.xml
@@ -15,23 +15,23 @@
<dependency>
<groupId>com.amdocs.zusammen</groupId>
<artifactId>zusammen-sdk</artifactId>
- <version>0.0.1</version>
+ <version>${zusammen.version}</version>
</dependency>
<dependency>
<groupId>com.amdocs.zusammen</groupId>
<artifactId>zusammen-commons-db-api</artifactId>
- <version>0.0.1</version>
+ <version>${zusammen.version}</version>
</dependency>
<dependency>
<groupId>com.amdocs.zusammen</groupId>
<artifactId>zusammen-commons-db-impl</artifactId>
- <version>0.0.1</version>
+ <version>${zusammen.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.amdocs.zusammen.plugin</groupId>
<artifactId>zusammen-state-store-cassandra-plugin</artifactId>
- <version>0.0.1</version>
+ <version>${zusammen.version}</version>
</dependency>
</dependencies>
</project>
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/ElementCollaborationStore.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/ElementCollaborationStore.java
index 93ee2d058b..76b0a900c1 100644
--- a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/ElementCollaborationStore.java
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/ElementCollaborationStore.java
@@ -78,6 +78,10 @@ public class ElementCollaborationStore {
ZusammenPluginUtil.getElementEntity(element));
}
+ public boolean checkHealth(SessionContext sessionContext){
+ return getElementRepository(sessionContext).checkHealth(sessionContext);
+ }
+
private void deleteElementHierarchy(ElementRepository elementRepository, SessionContext context,
ElementEntityContext elementEntityContext,
ElementEntity elementEntity) {
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/ElementRepository.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/ElementRepository.java
index 468b6f0a28..967814c4d8 100644
--- a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/ElementRepository.java
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/ElementRepository.java
@@ -22,4 +22,6 @@ public interface ElementRepository {
void createNamespace(SessionContext context, ElementEntityContext elementContext,
ElementEntity element);
+
+ boolean checkHealth(SessionContext context);
}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/CassandraElementRepository.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/CassandraElementRepository.java
index 12fd2dabba..c19e8799d1 100644
--- a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/CassandraElementRepository.java
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/CassandraElementRepository.java
@@ -98,6 +98,12 @@ public class CassandraElementRepository implements ElementRepository {
element.getNamespace().toString());
}
+ @Override
+ public boolean checkHealth(SessionContext context) {
+ ResultSet resultSet = getVersionElementsAccessor(context).checkHealth();
+ return resultSet.getColumnDefinitions().contains("element_ids");
+ }
+
private String getVersionId(ElementEntityContext elementContext) {
return elementContext.getChangeRef() == null
? elementContext.getVersionId().toString()
@@ -350,6 +356,9 @@ CREATE TABLE IF NOT EXISTS element (
@Query("SELECT element_ids FROM version_elements WHERE space=? AND item_id=? AND version_id=?")
ResultSet get(String space, String itemId, String versionId);
+
+ @Query("SELECT element_ids FROM version_elements LIMIT 1")
+ ResultSet checkHealth();
}
private static final class VersionElementsField {
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/main/CassandraCollaborationStorePluginImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/main/CassandraCollaborationStorePluginImpl.java
index 4bf9a8d25e..90fd3366fe 100644
--- a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/main/CassandraCollaborationStorePluginImpl.java
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/main/CassandraCollaborationStorePluginImpl.java
@@ -17,6 +17,7 @@
package org.openecomp.core.zusammen.plugin.main;
import com.amdocs.zusammen.commons.health.data.HealthInfo;
+import com.amdocs.zusammen.commons.health.data.HealthStatus;
import com.amdocs.zusammen.datatypes.Id;
import com.amdocs.zusammen.datatypes.Namespace;
import com.amdocs.zusammen.datatypes.SessionContext;
@@ -155,6 +156,15 @@ public class CassandraCollaborationStorePluginImpl implements CollaborationStore
@Override
public Response<HealthInfo> checkHealth(SessionContext sessionContext) throws ZusammenException {
- return null;
+
+ boolean health = elementCollaborationStore.checkHealth(sessionContext);
+ HealthInfo healthInfo ;
+ if (health){
+ healthInfo = new HealthInfo("Collaboration", HealthStatus.UP,"");
+ } else {
+ healthInfo = new HealthInfo("Collaboration", HealthStatus.DOWN,"No Schema Available");
+ }
+ return new Response<HealthInfo>(healthInfo);
+
}
} \ No newline at end of file