diff --git a/pom.xml b/pom.xml index ebaeef2..c443ebb 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ com.loafle.overflow commons-java - 1.0.19-SNAPSHOT + 1.0.20-SNAPSHOT diff --git a/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraOSApplicationDAO.java b/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraHostApplicationDAO.java similarity index 59% rename from src/main/java/com/loafle/overflow/central/module/infra/dao/InfraOSApplicationDAO.java rename to src/main/java/com/loafle/overflow/central/module/infra/dao/InfraHostApplicationDAO.java index 7c5baad..2ed72b1 100644 --- a/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraOSApplicationDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraHostApplicationDAO.java @@ -1,6 +1,6 @@ package com.loafle.overflow.central.module.infra.dao; -import com.loafle.overflow.model.infra.InfraOSApplication; +import com.loafle.overflow.model.infra.InfraHostApplication; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; @@ -8,6 +8,6 @@ import org.springframework.stereotype.Repository; * Created by insanity on 17. 6. 23. */ @Repository -public interface InfraOSApplicationDAO extends JpaRepository { +public interface InfraHostApplicationDAO extends JpaRepository { } \ No newline at end of file diff --git a/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraMachineDAO.java b/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraHostDaemonDAO.java similarity index 62% rename from src/main/java/com/loafle/overflow/central/module/infra/dao/InfraMachineDAO.java rename to src/main/java/com/loafle/overflow/central/module/infra/dao/InfraHostDaemonDAO.java index 4455f25..d1ed59d 100644 --- a/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraMachineDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraHostDaemonDAO.java @@ -1,6 +1,6 @@ package com.loafle.overflow.central.module.infra.dao; -import com.loafle.overflow.model.infra.InfraMachine; +import com.loafle.overflow.model.infra.InfraHostDaemon; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; @@ -8,6 +8,6 @@ import org.springframework.stereotype.Repository; * Created by insanity on 17. 6. 23. */ @Repository -public interface InfraMachineDAO extends JpaRepository { +public interface InfraHostDaemonDAO extends JpaRepository { } \ No newline at end of file diff --git a/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraHostIPDAO.java b/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraHostIPDAO.java new file mode 100644 index 0000000..561e592 --- /dev/null +++ b/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraHostIPDAO.java @@ -0,0 +1,20 @@ +package com.loafle.overflow.central.module.infra.dao; + +import java.util.List; + +import com.loafle.overflow.model.infra.InfraHostIP; + +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +/** + * Created by insanity on 17. 6. 23. + */ +@Repository +public interface InfraHostIPDAO extends JpaRepository { + List findAllByInfraHostId(Long infraHostId); + List findAllByInfraHostIdAndMetaIPTypeKey(Long infraHostId, String metaIPTypeKey); + List findAllByInfraHostIdAndMac(Long infraHostId, String mac); + InfraHostIP findByInfraHostIdAndMetaIPTypeKeyAndAddress(Long infraHostId, String metaIPTypeKey, String address); + +} \ No newline at end of file diff --git a/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraOSDaemonDAO.java b/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraHostMachineDAO.java similarity index 61% rename from src/main/java/com/loafle/overflow/central/module/infra/dao/InfraOSDaemonDAO.java rename to src/main/java/com/loafle/overflow/central/module/infra/dao/InfraHostMachineDAO.java index 83de8fc..b279268 100644 --- a/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraOSDaemonDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraHostMachineDAO.java @@ -1,6 +1,6 @@ package com.loafle.overflow.central.module.infra.dao; -import com.loafle.overflow.model.infra.InfraOSDaemon; +import com.loafle.overflow.model.infra.InfraHostMachine; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; @@ -8,6 +8,6 @@ import org.springframework.stereotype.Repository; * Created by insanity on 17. 6. 23. */ @Repository -public interface InfraOSDaemonDAO extends JpaRepository { +public interface InfraHostMachineDAO extends JpaRepository { } \ No newline at end of file diff --git a/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraOSDAO.java b/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraHostOSDAO.java similarity index 64% rename from src/main/java/com/loafle/overflow/central/module/infra/dao/InfraOSDAO.java rename to src/main/java/com/loafle/overflow/central/module/infra/dao/InfraHostOSDAO.java index e1f6576..f474efe 100644 --- a/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraOSDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraHostOSDAO.java @@ -1,6 +1,6 @@ package com.loafle.overflow.central.module.infra.dao; -import com.loafle.overflow.model.infra.InfraOS; +import com.loafle.overflow.model.infra.InfraHostOS; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; @@ -8,6 +8,6 @@ import org.springframework.stereotype.Repository; * Created by insanity on 17. 6. 23. */ @Repository -public interface InfraOSDAO extends JpaRepository { +public interface InfraHostOSDAO extends JpaRepository { } \ No newline at end of file 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 new file mode 100644 index 0000000..91178e3 --- /dev/null +++ b/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraHostPortDAO.java @@ -0,0 +1,18 @@ +package com.loafle.overflow.central.module.infra.dao; + +import java.util.List; + +import com.loafle.overflow.model.infra.InfraHostPort; + +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +/** + * Created by insanity on 17. 6. 23. + */ +@Repository +public interface InfraHostPortDAO extends JpaRepository { + List findAllByInfraHostId(Long infraHostId); + List findAllByInfraHostIdAndMetaPortTypeId(Long infraHostId, Short metaPortTypeId); + InfraHostPort findByInfraHostIdAndMetaPortTypeIdAndPort(Long infraHostId, Short metaPortTypeId, Integer port); +} \ No newline at end of file diff --git a/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraOSPortDAO.java b/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraOSPortDAO.java deleted file mode 100644 index 2367be3..0000000 --- a/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraOSPortDAO.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.loafle.overflow.central.module.infra.dao; - -import com.loafle.overflow.model.infra.InfraOSPort; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.stereotype.Repository; - -/** - * Created by insanity on 17. 6. 23. - */ -@Repository -public interface InfraOSPortDAO extends JpaRepository { - InfraOSPort findByInfraOSAndPortAndPortType(Long infraOSId, Integer port, String portType); -} \ No newline at end of file diff --git a/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraZoneDAO.java b/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraZoneDAO.java new file mode 100644 index 0000000..791723e --- /dev/null +++ b/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraZoneDAO.java @@ -0,0 +1,17 @@ +package com.loafle.overflow.central.module.infra.dao; + +import java.util.List; + +import com.loafle.overflow.model.infra.InfraZone; + +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +/** + * Created by insanity on 17. 6. 23. + */ +@Repository +public interface InfraZoneDAO extends JpaRepository { + List findAllByProbeDomainId(Long probeDomainId); + List findAllByProbeId(Long probeId); +} \ No newline at end of file diff --git a/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraHostApplicationService.java b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraHostApplicationService.java new file mode 100644 index 0000000..77a6f53 --- /dev/null +++ b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraHostApplicationService.java @@ -0,0 +1,26 @@ +package com.loafle.overflow.central.module.infra.service; + +import com.loafle.overflow.central.module.infra.dao.InfraHostApplicationDAO; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.infra.InfraHostApplication; +import com.loafle.overflow.service.central.infra.InfraHostApplicationService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * Created by insanity on 17. 6. 28. + */ + +@Service("InfraHostApplicationService") +public class CentralInfraHostApplicationService implements InfraHostApplicationService { + @Autowired + InfraHostApplicationDAO infraHostApplicationDAO; + + public InfraHostApplication regist(InfraHostApplication infraHostApplication) throws OverflowException { + return this.infraHostApplicationDAO.save(infraHostApplication); + } + + public InfraHostApplication read(Long id) throws OverflowException { + return this.infraHostApplicationDAO.findById(id).get(); + } +} diff --git a/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraHostDaemonService.java b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraHostDaemonService.java new file mode 100644 index 0000000..90024fc --- /dev/null +++ b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraHostDaemonService.java @@ -0,0 +1,26 @@ +package com.loafle.overflow.central.module.infra.service; + +import com.loafle.overflow.central.module.infra.dao.InfraHostDaemonDAO; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.infra.InfraHostDaemon; +import com.loafle.overflow.service.central.infra.InfraHostDaemonService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * Created by insanity on 17. 6. 28. + */ + +@Service("InfraOSDaemonService") +public class CentralInfraHostDaemonService implements InfraHostDaemonService { + @Autowired + InfraHostDaemonDAO infraHostDaemonDAO; + + public InfraHostDaemon regist(InfraHostDaemon infraOSDaemon) throws OverflowException { + return this.infraHostDaemonDAO.save(infraOSDaemon); + } + + public InfraHostDaemon read(Long id) throws OverflowException { + return this.infraHostDaemonDAO.findById(id).get(); + } +} diff --git a/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraHostIPService.java b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraHostIPService.java new file mode 100644 index 0000000..8074f34 --- /dev/null +++ b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraHostIPService.java @@ -0,0 +1,46 @@ +package com.loafle.overflow.central.module.infra.service; + +import java.util.List; + +import com.loafle.overflow.central.module.infra.dao.InfraHostIPDAO; +import com.loafle.overflow.central.module.infra.dao.InfraHostPortDAO; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.infra.InfraHostIP; +import com.loafle.overflow.model.infra.InfraHostPort; +import com.loafle.overflow.service.central.infra.InfraHostIPService; +import com.loafle.overflow.service.central.infra.InfraHostPortService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * Created by insanity on 17. 6. 28. + */ + +@Service("InfraOSIPService") +public class CentralInfraHostIPService implements InfraHostIPService { + @Autowired + InfraHostIPDAO infraHostIPDAO; + + public InfraHostIP regist(InfraHostIP infraHostIP) throws OverflowException { + return this.infraHostIPDAO.save(infraHostIP); + } + + public InfraHostIP read(Long id) throws OverflowException { + return this.infraHostIPDAO.findById(id).get(); + } + + public List readByInfraHostID(Long infraHostID) throws OverflowException { + return this.infraHostIPDAO.findAllByInfraHostId(infraHostID); + } + + public List readByInfraHostIDAndMetaIPTypeKey(Long infraHostID, String metaIPTypeKey) + throws OverflowException { + return this.infraHostIPDAO.findAllByInfraHostIdAndMetaIPTypeKey(infraHostID, metaIPTypeKey); + } + + public InfraHostIP readByInfraHostIDAndMetaIPTypeKeyAndAddress(Long infraHostID, String metaIPTypeKey, String address) + throws OverflowException { + return this.infraHostIPDAO.findByInfraHostIdAndMetaIPTypeKeyAndAddress(infraHostID, metaIPTypeKey, address); + } + +} diff --git a/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraHostMachineService.java b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraHostMachineService.java new file mode 100644 index 0000000..63cafdd --- /dev/null +++ b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraHostMachineService.java @@ -0,0 +1,25 @@ +package com.loafle.overflow.central.module.infra.service; + +import com.loafle.overflow.central.module.infra.dao.InfraHostMachineDAO; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.infra.InfraHostMachine; +import com.loafle.overflow.service.central.infra.InfraHostMachineService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * Created by insanity on 17. 6. 28. + */ +@Service("InfraHostMachineService") +public class CentralInfraHostMachineService implements InfraHostMachineService { + @Autowired + InfraHostMachineDAO infraHostMachineDAO; + + public InfraHostMachine regist(InfraHostMachine infraHostMachine) throws OverflowException { + return this.infraHostMachineDAO.save(infraHostMachine); + } + + public InfraHostMachine read(Long id) { + return this.infraHostMachineDAO.findById(id).get(); + } +} diff --git a/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraHostOSService.java b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraHostOSService.java new file mode 100644 index 0000000..2cbffcd --- /dev/null +++ b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraHostOSService.java @@ -0,0 +1,26 @@ +package com.loafle.overflow.central.module.infra.service; + +import com.loafle.overflow.central.module.infra.dao.InfraHostOSDAO; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.infra.InfraHostOS; +import com.loafle.overflow.service.central.infra.InfraHostOSService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * Created by insanity on 17. 6. 28. + */ + +@Service("InfraHostOSService") +public class CentralInfraHostOSService implements InfraHostOSService { + @Autowired + InfraHostOSDAO infraHostOSDAO; + + public InfraHostOS regist(InfraHostOS infraHostOS) throws OverflowException { + return this.infraHostOSDAO.save(infraHostOS); + } + + public InfraHostOS read(Long id) throws OverflowException { + return this.infraHostOSDAO.findById(id).get(); + } +} 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 new file mode 100644 index 0000000..662384d --- /dev/null +++ b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraHostPortService.java @@ -0,0 +1,31 @@ +package com.loafle.overflow.central.module.infra.service; + +import com.loafle.overflow.central.module.infra.dao.InfraHostPortDAO; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.infra.InfraHostPort; +import com.loafle.overflow.service.central.infra.InfraHostPortService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * Created by insanity on 17. 6. 28. + */ + +@Service("InfraOSPortService") +public class CentralInfraHostPortService implements InfraHostPortService { + @Autowired + InfraHostPortDAO infraHostPortDAO; + + public InfraHostPort regist(InfraHostPort infraHostPort) throws OverflowException { + return this.infraHostPortDAO.save(infraHostPort); + } + + public InfraHostPort read(Long id) throws OverflowException { + return this.infraHostPortDAO.findById(id).get(); + } + + public InfraHostPort readByInfraOSIDAndPortAndPortType(Long infraOSID, Short metaPortTypeID, Integer port) + throws OverflowException { + return this.infraHostPortDAO.findByInfraHostIdAndMetaPortTypeIdAndPort(infraOSID, metaPortTypeID, port); + } +} diff --git a/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraHostService.java b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraHostService.java index 149863d..5ee5ea7 100644 --- a/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraHostService.java +++ b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraHostService.java @@ -28,4 +28,10 @@ public class CentralInfraHostService implements InfraHostService { return this.infraHostDAO.findByProbeIdAndIpv4(probeId, ip); } + @Override + public InfraHost readByProbeIdAndInfraHostIPsAddressAndMetaIPTypeKey(String probeID, String address, String ipTypeKey) + throws OverflowException { + return null; + } + } diff --git a/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraMachineService.java b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraMachineService.java deleted file mode 100644 index 946cec4..0000000 --- a/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraMachineService.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.loafle.overflow.central.module.infra.service; - -import com.loafle.overflow.central.module.infra.dao.InfraMachineDAO; -import com.loafle.overflow.core.exception.OverflowException; -import com.loafle.overflow.model.infra.InfraMachine; -import com.loafle.overflow.service.central.infra.InfraMachineService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -/** - * Created by insanity on 17. 6. 28. - */ -@Service("InfraMachineService") -public class CentralInfraMachineService implements InfraMachineService { - @Autowired - InfraMachineDAO infraMachineDAO; - - public InfraMachine regist(InfraMachine infraMachine) throws OverflowException { - return this.infraMachineDAO.save(infraMachine); - } - - public InfraMachine read(Long id) { - return this.infraMachineDAO.findById(id).get(); - } -} diff --git a/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraOSApplicationService.java b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraOSApplicationService.java deleted file mode 100644 index bd071aa..0000000 --- a/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraOSApplicationService.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.loafle.overflow.central.module.infra.service; - -import com.loafle.overflow.central.module.infra.dao.InfraOSApplicationDAO; -import com.loafle.overflow.core.exception.OverflowException; -import com.loafle.overflow.model.infra.InfraOSApplication; -import com.loafle.overflow.service.central.infra.InfraOSApplicationService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -/** - * Created by insanity on 17. 6. 28. - */ - -@Service("InfraOSApplicationService") -public class CentralInfraOSApplicationService implements InfraOSApplicationService { - @Autowired - InfraOSApplicationDAO infraOSApplicationDAO; - - public InfraOSApplication regist(InfraOSApplication infraOSApplication) throws OverflowException { - return this.infraOSApplicationDAO.save(infraOSApplication); - } - - public InfraOSApplication read(Long id) throws OverflowException { - return this.infraOSApplicationDAO.findById(id).get(); - } -} diff --git a/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraOSDaemonService.java b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraOSDaemonService.java deleted file mode 100644 index 4f13ede..0000000 --- a/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraOSDaemonService.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.loafle.overflow.central.module.infra.service; - -import com.loafle.overflow.central.module.infra.dao.InfraOSDaemonDAO; -import com.loafle.overflow.core.exception.OverflowException; -import com.loafle.overflow.model.infra.InfraOSDaemon; -import com.loafle.overflow.service.central.infra.InfraOSDaemonService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -/** - * Created by insanity on 17. 6. 28. - */ - -@Service("InfraOSDaemonService") -public class CentralInfraOSDaemonService implements InfraOSDaemonService { - @Autowired - InfraOSDaemonDAO infraOSDaemonDAO; - - public InfraOSDaemon regist(InfraOSDaemon infraOSDaemon) throws OverflowException { - return this.infraOSDaemonDAO.save(infraOSDaemon); - } - - public InfraOSDaemon read(Long id) throws OverflowException { - return this.infraOSDaemonDAO.findById(id).get(); - } -} diff --git a/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraOSPortService.java b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraOSPortService.java deleted file mode 100644 index 859fbfa..0000000 --- a/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraOSPortService.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.loafle.overflow.central.module.infra.service; - -import com.loafle.overflow.central.module.infra.dao.InfraOSPortDAO; -import com.loafle.overflow.core.exception.OverflowException; -import com.loafle.overflow.model.infra.InfraOSPort; -import com.loafle.overflow.service.central.infra.InfraOSPortService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -/** - * Created by insanity on 17. 6. 28. - */ - -@Service("InfraOSPortService") -public class CentralInfraOSPortService implements InfraOSPortService { - @Autowired - InfraOSPortDAO infraOSPortDAO; - - public InfraOSPort regist(InfraOSPort infraOSPort) throws OverflowException { - return this.infraOSPortDAO.save(infraOSPort); - } - - public InfraOSPort read(Long id) throws OverflowException { - return this.infraOSPortDAO.findById(id).get(); - } - - public InfraOSPort readByInfraOSIDAndPortAndPortType(Long infraOSID, Integer port, String portType) - throws OverflowException { - return this.infraOSPortDAO.findByInfraOSAndPortAndPortType(infraOSID, port, portType); - } -} diff --git a/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraOSService.java b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraOSService.java deleted file mode 100644 index ff2498e..0000000 --- a/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraOSService.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.loafle.overflow.central.module.infra.service; - -import com.loafle.overflow.central.module.infra.dao.InfraOSDAO; -import com.loafle.overflow.core.exception.OverflowException; -import com.loafle.overflow.model.infra.InfraOS; -import com.loafle.overflow.service.central.infra.InfraOSService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -/** - * Created by insanity on 17. 6. 28. - */ - -@Service("InfraOSService") -public class CentralInfraOSService implements InfraOSService { - @Autowired - InfraOSDAO infraOSDAO; - - public InfraOS regist(InfraOS infraOS) throws OverflowException { - return this.infraOSDAO.save(infraOS); - } - - public InfraOS read(Long id) throws OverflowException { - return this.infraOSDAO.findById(id).get(); - } -} 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 7b26807..96974ee 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 @@ -6,7 +6,12 @@ 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; import com.loafle.overflow.model.infra.Infra; +import com.loafle.overflow.model.infra.InfraHost; +import com.loafle.overflow.model.infra.InfraZone; +import com.loafle.overflow.model.noauthprobe.NoAuthProbeDescription; import com.loafle.overflow.service.central.infra.InfraService; import com.loafle.overflow.service.central.probe.ProbeService; import org.springframework.beans.factory.annotation.Autowired; @@ -15,7 +20,6 @@ import org.springframework.stereotype.Service; import java.util.List; - @Service("InfraService") public class CentralInfraService implements InfraService { @@ -51,4 +55,25 @@ public class CentralInfraService implements InfraService { return infraList; } + public InfraZone regist(Long probeID, List hosts, List services) throws OverflowException { + return null; + } + + public InfraZone regist(Long probeID, Zone zone) throws OverflowException { + return null; + } + + public InfraHost regist(Long probeID, Host host) throws OverflowException { + return null; + } + + public InfraService regist(Long probeID, com.loafle.overflow.model.discovery.Service service) + throws OverflowException { + return null; + } + + public InfraHost regist(Long probeID, NoAuthProbeDescription noAuthProbeDescription) throws OverflowException { + return null; + } + } diff --git a/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraZoneService.java b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraZoneService.java new file mode 100644 index 0000000..a549936 --- /dev/null +++ b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraZoneService.java @@ -0,0 +1,43 @@ +package com.loafle.overflow.central.module.infra.service; + +import com.loafle.overflow.central.commons.utils.PageUtil; +import com.loafle.overflow.central.module.infra.dao.InfraDAO; +import com.loafle.overflow.central.module.infra.dao.InfraZoneDAO; +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.infra.Infra; +import com.loafle.overflow.model.infra.InfraZone; +import com.loafle.overflow.service.central.infra.InfraService; +import com.loafle.overflow.service.central.infra.InfraZoneService; +import com.loafle.overflow.service.central.probe.ProbeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.stereotype.Service; + +import java.util.List; + + +@Service("InfraZoneService") +public class CentralInfraZoneService implements InfraZoneService { + + @Autowired + InfraZoneDAO infraZoneDAO; + + public InfraZone regist(InfraZone infraZone) throws OverflowException { + return this.infraZoneDAO.save(infraZone); + } + + public InfraZone read(Long id) throws OverflowException { + return this.infraZoneDAO.findById(id).get(); + } + + public List readAllByProbeID(Long probeID) throws OverflowException { + return this.infraZoneDAO.findAllByProbeId(probeID); + } + + public List readAllByDomainID(Long domainID) throws OverflowException { + return this.infraZoneDAO.findAllByProbeDomainId(domainID); + } +}