some modle variables has changed.

This commit is contained in:
insanity 2017-07-28 13:34:57 +09:00
parent b9be479aa5
commit c31f9e685e
12 changed files with 31 additions and 83 deletions

View File

@ -42,11 +42,11 @@ public class Infra {
@ManyToOne @ManyToOne
@JoinColumn(name = "TYPE_ID", nullable = false) @JoinColumn(name = "TYPE_ID", nullable = false)
public MetaInfraType getType() { public MetaInfraType getInfraType() {
return infraType; return infraType;
} }
public void setType(MetaInfraType infraType) { public void setInfraType(MetaInfraType infraType) {
this.infraType = infraType; this.infraType = infraType;
} }
@ -118,7 +118,7 @@ public class Infra {
infraType.setId(7); infraType.setId(7);
} }
infra.setType(infraType); infra.setInfraType(infraType);
return infra; return infra;
} }

View File

@ -33,21 +33,21 @@ public class MetaCrawlerInputItem {
@ManyToOne @ManyToOne
@JoinColumn(name = "TYPE_ID", nullable = false) @JoinColumn(name = "TYPE_ID", nullable = false)
public MetaInputType getMetaInputType() { public MetaInputType getInputType() {
return inputType; return inputType;
} }
public void setMetaInputType(MetaInputType inputType) { public void setInputType(MetaInputType inputType) {
this.inputType = inputType; this.inputType = inputType;
} }
@ManyToOne @ManyToOne
@JoinColumn(name = "CRAWLER_ID", nullable = false) @JoinColumn(name = "CRAWLER_ID", nullable = false)
public MetaCrawler getMetaCrawler() { public MetaCrawler getCrawler() {
return crawler; return crawler;
} }
public void setMetaCrawler(MetaCrawler crawler) { public void setCrawler(MetaCrawler crawler) {
this.crawler = crawler; this.crawler = crawler;
} }

View File

@ -46,11 +46,11 @@ public class MetaInfraVendor {
@ManyToOne @ManyToOne
@JoinColumn(name = "TYPE_ID", nullable=false) @JoinColumn(name = "TYPE_ID", nullable=false)
public MetaInfraType getMetaInfraType() { public MetaInfraType getInfraType() {
return infraType; return infraType;
} }
public void setMetaInfraType(MetaInfraType infraType) { public void setInfraType(MetaInfraType infraType) {
this.infraType = infraType; this.infraType = infraType;
} }

View File

@ -37,11 +37,11 @@ public class MetaSensorItem {
@ManyToOne @ManyToOne
@JoinColumn(name = "TYPE_ID", nullable = false) @JoinColumn(name = "TYPE_ID", nullable = false)
public MetaSensorItemType getMetaSensorItemType() { public MetaSensorItemType getItemType() {
return itemType; return itemType;
} }
public void setMetaSensorItemType(MetaSensorItemType itemType) { public void setItemType(MetaSensorItemType itemType) {
this.itemType = itemType; this.itemType = itemType;
} }

View File

@ -25,21 +25,21 @@ public class MetaVendorCrawler {
@ManyToOne @ManyToOne
@JoinColumn(name = "CRAWLER_ID", nullable = false) @JoinColumn(name = "CRAWLER_ID", nullable = false)
public MetaCrawler getMetaCrawler() { public MetaCrawler getCrawler() {
return crawler; return crawler;
} }
public void setMetaCrawler(MetaCrawler crawler) { public void setCrawler(MetaCrawler crawler) {
this.crawler = crawler; this.crawler = crawler;
} }
@ManyToOne @ManyToOne
@JoinColumn(name = "VENDOR_ID", nullable = false) @JoinColumn(name = "VENDOR_ID", nullable = false)
public MetaInfraVendor getMetaInfraVendor() { public MetaInfraVendor getInfraVendor() {
return infraVendor; return infraVendor;
} }
public void setMetaInfraVendor(MetaInfraVendor infraVendor) { public void setInfraVendor(MetaInfraVendor infraVendor) {
this.infraVendor = infraVendor; this.infraVendor = infraVendor;
} }

View File

@ -14,7 +14,7 @@ public class MetaVendorCrawlerSensorItem {
private String warnCondition; private String warnCondition;
private Date createDate; private Date createDate;
private MetaSensorItem sensorItem; private MetaSensorItem sensorItem;
private MetaInfraVendor infraVendor; private MetaInfraVendor vendor;
private short crawlerId; private short crawlerId;
@Id @Id
@ -57,45 +57,25 @@ public class MetaVendorCrawlerSensorItem {
this.createDate = createDate; 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 @ManyToOne
@JoinColumn(name = "ITEM_ID", nullable = false) @JoinColumn(name = "ITEM_ID", nullable = false)
public MetaSensorItem getMetaSensorItem() { public MetaSensorItem getSensorItem() {
return sensorItem; return sensorItem;
} }
public void setMetaSensorItem(MetaSensorItem sensorItem) { public void setSensorItem(MetaSensorItem sensorItem) {
this.sensorItem = sensorItem; this.sensorItem = sensorItem;
} }
@ManyToOne @ManyToOne
@JoinColumn(name = "VENDOR_ID", nullable = false) @JoinColumn(name = "VENDOR_ID", nullable = false)
public MetaInfraVendor getMetaInfraVendor() { public MetaInfraVendor getVendor() {
return infraVendor; return vendor;
} }
public void setMetaInfraVendor(MetaInfraVendor infraVendor) { public void setVendor(MetaInfraVendor vendor) {
this.infraVendor = infraVendor; this.vendor = vendor;
} }
@Basic @Basic

View File

@ -15,35 +15,13 @@ import java.util.Date;
@Table(name = "PROBE", schema = "public", catalog = "postgres") @Table(name = "PROBE", schema = "public", catalog = "postgres")
public class Probe { 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 long id;
private MetaProbeStatus status; private MetaProbeStatus status;
private String description; private String description;
private Date createDate; private Date createDate;
private Domain domain; private Domain domain;
private String probeKey; private String probeKey;
private String encryptionKey; private String encryptionKey;
// private Date lastPollingDate;
// private Date nextPollingDate;
private int targetCount; private int targetCount;
private int sensorCount; private int sensorCount;
private String displayName; private String displayName;
@ -180,11 +158,11 @@ status (Meta)
@ManyToOne @ManyToOne
@JoinColumn(name = "HOST_ID", nullable = false) @JoinColumn(name = "HOST_ID", nullable = false)
public InfraHost getInfraHost() { public InfraHost getHost() {
return host; return host;
} }
public void setInfraHost(InfraHost host) { public void setHost(InfraHost host) {
this.host = host; this.host = host;
} }
} }

View File

@ -34,11 +34,11 @@ public class ProbeTask {
@ManyToOne @ManyToOne
@JoinColumn(name = "TYPE_ID", nullable = false) @JoinColumn(name = "TYPE_ID", nullable = false)
public MetaProbeTaskType getMetaProbeTaskType() { public MetaProbeTaskType getTaskType() {
return taskType; return taskType;
} }
public void setMetaProbeTaskType(MetaProbeTaskType taskType) { public void setTaskType(MetaProbeTaskType taskType) {
this.taskType = taskType; this.taskType = taskType;
} }

View File

@ -2,7 +2,6 @@ package com.loafle.overflow.module.infra.service;
import com.loafle.overflow.module.infra.model.Infra; import com.loafle.overflow.module.infra.model.Infra;
import com.loafle.overflow.module.meta.model.MetaInfraType; 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.probe.model.Probe;
import com.loafle.overflow.module.target.model.Target; import com.loafle.overflow.module.target.model.Target;
import com.loafle.overflow.spring.AppConfig; 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.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import static org.junit.Assert.*;
/** /**
* Created by snoop on 17. 7. 27. * Created by snoop on 17. 7. 27.
*/ */
@ -49,7 +46,7 @@ public class InfraServiceTest {
metaInfraType.setId(type); metaInfraType.setId(type);
Infra infra = new Infra(); Infra infra = new Infra();
infra.setType(metaInfraType); infra.setInfraType(metaInfraType);
infra.setChildId(childId); infra.setChildId(childId);

View File

@ -15,8 +15,6 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.util.List; import java.util.List;
import static org.junit.Assert.*;
/** /**
* Created by snoop on 17. 7. 27. * Created by snoop on 17. 7. 27.
*/ */
@ -50,8 +48,8 @@ public class MetaVendorCrawlerServiceTest {
MetaInfraVendor metaInfraVendor = new MetaInfraVendor(); MetaInfraVendor metaInfraVendor = new MetaInfraVendor();
metaInfraVendor.setId(42); metaInfraVendor.setId(42);
metaVendorCrawler.setMetaCrawler(metaCrawler); metaVendorCrawler.setCrawler(metaCrawler);
metaVendorCrawler.setMetaInfraVendor(metaInfraVendor); metaVendorCrawler.setInfraVendor(metaInfraVendor);
metaVendorCrawler.setId(1); metaVendorCrawler.setId(1);
this.service.regist(metaVendorCrawler); this.service.regist(metaVendorCrawler);

View File

@ -16,11 +16,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.util.Date;
import java.util.List; import java.util.List;
import static org.junit.Assert.*;
/** /**
* Created by snoop on 17. 6. 28. * Created by snoop on 17. 6. 28.
*/ */
@ -66,7 +63,7 @@ public class ProbeServiceTest {
InfraHost infraHost = new InfraHost(); InfraHost infraHost = new InfraHost();
infraHost.setId(1); infraHost.setId(1);
probe.setInfraHost(infraHost); probe.setHost(infraHost);
this.probeService.regist(probe); this.probeService.regist(probe);

View File

@ -15,8 +15,6 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.util.List; import java.util.List;
import static org.junit.Assert.*;
/** /**
* Created by snoop on 17. 6. 28. * Created by snoop on 17. 6. 28.
*/ */
@ -36,7 +34,7 @@ public class ProbeTaskServiceTest {
MetaProbeTaskType typeDiscovery = new MetaProbeTaskType(); MetaProbeTaskType typeDiscovery = new MetaProbeTaskType();
typeDiscovery.setId((short)1); typeDiscovery.setId((short)1);
probeTask.setMetaProbeTaskType(typeDiscovery); probeTask.setTaskType(typeDiscovery);
probeTask.setData(""); probeTask.setData("");
Probe probe = new Probe(); Probe probe = new Probe();