infra arrange

This commit is contained in:
insanity 2017-06-23 14:39:06 +09:00
parent 47bacb0629
commit b32762c3ed
12 changed files with 331 additions and 502 deletions

View File

@ -3,7 +3,7 @@ package com.loafle.overflow.module.infra;
import com.loafle.overflow.meta.model.MetaInfraType;
import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
@ -14,7 +14,7 @@ public class Infra {
private long id;
private MetaInfraType type;
private long childId;
private Timestamp createDate;
private Date createDate;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
@ -46,13 +46,13 @@ public class Infra {
this.childId = childId;
}
@Basic
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Timestamp getCreateDate() {
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Timestamp createDate) {
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}

View File

@ -1,7 +1,7 @@
package com.loafle.overflow.module.infra;
import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
@ -10,10 +10,10 @@ import java.sql.Timestamp;
@Table(name = "INFRA_HOST", schema = "public", catalog = "postgres")
public class InfraHost {
private long id;
private long osId;
private InfraOS os;
private int ip;
private int mac;
private Timestamp createDate;
private Date createDate;
@Id
@Column(name = "ID", nullable = false)
@ -25,14 +25,14 @@ public class InfraHost {
this.id = id;
}
@Basic
@Column(name = "OS_ID", nullable = false)
public long getOsId() {
return osId;
@ManyToOne
@JoinColumn(name = "OS_ID", nullable = false)
public InfraOS getOs() {
return os;
}
public void setOsId(long osId) {
this.osId = osId;
public void setOs(InfraOS os) {
this.os = os;
}
@Basic
@ -55,39 +55,14 @@ public class InfraHost {
this.mac = mac;
}
@Basic
@Column(name = "CREATE_DATE", nullable = false)
public Timestamp getCreateDate() {
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Timestamp createDate) {
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
InfraHost that = (InfraHost) o;
if (id != that.id) return false;
if (osId != that.osId) return false;
if (ip != that.ip) return false;
if (mac != that.mac) return false;
if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;
return true;
}
@Override
public int hashCode() {
int result = (int) (id ^ (id >>> 32));
result = 31 * result + (int) (osId ^ (osId >>> 32));
result = 31 * result + ip;
result = 31 * result + mac;
result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
return result;
}
}

View File

@ -1,7 +1,9 @@
package com.loafle.overflow.module.infra;
import com.loafle.overflow.module.probe.model.Probe;
import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
@ -10,9 +12,9 @@ import java.sql.Timestamp;
@Table(name = "INFRA_MACHINE", schema = "public", catalog = "postgres")
public class InfraMachine {
private long id;
private long probeId;
private Probe probe;
private String meta;
private Timestamp createDate;
private Date createDate;
@Id
@Column(name = "ID", nullable = false)
@ -24,14 +26,14 @@ public class InfraMachine {
this.id = id;
}
@Basic
@Column(name = "PROBE_ID", nullable = false)
public long getProbeId() {
return probeId;
@ManyToOne
@JoinColumn(name = "PROBE_ID", nullable = false)
public Probe getProbe() {
return probe;
}
public void setProbeId(long probeId) {
this.probeId = probeId;
public void setProbe(Probe probe) {
this.probe = probe;
}
@Basic
@ -44,37 +46,14 @@ public class InfraMachine {
this.meta = meta;
}
@Basic
@Column(name = "CREATE_DATE", nullable = false)
public Timestamp getCreateDate() {
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Timestamp createDate) {
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
InfraMachine that = (InfraMachine) o;
if (id != that.id) return false;
if (probeId != that.probeId) return false;
if (meta != null ? !meta.equals(that.meta) : that.meta != null) return false;
if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;
return true;
}
@Override
public int hashCode() {
int result = (int) (id ^ (id >>> 32));
result = 31 * result + (int) (probeId ^ (probeId >>> 32));
result = 31 * result + (meta != null ? meta.hashCode() : 0);
result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
return result;
}
}

View File

@ -0,0 +1,70 @@
package com.loafle.overflow.module.infra;
import com.loafle.overflow.meta.model.MetaInfraVendor;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "INFRA_OS", schema = "public", catalog = "postgres")
public class InfraOS {
private long id;
private InfraMachine machine;
private String meta;
private Date createDate;
private MetaInfraVendor vendor;
@Id
@Column(name = "ID", nullable = false)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@ManyToOne
@JoinColumn(name = "MACHINE_ID", nullable = false)
public InfraMachine getMachine() {
return machine;
}
public void setMachine(InfraMachine machine) {
this.machine = machine;
}
@Basic
@Column(name = "META", nullable = true, length = 255)
public String getMeta() {
return meta;
}
public void setMeta(String meta) {
this.meta = meta;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
@ManyToOne
@JoinColumn(name = "VENDOR_ID", nullable = false)
public MetaInfraVendor getVendor() {
return vendor;
}
public void setVendor(MetaInfraVendor vendor) {
this.vendor = vendor;
}
}

View File

@ -0,0 +1,57 @@
package com.loafle.overflow.module.infra;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "INFRA_OS_APPLICATION", schema = "public", catalog = "postgres")
public class InfraOSApplication {
private long id;
private InfraOS os;
private String name;
private Date createDate;
@Id
@Column(name = "ID", nullable = false)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@ManyToOne
@JoinColumn(name = "OS_ID", nullable = false)
public InfraOS getOs() {
return os;
}
public void setOs(InfraOS os) {
this.os = os;
}
@Basic
@Column(name = "NAME", nullable = true, length = 50)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}

View File

@ -0,0 +1,56 @@
package com.loafle.overflow.module.infra;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "INFRA_OS_DAEMON", schema = "public", catalog = "postgres")
public class InfraOSDaemon {
private long id;
private InfraOS os;
private String name;
private Date createDate;
@Id
@Column(name = "ID", nullable = false)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@ManyToOne
@JoinColumn(name = "OS_ID", nullable = false)
public InfraOS getOs() {
return os;
}
public void setOs(InfraOS os) {
this.os = os;
}
@Basic
@Column(name = "NAME", nullable = true, length = 50)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}

View File

@ -0,0 +1,92 @@
package com.loafle.overflow.module.infra;
import com.loafle.overflow.meta.model.MetaInfraVendor;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "INFRA_OS_PORT", schema = "public", catalog = "postgres")
public class InfraOSPort {
private long id;
private InfraOS os;
private Date createDate;
private Integer port;
private String portType;
private MetaInfraVendor vendor;
private boolean tlsType;
@Id
@Column(name = "ID", nullable = false)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@ManyToOne
@JoinColumn(name = "OS_ID", nullable = false)
public InfraOS getOs() {
return this.os;
}
public void setOs(InfraOS os) {
this.os = os;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
@Basic
@Column(name = "PORT", nullable = true)
public Integer getPort() {
return port;
}
public void setPort(Integer port) {
this.port = port;
}
@Basic
@Column(name = "PORT_TYPE", nullable = false)
public String getPortType() {
return portType;
}
public void setPortType(String portType) {
this.portType = portType;
}
@ManyToOne
@JoinColumn(name = "VENDOR_ID", nullable = true)
public MetaInfraVendor getVendor() {
return vendor;
}
public void setVendor(MetaInfraVendor vendor) {
this.vendor = vendor;
}
@Basic
@Column(name = "TLS_TYPE", nullable = false)
public boolean isTlsType() {
return tlsType;
}
public void setTlsType(boolean tlsType) {
this.tlsType = tlsType;
}
}

View File

@ -1,93 +0,0 @@
package com.loafle.overflow.module.infra;
import javax.persistence.*;
import java.sql.Timestamp;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "INFRA_OS", schema = "public", catalog = "postgres")
public class InfraOs {
private long id;
private long machineId;
private String meta;
private Timestamp createDate;
private int vendorId;
@Id
@Column(name = "ID", nullable = false)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@Basic
@Column(name = "MACHINE_ID", nullable = false)
public long getMachineId() {
return machineId;
}
public void setMachineId(long machineId) {
this.machineId = machineId;
}
@Basic
@Column(name = "META", nullable = true, length = 255)
public String getMeta() {
return meta;
}
public void setMeta(String meta) {
this.meta = meta;
}
@Basic
@Column(name = "CREATE_DATE", nullable = false)
public Timestamp getCreateDate() {
return createDate;
}
public void setCreateDate(Timestamp createDate) {
this.createDate = createDate;
}
@Basic
@Column(name = "VENDOR_ID", nullable = false)
public int getVendorId() {
return vendorId;
}
public void setVendorId(int vendorId) {
this.vendorId = vendorId;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
InfraOs that = (InfraOs) o;
if (id != that.id) return false;
if (machineId != that.machineId) return false;
if (vendorId != that.vendorId) return false;
if (meta != null ? !meta.equals(that.meta) : that.meta != null) return false;
if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;
return true;
}
@Override
public int hashCode() {
int result = (int) (id ^ (id >>> 32));
result = 31 * result + (int) (machineId ^ (machineId >>> 32));
result = 31 * result + (meta != null ? meta.hashCode() : 0);
result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
result = 31 * result + vendorId;
return result;
}
}

View File

@ -1,80 +0,0 @@
package com.loafle.overflow.module.infra;
import javax.persistence.*;
import java.sql.Timestamp;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "INFRA_OS_APPLICATION", schema = "public", catalog = "postgres")
public class InfraOsApplication {
private long id;
private long osId;
private String name;
private Timestamp createDate;
@Id
@Column(name = "ID", nullable = false)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@Basic
@Column(name = "OS_ID", nullable = false)
public long getOsId() {
return osId;
}
public void setOsId(long osId) {
this.osId = osId;
}
@Basic
@Column(name = "NAME", nullable = true, length = 50)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Basic
@Column(name = "CREATE_DATE", nullable = false)
public Timestamp getCreateDate() {
return createDate;
}
public void setCreateDate(Timestamp createDate) {
this.createDate = createDate;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
InfraOsApplication that = (InfraOsApplication) o;
if (id != that.id) return false;
if (osId != that.osId) return false;
if (name != null ? !name.equals(that.name) : that.name != null) return false;
if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;
return true;
}
@Override
public int hashCode() {
int result = (int) (id ^ (id >>> 32));
result = 31 * result + (int) (osId ^ (osId >>> 32));
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
return result;
}
}

View File

@ -1,80 +0,0 @@
package com.loafle.overflow.module.infra;
import javax.persistence.*;
import java.sql.Timestamp;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "INFRA_OS_DAEMON", schema = "public", catalog = "postgres")
public class InfraOsDaemon {
private long id;
private long osId;
private String name;
private Timestamp createDate;
@Id
@Column(name = "ID", nullable = false)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@Basic
@Column(name = "OS_ID", nullable = false)
public long getOsId() {
return osId;
}
public void setOsId(long osId) {
this.osId = osId;
}
@Basic
@Column(name = "NAME", nullable = true, length = 50)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Basic
@Column(name = "CREATE_DATE", nullable = false)
public Timestamp getCreateDate() {
return createDate;
}
public void setCreateDate(Timestamp createDate) {
this.createDate = createDate;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
InfraOsDaemon that = (InfraOsDaemon) o;
if (id != that.id) return false;
if (osId != that.osId) return false;
if (name != null ? !name.equals(that.name) : that.name != null) return false;
if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;
return true;
}
@Override
public int hashCode() {
int result = (int) (id ^ (id >>> 32));
result = 31 * result + (int) (osId ^ (osId >>> 32));
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
return result;
}
}

