From 2fd73e60cf9ddb5b1707e18dc90712f570306ebc Mon Sep 17 00:00:00 2001 From: crusader Date: Fri, 15 Jun 2018 12:41:50 +0900 Subject: [PATCH] ing --- pom.xml | 2 +- .../central/module/infra/dao/InfraHostPortDAO.java | 10 +++------- .../infra/service/CentralInfraHostPortService.java | 12 +----------- .../module/infra/service/CentralInfraService.java | 4 ++-- 4 files changed, 7 insertions(+), 21 deletions(-) diff --git a/pom.xml b/pom.xml index 0bf06e1..1b43465 100644 --- a/pom.xml +++ b/pom.xml @@ -51,7 +51,7 @@ com.loafle.overflow commons-java - 1.0.72-SNAPSHOT + 1.0.74-SNAPSHOT diff --git a/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraHostPortDAO.java b/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraHostPortDAO.java index 3c0c98d..76ef1b2 100644 --- a/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraHostPortDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraHostPortDAO.java @@ -12,13 +12,9 @@ import org.springframework.stereotype.Repository; */ @Repository public interface InfraHostPortDAO extends JpaRepository { - List findAllByInfraHostId(Long infraHostId); + List findAllByInfraHostIPId(Long infraHostIPId); - List findAllByInfraHostIdAndMetaPortTypeId(Long infraHostId, Short metaPortTypeId); - - InfraHostPort findByInfraHostIdAndMetaPortTypeKeyAndPort(Long infraHostId, String metaPortTypeKey, Integer port); - - InfraHostPort findByInfraHostInfraZoneIdAndMetaPortTypeKeyAndPort(Long infraHostInfraZoneId, String metaPortTypeKey, - Integer port); + List findAllByInfraHostIPIdAndMetaPortTypeId(Long infraHostIPId, Short metaPortTypeId); + InfraHostPort findByInfraHostIPIdAndMetaPortTypeKeyAndPort(Long infraHostIPId, String metaPortTypeKey, Integer port); } \ No newline at end of file diff --git a/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraHostPortService.java b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraHostPortService.java index 7a193cf..0238d5e 100644 --- a/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraHostPortService.java +++ b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraHostPortService.java @@ -68,17 +68,7 @@ public class CentralInfraHostPortService implements InfraHostPortService { public InfraHostPort readByInfraHostIPIDAndMetaPortTypeKeyAndPort(Long infraHostIPID, String metaPortTypeKey, Integer port) throws OverflowException { - return this.infraHostPortDAO.findByInfraHostIdAndMetaPortTypeKeyAndPort(infraHostIPID, metaPortTypeKey, port); + return this.infraHostPortDAO.findByInfraHostIPIdAndMetaPortTypeKeyAndPort(infraHostIPID, metaPortTypeKey, port); } - public InfraHostPort readByInfraHostIDAndMetaPortTypeKeyAndPort(Long infraHostID, String metaPortTypeKey, - Integer port) throws OverflowException { - return this.infraHostPortDAO.findByInfraHostIdAndMetaPortTypeKeyAndPort(infraHostID, metaPortTypeKey, port); - } - - public InfraHostPort readByInfraHostInfraZoneIDAndMetaPortTypeKeyAndPort(Long infraHostInfraZoneID, - String metaPortTypeKey, Integer port) throws OverflowException { - return this.infraHostPortDAO.findByInfraHostInfraZoneIdAndMetaPortTypeKeyAndPort(infraHostInfraZoneID, - metaPortTypeKey, port); - } } diff --git a/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraService.java b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraService.java index 9ecf175..8b75491 100644 --- a/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraService.java +++ b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraService.java @@ -234,8 +234,8 @@ public class CentralInfraService implements InfraService { } infraHostIP = eInfraHostIP; - InfraHostPort eInfraHostPort = this.infraHostPortService.readByInfraHostIDAndMetaPortTypeKeyAndPort( - infraHost.getId(), infraHostPort.getMetaPortType().getKey(), infraHostPort.getPort()); + InfraHostPort eInfraHostPort = this.infraHostPortService.readByInfraHostIPIDAndMetaPortTypeKeyAndPort( + infraHostIP.getId(), infraHostPort.getMetaPortType().getKey(), infraHostPort.getPort()); if (null != eInfraHostPort) { throw new OverflowException(String.format("Port[%d(%s)] of Zone[%s].Host[%s(%s)] is not exist", host.getAddress(), infraHostPort.getMetaPortType().getName(), infraZone.getNetwork(), infraHostIP.getAddress(),