diff --git a/pom.xml b/pom.xml index ef2e4b2..907969d 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ com.loafle.overflow commons-java - 1.0.22-SNAPSHOT + 1.0.24-SNAPSHOT diff --git a/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraDAO.java b/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraDAO.java index 56bdd3b..1b350f1 100644 --- a/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraDAO.java @@ -1,8 +1,6 @@ package com.loafle.overflow.central.module.infra.dao; import com.loafle.overflow.model.infra.Infra; -import com.loafle.overflow.model.probe.Probe; -import com.loafle.overflow.model.target.Target; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; @@ -15,14 +13,11 @@ import java.util.List; */ @Repository public interface InfraDAO extends JpaRepository { - List findAllByProbeId(Long probeID); + List findAllByProbeId(Long probeId); - Page findAllByProbeId(Long probeID, Pageable pageable); + Page findAllByProbeId(Long probeId, Pageable pageable); - Page findAllByProbeIn(List probes, Pageable pageable); - - List findAllTargetByProbeIn(List probes); - - // Infra findByTargetId(Long targetID); + Page findAllByProbeIdIn(List probeIds, Pageable pageable); + Page findAllByProbeDomainId(Long probeDomainId, Pageable pageable); } \ No newline at end of file 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 2f0d258..6bce25d 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 @@ -4,7 +4,6 @@ import com.loafle.overflow.central.commons.utils.PageUtil; import com.loafle.overflow.central.module.infra.dao.InfraDAO; import com.loafle.overflow.core.model.PageParams; import com.loafle.overflow.model.probe.Probe; -import com.loafle.overflow.central.module.sensor.dao.SensorDAO; import com.loafle.overflow.core.exception.OverflowException; import com.loafle.overflow.model.discovery.Host; import com.loafle.overflow.model.discovery.Zone; @@ -33,9 +32,6 @@ public class CentralInfraService implements InfraService { @Autowired InfraDAO infraDAO; - @Autowired - SensorDAO sensorDAO; - @Autowired private ProbeService probeService; @@ -62,14 +58,6 @@ public class CentralInfraService implements InfraService { return infraList; } - public InfraZone regist(Long probeID, List hosts, List services) throws OverflowException { - // List targets = new ArrayList(); - // targets.addAll(registDiscoveredHostTargets(probeId, hosts)); - // targets.addAll(this.registDiscoveredServiceTargets(probeId, services)); - - return null; - } - public InfraZone regist(Long probeID, Zone zone) throws OverflowException { return null; } @@ -87,7 +75,7 @@ public class CentralInfraService implements InfraService { NoAuthProbeDescriptionNetwork networkInfo = noAuthProbeDescription.getNetwork(); InfraHostIP infraHostIP = new InfraHostIP(); // FIXME getting IPType from networkInfo - infraHostIP.setMetaIPType(new MetaIPType((short)1)); + infraHostIP.setMetaIPType(new MetaIPType((short) 1)); infraHostIP.setAddress(networkInfo.getAddress()); infraHostIP.setMac(networkInfo.getMacAddress()); List infraHostIPs = new ArrayList<>();