diff --git a/pom.xml b/pom.xml index b3dc611..67c5550 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ com.loafle.overflow commons-java - 1.0.38-SNAPSHOT + 1.0.43-SNAPSHOT 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 5ba8027..c8f5760 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 @@ -24,7 +24,6 @@ import com.loafle.overflow.model.meta.MetaPortType; import com.loafle.overflow.model.meta.MetaTargetHostType; import com.loafle.overflow.model.meta.MetaTargetZoneType; import com.loafle.overflow.model.noauthprobe.NoAuthProbeDescription; -import com.loafle.overflow.model.noauthprobe.NoAuthProbeDescriptionNetwork; import com.loafle.overflow.service.central.infra.InfraService; import com.loafle.overflow.service.central.probe.ProbeService; @@ -273,22 +272,24 @@ public class CentralInfraService implements InfraService { public InfraHost registByNoAuthProbe(Long probeID, NoAuthProbeDescription noAuthProbeDescription) throws OverflowException { - NoAuthProbeDescriptionNetwork networkInfo = noAuthProbeDescription.getNetwork(); - InfraHostIP infraHostIP = new InfraHostIP(); - // FIXME getting IPType from networkInfo - infraHostIP.setMetaIPType(new MetaIPType((short) 1)); - infraHostIP.setAddress(networkInfo.getAddress()); - infraHostIP.setMac(networkInfo.getMacAddress()); - List infraHostIPs = new ArrayList<>(); - infraHostIPs.add(infraHostIP); + // NoAuthProbeDescriptionNetwork networkInfo = noAuthProbeDescription.getNetwork(); + // InfraHostIP infraHostIP = new InfraHostIP(); + // // FIXME getting IPType from networkInfo + // infraHostIP.setMetaIPType(new MetaIPType((short) 1)); + // infraHostIP.setAddress(networkInfo.getAddress()); + // infraHostIP.setMac(networkInfo.getMacAddress()); + // List infraHostIPs = new ArrayList<>(); + // infraHostIPs.add(infraHostIP); - InfraHost infraHost = new InfraHost(); - infraHost.setProbe(new Probe(probeID)); - infraHost.setMetaInfraType(MetaInfraType.Enum.HOST.to()); - infraHost.setMetaTargetHostType(new MetaTargetHostType(1)); - infraHost.setInfraHostIPs(infraHostIPs); + // InfraHost infraHost = new InfraHost(); + // infraHost.setProbe(new Probe(probeID)); + // infraHost.setMetaInfraType(MetaInfraType.Enum.HOST.to()); + // infraHost.setMetaTargetHostType(new MetaTargetHostType(1)); + // infraHost.setInfraHostIPs(infraHostIPs); - return this.infraDAO.save(infraHost); + // return this.infraDAO.save(infraHost); + + return null; } @Override diff --git a/src/main/java/com/loafle/overflow/central/module/noauthprobe/service/CentralNoAuthProbeService.java b/src/main/java/com/loafle/overflow/central/module/noauthprobe/service/CentralNoAuthProbeService.java index 2e2891c..9f42b5f 100644 --- a/src/main/java/com/loafle/overflow/central/module/noauthprobe/service/CentralNoAuthProbeService.java +++ b/src/main/java/com/loafle/overflow/central/module/noauthprobe/service/CentralNoAuthProbeService.java @@ -135,13 +135,13 @@ public class CentralNoAuthProbeService implements NoAuthProbeService { probe.setTargetCount(0); probe.setMetaProbeStatus(new MetaProbeStatus((short) 1)); - String name = noAuthProbeDescription.getHost().getName(); + String name = noAuthProbeDescription.getInfraHost().getInfraHostOS().getName(); name += " probe"; probe.setName(name); - String addrStr = noAuthProbeDescription.getNetwork().getAddress(); - String[] addrArr = addrStr.split("\\|"); - probe.setCidr(addrArr[0]); + // String addrStr = noAuthProbeDescription.getNetwork().getAddress(); + // String[] addrArr = addrStr.split("\\|"); + // probe.setCidr(addrArr[0]); return this.probeService.regist(probe); } diff --git a/src/main/resources/local/init.sql b/src/main/resources/local/init.sql index a834fe5..94441cc 100644 --- a/src/main/resources/local/init.sql +++ b/src/main/resources/local/init.sql @@ -946,7 +946,8 @@ INSERT INTO public.infra_host_ip (id, infra_host_id, meta_ip_type_id, "address", INSERT INTO public.infra_host_port (id, infra_host_id, meta_port_type_id, port) VALUES (1, 2, 1, 5432); INSERT INTO public.infra_host_machine (id, infra_host_id, meta) VALUES (1, 2, '{"vendor": "Micro-Star International Co., Ltd.", "product": "GP60 2QF (To be filled by O.E.M.)", "version": "REV:1.0", "serial": "9S716GH21875ZF1000339"}'); -INSERT INTO public.infra_host_os (id, infra_host_id, meta) VALUES (1, 2, '{"vendor": "Ubuntu"}'); +INSERT INTO public.infra_host_os (id, infra_host_id, os, platform, platform_family, platform_version, kernel_version, host_id) VALUES (1, 2, 'linux', 'ubuntu', 'debian', '', '4.4.0-93-generic', '03000200-0400-0500-0006-000700080009'); + INSERT INTO public.infra_host_application (id, infra_host_id, "name") VALUES (1, 2, 'Apache Httpd'); INSERT INTO public.infra_host_application (id, infra_host_id, "name") VALUES (2, 2, 'PostgreSQL');