diff options
author | 2020-10-09 17:48:32 +0800 | |
---|---|---|
committer | 2020-10-09 17:48:32 +0800 | |
commit | d2c6f5901291b458cc09b864c0eb140e5c636060 (patch) | |
tree | 3136e144dafa4af79ee9e5816b8c3f25ac644c62 /holmes-actions/src/main/java/org/onap | |
parent | 38107cb7956b94100cbc5a766c7bbc12dc7154a2 (diff) |
Added DB Query for Legacy Engine Instances
Issue-ID: HOLMES-365
Signed-off-by: tang peng <tang.peng5@zte.com.cn>
Change-Id: I682c0e65b3382eda5d98bffd2459303e630828ca
Diffstat (limited to 'holmes-actions/src/main/java/org/onap')
3 files changed, 10 insertions, 1 deletions
diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/engine/dao/EngineEntityDao.java b/holmes-actions/src/main/java/org/onap/holmes/common/engine/dao/EngineEntityDao.java index 42e0bf4..5ca38e0 100644 --- a/holmes-actions/src/main/java/org/onap/holmes/common/engine/dao/EngineEntityDao.java +++ b/holmes-actions/src/main/java/org/onap/holmes/common/engine/dao/EngineEntityDao.java @@ -33,6 +33,9 @@ public interface EngineEntityDao { @SqlQuery("SELECT * FROM ENGINE_ENTITY") List<EngineEntity> getAllEntities(); + @SqlQuery("SELECT DISTINCT(ENGINEINSTANCE) FROM APLUS_RULE") + List<String> getLegacyEngines(); + @SqlUpdate("INSERT INTO ENGINE_ENTITY VALUES (:id, :ip, :port, :lastModified)") void insertEntity(@BindBean EngineEntity entity); diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/engine/service/EngineEntityService.java b/holmes-actions/src/main/java/org/onap/holmes/common/engine/service/EngineEntityService.java index 0baa4de..b913f38 100644 --- a/holmes-actions/src/main/java/org/onap/holmes/common/engine/service/EngineEntityService.java +++ b/holmes-actions/src/main/java/org/onap/holmes/common/engine/service/EngineEntityService.java @@ -16,7 +16,7 @@ package org.onap.holmes.common.engine.service; -import org.glassfish.jersey.spi.Contract; +import org.jvnet.hk2.annotations.Contract; import org.onap.holmes.common.engine.entity.EngineEntity; import java.util.List; @@ -25,6 +25,7 @@ import java.util.List; public interface EngineEntityService { EngineEntity getEntity(String id); List<EngineEntity> getAllEntities(); + List<String> getLegacyEngines(); void updateEntity(EngineEntity entity); void insertEntity(EngineEntity entity); void deleteEntity(String id); diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/engine/service/impl/EngineEntityServiceImpl.java b/holmes-actions/src/main/java/org/onap/holmes/common/engine/service/impl/EngineEntityServiceImpl.java index 926af13..62d2388 100644 --- a/holmes-actions/src/main/java/org/onap/holmes/common/engine/service/impl/EngineEntityServiceImpl.java +++ b/holmes-actions/src/main/java/org/onap/holmes/common/engine/service/impl/EngineEntityServiceImpl.java @@ -46,6 +46,11 @@ public class EngineEntityServiceImpl implements EngineEntityService { } @Override + public List<String> getLegacyEngines() { + return engineEntityDao.getLegacyEngines(); + } + + @Override public void updateEntity(EngineEntity entity) { engineEntityDao.updateEntity(entity); } |