View File

@ -1,119 +0,0 @@
package com.loafle.overflow.module.infra;
import javax.persistence.*;
import java.sql.Timestamp;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "INFRA_OS_PORT", schema = "public", catalog = "postgres")
public class InfraOsPort {
private long id;
private long osId;
private Timestamp createDate;
private Integer port;
private String portType;
private Integer vendorId;
private boolean tlsType;
@Id
@Column(name = "ID", nullable = false)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@Basic
@Column(name = "OS_ID", nullable = false)
public long getOsId() {
return osId;
}
public void setOsId(long osId) {
this.osId = osId;
}
@Basic
@Column(name = "CREATE_DATE", nullable = true)
public Timestamp getCreateDate() {
return createDate;
}
public void setCreateDate(Timestamp createDate) {
this.createDate = createDate;
}
@Basic
@Column(name = "PORT", nullable = true)
public Integer getPort() {
return port;
}
public void setPort(Integer port) {
this.port = port;
}
@Basic
@Column(name = "PORT_TYPE", nullable = false)
public String getPortType() {
return portType;
}
public void setPortType(String portType) {
this.portType = portType;
}
@Basic
@Column(name = "VENDOR_ID", nullable = true)
public Integer getVendorId() {
return vendorId;
}
public void setVendorId(Integer vendorId) {
this.vendorId = vendorId;
}
@Basic
@Column(name = "TLS_TYPE", nullable = false)
public boolean isTlsType() {
return tlsType;
}
public void setTlsType(boolean tlsType) {
this.tlsType = tlsType;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
InfraOsPort that = (InfraOsPort) o;
if (id != that.id) return false;
if (osId != that.osId) return false;
if (tlsType != that.tlsType) return false;
if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;
if (port != null ? !port.equals(that.port) : that.port != null) return false;
if (portType != null ? !portType.equals(that.portType) : that.portType != null) return false;
if (vendorId != null ? !vendorId.equals(that.vendorId) : that.vendorId != null) return false;
return true;
}
@Override
public int hashCode() {
int result = (int) (id ^ (id >>> 32));
result = 31 * result + (int) (osId ^ (osId >>> 32));
result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
result = 31 * result + (port != null ? port.hashCode() : 0);
result = 31 * result + (portType != null ? portType.hashCode() : 0);
result = 31 * result + (vendorId != null ? vendorId.hashCode() : 0);
result = 31 * result + (tlsType ? 1 : 0);
return result;
}
}

