diff --git a/src/main/java/com/loafle/overflow/module/infra/model/Infra.java b/src/main/java/com/loafle/overflow/module/infra/model/Infra.java index 531dd23..f096692 100644 --- a/src/main/java/com/loafle/overflow/module/infra/model/Infra.java +++ b/src/main/java/com/loafle/overflow/module/infra/model/Infra.java @@ -42,11 +42,11 @@ public class Infra { @ManyToOne @JoinColumn(name = "TYPE_ID", nullable = false) - public MetaInfraType getType() { + public MetaInfraType getInfraType() { return infraType; } - public void setType(MetaInfraType infraType) { + public void setInfraType(MetaInfraType infraType) { this.infraType = infraType; } @@ -118,7 +118,7 @@ public class Infra { infraType.setId(7); } - infra.setType(infraType); + infra.setInfraType(infraType); return infra; } diff --git a/src/main/java/com/loafle/overflow/module/meta/model/MetaCrawlerInputItem.java b/src/main/java/com/loafle/overflow/module/meta/model/MetaCrawlerInputItem.java index d89253d..59a06a0 100644 --- a/src/main/java/com/loafle/overflow/module/meta/model/MetaCrawlerInputItem.java +++ b/src/main/java/com/loafle/overflow/module/meta/model/MetaCrawlerInputItem.java @@ -33,21 +33,21 @@ public class MetaCrawlerInputItem { @ManyToOne @JoinColumn(name = "TYPE_ID", nullable = false) - public MetaInputType getMetaInputType() { + public MetaInputType getInputType() { return inputType; } - public void setMetaInputType(MetaInputType inputType) { + public void setInputType(MetaInputType inputType) { this.inputType = inputType; } @ManyToOne @JoinColumn(name = "CRAWLER_ID", nullable = false) - public MetaCrawler getMetaCrawler() { + public MetaCrawler getCrawler() { return crawler; } - public void setMetaCrawler(MetaCrawler crawler) { + public void setCrawler(MetaCrawler crawler) { this.crawler = crawler; } diff --git a/src/main/java/com/loafle/overflow/module/meta/model/MetaInfraVendor.java b/src/main/java/com/loafle/overflow/module/meta/model/MetaInfraVendor.java index 8443e11..564fb73 100644 --- a/src/main/java/com/loafle/overflow/module/meta/model/MetaInfraVendor.java +++ b/src/main/java/com/loafle/overflow/module/meta/model/MetaInfraVendor.java @@ -46,11 +46,11 @@ public class MetaInfraVendor { @ManyToOne @JoinColumn(name = "TYPE_ID", nullable=false) - public MetaInfraType getMetaInfraType() { + public MetaInfraType getInfraType() { return infraType; } - public void setMetaInfraType(MetaInfraType infraType) { + public void setInfraType(MetaInfraType infraType) { this.infraType = infraType; } diff --git a/src/main/java/com/loafle/overflow/module/meta/model/MetaSensorItem.java b/src/main/java/com/loafle/overflow/module/meta/model/MetaSensorItem.java index 01c187c..64a7861 100644 --- a/src/main/java/com/loafle/overflow/module/meta/model/MetaSensorItem.java +++ b/src/main/java/com/loafle/overflow/module/meta/model/MetaSensorItem.java @@ -37,11 +37,11 @@ public class MetaSensorItem { @ManyToOne @JoinColumn(name = "TYPE_ID", nullable = false) - public MetaSensorItemType getMetaSensorItemType() { + public MetaSensorItemType getItemType() { return itemType; } - public void setMetaSensorItemType(MetaSensorItemType itemType) { + public void setItemType(MetaSensorItemType itemType) { this.itemType = itemType; } diff --git a/src/main/java/com/loafle/overflow/module/meta/model/MetaVendorCrawler.java b/src/main/java/com/loafle/overflow/module/meta/model/MetaVendorCrawler.java index 2fec27a..3873c38 100644 --- a/src/main/java/com/loafle/overflow/module/meta/model/MetaVendorCrawler.java +++ b/src/main/java/com/loafle/overflow/module/meta/model/MetaVendorCrawler.java @@ -25,21 +25,21 @@ public class MetaVendorCrawler { @ManyToOne @JoinColumn(name = "CRAWLER_ID", nullable = false) - public MetaCrawler getMetaCrawler() { + public MetaCrawler getCrawler() { return crawler; } - public void setMetaCrawler(MetaCrawler crawler) { + public void setCrawler(MetaCrawler crawler) { this.crawler = crawler; } @ManyToOne @JoinColumn(name = "VENDOR_ID", nullable = false) - public MetaInfraVendor getMetaInfraVendor() { + public MetaInfraVendor getInfraVendor() { return infraVendor; } - public void setMetaInfraVendor(MetaInfraVendor infraVendor) { + public void setInfraVendor(MetaInfraVendor infraVendor) { this.infraVendor = infraVendor; } diff --git a/src/main/java/com/loafle/overflow/module/meta/model/MetaVendorCrawlerSensorItem.java b/src/main/java/com/loafle/overflow/module/meta/model/MetaVendorCrawlerSensorItem.java index 9917295..d66eb56 100644 --- a/src/main/java/com/loafle/overflow/module/meta/model/MetaVendorCrawlerSensorItem.java +++ b/src/main/java/com/loafle/overflow/module/meta/model/MetaVendorCrawlerSensorItem.java @@ -14,7 +14,7 @@ public class MetaVendorCrawlerSensorItem { private String warnCondition; private Date createDate; private MetaSensorItem sensorItem; - private MetaInfraVendor infraVendor; + private MetaInfraVendor vendor; private short crawlerId; @Id @@ -57,45 +57,25 @@ public class MetaVendorCrawlerSensorItem { this.createDate = createDate; } -// @Basic -// @Column(name = "ITEM_ID", nullable = false) -// public int getItemId() { -// return itemId; -// } -// -// public void setItemId(int itemId) { -// this.itemId = itemId; -// } -// -// @Basic -// @Column(name = "VENDOR_ID", nullable = false) -// public int getVendorId() { -// return vendorId; -// } -// -// public void setVendorId(int vendorId) { -// this.vendorId = vendorId; -// } - @ManyToOne @JoinColumn(name = "ITEM_ID", nullable = false) - public MetaSensorItem getMetaSensorItem() { + public MetaSensorItem getSensorItem() { return sensorItem; } - public void setMetaSensorItem(MetaSensorItem sensorItem) { + public void setSensorItem(MetaSensorItem sensorItem) { this.sensorItem = sensorItem; } @ManyToOne @JoinColumn(name = "VENDOR_ID", nullable = false) - public MetaInfraVendor getMetaInfraVendor() { - return infraVendor; + public MetaInfraVendor getVendor() { + return vendor; } - public void setMetaInfraVendor(MetaInfraVendor infraVendor) { - this.infraVendor = infraVendor; + public void setVendor(MetaInfraVendor vendor) { + this.vendor = vendor; } @Basic diff --git a/src/main/java/com/loafle/overflow/module/probe/model/Probe.java b/src/main/java/com/loafle/overflow/module/probe/model/Probe.java index 92cad5b..fda96ae 100644 --- a/src/main/java/com/loafle/overflow/module/probe/model/Probe.java +++ b/src/main/java/com/loafle/overflow/module/probe/model/Probe.java @@ -15,35 +15,13 @@ import java.util.Date; @Table(name = "PROBE", schema = "public", catalog = "postgres") public class Probe { - /* - domain Domain -target count int -sensor count int -displayName String -description String -cidr String -createdDate Date -restartedDated Date -authorizedDate Date -authorizedMember Member -host InfraHost // host > infraOS > infraMachine -> Probe -probeKey String -encryptionKey String -status (Meta) - */ - private long id; private MetaProbeStatus status; private String description; private Date createDate; - private Domain domain; private String probeKey; private String encryptionKey; - -// private Date lastPollingDate; -// private Date nextPollingDate; - private int targetCount; private int sensorCount; private String displayName; @@ -180,11 +158,11 @@ status (Meta) @ManyToOne @JoinColumn(name = "HOST_ID", nullable = false) - public InfraHost getInfraHost() { + public InfraHost getHost() { return host; } - public void setInfraHost(InfraHost host) { + public void setHost(InfraHost host) { this.host = host; } } diff --git a/src/main/java/com/loafle/overflow/module/probe/model/ProbeTask.java b/src/main/java/com/loafle/overflow/module/probe/model/ProbeTask.java index 323dc6a..6f5f69d 100644 --- a/src/main/java/com/loafle/overflow/module/probe/model/ProbeTask.java +++ b/src/main/java/com/loafle/overflow/module/probe/model/ProbeTask.java @@ -34,11 +34,11 @@ public class ProbeTask { @ManyToOne @JoinColumn(name = "TYPE_ID", nullable = false) - public MetaProbeTaskType getMetaProbeTaskType() { + public MetaProbeTaskType getTaskType() { return taskType; } - public void setMetaProbeTaskType(MetaProbeTaskType taskType) { + public void setTaskType(MetaProbeTaskType taskType) { this.taskType = taskType; } diff --git a/src/test/java/com/loafle/overflow/module/infra/service/InfraServiceTest.java b/src/test/java/com/loafle/overflow/module/infra/service/InfraServiceTest.java index 95813a1..1b13451 100644 --- a/src/test/java/com/loafle/overflow/module/infra/service/InfraServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/infra/service/InfraServiceTest.java @@ -2,7 +2,6 @@ package com.loafle.overflow.module.infra.service; import com.loafle.overflow.module.infra.model.Infra; import com.loafle.overflow.module.meta.model.MetaInfraType; -import com.loafle.overflow.module.meta.model.MetaInfraVendor; import com.loafle.overflow.module.probe.model.Probe; import com.loafle.overflow.module.target.model.Target; import com.loafle.overflow.spring.AppConfig; @@ -16,8 +15,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import static org.junit.Assert.*; - /** * Created by snoop on 17. 7. 27. */ @@ -49,7 +46,7 @@ public class InfraServiceTest { metaInfraType.setId(type); Infra infra = new Infra(); - infra.setType(metaInfraType); + infra.setInfraType(metaInfraType); infra.setChildId(childId); diff --git a/src/test/java/com/loafle/overflow/module/meta/service/MetaVendorCrawlerServiceTest.java b/src/test/java/com/loafle/overflow/module/meta/service/MetaVendorCrawlerServiceTest.java index 2eaed24..35d624e 100644 --- a/src/test/java/com/loafle/overflow/module/meta/service/MetaVendorCrawlerServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/meta/service/MetaVendorCrawlerServiceTest.java @@ -15,8 +15,6 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import java.util.List; -import static org.junit.Assert.*; - /** * Created by snoop on 17. 7. 27. */ @@ -50,8 +48,8 @@ public class MetaVendorCrawlerServiceTest { MetaInfraVendor metaInfraVendor = new MetaInfraVendor(); metaInfraVendor.setId(42); - metaVendorCrawler.setMetaCrawler(metaCrawler); - metaVendorCrawler.setMetaInfraVendor(metaInfraVendor); + metaVendorCrawler.setCrawler(metaCrawler); + metaVendorCrawler.setInfraVendor(metaInfraVendor); metaVendorCrawler.setId(1); this.service.regist(metaVendorCrawler); diff --git a/src/test/java/com/loafle/overflow/module/probe/service/ProbeServiceTest.java b/src/test/java/com/loafle/overflow/module/probe/service/ProbeServiceTest.java index ca2e241..b3c6a99 100644 --- a/src/test/java/com/loafle/overflow/module/probe/service/ProbeServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/probe/service/ProbeServiceTest.java @@ -16,11 +16,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import java.util.Date; import java.util.List; -import static org.junit.Assert.*; - /** * Created by snoop on 17. 6. 28. */ @@ -66,7 +63,7 @@ public class ProbeServiceTest { InfraHost infraHost = new InfraHost(); infraHost.setId(1); - probe.setInfraHost(infraHost); + probe.setHost(infraHost); this.probeService.regist(probe); diff --git a/src/test/java/com/loafle/overflow/module/probe/service/ProbeTaskServiceTest.java b/src/test/java/com/loafle/overflow/module/probe/service/ProbeTaskServiceTest.java index a95636f..b6ce121 100644 --- a/src/test/java/com/loafle/overflow/module/probe/service/ProbeTaskServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/probe/service/ProbeTaskServiceTest.java @@ -15,8 +15,6 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import java.util.List; -import static org.junit.Assert.*; - /** * Created by snoop on 17. 6. 28. */ @@ -36,7 +34,7 @@ public class ProbeTaskServiceTest { MetaProbeTaskType typeDiscovery = new MetaProbeTaskType(); typeDiscovery.setId((short)1); - probeTask.setMetaProbeTaskType(typeDiscovery); + probeTask.setTaskType(typeDiscovery); probeTask.setData(""); Probe probe = new Probe();