diff --git a/src/main/java/com/loafle/overflow/model/email/EmailAuth.java b/src/main/java/com/loafle/overflow/model/email/EmailAuth.java index 014978c..2a9f159 100644 --- a/src/main/java/com/loafle/overflow/model/email/EmailAuth.java +++ b/src/main/java/com/loafle/overflow/model/email/EmailAuth.java @@ -1,7 +1,7 @@ package com.loafle.overflow.model.email; import com.loafle.overflow.model.member.Member; -import com.loafle.overflow.model.meta.MetaEmailStatus; +import com.loafle.overflow.model.meta.MetaEmailType; import javax.persistence.*; import java.util.Date; @@ -17,7 +17,7 @@ public class EmailAuth { private Date createDate; private Date authConfirmDate; private Member member; - private MetaEmailStatus metaEmailStatus; + private MetaEmailType metaEmailType; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @@ -70,12 +70,12 @@ public class EmailAuth { } @ManyToOne - @JoinColumn(name = "META_EMAIL_STATUS_ID", nullable = false) - public MetaEmailStatus getMetaEmailStatus() { - return metaEmailStatus; + @JoinColumn(name = "META_EMAIL_TYPE_ID", nullable = false) + public MetaEmailType getMetaEmailType() { + return metaEmailType; } - public void setMetaEmailStatus(MetaEmailStatus metaEmailStatus) { - this.metaEmailStatus = metaEmailStatus; + public void setMetaEmailType(MetaEmailType metaEmailType) { + this.metaEmailType = metaEmailType; } } diff --git a/src/main/java/com/loafle/overflow/model/infra/Infra.java b/src/main/java/com/loafle/overflow/model/infra/Infra.java index 38ceb50..2473c79 100644 --- a/src/main/java/com/loafle/overflow/model/infra/Infra.java +++ b/src/main/java/com/loafle/overflow/model/infra/Infra.java @@ -11,12 +11,12 @@ import java.util.Date; @Entity(name = "INFRA") @Table(name = "INFRA", schema = "public") @Inheritance(strategy = InheritanceType.JOINED) -@DiscriminatorColumn(name = "INFRA_TYPE", discriminatorType = DiscriminatorType.INTEGER) +@DiscriminatorColumn(name = "META_INFRA_TYPE_ID", discriminatorType = DiscriminatorType.INTEGER) public abstract class Infra { private Long id; private MetaInfraType metaInfraType; - private Date createDate; private Probe probe; + private Date createDate; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @@ -38,16 +38,6 @@ public abstract class Infra { this.metaInfraType = metaInfraType; } - @Temporal(TemporalType.TIMESTAMP) - @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false) - public Date getCreateDate() { - return createDate; - } - - public void setCreateDate(Date createDate) { - this.createDate = createDate; - } - @ManyToOne @JoinColumn(name = "PROBE_ID", nullable = true) public Probe getProbe() { @@ -58,4 +48,13 @@ public abstract class Infra { this.probe = probe; } + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false) + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } } diff --git a/src/main/java/com/loafle/overflow/model/infra/InfraHost.java b/src/main/java/com/loafle/overflow/model/infra/InfraHost.java index 33bbc05..78f724b 100644 --- a/src/main/java/com/loafle/overflow/model/infra/InfraHost.java +++ b/src/main/java/com/loafle/overflow/model/infra/InfraHost.java @@ -1,7 +1,8 @@ package com.loafle.overflow.model.infra; import javax.persistence.*; -import java.util.Date; + +import com.loafle.overflow.model.meta.MetaTargetHostType; /** * Created by root on 17. 6. 22. @@ -10,71 +11,16 @@ import java.util.Date; @Table(name = "INFRA_HOST", schema = "public") @DiscriminatorValue("2") public class InfraHost extends Infra { - // private Long id; - private InfraOS infraOS; - private String ipv4; - private String ipv6; - private String mac; - private Date createDate; - - // @Id - // @GeneratedValue(strategy= GenerationType.IDENTITY) - // public Long getId() { - // return id; - // } - // - // public void setId(Long id) { - // this.id = id; - // } + private MetaTargetHostType metaTargetHostType; @ManyToOne - @JoinColumn(name = "INFRA_OS_ID", nullable = true) - public InfraOS getInfraOS() { - return infraOS; + @JoinColumn(name = "META_TARGET_HOST_TYPE_ID", nullable = true) + public MetaTargetHostType getMetaTargetHostType() { + return metaTargetHostType; } - public void setInfraOS(InfraOS infraOS) { - this.infraOS = infraOS; - } - - @Basic - @Column(name = "IP_V4", nullable = true) - public String getIpv4() { - return ipv4; - } - - public void setIpv4(String ipv4) { - this.ipv4 = ipv4; - } - - @Basic - @Column(name = "IP_V6", nullable = true) - public String getIpv6() { - return ipv6; - } - - public void setIpv6(String ipv6) { - this.ipv6 = ipv6; - } - - @Basic - @Column(name = "MAC", nullable = true) - public String getMac() { - return mac; - } - - public void setMac(String mac) { - this.mac = mac; - } - - @Temporal(TemporalType.TIMESTAMP) - @Column(name = "CREATE_DATE", nullable = true, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false) - public Date getCreateDate() { - return createDate; - } - - public void setCreateDate(Date createDate) { - this.createDate = createDate; + public void setMetaTargetHostType(MetaTargetHostType metaTargetHostType) { + this.metaTargetHostType = metaTargetHostType; } } diff --git a/src/main/java/com/loafle/overflow/model/infra/InfraHostApplication.java b/src/main/java/com/loafle/overflow/model/infra/InfraHostApplication.java new file mode 100644 index 0000000..f6c5c32 --- /dev/null +++ b/src/main/java/com/loafle/overflow/model/infra/InfraHostApplication.java @@ -0,0 +1,58 @@ +package com.loafle.overflow.model.infra; + +import javax.persistence.*; + +import java.util.Date; + +/** + * Created by root on 17. 6. 22. + */ +@Entity +@Table(name = "INFRA_HOST_APPLICATION", schema = "public") +public class InfraHostApplication { + private Long id; + private InfraHost infraHost; + private String name; + private Date createDate; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + @ManyToOne + @JoinColumn(name = "INFRA_HOST_ID", nullable = true) + public InfraHost getInfraHost() { + return infraHost; + } + + public void setInfraHost(InfraHost infraHost) { + this.infraHost = infraHost; + } + + @Basic + @Column(name = "META", nullable = true) + 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", insertable = false, updatable = false) + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } +} diff --git a/src/main/java/com/loafle/overflow/model/infra/InfraHostDaemon.java b/src/main/java/com/loafle/overflow/model/infra/InfraHostDaemon.java new file mode 100644 index 0000000..a41306a --- /dev/null +++ b/src/main/java/com/loafle/overflow/model/infra/InfraHostDaemon.java @@ -0,0 +1,58 @@ +package com.loafle.overflow.model.infra; + +import javax.persistence.*; + +import java.util.Date; + +/** + * Created by root on 17. 6. 22. + */ +@Entity +@Table(name = "INFRA_HOST_DAEMON", schema = "public") +public class InfraHostDaemon { + private Long id; + private InfraHost infraHost; + private String name; + private Date createDate; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + @ManyToOne + @JoinColumn(name = "INFRA_HOST_ID", nullable = true) + public InfraHost getInfraHost() { + return infraHost; + } + + public void setInfraHost(InfraHost infraHost) { + this.infraHost = infraHost; + } + + @Basic + @Column(name = "META", nullable = true) + 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", insertable = false, updatable = false) + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } +} diff --git a/src/main/java/com/loafle/overflow/model/infra/InfraHostIP.java b/src/main/java/com/loafle/overflow/model/infra/InfraHostIP.java new file mode 100644 index 0000000..205868d --- /dev/null +++ b/src/main/java/com/loafle/overflow/model/infra/InfraHostIP.java @@ -0,0 +1,81 @@ +package com.loafle.overflow.model.infra; + +import javax.persistence.*; + +import com.loafle.overflow.model.meta.MetaIPType; + +import java.util.Date; + +/** + * Created by root on 17. 6. 22. + */ +@Entity +@Table(name = "INFRA_HOST_IP", schema = "public") +public class InfraHostIP { + private Long id; + private InfraHost infraHost; + private MetaIPType metaIPType; + private String ip; + private String mac; + private Date createDate; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + @ManyToOne + @JoinColumn(name = "INFRA_HOST_ID", nullable = true) + public InfraHost getInfraHost() { + return infraHost; + } + + public void setInfraHost(InfraHost infraHost) { + this.infraHost = infraHost; + } + + @ManyToOne + @JoinColumn(name = "META_IP_TYPE_ID", nullable = true) + public MetaIPType getMetaIPType() { + return metaIPType; + } + + public void setMetaIPType(MetaIPType metaIPType) { + this.metaIPType = metaIPType; + } + + @Basic + @Column(name = "IP", nullable = true) + public String getIP() { + return ip; + } + + public void setIP(String ip) { + this.ip = ip; + } + + @Basic + @Column(name = "MAC", nullable = true) + public String getMac() { + return mac; + } + + public void setMac(String mac) { + this.mac = mac; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false) + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } +} diff --git a/src/main/java/com/loafle/overflow/model/infra/InfraHostMachine.java b/src/main/java/com/loafle/overflow/model/infra/InfraHostMachine.java new file mode 100644 index 0000000..e1a9c88 --- /dev/null +++ b/src/main/java/com/loafle/overflow/model/infra/InfraHostMachine.java @@ -0,0 +1,58 @@ +package com.loafle.overflow.model.infra; + +import javax.persistence.*; + +import java.util.Date; + +/** + * Created by root on 17. 6. 22. + */ +@Entity +@Table(name = "INFRA_HOST_MACHINE", schema = "public") +public class InfraHostMachine { + private Long id; + private InfraHost infraHost; + private String meta; + private Date createDate; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + @OneToOne + @JoinColumn(name = "INFRA_HOST_ID", nullable = true) + public InfraHost getInfraHost() { + return infraHost; + } + + public void setInfraHost(InfraHost infraHost) { + this.infraHost = infraHost; + } + + @Basic + @Column(name = "META", nullable = true) + 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", insertable = false, updatable = false) + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } +} diff --git a/src/main/java/com/loafle/overflow/model/infra/InfraMachine.java b/src/main/java/com/loafle/overflow/model/infra/InfraHostOS.java similarity index 53% rename from src/main/java/com/loafle/overflow/model/infra/InfraMachine.java rename to src/main/java/com/loafle/overflow/model/infra/InfraHostOS.java index 42e2d3c..beea54e 100644 --- a/src/main/java/com/loafle/overflow/model/infra/InfraMachine.java +++ b/src/main/java/com/loafle/overflow/model/infra/InfraHostOS.java @@ -1,36 +1,42 @@ package com.loafle.overflow.model.infra; import javax.persistence.*; + import java.util.Date; /** * Created by root on 17. 6. 22. */ -@Entity(name = "INFRA_MACHINE") -@Table(name = "INFRA_MACHINE", schema = "public") -@DiscriminatorValue("1") -public class InfraMachine extends Infra { - // private Long id; - +@Entity +@Table(name = "INFRA_HOST_OS", schema = "public") +public class InfraHostOS { + private Long id; + private InfraHost infraHost; private String meta; private Date createDate; - /* - * private Long id; private String meta; private Date createDate; - */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + public Long getId() { + return id; + } - // @Id - // @GeneratedValue(strategy= GenerationType.IDENTITY) - // public Long getId() { - // return id; - // } - // - // public void setId(Long id) { - // this.id = id; - // } + public void setId(Long id) { + this.id = id; + } + + @OneToOne + @JoinColumn(name = "INFRA_HOST_ID", nullable = true) + public InfraHost getInfraHost() { + return infraHost; + } + + public void setInfraHost(InfraHost infraHost) { + this.infraHost = infraHost; + } @Basic - @Column(name = "META", nullable = true, length = 1000) + @Column(name = "META", nullable = true) public String getMeta() { return meta; } @@ -39,6 +45,7 @@ public class InfraMachine extends Infra { this.meta = meta; } + @Temporal(TemporalType.TIMESTAMP) @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false) public Date getCreateDate() { @@ -48,5 +55,4 @@ public class InfraMachine extends Infra { public void setCreateDate(Date createDate) { this.createDate = createDate; } - } diff --git a/src/main/java/com/loafle/overflow/model/infra/InfraHostPort.java b/src/main/java/com/loafle/overflow/model/infra/InfraHostPort.java new file mode 100644 index 0000000..bc13ace --- /dev/null +++ b/src/main/java/com/loafle/overflow/model/infra/InfraHostPort.java @@ -0,0 +1,83 @@ +package com.loafle.overflow.model.infra; + +import javax.persistence.*; + +import com.loafle.overflow.model.meta.MetaCryptoType; +import com.loafle.overflow.model.meta.MetaPortType; + +import java.util.Date; + +/** + * Created by root on 17. 6. 22. + */ +@Entity +@Table(name = "INFRA_HOST_PORT", schema = "public") +public class InfraHostPort { + private Long id; + private InfraHost infraHost; + private MetaPortType metaPortType; + private Integer port; + private MetaCryptoType metaCryptoType; + private Date createDate; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + @ManyToOne + @JoinColumn(name = "INFRA_HOST_ID", nullable = true) + public InfraHost getInfraHost() { + return infraHost; + } + + public void setInfraHost(InfraHost infraHost) { + this.infraHost = infraHost; + } + + @ManyToOne + @JoinColumn(name = "META_PORT_TYPE_ID", nullable = true) + public MetaPortType getMetaPortType() { + return metaPortType; + } + + public void setMetaPortType(MetaPortType metaPortType) { + this.metaPortType = metaPortType; + } + + @Basic + @Column(name = "PORT", nullable = true) + public Integer getPort() { + return port; + } + + public void setPort(Integer port) { + this.port = port; + } + + + @ManyToOne + @JoinColumn(name = "META_PORT_TYPE_ID", nullable = true) + public MetaCryptoType getMetaCryptoType() { + return metaCryptoType; + } + + public void setMetaCryptoType(MetaCryptoType metaCryptoType) { + this.metaCryptoType = metaCryptoType; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false) + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } +} diff --git a/src/main/java/com/loafle/overflow/model/infra/InfraOS.java b/src/main/java/com/loafle/overflow/model/infra/InfraOS.java deleted file mode 100644 index d291d74..0000000 --- a/src/main/java/com/loafle/overflow/model/infra/InfraOS.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.loafle.overflow.model.infra; - -import com.loafle.overflow.model.meta.MetaInfraVendor; - -import javax.persistence.*; -import java.util.Date; - -/** - * Created by root on 17. 6. 22. - */ -@Entity(name = "INFRA_OS") -@Table(name = "INFRA_OS", schema = "public") -@DiscriminatorValue("3") -public class InfraOS extends Infra { - // private Long id; - private InfraMachine infraMachine; - private String meta; - private Date createDate; - private MetaInfraVendor metaInfraVendor; - - // @Id - // @GeneratedValue(strategy= GenerationType.IDENTITY) - // public Long getId() { - // return id; - // } - // - // public void setId(Long id) { - // this.id = id; - // } - - @ManyToOne - @JoinColumn(name = "INFRA_MACHINE_ID", nullable = true) - public InfraMachine getInfraMachine() { - return infraMachine; - } - - public void setInfraMachine(InfraMachine infraMachine) { - this.infraMachine = infraMachine; - } - - @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 = true, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false) - public Date getCreateDate() { - return createDate; - } - - public void setCreateDate(Date createDate) { - this.createDate = createDate; - } - - @ManyToOne - @JoinColumn(name = "META_INFRA_VENDOR_ID", nullable = true) - public MetaInfraVendor getMetaInfraVendor() { - return metaInfraVendor; - } - - public void setMetaInfraVendor(MetaInfraVendor metaInfraVendor) { - this.metaInfraVendor = metaInfraVendor; - } - -} diff --git a/src/main/java/com/loafle/overflow/model/infra/InfraOSApplication.java b/src/main/java/com/loafle/overflow/model/infra/InfraOSApplication.java deleted file mode 100644 index d271284..0000000 --- a/src/main/java/com/loafle/overflow/model/infra/InfraOSApplication.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.loafle.overflow.model.infra; - -import javax.persistence.*; -import java.util.Date; - -/** - * Created by root on 17. 6. 22. - */ -@Entity(name = "INFRA_OS_APPLICATION") -@Table(name = "INFRA_OS_APPLICATION", schema = "public") -@DiscriminatorValue("4") -public class InfraOSApplication extends Infra { - // private Long id; - private InfraOS infraOS; - private String name; - private Date createDate; - - // @Id - // @GeneratedValue(strategy= GenerationType.IDENTITY) - // public Long getId() { - // return id; - // } - // - // public void setId(Long id) { - // this.id = id; - // } - - @ManyToOne - @JoinColumn(name = "INFRA_OS_ID", nullable = true) - public InfraOS getInfraOS() { - return infraOS; - } - - public void setInfraOS(InfraOS infraOS) { - this.infraOS = infraOS; - } - - @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 = true, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false) - public Date getCreateDate() { - return createDate; - } - - public void setCreateDate(Date createDate) { - this.createDate = createDate; - } - -} diff --git a/src/main/java/com/loafle/overflow/model/infra/InfraOSDaemon.java b/src/main/java/com/loafle/overflow/model/infra/InfraOSDaemon.java deleted file mode 100644 index a1ec37a..0000000 --- a/src/main/java/com/loafle/overflow/model/infra/InfraOSDaemon.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.loafle.overflow.model.infra; - -import javax.persistence.*; -import java.util.Date; - -/** - * Created by root on 17. 6. 22. - */ -@Entity(name = "INFRA_OS_DAEMON") -@Table(name = "INFRA_OS_DAEMON", schema = "public") -@DiscriminatorValue("5") -public class InfraOSDaemon extends Infra { - // private Long id; - private InfraOS infraOS; - private String name; - private Date createDate; - - // @Id - // @GeneratedValue(strategy= GenerationType.IDENTITY) - // public Long getId() { - // return id; - // } - // - // public void setId(Long id) { - // this.id = id; - // } - - @ManyToOne - @JoinColumn(name = "INFRA_OS_ID", nullable = true) - public InfraOS getInfraOS() { - return infraOS; - } - - public void setInfraOS(InfraOS infraOS) { - this.infraOS = infraOS; - } - - @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 = true, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false) - public Date getCreateDate() { - return createDate; - } - - public void setCreateDate(Date createDate) { - this.createDate = createDate; - } -} diff --git a/src/main/java/com/loafle/overflow/model/infra/InfraOSPort.java b/src/main/java/com/loafle/overflow/model/infra/InfraOSPort.java deleted file mode 100644 index 382d301..0000000 --- a/src/main/java/com/loafle/overflow/model/infra/InfraOSPort.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.loafle.overflow.model.infra; - -import com.loafle.overflow.model.meta.MetaInfraVendor; - -import javax.persistence.*; -import java.util.Date; - -/** - * Created by root on 17. 6. 22. - */ -@Entity(name = "INFRA_OS_PORT") -@Table(name = "INFRA_OS_PORT", schema = "public") -@DiscriminatorValue("6") -public class InfraOSPort extends Infra { - // private Long id; - private InfraOS infraOS; - private Date createDate; - private Integer port; - private String portType; - private MetaInfraVendor metaInfraVendor; - private Boolean tlsType; - // - // @Id - // @GeneratedValue(strategy= GenerationType.IDENTITY) - // public Long getId() { - // return id; - // } - // - // public void setId(Long id) { - // this.id = id; - // } - - @ManyToOne - @JoinColumn(name = "INFRA_OS_ID", nullable = true) - public InfraOS getInfraOS() { - return infraOS; - } - - public void setInfraOS(InfraOS infraOS) { - this.infraOS = infraOS; - } - - @Temporal(TemporalType.TIMESTAMP) - @Column(name = "CREATE_DATE", nullable = true, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false) - 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 = true) - public String getPortType() { - return portType; - } - - public void setPortType(String portType) { - this.portType = portType; - } - - @ManyToOne - @JoinColumn(name = "META_INFRA_VENDOR_ID", nullable = true) - public MetaInfraVendor getMetaInfraVendor() { - return metaInfraVendor; - } - - public void setMetaInfraVendor(MetaInfraVendor metaInfraVendor) { - this.metaInfraVendor = metaInfraVendor; - } - - @Basic - @Column(name = "TLS_TYPE", nullable = true) - public Boolean isTlsType() { - return tlsType; - } - - public void setTlsType(Boolean tlsType) { - this.tlsType = tlsType; - } - -} diff --git a/src/main/java/com/loafle/overflow/model/infra/InfraService.java b/src/main/java/com/loafle/overflow/model/infra/InfraService.java index 5ae8c72..75a8777 100644 --- a/src/main/java/com/loafle/overflow/model/infra/InfraService.java +++ b/src/main/java/com/loafle/overflow/model/infra/InfraService.java @@ -1,92 +1,50 @@ package com.loafle.overflow.model.infra; -import com.loafle.overflow.model.meta.MetaInfraVendor; - import javax.persistence.*; -import java.util.Date; + +import com.loafle.overflow.model.meta.MetaTargetServiceType; /** * Created by root on 17. 6. 22. */ @Entity(name = "INFRA_SERVICE") @Table(name = "INFRA_SERVICE", schema = "public") -@DiscriminatorValue("7") +@DiscriminatorValue("3") public class InfraService extends Infra { - // private Long id; - private InfraHost infraHost; - private String portType; - private Integer port; - private MetaInfraVendor metaInfraVendor; - private Date createDate; - private Boolean tlsType; - // @Id - // @GeneratedValue(strategy= GenerationType.IDENTITY) - // public Long getId() { - // return id; - // } - // - // public void setId(Long id) { - // this.id = id; - // } + private MetaTargetServiceType metaTargetServiceType; + private InfraHostIP infraHostIP; + private InfraHostPort infraHostPort; + @ManyToOne - @JoinColumn(name = "INFRA_HOST_ID", nullable = true) - public InfraHost getInfraHost() { - return infraHost; + @JoinColumn(name = "META_TARGET_SERVICE_TYPE_ID", nullable = true) + public MetaTargetServiceType getMetaTargetServiceType() { + return metaTargetServiceType; } - public void setInfraHost(InfraHost infraHost) { - this.infraHost = infraHost; - } - - @Basic - @Column(name = "PORT_TYPE", nullable = true) - public String getPortType() { - return portType; - } - - public void setPortType(String portType) { - this.portType = portType; - } - - @Basic - @Column(name = "PORT", nullable = true) - public Integer getPort() { - return port; - } - - public void setPort(Integer port) { - this.port = port; + public void setMetaTargetServiceType(MetaTargetServiceType metaTargetServiceType) { + this.metaTargetServiceType = metaTargetServiceType; } @ManyToOne - @JoinColumn(name = "META_INFRA_VENDOR_ID", nullable = true) - public MetaInfraVendor getMetaInfraVendor() { - return metaInfraVendor; + @JoinColumn(name = "INFRA_HOST_IP_ID", nullable = true) + public InfraHostIP getInfraHostIP() { + return infraHostIP; } - public void setMetaInfraVendor(MetaInfraVendor metaInfraVendor) { - this.metaInfraVendor = metaInfraVendor; + public void setInfraHostIP(InfraHostIP infraHostIP) { + this.infraHostIP = infraHostIP; } - @Temporal(TemporalType.TIMESTAMP) - @Column(name = "CREATE_DATE", nullable = true, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false) - public Date getCreateDate() { - return createDate; + @ManyToOne + @JoinColumn(name = "INFRA_HOST_PORT_ID", nullable = true) + public InfraHostPort getInfraHostPort() { + return infraHostPort; } - public void setCreateDate(Date createDate) { - this.createDate = createDate; + public void setInfraHostPort(InfraHostPort infraHostPort) { + this.infraHostPort = infraHostPort; } - @Basic - @Column(name = "TLS_TYPE", nullable = true) - public Boolean isTlsType() { - return tlsType; - } - - public void setTlsType(Boolean tlsType) { - this.tlsType = tlsType; - } } diff --git a/src/main/java/com/loafle/overflow/model/infra/InfraZone.java b/src/main/java/com/loafle/overflow/model/infra/InfraZone.java new file mode 100644 index 0000000..f2b8847 --- /dev/null +++ b/src/main/java/com/loafle/overflow/model/infra/InfraZone.java @@ -0,0 +1,26 @@ +package com.loafle.overflow.model.infra; + +import javax.persistence.*; + +import com.loafle.overflow.model.meta.MetaTargetZoneType; + +/** + * Created by root on 17. 6. 22. + */ +@Entity(name = "INFRA_ZONE") +@Table(name = "INFRA_ZONE", schema = "public") +@DiscriminatorValue("1") +public class InfraZone extends Infra { + private MetaTargetZoneType metaTargetZoneType; + + @ManyToOne + @JoinColumn(name = "META_TARGET_ZONE_TYPE_ID", nullable = true) + public MetaTargetZoneType getMetaTargetZoneType() { + return metaTargetZoneType; + } + + public void setMetaTargetZoneType(MetaTargetZoneType metaTargetZoneType) { + this.metaTargetZoneType = metaTargetZoneType; + } + +} diff --git a/src/main/java/com/loafle/overflow/model/meta/MetaCrawler.java b/src/main/java/com/loafle/overflow/model/meta/MetaCrawler.java index 2638905..9e8554f 100644 --- a/src/main/java/com/loafle/overflow/model/meta/MetaCrawler.java +++ b/src/main/java/com/loafle/overflow/model/meta/MetaCrawler.java @@ -10,9 +10,10 @@ import java.util.Date; @Table(name = "META_CRAWLER", schema = "public") public class MetaCrawler { private Short id; - private Date createDate; + private String key; private String name; - private String description; + private Boolean isDefault; + private Date createDate; @Id public Short getId() { @@ -23,6 +24,34 @@ public class MetaCrawler { this.id = id; } + @Column(name = "KEY", nullable = true, length = 50) + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + @Column(name = "NAME", nullable = true, length = 50) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Basic + @Column(name = "IS_DEFAULT", nullable = false, columnDefinition = "Boolean default false") + public Boolean getDefault() { + return isDefault; + } + + public void setDefault(Boolean aDefault) { + isDefault = aDefault; + } + @Temporal(TemporalType.TIMESTAMP) @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false) public Date getCreateDate() { @@ -33,22 +62,4 @@ public class MetaCrawler { this.createDate = createDate; } - @Column(name = "NAME", nullable = true, length = 50) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Column(name = "DESCRIPTION", nullable = true, length = 100) - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - } diff --git a/src/main/java/com/loafle/overflow/model/meta/MetaCrawlerEnum.java b/src/main/java/com/loafle/overflow/model/meta/MetaCrawlerEnum.java new file mode 100644 index 0000000..7001eb1 --- /dev/null +++ b/src/main/java/com/loafle/overflow/model/meta/MetaCrawlerEnum.java @@ -0,0 +1,52 @@ +package com.loafle.overflow.model.meta; + +/** + * Created by snoop on 17. 9. 8. + */ +public enum MetaCrawlerEnum { + + UNKNOWN((short) 1), + ACTIVEDIRECTORY((short) 2), + CASSANDRA((short) 3), + DHCP((short) 4), + DNS((short) 5), + FTP((short) 6), + HTTP((short) 7), + IMAP((short) 8), + LDAP((short) 9), + MONGODB((short) 10), + MSSQL((short) 11), + MYSQL((short) 12), + NETBIOS((short) 13), + ORACLE((short) 14), + POP((short) 15), + POSTGRESQL((short) 16), + REDIS((short) 17), + JMX((short) 18), + SMB((short) 19), + SMTP((short) 20), + SNMPV2((short) 21), + SNMPV3((short) 22), + SSH((short) 23), + TELNET((short) 24), + WMI((short) 25); + + private Short value; + + private MetaCrawlerEnum(Short value) { + this.value = value; + } + + public Short getValue() { + return this.value; + } + + public boolean equals(MetaCrawlerEnum metaCrawlerEnum) { + return this.value.equals(metaCrawlerEnum.value); + } + + public boolean equals(MetaCrawler metaCrawler) { + return this.value.equals(metaCrawler.getId()); + } + +} diff --git a/src/main/java/com/loafle/overflow/model/meta/MetaCrawlerInputItem.java b/src/main/java/com/loafle/overflow/model/meta/MetaCrawlerInputItem.java index 0fed166..a56e86b 100644 --- a/src/main/java/com/loafle/overflow/model/meta/MetaCrawlerInputItem.java +++ b/src/main/java/com/loafle/overflow/model/meta/MetaCrawlerInputItem.java @@ -10,16 +10,15 @@ import java.util.Date; @Table(name = "META_CRAWLER_INPUT_ITEM", schema = "public") public class MetaCrawlerInputItem { private Integer id; + private String name; private MetaInputType metaInputType; private MetaCrawler metaCrawler; - private String description; - private String name; - private Date createDate; private Boolean required; private String defaultValue; private String pattern; private String keyName; private String keyValue; + private Date createDate; @Id public Integer getId() { @@ -50,15 +49,6 @@ public class MetaCrawlerInputItem { this.metaCrawler = metaCrawler; } - @Column(name = "DESCRIPTION", nullable = true, length = 50) - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - @Column(name = "NAME", nullable = true, length = 50) public String getName() { return name; diff --git a/src/main/java/com/loafle/overflow/model/meta/MetaCrawlerMapping.java b/src/main/java/com/loafle/overflow/model/meta/MetaCrawlerMapping.java new file mode 100644 index 0000000..7af25d9 --- /dev/null +++ b/src/main/java/com/loafle/overflow/model/meta/MetaCrawlerMapping.java @@ -0,0 +1,59 @@ +package com.loafle.overflow.model.meta; + +import java.util.Date; + +import javax.persistence.*; + +/** + * Created by snoop on 18. 4. 24. + */ +@Entity +@Table(name = "META_CRAWLER_MAPPING", schema = "public") +public class MetaCrawlerMapping { + + private Long id; + private MetaTargetType metaTargetType; + private MetaCrawler metaCrawler; + private Date createDate; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + @ManyToOne + @JoinColumn(name = "META_TARGET_TYPE_ID", nullable = false) + public MetaTargetType getMetaTargetType() { + return metaTargetType; + } + + public void setMetaTargetType(MetaTargetType metaTargetType) { + this.metaTargetType = metaTargetType; + } + + @ManyToOne + @JoinColumn(name = "META_CRAWLER_ID", nullable = false) + public MetaCrawler getMetaCrawler() { + return metaCrawler; + } + + public void setMetaCrawler(MetaCrawler metaCrawler) { + this.metaCrawler = metaCrawler; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false) + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } + +} diff --git a/src/main/java/com/loafle/overflow/model/meta/MetaProbeTaskType.java b/src/main/java/com/loafle/overflow/model/meta/MetaCryptoType.java similarity index 63% rename from src/main/java/com/loafle/overflow/model/meta/MetaProbeTaskType.java rename to src/main/java/com/loafle/overflow/model/meta/MetaCryptoType.java index b35c5d0..1ffdb77 100644 --- a/src/main/java/com/loafle/overflow/model/meta/MetaProbeTaskType.java +++ b/src/main/java/com/loafle/overflow/model/meta/MetaCryptoType.java @@ -3,17 +3,22 @@ package com.loafle.overflow.model.meta; import javax.persistence.*; import java.util.Date; -/** - * Created by root on 17. 6. 22. - */ @Entity -@Table(name = "META_PROBE_TASK_TYPE", schema = "public") -public class MetaProbeTaskType { +@Table(name = "META_CRYPTO_TYPE", schema = "public") +public class MetaCryptoType { + private Short id; private String name; - private String description; + private String key; private Date createDate; + public MetaCryptoType() { + } + + public MetaCryptoType(Short id) { + this.id = id; + } + @Id public Short getId() { return id; @@ -23,7 +28,16 @@ public class MetaProbeTaskType { this.id = id; } - @Column(name = "NAME", nullable = false, length = 50) + @Column(name = "KEY", nullable = true, length = 50) + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + @Column(name = "NAME", nullable = true, length = 50) public String getName() { return name; } @@ -32,15 +46,6 @@ public class MetaProbeTaskType { this.name = name; } - @Column(name = "DESCRIPTION", nullable = false, length = 50) - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - @Temporal(TemporalType.TIMESTAMP) @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false) public Date getCreateDate() { @@ -50,5 +55,4 @@ public class MetaProbeTaskType { public void setCreateDate(Date createDate) { this.createDate = createDate; } - } diff --git a/src/main/java/com/loafle/overflow/model/meta/MetaEmailStatus.java b/src/main/java/com/loafle/overflow/model/meta/MetaEmailType.java similarity index 71% rename from src/main/java/com/loafle/overflow/model/meta/MetaEmailStatus.java rename to src/main/java/com/loafle/overflow/model/meta/MetaEmailType.java index 92d334f..aec7b6b 100644 --- a/src/main/java/com/loafle/overflow/model/meta/MetaEmailStatus.java +++ b/src/main/java/com/loafle/overflow/model/meta/MetaEmailType.java @@ -4,17 +4,18 @@ import javax.persistence.*; import java.util.Date; @Entity -@Table(name = "META_EMAIL_STATUS", schema = "public") -public class MetaEmailStatus { +@Table(name = "META_EMAIL_TYPE", schema = "public") +public class MetaEmailType { private Integer id; private String name; + private String key; private Date createDate; - public MetaEmailStatus() { + public MetaEmailType() { } - public MetaEmailStatus(Integer id) { + public MetaEmailType(Integer id) { this.id = id; } @@ -27,6 +28,15 @@ public class MetaEmailStatus { this.id = id; } + @Column(name = "KEY", nullable = true, length = 50) + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + @Column(name = "NAME", nullable = true, length = 50) public String getName() { return name; diff --git a/src/main/java/com/loafle/overflow/model/meta/MetaHistoryType.java b/src/main/java/com/loafle/overflow/model/meta/MetaHistoryType.java index 4e8179b..f1a8a31 100644 --- a/src/main/java/com/loafle/overflow/model/meta/MetaHistoryType.java +++ b/src/main/java/com/loafle/overflow/model/meta/MetaHistoryType.java @@ -10,6 +10,7 @@ import java.util.Date; @Table(name = "META_HISTORY_TYPE", schema = "public") public class MetaHistoryType { private Integer id; + private String key; private String name; private Date createDate; @@ -30,6 +31,15 @@ public class MetaHistoryType { this.id = id; } + @Column(name = "KEY", nullable = true, length = 50) + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + @Column(name = "NAME", nullable = true, length = 50) public String getName() { return name; diff --git a/src/main/java/com/loafle/overflow/model/meta/MetaProbeOs.java b/src/main/java/com/loafle/overflow/model/meta/MetaIPType.java similarity index 69% rename from src/main/java/com/loafle/overflow/model/meta/MetaProbeOs.java rename to src/main/java/com/loafle/overflow/model/meta/MetaIPType.java index eb99230..b5055c1 100644 --- a/src/main/java/com/loafle/overflow/model/meta/MetaProbeOs.java +++ b/src/main/java/com/loafle/overflow/model/meta/MetaIPType.java @@ -3,16 +3,22 @@ package com.loafle.overflow.model.meta; import javax.persistence.*; import java.util.Date; -/** - * Created by root on 17. 6. 22. - */ @Entity -@Table(name = "META_PROBE_OS", schema = "public") -public class MetaProbeOs { +@Table(name = "META_IP_TYPE", schema = "public") +public class MetaIPType { + private Short id; private String name; + private String key; private Date createDate; + public MetaIPType() { + } + + public MetaIPType(Short id) { + this.id = id; + } + @Id public Short getId() { return id; @@ -22,6 +28,15 @@ public class MetaProbeOs { this.id = id; } + @Column(name = "KEY", nullable = true, length = 50) + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + @Column(name = "NAME", nullable = true, length = 50) public String getName() { return name; @@ -40,5 +55,4 @@ public class MetaProbeOs { public void setCreateDate(Date createDate) { this.createDate = createDate; } - } diff --git a/src/main/java/com/loafle/overflow/model/meta/MetaInfraType.java b/src/main/java/com/loafle/overflow/model/meta/MetaInfraType.java index b721a07..7482152 100644 --- a/src/main/java/com/loafle/overflow/model/meta/MetaInfraType.java +++ b/src/main/java/com/loafle/overflow/model/meta/MetaInfraType.java @@ -10,6 +10,7 @@ import java.util.Date; @Table(name = "META_INFRA_TYPE", schema = "public") public class MetaInfraType { private Integer id; + private String key; private String name; private Date createDate; @@ -29,6 +30,15 @@ public class MetaInfraType { this.id = id; } + @Column(name = "KEY", nullable = true, length = 50) + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + @Column(name = "NAME", nullable = true, length = 50) public String getName() { return name; @@ -39,7 +49,7 @@ public class MetaInfraType { } @Temporal(TemporalType.TIMESTAMP) - @Column(name = "CREATE_DATE", nullable = false) + @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false) public Date getCreateDate() { return createDate; } diff --git a/src/main/java/com/loafle/overflow/model/meta/MetaInputType.java b/src/main/java/com/loafle/overflow/model/meta/MetaInputType.java index 63920e4..10c9bab 100644 --- a/src/main/java/com/loafle/overflow/model/meta/MetaInputType.java +++ b/src/main/java/com/loafle/overflow/model/meta/MetaInputType.java @@ -10,8 +10,8 @@ import java.util.Date; @Table(name = "META_INPUT_TYPE", schema = "public") public class MetaInputType { private Short id; + private String key; private String name; - private String description; private Date createDate; @Id @@ -23,6 +23,15 @@ public class MetaInputType { this.id = id; } + @Column(name = "KEY", nullable = true, length = 50) + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + @Column(name = "NAME", nullable = true, length = 50) public String getName() { return name; @@ -32,15 +41,6 @@ public class MetaInputType { this.name = name; } - @Column(name = "DESCRIPTION", nullable = true, length = 50) - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - @Temporal(TemporalType.TIMESTAMP) @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false) public Date getCreateDate() { diff --git a/src/main/java/com/loafle/overflow/model/meta/MetaMemberStatus.java b/src/main/java/com/loafle/overflow/model/meta/MetaMemberStatus.java index 7ebf9e3..89c5228 100644 --- a/src/main/java/com/loafle/overflow/model/meta/MetaMemberStatus.java +++ b/src/main/java/com/loafle/overflow/model/meta/MetaMemberStatus.java @@ -1,9 +1,13 @@ package com.loafle.overflow.model.meta; +import java.util.Date; + import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; /** * Created by root on 17. 6. 22. @@ -12,7 +16,9 @@ import javax.persistence.Table; @Table(name = "META_MEMBER_STATUS", schema = "public") public class MetaMemberStatus { private Short id; + private String key; private String name; + private Date createDate; public MetaMemberStatus() { @@ -31,6 +37,15 @@ public class MetaMemberStatus { this.id = id; } + @Column(name = "KEY", nullable = true, length = 50) + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + @Column(name = "Name", nullable = false, length = 10) public String getName() { return name; @@ -40,4 +55,13 @@ public class MetaMemberStatus { this.name = name; } + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false) + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } } diff --git a/src/main/java/com/loafle/overflow/model/meta/MetaNoAuthProbeStatus.java b/src/main/java/com/loafle/overflow/model/meta/MetaNoAuthProbeStatus.java index bcdadcd..7e6b20c 100644 --- a/src/main/java/com/loafle/overflow/model/meta/MetaNoAuthProbeStatus.java +++ b/src/main/java/com/loafle/overflow/model/meta/MetaNoAuthProbeStatus.java @@ -1,9 +1,13 @@ package com.loafle.overflow.model.meta; +import java.util.Date; + import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; /** * Created by snoop on 17. 6. 26. @@ -12,7 +16,9 @@ import javax.persistence.Table; @Table(name = "META_NOAUTH_PROBE_STATUS", schema = "public") public class MetaNoAuthProbeStatus { private Short id; + private String key; private String name; + private Date createDate; public MetaNoAuthProbeStatus() { @@ -31,6 +37,15 @@ public class MetaNoAuthProbeStatus { this.id = id; } + @Column(name = "KEY", nullable = true, length = 50) + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + @Column(name = "Name", nullable = false, length = 10) public String getName() { return name; @@ -39,4 +54,14 @@ public class MetaNoAuthProbeStatus { public void setName(String name) { this.name = name; } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false) + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } } diff --git a/src/main/java/com/loafle/overflow/model/meta/MetaNotification.java b/src/main/java/com/loafle/overflow/model/meta/MetaNotification.java deleted file mode 100644 index 99d848d..0000000 --- a/src/main/java/com/loafle/overflow/model/meta/MetaNotification.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.loafle.overflow.model.meta; - -import javax.persistence.*; -import java.util.Date; - -/** - * Created by root on 17. 6. 22. - */ -@Entity -@Table(name = "META_NOTIFICATION", schema = "public") -public class MetaNotification { - private Long id; - private Date createDate; - private String name; - private String description; - - @Id - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - @Temporal(TemporalType.TIMESTAMP) - @Column(name = "CREATE_DATE", nullable = false) - public Date getCreateDate() { - return createDate; - } - - public void setCreateDate(Date createDate) { - this.createDate = createDate; - } - - @Column(name = "NAME", nullable = true, length = 50) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Column(name = "DESCRIPTION", nullable = true, length = 50) - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } -} diff --git a/src/main/java/com/loafle/overflow/model/meta/MetaProbeArchitecture.java b/src/main/java/com/loafle/overflow/model/meta/MetaPortType.java similarity index 52% rename from src/main/java/com/loafle/overflow/model/meta/MetaProbeArchitecture.java rename to src/main/java/com/loafle/overflow/model/meta/MetaPortType.java index eb01272..29ca133 100644 --- a/src/main/java/com/loafle/overflow/model/meta/MetaProbeArchitecture.java +++ b/src/main/java/com/loafle/overflow/model/meta/MetaPortType.java @@ -3,16 +3,22 @@ package com.loafle.overflow.model.meta; import javax.persistence.*; import java.util.Date; -/** - * Created by root on 17. 6. 22. - */ @Entity -@Table(name = "META_PROBE_ARCHITECTURE", schema = "public") -public class MetaProbeArchitecture { +@Table(name = "META_PORT_TYPE", schema = "public") +public class MetaPortType { + private Short id; - private String architecture; + private String name; + private String key; private Date createDate; + public MetaPortType() { + } + + public MetaPortType(Short id) { + this.id = id; + } + @Id public Short getId() { return id; @@ -22,13 +28,22 @@ public class MetaProbeArchitecture { this.id = id; } - @Column(name = "ARCHITECTURE", nullable = true, length = 10) - public String getArchitecture() { - return architecture; + @Column(name = "KEY", nullable = true, length = 50) + public String getKey() { + return key; } - public void setArchitecture(String architecture) { - this.architecture = architecture; + public void setKey(String key) { + this.key = key; + } + + @Column(name = "NAME", nullable = true, length = 50) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; } @Temporal(TemporalType.TIMESTAMP) @@ -40,5 +55,4 @@ public class MetaProbeArchitecture { public void setCreateDate(Date createDate) { this.createDate = createDate; } - } diff --git a/src/main/java/com/loafle/overflow/model/meta/MetaProbePackage.java b/src/main/java/com/loafle/overflow/model/meta/MetaProbePackage.java deleted file mode 100644 index a676425..0000000 --- a/src/main/java/com/loafle/overflow/model/meta/MetaProbePackage.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.loafle.overflow.model.meta; - -import javax.persistence.*; -import java.util.Date; - -/** - * Created by root on 17. 6. 22. - */ -@Entity -@Table(name = "META_PROBE_PACKAGE", schema = "public") -public class MetaProbePackage { - private Long id; - private MetaProbeVersion metaProbeVersion; - private MetaProbeOs metaProbeOs; - private MetaProbeArchitecture metaProbeArchitecture; - private Date createDate; - - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - @ManyToOne - @JoinColumn(name = "META_PROBE_VERSION_ID", nullable = false) - public MetaProbeVersion getMetaProbeVersion() { - return metaProbeVersion; - } - - public void setMetaProbeVersion(MetaProbeVersion metaProbeVersion) { - this.metaProbeVersion = metaProbeVersion; - } - - @ManyToOne - @JoinColumn(name = "META_PROBE_OS_ID", nullable = false) - public MetaProbeOs getMetaProbeOs() { - return metaProbeOs; - } - - public void setMetaProbeOs(MetaProbeOs metaProbeOs) { - this.metaProbeOs = metaProbeOs; - } - - @ManyToOne - @JoinColumn(name = "META_PROBE_ARCHITECTURE_ID", nullable = false) - public MetaProbeArchitecture getMetaProbeArchitecture() { - return metaProbeArchitecture; - } - - public void setMetaProbeArchitecture(MetaProbeArchitecture metaProbeArchitecture) { - this.metaProbeArchitecture = metaProbeArchitecture; - } - - @Temporal(TemporalType.TIMESTAMP) - @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false) - public Date getCreateDate() { - return createDate; - } - - public void setCreateDate(Date createDate) { - this.createDate = createDate; - } - -} diff --git a/src/main/java/com/loafle/overflow/model/meta/MetaProbeStatus.java b/src/main/java/com/loafle/overflow/model/meta/MetaProbeStatus.java index 0948b5f..6ddee37 100644 --- a/src/main/java/com/loafle/overflow/model/meta/MetaProbeStatus.java +++ b/src/main/java/com/loafle/overflow/model/meta/MetaProbeStatus.java @@ -1,9 +1,13 @@ package com.loafle.overflow.model.meta; +import java.util.Date; + import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; /** * Created by snoop on 17. 6. 26. @@ -12,7 +16,9 @@ import javax.persistence.Table; @Table(name = "META_PROBE_STATUS", schema = "public") public class MetaProbeStatus { private Short id; + private String key; private String name; + private Date createDate; public MetaProbeStatus() { @@ -31,6 +37,15 @@ public class MetaProbeStatus { this.id = id; } + @Column(name = "KEY", nullable = true, length = 50) + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + @Column(name = "Name", nullable = false, length = 10) public String getName() { return name; @@ -39,4 +54,14 @@ public class MetaProbeStatus { public void setName(String name) { this.name = name; } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false) + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } } diff --git a/src/main/java/com/loafle/overflow/model/meta/MetaProbeVersion.java b/src/main/java/com/loafle/overflow/model/meta/MetaProbeVersion.java deleted file mode 100644 index 9970104..0000000 --- a/src/main/java/com/loafle/overflow/model/meta/MetaProbeVersion.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.loafle.overflow.model.meta; - -import javax.persistence.*; -import java.util.Date; - -/** - * Created by root on 17. 6. 22. - */ -@Entity -@Table(name = "META_PROBE_VERSION", schema = "public") -public class MetaProbeVersion { - private Short id; - private String version; - private Date createDate; - - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - public Short getId() { - return id; - } - - public void setId(Short id) { - this.id = id; - } - - @Column(name = "VERSION", nullable = true, length = 10) - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - @Temporal(TemporalType.TIMESTAMP) - @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false) - public Date getCreateDate() { - return createDate; - } - - public void setCreateDate(Date createDate) { - this.createDate = createDate; - } - -} diff --git a/src/main/java/com/loafle/overflow/model/meta/MetaSensorDisplayItem.java b/src/main/java/com/loafle/overflow/model/meta/MetaSensorDisplayItem.java index 245b843..7aedf49 100644 --- a/src/main/java/com/loafle/overflow/model/meta/MetaSensorDisplayItem.java +++ b/src/main/java/com/loafle/overflow/model/meta/MetaSensorDisplayItem.java @@ -12,13 +12,12 @@ public class MetaSensorDisplayItem { private Long id; private String key; - private String displayName; - private String description; + private String name; + private Boolean isDefault; private MetaCrawler metaCrawler; private MetaSensorItemUnit metaSensorItemUnit; - private Date createDate; - private Boolean isDefault; private MetaSensorItemType metaSensorItemType; + private Date createDate; public MetaSensorDisplayItem() { @@ -46,22 +45,13 @@ public class MetaSensorDisplayItem { this.key = key; } - @Column(name = "DISPLAY_NAME", nullable = false) - public String getDisplayName() { - return displayName; + @Column(name = "NAME", nullable = false) + public String getName() { + return name; } - public void setDisplayName(String displayName) { - this.displayName = displayName; - } - - @Column(name = "DESCRIPTION", nullable = false) - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; + public void setName(String name) { + this.name = name; } @ManyToOne diff --git a/src/main/java/com/loafle/overflow/model/meta/MetaSensorDisplayMapping.java b/src/main/java/com/loafle/overflow/model/meta/MetaSensorDisplayMapping.java index a8d2f4f..e0e1741 100644 --- a/src/main/java/com/loafle/overflow/model/meta/MetaSensorDisplayMapping.java +++ b/src/main/java/com/loafle/overflow/model/meta/MetaSensorDisplayMapping.java @@ -1,5 +1,7 @@ package com.loafle.overflow.model.meta; +import java.util.Date; + import javax.persistence.*; /** @@ -12,6 +14,7 @@ public class MetaSensorDisplayMapping { private Long id; private MetaSensorDisplayItem metaSensorDisplayItem; private MetaSensorItemKey metaSensorItemKey; + private Date createDate; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @@ -42,4 +45,15 @@ public class MetaSensorDisplayMapping { public void setMetaSensorItemKey(MetaSensorItemKey metaSensorItemKey) { this.metaSensorItemKey = metaSensorItemKey; } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false) + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } + } diff --git a/src/main/java/com/loafle/overflow/model/meta/MetaSensorItem.java b/src/main/java/com/loafle/overflow/model/meta/MetaSensorItem.java index bd720aa..77a5dda 100644 --- a/src/main/java/com/loafle/overflow/model/meta/MetaSensorItem.java +++ b/src/main/java/com/loafle/overflow/model/meta/MetaSensorItem.java @@ -42,7 +42,7 @@ public class MetaSensorItem { } @Temporal(TemporalType.TIMESTAMP) - @Column(name = "CREATE_DATE", nullable = false) + @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false) public Date getCreateDate() { return createDate; } diff --git a/src/main/java/com/loafle/overflow/model/meta/MetaSensorItemKey.java b/src/main/java/com/loafle/overflow/model/meta/MetaSensorItemKey.java index 8c11ce7..0515576 100644 --- a/src/main/java/com/loafle/overflow/model/meta/MetaSensorItemKey.java +++ b/src/main/java/com/loafle/overflow/model/meta/MetaSensorItemKey.java @@ -10,13 +10,14 @@ import java.util.Date; @Table(name = "META_SENSOR_ITEM_KEY", schema = "public") public class MetaSensorItemKey { private Long id; - private MetaSensorItem metaSensorItem; private String key; + private String name; private String froms; private String option; + private MetaSensorItem metaSensorItem; private MetaCrawler metaCrawler; - private Date createDate; private MetaSensorItemUnit metaSensorItemUnit; + private Date createDate; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @@ -28,6 +29,15 @@ public class MetaSensorItemKey { this.id = id; } + @Column(name = "NAME", nullable = true, length = 100) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + @ManyToOne @JoinColumn(name = "META_SENSOR_ITEM_ID", nullable = false) public MetaSensorItem getMetaSensorItem() { diff --git a/src/main/java/com/loafle/overflow/model/meta/MetaSensorItemType.java b/src/main/java/com/loafle/overflow/model/meta/MetaSensorItemType.java index 99000e1..f9ca157 100644 --- a/src/main/java/com/loafle/overflow/model/meta/MetaSensorItemType.java +++ b/src/main/java/com/loafle/overflow/model/meta/MetaSensorItemType.java @@ -10,8 +10,8 @@ import java.util.Date; @Table(name = "META_SENSOR_ITEM_TYPE", schema = "public") public class MetaSensorItemType { private Short id; + private String key; private String name; - private String description; private Date createDate; public MetaSensorItemType() { @@ -30,6 +30,15 @@ public class MetaSensorItemType { this.id = id; } + @Column(name = "KEY", nullable = true, length = 50) + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + @Column(name = "NAME", nullable = true, length = 50) public String getName() { return name; @@ -39,17 +48,8 @@ public class MetaSensorItemType { this.name = name; } - @Column(name = "DESCRIPTION", nullable = true, length = 50) - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - @Temporal(TemporalType.TIMESTAMP) - @Column(name = "CREATE_DATE", nullable = false) + @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false) public Date getCreateDate() { return createDate; } diff --git a/src/main/java/com/loafle/overflow/model/meta/MetaSensorItemUnit.java b/src/main/java/com/loafle/overflow/model/meta/MetaSensorItemUnit.java index 2550684..665cb38 100644 --- a/src/main/java/com/loafle/overflow/model/meta/MetaSensorItemUnit.java +++ b/src/main/java/com/loafle/overflow/model/meta/MetaSensorItemUnit.java @@ -11,8 +11,8 @@ import java.util.Date; public class MetaSensorItemUnit { private Short id; private String unit; - private Date createDate; private String mark; + private Date createDate; @Id public Short getId() { @@ -32,6 +32,24 @@ public class MetaSensorItemUnit { this.unit = unit; } + @Column(name = "MARK", nullable = false) + public String getMark() { + return mark; + } + + public void setMark(String mark) { + this.mark = mark; + } + + @Column(name = "DESCRIPTION", nullable = true, length = 255) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + @Temporal(TemporalType.TIMESTAMP) @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false) public Date getCreateDate() { @@ -41,13 +59,4 @@ public class MetaSensorItemUnit { public void setCreateDate(Date createDate) { this.createDate = createDate; } - - @Column(name = "MARK", nullable = false) - public String getMark() { - return mark; - } - - public void setMark(String mark) { - this.mark = mark; - } } diff --git a/src/main/java/com/loafle/overflow/model/meta/MetaSensorStatus.java b/src/main/java/com/loafle/overflow/model/meta/MetaSensorStatus.java index dacae60..96b1024 100644 --- a/src/main/java/com/loafle/overflow/model/meta/MetaSensorStatus.java +++ b/src/main/java/com/loafle/overflow/model/meta/MetaSensorStatus.java @@ -1,9 +1,13 @@ package com.loafle.overflow.model.meta; +import java.util.Date; + import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; /** * Created by snoop on 17. 6. 26. @@ -12,7 +16,9 @@ import javax.persistence.Table; @Table(name = "META_SENSOR_STATUS", schema = "public") public class MetaSensorStatus { private Short id; + private String key; private String name; + private Date createDate; public MetaSensorStatus() { @@ -31,6 +37,15 @@ public class MetaSensorStatus { this.id = id; } + @Column(name = "KEY", nullable = true, length = 50) + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + @Column(name = "Name", nullable = false, length = 10) public String getName() { return name; @@ -39,4 +54,14 @@ public class MetaSensorStatus { public void setName(String name) { this.name = name; } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false) + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } } diff --git a/src/main/java/com/loafle/overflow/model/meta/MetaTargetHostType.java b/src/main/java/com/loafle/overflow/model/meta/MetaTargetHostType.java new file mode 100644 index 0000000..94f55c3 --- /dev/null +++ b/src/main/java/com/loafle/overflow/model/meta/MetaTargetHostType.java @@ -0,0 +1,12 @@ +package com.loafle.overflow.model.meta; + +import javax.persistence.*; + +/** + * Created by root on 17. 6. 22. + */ +@Entity(name = "META_TARGET_HOST_TYPE") +@Table(name = "META_TARGET_HOST_TYPE", schema = "public") +@DiscriminatorValue("2") +public class MetaTargetHostType extends MetaTargetType { +} diff --git a/src/main/java/com/loafle/overflow/model/meta/MetaTargetServiceType.java b/src/main/java/com/loafle/overflow/model/meta/MetaTargetServiceType.java new file mode 100644 index 0000000..d051f92 --- /dev/null +++ b/src/main/java/com/loafle/overflow/model/meta/MetaTargetServiceType.java @@ -0,0 +1,13 @@ +package com.loafle.overflow.model.meta; + +import javax.persistence.*; + +/** + * Created by root on 17. 6. 22. + */ +@Entity(name = "META_TARGET_SERVICE_TYPE") +@Table(name = "META_TARGET_SERVICE_TYPE", schema = "public") +@DiscriminatorValue("3") +public class MetaTargetServiceType extends MetaTargetType { + +} diff --git a/src/main/java/com/loafle/overflow/model/meta/MetaTargetStatus.java b/src/main/java/com/loafle/overflow/model/meta/MetaTargetStatus.java new file mode 100644 index 0000000..e38148b --- /dev/null +++ b/src/main/java/com/loafle/overflow/model/meta/MetaTargetStatus.java @@ -0,0 +1,67 @@ +package com.loafle.overflow.model.meta; + +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * Created by snoop on 17. 6. 26. + */ +@Entity +@Table(name = "META_TARGET_STATUS", schema = "public") +public class MetaTargetStatus { + private Short id; + private String key; + private String name; + private Date createDate; + + public MetaTargetStatus() { + + } + + public MetaTargetStatus(Short id) { + this.id = id; + } + + @Id + public Short getId() { + return id; + } + + public void setId(Short id) { + this.id = id; + } + + @Column(name = "KEY", nullable = true, length = 50) + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + @Column(name = "Name", nullable = false, length = 10) + 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", insertable = false, updatable = false) + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } +} diff --git a/src/main/java/com/loafle/overflow/model/meta/MetaTargetType.java b/src/main/java/com/loafle/overflow/model/meta/MetaTargetType.java new file mode 100644 index 0000000..f88bb5b --- /dev/null +++ b/src/main/java/com/loafle/overflow/model/meta/MetaTargetType.java @@ -0,0 +1,78 @@ +package com.loafle.overflow.model.meta; + +import com.loafle.overflow.model.meta.MetaInfraType; +import javax.persistence.*; +import java.util.Date; + +/** + * Created by root on 17. 6. 22. + */ +@Entity(name = "META_TARGET_TYPE") +@Table(name = "META_TARGET_TYPE", schema = "public") +@Inheritance(strategy = InheritanceType.JOINED) +@DiscriminatorColumn(name = "META_INFRA_TYPE_ID", discriminatorType = DiscriminatorType.INTEGER) +public abstract class MetaTargetType { + private Long id; + private MetaInfraType metaInfraType; + private String key; + private String name; + private Boolean isSupported; + private Date createDate; + + @Id + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + @ManyToOne + @JoinColumn(name = "META_INFRA_TYPE_ID", nullable = false) + public MetaInfraType getMetaInfraType() { + return metaInfraType; + } + + public void setMetaInfraType(MetaInfraType metaInfraType) { + this.metaInfraType = metaInfraType; + } + + @Column(name = "KEY", nullable = true, length = 50) + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + @Column(name = "NAME", nullable = true, length = 50) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Basic + @Column(name = "IS_SUPPORTED", nullable = false, columnDefinition = "Boolean default false") + public Boolean getSupported() { + return isSupported; + } + + public void setSupported(Boolean isSupported) { + this.isSupported = isSupported; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false) + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } +} diff --git a/src/main/java/com/loafle/overflow/model/meta/MetaInfraVendor.java b/src/main/java/com/loafle/overflow/model/meta/MetaTargetTypeCategory.java similarity index 50% rename from src/main/java/com/loafle/overflow/model/meta/MetaInfraVendor.java rename to src/main/java/com/loafle/overflow/model/meta/MetaTargetTypeCategory.java index 00a5d6d..13bbbd7 100644 --- a/src/main/java/com/loafle/overflow/model/meta/MetaInfraVendor.java +++ b/src/main/java/com/loafle/overflow/model/meta/MetaTargetTypeCategory.java @@ -7,12 +7,13 @@ import java.util.Date; * Created by root on 17. 6. 22. */ @Entity -@Table(name = "META_INFRA_VENDOR", schema = "public") -public class MetaInfraVendor { +@Table(name = "META_TARGET_TYPE_CATEGORY", schema = "public") +public class MetaTargetTypeCategory { private Integer id; + private MetaInfraType metaInfraType; + private String key; private String name; private Date createDate; - private MetaInfraType metaInfraType; @Id public Integer getId() { @@ -23,6 +24,25 @@ public class MetaInfraVendor { this.id = id; } + @ManyToOne + @JoinColumn(name = "META_INFRA_TYPE_ID", nullable = false) + public MetaInfraType getMetaInfraType() { + return metaInfraType; + } + + public void setMetaInfraType(MetaInfraType metaInfraType) { + this.metaInfraType = metaInfraType; + } + + @Column(name = "KEY", nullable = true, length = 50) + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + @Column(name = "NAME", nullable = true, length = 50) public String getName() { return name; @@ -42,56 +62,4 @@ public class MetaInfraVendor { this.createDate = createDate; } - @ManyToOne - @JoinColumn(name = "META_INFRA_TYPE_ID", nullable = false) - public MetaInfraType getMetaInfraType() { - return metaInfraType; - } - - public void setMetaInfraType(MetaInfraType metaInfraType) { - this.metaInfraType = metaInfraType; - } - - public static MetaInfraVendor CreateInfraVendorByOS(String osName) { - - MetaInfraVendor vendor = new MetaInfraVendor(); - - if (osName == null || osName.length() <= 0) { - vendor.setId(24); // FIXME: Unknown - return vendor; - } - - if (osName.equals("Windows")) { - vendor.setId(26); - } else if (osName.equals("Linux")) { - vendor.setId(28); // ubuntu - } else { - vendor.setId(24); // FIXME: Unknown - } - - return vendor; - } - - public static MetaInfraVendor CreateInfraVendorByPort(int portNumber) { - return null; - } - - public static MetaInfraVendor CreateInfraVendorByService(String serviceName) { - - MetaInfraVendor vendor = new MetaInfraVendor(); - - if (serviceName.equals("mysql")) { - vendor.setId(11); - } else if (serviceName.equals("portgresql")) { - vendor.setId(15); - } else if (serviceName.equals("wmi")) { - vendor.setId(23); - } else if (serviceName.equals("snmpv2")) { - vendor.setId(20); - } else { - vendor.setId(24); // unknown - } - - return vendor; - } } diff --git a/src/main/java/com/loafle/overflow/model/meta/MetaTargetTypeCategoryMapping.java b/src/main/java/com/loafle/overflow/model/meta/MetaTargetTypeCategoryMapping.java new file mode 100644 index 0000000..8765556 --- /dev/null +++ b/src/main/java/com/loafle/overflow/model/meta/MetaTargetTypeCategoryMapping.java @@ -0,0 +1,59 @@ +package com.loafle.overflow.model.meta; + +import java.util.Date; + +import javax.persistence.*; + +/** + * Created by snoop on 18. 4. 24. + */ +@Entity +@Table(name = "META_TARGET_TYPE_CATEGORY_MAPPING", schema = "public") +public class MetaTargetTypeCategoryMapping { + + private Long id; + private MetaTargetTypeCategory metaTargetTypeCategory; + private MetaTargetType metaTargetType; + private Date createDate; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + @ManyToOne + @JoinColumn(name = "META_TARGET_TYPE_CATEGORY_ID", nullable = false) + public MetaTargetTypeCategory getMetaTargetTypeCategory() { + return metaTargetTypeCategory; + } + + public void setMetaTargetTypeCategory(MetaTargetTypeCategory metaTargetTypeCategory) { + this.metaTargetTypeCategory = metaTargetTypeCategory; + } + + @ManyToOne + @JoinColumn(name = "META_TARGET_TYPE_ID", nullable = false) + public MetaTargetType getMetaTargetType() { + return metaTargetType; + } + + public void setMetaTargetType(MetaTargetType metaTargetType) { + this.metaTargetType = metaTargetType; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false) + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } + +} diff --git a/src/main/java/com/loafle/overflow/model/meta/MetaTargetZoneType.java b/src/main/java/com/loafle/overflow/model/meta/MetaTargetZoneType.java new file mode 100644 index 0000000..3f0662e --- /dev/null +++ b/src/main/java/com/loafle/overflow/model/meta/MetaTargetZoneType.java @@ -0,0 +1,12 @@ +package com.loafle.overflow.model.meta; + +import javax.persistence.*; + +/** + * Created by root on 17. 6. 22. + */ +@Entity(name = "META_TARGET_ZONE_TYPE") +@Table(name = "META_TARGET_ZONE_TYPE", schema = "public") +@DiscriminatorValue("1") +public class MetaTargetZoneType extends MetaTargetType { +} diff --git a/src/main/java/com/loafle/overflow/model/meta/MetaVendorCrawler.java b/src/main/java/com/loafle/overflow/model/meta/MetaVendorCrawler.java index d0f6e1d..ffa9828 100644 --- a/src/main/java/com/loafle/overflow/model/meta/MetaVendorCrawler.java +++ b/src/main/java/com/loafle/overflow/model/meta/MetaVendorCrawler.java @@ -72,5 +72,4 @@ public class MetaVendorCrawler { public void setCreateDate(Date createDate) { this.createDate = createDate; } - } diff --git a/src/main/java/com/loafle/overflow/model/meta/MetaVendorCrawlerSensorItem.java b/src/main/java/com/loafle/overflow/model/meta/MetaVendorCrawlerSensorItem.java index 86d43f6..eb1ec0d 100644 --- a/src/main/java/com/loafle/overflow/model/meta/MetaVendorCrawlerSensorItem.java +++ b/src/main/java/com/loafle/overflow/model/meta/MetaVendorCrawlerSensorItem.java @@ -12,10 +12,10 @@ public class MetaVendorCrawlerSensorItem { private Long id; private String interval; private String warnCondition; - private Date createDate; + private Short crawlerId; private MetaSensorItem metaSensorItem; private MetaInfraVendor metaInfraVendor; - private Short crawlerId; + private Date createDate; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @@ -45,16 +45,6 @@ public class MetaVendorCrawlerSensorItem { this.warnCondition = warnCondition; } - @Temporal(TemporalType.TIMESTAMP) - @Column(name = "CREATE_DATE", nullable = false) - public Date getCreateDate() { - return createDate; - } - - public void setCreateDate(Date createDate) { - this.createDate = createDate; - } - @ManyToOne @JoinColumn(name = "META_SENSOR_ITEM_ID", nullable = false) public MetaSensorItem getMetaSensorItem() { @@ -85,4 +75,22 @@ public class MetaVendorCrawlerSensorItem { this.crawlerId = crawlerId; } + @Column(name = "DESCRIPTION", nullable = true, length = 255) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false) + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } } diff --git a/src/main/java/com/loafle/overflow/model/meta/type/MetaCrawlerEnum.java b/src/main/java/com/loafle/overflow/model/meta/type/MetaCrawlerEnum.java deleted file mode 100644 index 0b8e32b..0000000 --- a/src/main/java/com/loafle/overflow/model/meta/type/MetaCrawlerEnum.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.loafle.overflow.model.meta.type; - -/** - * Created by snoop on 17. 9. 8. - */ -public enum MetaCrawlerEnum { - - ACTIVEDIRECTORY_CRAWLER((short) 1), - CASSANDRA_CRAWLER((short) 2), - DHCP_CRAWLER((short) 3), - DNS_CRAWLER((short) 4), - FTP_CRAWLER((short) 5), - HTTP_CRAWLER((short) 6), - IMAP_CRAWLER((short) 7), - LDAP_CRAWLER((short) 8), - MONGODB_CRAWLER((short) 9), - MSSQL_CRAWLER((short) 10), - MYSQL_CRAWLER((short) 11), - NETBIOS_CRAWLER((short) 12), - ORACLE_CRAWLER((short) 13), - POP_CRAWLER((short) 14), - POSTGRESQL_CRAWLER((short) 15), - REDIS_CRAWLER((short) 16), - JMX_CRAWLER((short) 17), - SMB_CRAWLER((short) 18), - SMTP_CRAWLER((short) 19), - SNMP_CRAWLER((short) 20), - SSH_CRAWLER((short) 21), - TELNET_CRAWLER((short) 22), - WMI_CRAWLER((short) 23), - UNKNOWN_CRAWLER((short) 24); - - private Short value; - - private MetaCrawlerEnum(Short value) { - this.value = value; - } - - public Short getValue() { - return this.value; - } - -}