View File

@ -1,7 +1,9 @@
package com.loafle.overflow.module.infra;
import com.loafle.overflow.meta.model.MetaInfraVendor;
import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
@ -10,11 +12,11 @@ import java.sql.Timestamp;
@Table(name = "INFRA_SERVICE", schema = "public", catalog = "postgres")
public class InfraService {
private long id;
private long hostId;
private InfraHost host;
private String portType;
private Integer port;
private int vendorId;
private Timestamp createDate;
private MetaInfraVendor vendor;
private Date createDate;
private boolean tlsType;
@Id
@ -27,14 +29,14 @@ public class InfraService {
this.id = id;
}
@Basic
@Column(name = "HOST_ID", nullable = false)
public long getHostId() {
return hostId;
@ManyToOne
@JoinColumn(name = "HOST_ID", nullable = false)
public InfraHost getHost() {
return host;
}
public void setHostId(long hostId) {
this.hostId = hostId;
public void setHost(InfraHost host) {
this.host = host;
}
@Basic
@ -57,23 +59,23 @@ public class InfraService {
this.port = port;
}
@Basic
@Column(name = "VENDOR_ID", nullable = false)
public int getVendorId() {
return vendorId;
@ManyToOne
@JoinColumn(name = "VENDOR_ID", nullable = false)
public MetaInfraVendor getVendor() {
return vendor;
}
public void setVendorId(int vendorId) {
this.vendorId = vendorId;
public void setVendor(MetaInfraVendor vendor) {
this.vendor = vendor;
}
@Basic
@Column(name = "CREATE_DATE", nullable = false)
public Timestamp getCreateDate() {
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Timestamp createDate) {
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
@ -86,34 +88,4 @@ public class InfraService {
public void setTlsType(boolean tlsType) {
this.tlsType = tlsType;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
InfraService that = (InfraService) o;
if (id != that.id) return false;
if (hostId != that.hostId) return false;
if (vendorId != that.vendorId) return false;
if (tlsType != that.tlsType) return false;
if (portType != null ? !portType.equals(that.portType) : that.portType != null) return false;
if (port != null ? !port.equals(that.port) : that.port != null) return false;
if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;
return true;
}
@Override
public int hashCode() {
int result = (int) (id ^ (id >>> 32));
result = 31 * result + (int) (hostId ^ (hostId >>> 32));
result = 31 * result + (portType != null ? portType.hashCode() : 0);
result = 31 * result + (port != null ? port.hashCode() : 0);
result = 31 * result + vendorId;
result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
result = 31 * result + (tlsType ? 1 : 0);
return result;
}
}