This commit is contained in:
geek
2018-04-24 16:13:04 +09:00
parent 3308dce4fc
commit 8ca180c1eb
151 changed files with 568 additions and 942 deletions

View File

@@ -0,0 +1,78 @@
package com.loafle.overflow.model.apikey;
import com.loafle.overflow.model.domain.Domain;
import javax.persistence.*;
import java.util.Date;
@Entity
@Table(name = "API_KEY", schema = "public")
public class ApiKey {
private long id;
private String apiKey;
private Date createDate;
private Domain domain;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@Column(name = "API_KEY", nullable = false, unique = true,length = 50)
public String getApiKey() {
return apiKey;
}
public void setApiKey(String apiKey) {
this.apiKey = apiKey;
}
@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 = "DOMAIN_ID", nullable=false)
public Domain getDomain() {
return domain;
}
public void setDomain(Domain domain) {
this.domain = domain;
}
//
// @Override
// public boolean equals(Object o) {
// if (this == o) return true;
// if (o == null || getClass() != o.getClass()) return false;
//
// TblApiKey tblApiKey = (TblApiKey) o;
//
// if (id != tblApiKey.id) return false;
// if (domainId != tblApiKey.domainId) return false;
// if (apiKey != null ? !apiKey.equals(tblApiKey.apiKey) : tblApiKey.apiKey != null) return false;
// if (createDate != null ? !createDate.equals(tblApiKey.createDate) : tblApiKey.createDate != null) return false;
//
// return true;
// }
//
// @Override
// public int hashCode() {
// int result = (int) (id ^ (id >>> 32));
// result = 31 * result + (apiKey != null ? apiKey.hashCode() : 0);
// result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
// result = 31 * result + (int) (domainId ^ (domainId >>> 32));
// return result;
// }
}

View File

@@ -0,0 +1,72 @@
package com.loafle.overflow.model.auth;
import com.loafle.overflow.model.meta.MetaCrawler;
import com.loafle.overflow.model.target.Target;
import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction;
import javax.persistence.*;
import java.util.Date;
/**
* Created by geek on 17. 11. 7.
*/
@Entity
@Table(name = "AUTH_CRAWLER", schema = "public")
public class AuthCrawler {
private long id;
private MetaCrawler crawler;
private Target target;
private String authJson;
private Date createDate;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@ManyToOne
@JoinColumn(name = "CRAWLER_ID", nullable = false)
public MetaCrawler getCrawler() {
return crawler;
}
public void setCrawler(MetaCrawler crawler) {
this.crawler = crawler;
}
@ManyToOne
@OnDelete(action = OnDeleteAction.CASCADE)
@JoinColumn(name = "TARGET_ID", nullable = false)
public Target getTarget() {
return target;
}
public void setTarget(Target target) {
this.target = target;
}
@Column(name = "AUTH_JSON", nullable = false)
public String getAuthJson() {
return authJson;
}
public void setAuthJson(String authJson) {
this.authJson = authJson;
}
@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;
}
}

View File

@@ -0,0 +1,13 @@
package com.loafle.overflow.model.discovery;
/**
* DiscoveryHost
*/
public class DiscoverHost {
private String firstScanRange;
private String lastScanRange;
private String[] excludeHosts;
private String[] includeHosts;
private DiscoverPort discoverPort;
}

View File

@@ -0,0 +1,15 @@
package com.loafle.overflow.model.discovery;
/**
* DiscoveryPort
*/
public class DiscoverPort {
private int firstScanRange;
private int lastScanRange;
private int[] excludePorts;
private boolean includeTCP;
private boolean includeUDP;
private DiscoverService discoverService;
}

View File

@@ -0,0 +1,8 @@
package com.loafle.overflow.model.discovery;
/**
* DiscoveryService
*/
public class DiscoverService {
private String[] includeServices;
}

View File

@@ -0,0 +1,9 @@
package com.loafle.overflow.model.discovery;
/**
* DiscoveryZone
*/
public class DiscoverZone {
private String[] excludePatterns;
private DiscoverHost discoverHost;
}

View File

@@ -0,0 +1,20 @@
package com.loafle.overflow.model.discovery;
import java.util.Date;
/**
* Created by root on 17. 6. 4.
*/
public class Host {
private long id;
private String ip;
private String mac;
private String os;
private Date discoveredDate;
private Zone zone;
}

View File

@@ -0,0 +1,19 @@
package com.loafle.overflow.model.discovery;
import com.loafle.overflow.core.type.PortType;
import java.util.Date;
/**
* Created by root on 17. 6. 4.
*/
public class Port {
private long id;
private PortType portType;
private int portNumber;
private Date discoveredDate;
private Host host;
}

View File

@@ -0,0 +1,20 @@
package com.loafle.overflow.model.discovery;
import java.util.Date;
import com.loafle.overflow.core.type.CryptoType;
/**
* Created by root on 17. 6. 4.
*/
public class Service {
private long id;
private CryptoType cryptoType;
private String serviceName;
private Date discoveredDate;
private Port port;
}

View File

@@ -0,0 +1,16 @@
package com.loafle.overflow.model.discovery;
import java.util.Date;
/**
* Created by snoop on 17. 10. 31.
*/
public class Zone {
private long id;
private String network;
private String ip;
private String iface;
private String mac;
private Date discoveredDate;
}

View File

@@ -0,0 +1,52 @@
package com.loafle.overflow.model.domain;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "DOMAIN", schema = "public")
public class Domain {
private long id;
private String name;
private Date createDate;
public Domain() {
}
public Domain(long id) {
this.id = id;
}
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@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", insertable = false, updatable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}

View File

@@ -0,0 +1,59 @@
package com.loafle.overflow.model.domain;
import com.loafle.overflow.model.member.Member;
import javax.persistence.*;
import java.sql.Timestamp;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "DOMAIN_MEMBER", schema = "public")
public class DomainMember {
private long id;
private Timestamp createDate;
private Member member;
private Domain domain;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@Basic
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Timestamp getCreateDate() {
return createDate;
}
public void setCreateDate(Timestamp createDate) {
this.createDate = createDate;
}
@ManyToOne
@JoinColumn(name = "MEMBER_ID", nullable = false)
public Member getMember() {
return member;
}
public void setMember(Member member) {
this.member = member;
}
@ManyToOne
@JoinColumn(name = "DOMAIN_ID", nullable = false)
public Domain getDomain() {
return domain;
}
public void setDomain(Domain domain) {
this.domain = domain;
}
}

View File

@@ -0,0 +1,69 @@
package com.loafle.overflow.model.email;
import com.loafle.overflow.model.member.Member;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "EMAIL_AUTH", schema = "public")
public class EmailAuth {
private long id;
private String emailAuthKey;
private Date createDate;
private Date authConfirmDate;
private Member member;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@Basic
@Column(name = "EMAIL_AUTH_KEY", nullable = true, length = 50)
public String getEmailAuthKey() {
return emailAuthKey;
}
public void setEmailAuthKey(String emailAuthKey) {
this.emailAuthKey = emailAuthKey;
}
@Basic
@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;
}
@Basic
@Column(name = "AUTH_CONFIRM_DATE", nullable = true, insertable = true, updatable = true)
public Date getAuthConfirmDate() {
return authConfirmDate;
}
public void setAuthConfirmDate(Date authConfirmDate) {
this.authConfirmDate = authConfirmDate;
}
@ManyToOne
@JoinColumn(name = "MEMBER_ID", nullable = false)
public Member getMember() {
return member;
}
public void setMember(Member member) {
this.member = member;
}
}

View File

@@ -0,0 +1,116 @@
package com.loafle.overflow.model.history;
import com.loafle.overflow.model.domain.Domain;
import com.loafle.overflow.model.member.Member;
import com.loafle.overflow.model.meta.MetaHistoryType;
import com.loafle.overflow.model.probe.Probe;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "HISTORY", schema = "public")
public class History {
private long id;
private Date createDate;
private MetaHistoryType type;
private String message;
private Probe probe;
private Member member;
private Domain domain;
//private MetaResultType resultType; // i'm not sure this is necessary
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@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 = "TYPE_ID", nullable = false)
public MetaHistoryType getType() {
return type;
}
public void setType(MetaHistoryType type) {
this.type = type;
}
@Column(name = "MESSAGE", nullable = false, length = 255)
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
@ManyToOne
@JoinColumn(name = "PROBE_ID", nullable = false)
public Probe getProbe() {
return probe;
}
public void setProbe(Probe probe) {
this.probe = probe;
}
@ManyToOne
@JoinColumn(name = "MEMBER_ID", nullable = false)
public Member getMember() {
return member;
}
public void setMember(Member member) {
this.member = member;
}
@ManyToOne
@JoinColumn(name = "DOMAIN_ID", nullable = false)
public Domain getDomain() {
return domain;
}
public void setDomain(Domain domain) {
this.domain = domain;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
History that = (History) o;
if (id != that.id) 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 + (createDate != null ? createDate.hashCode() : 0);
return result;
}
}

View File

@@ -0,0 +1,183 @@
package com.loafle.overflow.model.infra;
import com.loafle.overflow.model.meta.MetaInfraType;
import com.loafle.overflow.model.probe.Probe;
import com.loafle.overflow.model.target.Target;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity(name = "INFRA")
@Table(name = "INFRA", schema = "public")
@Inheritance(strategy = InheritanceType.JOINED)
@DiscriminatorColumn(name = "INFRA_TYPE", discriminatorType = DiscriminatorType.INTEGER)
public abstract class Infra {
private long id;
private MetaInfraType infraType;
// private long childId;
private Date createDate;
private Probe probe;
private Target target;
// private InfraChild infraChild;
// private InfraHost infraHost;
// private InfraMachine infraMachine;
// private InfraOS infraOS;
/*
private long id;
private MetaInfraType infraType;
private long childId;
private Date createDate;
private Probe probeId;
private Target targetId;
*/
// @ManyToOne
// @JoinColumn(name = "CHILD_ID", nullable = false, insertable = false, updatable = false)
// public InfraHost getInfraChild() {
// return infraChild;
// }
//
// public void setInfraChild(InfraChild infraChild) {
// this.infraChild = infraChild;
// }
// @OneToOne
// @JoinColumn(name = "CHILD_ID")
// public InfraChild getInfraChild() {
// return infraChild;
// }
//
// public void setInfraChild(InfraChild infraChild) {
// this.infraChild = infraChild;
// }
// @ManyToOne
// @JoinColumn(name = "HOST_ID")
// public InfraHost getInfraHost() {
// return infraHost;
// }
//
// public void setInfraHost(InfraHost infraHost) {
// this.infraHost = infraHost;
// }
// @ManyToOne
// @JoinColumn(name = "MACHINE_ID")
// public InfraMachine getInfraMachine() {
// return infraMachine;
// }
//
// public void setInfraMachine(InfraMachine infraMachine) {
// this.infraMachine = infraMachine;
// }
//
// @ManyToOne
// @JoinColumn(name = "OS_ID")
// public InfraOS getInfraOS() {
// return infraOS;
// }
//
// public void setInfraOS(InfraOS infraOS) {
// this.infraOS = infraOS;
// }
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@ManyToOne
@JoinColumn(name = "TYPE_ID", nullable = false)
public MetaInfraType getInfraType() {
return infraType;
}
public void setInfraType(MetaInfraType infraType) {
this.infraType = infraType;
}
// @Basic
// @Column(name = "CHILD_ID", nullable = false)
// public long getChildId() {
// return childId;
// }
//
// public void setChildId(long childId) {
// this.childId = childId;
// }
@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() {
return probe;
}
public void setProbe(Probe probe) {
this.probe = probe;
}
@ManyToOne
@JoinColumn(name = "TARGET_ID", nullable = true)
public Target getTarget() {
return target;
}
public void setTarget(Target target) {
this.target = target;
}
// public static Infra CreateInfraByType(long id, Class c) {
//
// Infra infra = new Infra();
//// infra.setChildId(id);
//
// MetaInfraType infraType = new MetaInfraType();
// if(c == InfraMachine.class) {
// infraType.setId(1);
// }
// else if(c == InfraHost.class) {
// infraType.setId(2);
// }
// else if(c == InfraOS.class) {
// infraType.setId(3);
// }
// else if(c == InfraOSApplication.class) {
// infraType.setId(4);
// }
// else if(c == InfraOSDaemon.class) {
// infraType.setId(5);
// }
// else if(c == InfraOSPort.class) {
// infraType.setId(6);
// }
// else if(c == InfraService.class) {
// infraType.setId(7);
// }
//
// infra.setInfraType(infraType);
//
// return infra;
// }
}

View File

@@ -0,0 +1,69 @@
package com.loafle.overflow.model.infra;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity(name = "INFRA_HOST")
@Table(name = "INFRA_HOST", schema = "public")
@DiscriminatorValue("2")
public class InfraHost extends Infra {
// private long id;
private InfraOS os;
private long ip;
private long 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 = "OS_ID", nullable = true)
public InfraOS getOs() {
return os;
}
public void setOs(InfraOS os) {
this.os = os;
}
@Basic
@Column(name = "IP", nullable = true)
public long getIp() {
return ip;
}
public void setIp(long ip) {
this.ip = ip;
}
@Basic
@Column(name = "MAC", nullable = true)
public long getMac() {
return mac;
}
public void setMac(long 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;
}
}

View File

@@ -0,0 +1,55 @@
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;
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;
// }
//
// public void setId(long id) {
// this.id = id;
// }
@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", insertable = false, updatable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}

View File

@@ -0,0 +1,72 @@
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 machine;
private String meta;
private Date createDate;
private MetaInfraVendor vendor;
// @Id
// @GeneratedValue(strategy= GenerationType.IDENTITY)
// public long getId() {
// return id;
// }
//
// public void setId(long id) {
// this.id = id;
// }
@ManyToOne
@JoinColumn(name = "MACHINE_ID", nullable = true)
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 = 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 = "VENDOR_ID", nullable = true)
public MetaInfraVendor getVendor() {
return vendor;
}
public void setVendor(MetaInfraVendor vendor) {
this.vendor = vendor;
}
}

View File

@@ -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(name = "INFRA_OS_APPLICATION")
@Table(name = "INFRA_OS_APPLICATION", schema = "public")
@DiscriminatorValue("4")
public class InfraOSApplication extends Infra {
// private long id;
private InfraOS os;
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 = "OS_ID", nullable = true)
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 = true, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}

View File

@@ -0,0 +1,57 @@
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 os;
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 = "OS_ID", nullable = true)
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 = true, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}

View File

@@ -0,0 +1,94 @@
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 os;
private Date createDate;
private Integer port;
private String portType;
private MetaInfraVendor vendor;
private boolean tlsType;
//
// @Id
// @GeneratedValue(strategy= GenerationType.IDENTITY)
// public long getId() {
// return id;
// }
//
// public void setId(long id) {
// this.id = id;
// }
@ManyToOne
@JoinColumn(name = "OS_ID", nullable = true)
public InfraOS getOs() {
return this.os;
}
public void setOs(InfraOS os) {
this.os = os;
}
@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 = "VENDOR_ID", nullable = true)
public MetaInfraVendor getVendor() {
return vendor;
}
public void setVendor(MetaInfraVendor vendor) {
this.vendor = vendor;
}
@Basic
@Column(name = "TLS_TYPE", nullable = true)
public boolean isTlsType() {
return tlsType;
}
public void setTlsType(boolean tlsType) {
this.tlsType = tlsType;
}
}

View File

@@ -0,0 +1,93 @@
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_SERVICE")
@Table(name = "INFRA_SERVICE", schema = "public")
@DiscriminatorValue("7")
public class InfraService extends Infra{
// private long id;
private InfraHost host;
private String portType;
private Integer port;
private MetaInfraVendor vendor;
private Date createDate;
private boolean tlsType;
// @Id
// @GeneratedValue(strategy= GenerationType.IDENTITY)
// public long getId() {
// return id;
// }
//
// public void setId(long id) {
// this.id = id;
// }
@ManyToOne
@JoinColumn(name = "HOST_ID", nullable = true)
public InfraHost getHost() {
return host;
}
public void setHost(InfraHost host) {
this.host = host;
}
@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;
}
@ManyToOne
@JoinColumn(name = "VENDOR_ID", nullable = true)
public MetaInfraVendor getVendor() {
return vendor;
}
public void setVendor(MetaInfraVendor vendor) {
this.vendor = vendor;
}
@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 = "TLS_TYPE", nullable = true)
public boolean isTlsType() {
return tlsType;
}
public void setTlsType(boolean tlsType) {
this.tlsType = tlsType;
}
}

View File

@@ -0,0 +1,131 @@
package com.loafle.overflow.model.member;
import com.loafle.overflow.model.meta.MetaMemberStatus;
import javax.persistence.*;
import java.util.Date;
/**
* Created by geek on 17. 11. 7.
*/
@Entity
@Table(name = "MEMBER", schema = "public")
public class Member {
private long id;
private String email;
private transient String pw;
private String name;
private String phone;
private String companyName;
private Date createDate;
private MetaMemberStatus status;
private int signinFailCount;
private boolean totpType;
public Member() {
}
public Member(long id) {
this.id = id;
}
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@Basic
@Column(name = "EMAIL", nullable = false, length = 50)
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
@Basic
@Column(name = "PW", nullable = true, length = 64)
public String getPw() {
return pw;
}
public void setPw(String pw) {
this.pw = pw;
}
@Basic
@Column(name = "NAME", nullable = true, length = 50)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Basic
@Column(name = "PHONE", nullable = true, length = 50)
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
@Basic
@Column(name = "COMPANY_NAME", nullable = true, length = 50)
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
@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 = "STATUS_ID", nullable = false)
public MetaMemberStatus getStatus() {
return status;
}
public void setStatus(MetaMemberStatus status) {
this.status = status;
}
@Column(name = "SIGNIN_FAIL_COUNT", nullable = true, columnDefinition = "int default 0")
public int getSigninFailCount(){
return this.signinFailCount;
}
public void setSigninFailCount(int failCount) {
this.signinFailCount = failCount;
}
@Basic
@Column(name = "TOTP_TYPE", nullable = false, columnDefinition = "boolean default false")
public boolean isTotpType() {
return totpType;
}
public void setTotpType(boolean totpType) {
this.totpType = totpType;
}
}

View File

@@ -0,0 +1,85 @@
package com.loafle.overflow.model.member;
import javax.persistence.*;
import java.util.Date;
/**
* Created by geek on 18. 3. 8.
*/
@Entity
@Table(name = "MEMBER_TOTP", schema = "public")
public class MemberTotp {
private long id;
private Member member;
private String secretCode;
private Date createDate;
private Date updateDate;
private String otpAuth;
public MemberTotp() {
}
public MemberTotp(long id) {
this.id = id;
}
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@OneToOne
@JoinColumn(name = "MEMBER_ID", nullable = false)
public Member getMember() {
return member;
}
public void setMember(Member member) {
this.member = member;
}
@Basic
@Column(name = "SECRET_CODE", nullable = false, length = 20)
public String getSecretCode() {
return secretCode;
}
public void setSecretCode(String secretCode) {
this.secretCode = secretCode;
}
@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;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "UPDATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = true)
public Date getUpdateDate() {
return updateDate;
}
public void setUpdateDate(Date updateDate) {
this.updateDate = updateDate;
}
@Transient
public String getOtpAuth() {
return otpAuth;
}
public void setOtpAuth(String otpAuthURL) {
this.otpAuth = otpAuthURL;
}
}

View File

@@ -0,0 +1,55 @@
package com.loafle.overflow.model.meta;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "META_CRAWLER", schema = "public")
public class MetaCrawler {
private short id;
private Date createDate;
private String name;
private String description;
@Id
public short getId() {
return id;
}
public void setId(short id) {
this.id = id;
}
@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;
}
@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;
}
}

View File

@@ -0,0 +1,167 @@
package com.loafle.overflow.model.meta;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "META_CRAWLER_INPUT_ITEM", schema = "public")
public class MetaCrawlerInputItem {
private int id;
private MetaInputType inputType;
private MetaCrawler crawler;
private String description;
private String name;
private Date createDate;
private boolean required;
private String defaultValue;
private String pattern;
private String keyName;
private String keyValue;
@Id
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
@ManyToOne
@JoinColumn(name = "TYPE_ID", nullable = false)
public MetaInputType getInputType() {
return inputType;
}
public void setInputType(MetaInputType inputType) {
this.inputType = inputType;
}
@ManyToOne
@JoinColumn(name = "CRAWLER_ID", nullable = false)
public MetaCrawler getCrawler() {
return crawler;
}
public void setCrawler(MetaCrawler crawler) {
this.crawler = crawler;
}
@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;
}
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;
}
@Column(name = "REQUIRED", nullable = false)
public boolean isRequired() {
return required;
}
public void setRequired(boolean required) {
this.required = required;
}
@Column(name = "DEFAULT_VALUE", nullable = true, length = 50)
public String getDefaultValue() {
return defaultValue;
}
public void setDefaultValue(String defaultValue) {
this.defaultValue = defaultValue;
}
@Column(name = "PATTERN", nullable = true, length = 50)
public String getPattern() {
return pattern;
}
public void setPattern(String pattern) {
this.pattern = pattern;
}
@Column(name = "KEY_NAME", nullable = true, length = 50)
public String getKeyName() {
return keyName;
}
public void setKeyName(String keyName) {
this.keyName = keyName;
}
@Column(name = "KEY_VALUE", nullable = true, length = 50)
public String getKeyValue() {
return keyValue;
}
public void setKeyValue(String keyValue) {
this.keyValue = keyValue;
}
// @Override
// public boolean equals(Object o) {
// if (this == o) return true;
// if (o == null || getClass() != o.getClass()) return false;
//
// MetaCrawlerInputItem that = (MetaCrawlerInputItem) o;
//
// if (id != that.id) return false;
// if (typeId != that.typeId) return false;
// if (crawlerId != that.crawlerId) return false;
// if (required != that.required) return false;
// if (desc != null ? !desc.equals(that.desc) : that.desc != null) 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;
// if (defaultValue != null ? !defaultValue.equals(that.defaultValue) : that.defaultValue != null) return false;
// if (pattern != null ? !pattern.equals(that.pattern) : that.pattern != null) return false;
// if (keyName != null ? !keyName.equals(that.keyName) : that.keyName != null) return false;
// if (keyValue != null ? !keyValue.equals(that.keyValue) : that.keyValue != null) return false;
//
// return true;
// }
//
// @Override
// public int hashCode() {
// int result = id;
// result = 31 * result + (int) typeId;
// result = 31 * result + (int) crawlerId;
// result = 31 * result + (desc != null ? desc.hashCode() : 0);
// result = 31 * result + (name != null ? name.hashCode() : 0);
// result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
// result = 31 * result + (required ? 1 : 0);
// result = 31 * result + (defaultValue != null ? defaultValue.hashCode() : 0);
// result = 31 * result + (pattern != null ? pattern.hashCode() : 0);
// result = 31 * result + (keyName != null ? keyName.hashCode() : 0);
// result = 31 * result + (keyValue != null ? keyValue.hashCode() : 0);
// return result;
// }
}

View File

@@ -0,0 +1,53 @@
package com.loafle.overflow.model.meta;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "META_HISTORY_TYPE", schema = "public")
public class MetaHistoryType {
private int id;
private String name;
private Date createDate;
public MetaHistoryType() {
}
public MetaHistoryType(int id) {
this.id = id;
}
@Id
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
@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", insertable = false, updatable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}

View File

@@ -0,0 +1,45 @@
package com.loafle.overflow.model.meta;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "META_INFRA_TYPE", schema = "public")
public class MetaInfraType {
private int id;
private String name;
private Date createDate;
@Id
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
@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)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}

View File

@@ -0,0 +1,106 @@
package com.loafle.overflow.model.meta;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "META_INFRA_VENDOR", schema = "public")
public class MetaInfraVendor {
private int id;
private String name;
private Date createDate;
private MetaInfraType infraType;
@Id
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
@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", insertable = false, updatable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
@ManyToOne
@JoinColumn(name = "TYPE_ID", nullable=false)
public MetaInfraType getInfraType() {
return infraType;
}
public void setInfraType(MetaInfraType infraType) {
this.infraType = infraType;
}
public static MetaInfraVendor CreateInfraVendorByOS(String osName) {
MetaInfraVendor vendor = new MetaInfraVendor();
if(osName == null || osName.length() <= 0) {
vendor.setId(28); // FIXME: Unknown
return vendor;
}
if(osName.equals("Windows")) {
vendor.setId(26);
}
else if(osName.equals("Linux")) {
vendor.setId(28); // ubuntu
} else {
vendor.setId(28); // 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(39);
}
else if(serviceName.equals("portgresql")) {
vendor.setId(39);
}
else if(serviceName.equals("wmi")) {
vendor.setId(39);
}
else if(serviceName.equals("snmpv2")) {
vendor.setId(39);
}
else {
vendor.setId(43); // unknown
}
return vendor;
}
}

View File

@@ -0,0 +1,55 @@
package com.loafle.overflow.model.meta;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "META_INPUT_TYPE", schema = "public")
public class MetaInputType {
private short id;
private String name;
private String description;
private Date createDate;
@Id
public short getId() {
return id;
}
public void setId(short id) {
this.id = id;
}
@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;
}
@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;
}
}

View File

@@ -0,0 +1,44 @@
package com.loafle.overflow.model.meta;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "META_MEMBER_STATUS", schema = "public")
public class MetaMemberStatus {
private short id;
private String name;
public MetaMemberStatus() {
}
public MetaMemberStatus(short id) {
this.id = id;
}
@Id
public short getId() {
return id;
}
public void setId(short id) {
this.id = id;
}
@Column(name = "Name", nullable = false, length = 10)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

View File

@@ -0,0 +1,43 @@
package com.loafle.overflow.model.meta;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
/**
* Created by snoop on 17. 6. 26.
*/
@Entity
@Table(name = "META_NOAUTH_PROBE_STATUS", schema = "public")
public class MetaNoAuthProbeStatus {
private short id;
private String name;
public MetaNoAuthProbeStatus() {
}
public MetaNoAuthProbeStatus(short id) {
this.id = id;
}
@Id
public short getId() {
return id;
}
public void setId(short id) {
this.id = id;
}
@Column(name = "Name", nullable = false, length = 10)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

View File

@@ -0,0 +1,54 @@
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;
}
}

View File

@@ -0,0 +1,45 @@
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 {
private short id;
private String architecture;
private Date createDate;
@Id
public short getId() {
return id;
}
public void setId(short id) {
this.id = id;
}
@Column(name = "ARCHITECTURE", nullable = true, length = 10)
public String getArchitecture() {
return architecture;
}
public void setArchitecture(String architecture) {
this.architecture = architecture;
}
@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;
}
}

View File

@@ -0,0 +1,45 @@
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 {
private short id;
private String name;
private Date createDate;
@Id
public short getId() {
return id;
}
public void setId(short id) {
this.id = id;
}
@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", insertable = false, updatable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}

View File

@@ -0,0 +1,68 @@
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 version;
private MetaProbeOs os;
private MetaProbeArchitecture architecture;
private Date createDate;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@ManyToOne
@JoinColumn(name = "VERSION_ID", nullable = false)
public MetaProbeVersion getVersion() {
return version;
}
public void setVersion(MetaProbeVersion version) {
this.version = version;
}
@ManyToOne
@JoinColumn(name = "OS_ID", nullable = false)
public MetaProbeOs getOs() {
return os;
}
public void setOs(MetaProbeOs os) {
this.os = os;
}
@ManyToOne
@JoinColumn(name = "ARCHITECTURE_ID", nullable = false)
public MetaProbeArchitecture getArchitecture() {
return architecture;
}
public void setArchitecture(MetaProbeArchitecture architecture) {
this.architecture = architecture;
}
@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;
}
}

View File

@@ -0,0 +1,43 @@
package com.loafle.overflow.model.meta;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
/**
* Created by snoop on 17. 6. 26.
*/
@Entity
@Table(name = "META_PROBE_STATUS", schema = "public")
public class MetaProbeStatus {
private short id;
private String name;
public MetaProbeStatus() {
}
public MetaProbeStatus(short id) {
this.id = id;
}
@Id
public short getId() {
return id;
}
public void setId(short id) {
this.id = id;
}
@Column(name = "Name", nullable = false, length = 10)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

View File

@@ -0,0 +1,56 @@
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 {
private short id;
private String name;
private String description;
private Date createDate;
@Id
public short getId() {
return id;
}
public void setId(short id) {
this.id = id;
}
@Column(name = "NAME", nullable = false, length = 50)
public String getName() {
return name;
}
public void setName(String name) {
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() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}

View File

@@ -0,0 +1,46 @@
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;
}
}

View File

@@ -0,0 +1,80 @@
package com.loafle.overflow.model.meta;
import javax.persistence.*;
import java.util.Date;
/**
* Created by insanity on 17. 9. 20.
*/
@Entity
@Table(name = "META_SENSOR_DISPLAY_ITEM", schema = "public")
public class MetaSensorDisplayItem {
private long id;
private String name;
private MetaCrawler crawler;
private MetaSensorItemUnit unit;
private Date createDate;
private MetaSensorItemType itemType;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@Column(name = "NAME", nullable = false, length = 50)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@ManyToOne
@JoinColumn(name = "CRAWLER_ID", nullable = false)
public MetaCrawler getCrawler() {
return crawler;
}
public void setCrawler(MetaCrawler crawler) {
this.crawler = crawler;
}
@ManyToOne
@JoinColumn(name = "UNIT_ID", nullable = true)
public MetaSensorItemUnit getUnit() {
return unit;
}
public void setUnit(MetaSensorItemUnit unit) {
this.unit = unit;
}
@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 = "TYPE_ID", nullable = false)
public MetaSensorItemType getItemType() {
return itemType;
}
public void setItemType(MetaSensorItemType itemType) {
this.itemType = itemType;
}
}

View File

@@ -0,0 +1,45 @@
package com.loafle.overflow.model.meta;
import javax.persistence.*;
/**
* Created by snoop on 18. 4. 24.
*/
@Entity
@Table(name = "META_SENSOR_DISPLAY_MAPPING", schema = "public")
public class MetaSensorDisplayMapping {
private long id;
private MetaSensorDisplayItem displayItem;
private MetaSensorItemKey itemKey;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@ManyToOne
@JoinColumn(name = "DISPLAY_ITEM_ID", nullable = false)
public MetaSensorDisplayItem getDisplayItem() {
return displayItem;
}
public void setDisplayItem(MetaSensorDisplayItem displayItem) {
this.displayItem = displayItem;
}
@ManyToOne
@JoinColumn(name = "ITEM_KEY_ID", nullable = false)
public MetaSensorItemKey getItemKey() {
return itemKey;
}
public void setItemKey(MetaSensorItemKey itemKey) {
this.itemKey = itemKey;
}
}

View File

@@ -0,0 +1,74 @@
package com.loafle.overflow.model.meta;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "META_SENSOR_ITEM", schema = "public")
public class MetaSensorItem {
private int id;
private MetaSensorItemType itemType;
private String key;
private String name;
private Date createDate;
@Id
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
// @Column(name = "TYPE_ID", nullable = false)
// public short getTypeId() {
// return typeId;
// }
//
// public void setTypeId(short typeId) {
// this.typeId = typeId;
// }
@ManyToOne
@JoinColumn(name = "TYPE_ID", nullable = false)
public MetaSensorItemType getItemType() {
return itemType;
}
public void setItemType(MetaSensorItemType itemType) {
this.itemType = itemType;
}
@Column(name = "KEY", nullable = true, length = 100)
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
@Column(name = "NAME", nullable = true, length = 100)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}

View File

@@ -0,0 +1,97 @@
package com.loafle.overflow.model.meta;
import javax.persistence.*;
import java.util.Date;
/**
* Created by snoop on 17. 8. 29.
*/
@Entity
@Table(name = "META_SENSOR_ITEM_KEY", schema = "public")
public class MetaSensorItemKey {
private long id;
private MetaSensorItem item;
private String key;
private String froms;
private String option;
private MetaCrawler crawler;
private Date createDate;
private MetaSensorItemUnit unit;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@ManyToOne
@JoinColumn(name = "ITEM_ID", nullable = false)
public MetaSensorItem getItem() {
return item;
}
public void setItem(MetaSensorItem item) {
this.item = item;
}
@Column(name = "KEY", nullable = false, length = 100)
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
@Column(name = "FROMS", nullable = false, length = 100)
public String getFroms() {
return froms;
}
public void setFroms(String froms) {
this.froms = froms;
}
@Column(name = "OPTION_JSON", nullable = true)
public String getOption() {
return option;
}
public void setOption(String option) {
this.option = option;
}
@ManyToOne
@JoinColumn(name = "CRAWLER_ID", nullable = false)
public MetaCrawler getCrawler() {
return crawler;
}
public void setCrawler(MetaCrawler crawler) {
this.crawler = crawler;
}
@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 = "UNIT_ID", nullable = true)
public MetaSensorItemUnit getUnit() {
return unit;
}
public void setUnit(MetaSensorItemUnit unit) {
this.unit = unit;
}
}

View File

@@ -0,0 +1,63 @@
package com.loafle.overflow.model.meta;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "META_SENSOR_ITEM_TYPE", schema = "public")
public class MetaSensorItemType {
private short id;
private String name;
private String description;
private Date createDate;
public MetaSensorItemType() {
}
public MetaSensorItemType(short id) {
this.id = id;
}
@Id
public short getId() {
return id;
}
public void setId(short id) {
this.id = id;
}
@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;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}

View File

@@ -0,0 +1,53 @@
package com.loafle.overflow.model.meta;
import javax.persistence.*;
import java.util.Date;
/**
* Created by insanity on 17. 9. 19.
*/
@Entity
@Table(name = "META_SENSOR_ITEM_UNIT", schema = "public")
public class MetaSensorItemUnit {
private short id;
private String unit;
private Date createDate;
private String mark;
@Id
public short getId() {
return id;
}
public void setId(short id) {
this.id = id;
}
@Column(name = "UNIT", nullable = false)
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
@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;
}
@Column(name = "MARK", nullable = false)
public String getMark() {
return mark;
}
public void setMark(String mark) {
this.mark = mark;
}
}

View File

@@ -0,0 +1,43 @@
package com.loafle.overflow.model.meta;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
/**
* Created by snoop on 17. 6. 26.
*/
@Entity
@Table(name = "META_SENSOR_STATUS", schema = "public")
public class MetaSensorStatus {
private short id;
private String name;
public MetaSensorStatus() {
}
public MetaSensorStatus(short id) {
this.id = id;
}
@Id
public short getId() {
return id;
}
public void setId(short id) {
this.id = id;
}
@Column(name = "Name", nullable = false, length = 10)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

View File

@@ -0,0 +1,76 @@
package com.loafle.overflow.model.meta;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "META_VENDOR_CRAWLER", schema = "public")
public class MetaVendorCrawler {
private int id;
private MetaCrawler crawler;
private MetaInfraVendor infraVendor;
private Date createDate;
@Id
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
@ManyToOne
@JoinColumn(name = "CRAWLER_ID", nullable = false)
public MetaCrawler getCrawler() {
return crawler;
}
public void setCrawler(MetaCrawler crawler) {
this.crawler = crawler;
}
@ManyToOne
@JoinColumn(name = "VENDOR_ID", nullable = false)
public MetaInfraVendor getInfraVendor() {
return infraVendor;
}
public void setInfraVendor(MetaInfraVendor infraVendor) {
this.infraVendor = infraVendor;
}
// @Basic
// @Column(name = "CRAWLER_ID", nullable = false)
// public short getCrawlerId() {
// return crawlerId;
// }
//
// public void setCrawlerId(short crawlerId) {
// this.crawlerId = crawlerId;
// }
//
// @Basic
// @Column(name = "VENDOR_ID", nullable = false)
// public int getVendorId() {
// return vendorId;
// }
//
// public void setVendorId(int vendorId) {
// this.vendorId = vendorId;
// }
@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;
}
}

View File

@@ -0,0 +1,91 @@
package com.loafle.overflow.model.meta;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "META_VENDOR_CRAWLER_SENSOR_ITEM", schema = "public")
public class MetaVendorCrawlerSensorItem {
private long id;
private String interval;
private String warnCondition;
private Date createDate;
private MetaSensorItem sensorItem;
private MetaInfraVendor vendor;
private short crawlerId;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@Column(name = "INTERVAL", nullable = true, length = 50)
public String getInterval() {
return interval;
}
public void setInterval(String interval) {
this.interval = interval;
}
@Column(name = "WARN_CONDITION", nullable = true, length = 50)
public String getWarnCondition() {
return warnCondition;
}
public void setWarnCondition(String warnCondition) {
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 = "ITEM_ID", nullable = false)
public MetaSensorItem getSensorItem() {
return sensorItem;
}
public void setSensorItem(MetaSensorItem sensorItem) {
this.sensorItem = sensorItem;
}
@ManyToOne
@JoinColumn(name = "VENDOR_ID", nullable = false)
public MetaInfraVendor getVendor() {
return vendor;
}
public void setVendor(MetaInfraVendor vendor) {
this.vendor = vendor;
}
@Basic
@Column(name = "CRAWLER_ID", nullable = false)
public short getCrawlerId() {
return crawlerId;
}
public void setCrawlerId(short crawlerId) {
this.crawlerId = crawlerId;
}
}

View File

@@ -0,0 +1,44 @@
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;
}
}

View File

@@ -0,0 +1,138 @@
package com.loafle.overflow.model.noauthprobe;
import com.loafle.overflow.model.domain.Domain;
import com.loafle.overflow.model.meta.MetaNoAuthProbeStatus;
import com.loafle.overflow.model.probe.Probe;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "NOAUTH_PROBE", schema = "public")
public class NoAuthProbe {
private long id;
private String description;
private MetaNoAuthProbeStatus status;
private String tempProbeKey;
private Date createDate;
private String apiKey;
private Domain domain;
private Probe probe;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@Column(name = "DESCRIPTION", nullable = true, length = 1000)
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@ManyToOne
@JoinColumn(name = "STATUS", nullable = false)
public MetaNoAuthProbeStatus getStatus() {
return status;
}
public void setStatus(MetaNoAuthProbeStatus status) {
this.status = status;
}
@Column(name = "TEMP_PROBE_KEY", nullable = false, length = 50, unique = true)
public String getTempProbeKey() {
return tempProbeKey;
}
public void setTempProbeKey(String tempProbeKey) {
this.tempProbeKey = tempProbeKey;
}
@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;
}
@Column(name = "API_KEY", nullable = true, length = 50)
public String getApiKey() {
return apiKey;
}
public void setApiKey(String apiKey) {
this.apiKey = apiKey;
}
@ManyToOne
@JoinColumn(name = "DOMAIN_ID", nullable=false)
public Domain getDomain() {
return domain;
}
public void setDomain(Domain domain) {
this.domain = domain;
}
@ManyToOne
@JoinColumn(name = "PROBE_ID", nullable = true)
public Probe getProbe() {
return probe;
}
public void setProbe(Probe probe) {
this.probe = probe;
}
// @Override
// public boolean equals(Object o) {
// if (this == o) return true;
// if (o == null || getClass() != o.getClass()) return false;
//
// NoAuthProbe that = (NoAuthProbe) o;
//
// if (id != that.id) return false;
// if (domainId != that.domainId) return false;
// if (hostName != null ? !hostName.equals(that.hostName) : that.hostName != null) return false;
// if (macAddress != null ? !macAddress.equals(that.macAddress) : that.macAddress != null) return false;
// if (ipAddress != null ? !ipAddress.equals(that.ipAddress) : that.ipAddress != null) return false;
// if (status != null ? !status.equals(that.status) : that.status != null) return false;
// if (tempProbeKey != null ? !tempProbeKey.equals(that.tempProbeKey) : that.tempProbeKey != null) return false;
// if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;
// if (apiKey != null ? !apiKey.equals(that.apiKey) : that.apiKey != null) return false;
// if (probeId != null ? !probeId.equals(that.probeId) : that.probeId != null) return false;
//
// return true;
// }
//
// @Override
// public int hashCode() {
// int result = (int) (id ^ (id >>> 32));
// result = 31 * result + (hostName != null ? hostName.hashCode() : 0);
// result = 31 * result + (macAddress != null ? macAddress.hashCode() : 0);
// result = 31 * result + (ipAddress != null ? ipAddress.hashCode() : 0);
// result = 31 * result + (status != null ? status.hashCode() : 0);
// result = 31 * result + (tempProbeKey != null ? tempProbeKey.hashCode() : 0);
// result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
// result = 31 * result + (apiKey != null ? apiKey.hashCode() : 0);
// result = 31 * result + (int) (domainId ^ (domainId >>> 32));
// result = 31 * result + (probeId != null ? probeId.hashCode() : 0);
// return result;
// }
}

View File

@@ -0,0 +1,89 @@
package com.loafle.overflow.model.notification;
import com.loafle.overflow.model.member.Member;
import javax.persistence.*;
import java.util.Date;
/**
* Created by insanity on 17. 8. 25.
*/
@Entity
@Table(name = "NOTIFICATION", schema = "public")
public class Notification {
private long id;
private Date createDate;
private String title;
private String message;
private Member member;
private Date confirmDate;
private String url;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@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;
}
@Column(name = "TITLE", nullable = false, length = 50)
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
@Column(name = "MESSAGE", nullable = false, length = 255)
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
@ManyToOne
@JoinColumn(name = "MEMBER_ID", nullable = false)
public Member getMember() {
return member;
}
public void setMember(Member member) {
this.member = member;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CONFIRM_DATE", nullable = true)
public Date getConfirmDate() {
return confirmDate;
}
public void setConfirmDate(Date confirmDate) {
this.confirmDate = confirmDate;
}
@Column(name = "URL", nullable = false, length = 255)
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
}

View File

@@ -0,0 +1,175 @@
package com.loafle.overflow.model.probe;
import com.loafle.overflow.model.domain.Domain;
import com.loafle.overflow.model.member.Member;
import com.loafle.overflow.model.meta.MetaProbeStatus;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "PROBE", schema = "public")
public class Probe {
private long id;
private MetaProbeStatus status;
private String description;
private Date createDate;
private Domain domain;
private String probeKey;
private String encryptionKey;
private int targetCount;
private int sensorCount;
private String displayName;
private String cidr;
private Date authorizeDate;
private Member authorizeMember;
// private InfraHost host;
public Probe() {
}
public Probe(long id) {
this.id = id;
}
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@ManyToOne
@JoinColumn(name = "STATUS", nullable = false)
public MetaProbeStatus getStatus() {
return status;
}
public void setStatus(MetaProbeStatus status) {
this.status = status;
}
@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() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
@ManyToOne
@JoinColumn(name = "DOMAIN_ID", nullable = false)
public Domain getDomain() {
return domain;
}
public void setDomain(Domain domain) {
this.domain = domain;
}
@Column(name = "PROBE_KEY", nullable = false, unique = true)
public String getProbeKey() {
return probeKey;
}
public void setProbeKey(String probeKey) {
this.probeKey = probeKey;
}
@Column(name = "ENCRYPTION_KEY", nullable = false, length = 100, unique = true)
public String getEncryptionKey() {
return encryptionKey;
}
public void setEncryptionKey(String encryptionKey) {
this.encryptionKey = encryptionKey;
}
@Column(name = "TARGET_COUNT", nullable = false)
public int getTargetCount() {
return targetCount;
}
public void setTargetCount(int targetCount) {
this.targetCount = targetCount;
}
@Column(name = "SENSOR_COUNT", nullable = false)
public int getSensorCount() {
return sensorCount;
}
public void setSensorCount(int sensorCount) {
this.sensorCount = sensorCount;
}
@Column(name = "DISPLAY_NAME")
public String getDisplayName() {
return displayName;
}
public void setDisplayName(String displayName) {
this.displayName = displayName;
}
@Column(name = "CIDR")
public String getCidr() {
return cidr;
}
public void setCidr(String cidr) {
this.cidr = cidr;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "AUTHORIZE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Date getAuthorizeDate() {
return authorizeDate;
}
public void setAuthorizeDate(Date authorizeDate) {
this.authorizeDate = authorizeDate;
}
@ManyToOne
@JoinColumn(name = "AUTHORIZE_MEMBER_ID", nullable = false)
public Member getAuthorizeMember() {
return authorizeMember;
}
public void setAuthorizeMember(Member authorizeMember) {
this.authorizeMember = authorizeMember;
}
//
// @ManyToOne
// @JoinColumn(name = "HOST_ID", nullable = false)
// public InfraHost getHost() {
// return host;
// }
//
// public void setHost(InfraHost host) {
// this.host = host;
// }
}

View File

@@ -0,0 +1,48 @@
package com.loafle.overflow.model.probe;
import com.loafle.overflow.model.infra.InfraHost;
import javax.persistence.*;
/**
* Created by insanity on 17. 8. 21.
*/
@Entity
@Table(name = "PROBE_INFRAHOST", schema = "public")
public class ProbeHost {
private long id;
private Probe probe;
private InfraHost host;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@OneToOne
@JoinColumn(name = "PROBE_ID", nullable = false)
public Probe getProbe() {
return probe;
}
public void setProbe(Probe probe) {
this.probe = probe;
}
@OneToOne
@JoinColumn(name = "HOST_ID", nullable = false)
public InfraHost getHost() {
return host;
}
public void setHost(InfraHost infraHost) {
this.host = infraHost;
}
}

View File

@@ -0,0 +1,143 @@
package com.loafle.overflow.model.probe;
import com.loafle.overflow.model.meta.MetaProbeTaskType;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "PROBE_TASK", schema = "public")
public class ProbeTask {
private long id;
private MetaProbeTaskType taskType;
private Probe probe;
private String data;
private Date createDate;
private Date sendDate;
private Date startDate;
private Date endDate;
private Boolean succeed;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@ManyToOne
@JoinColumn(name = "TYPE_ID", nullable = false)
public MetaProbeTaskType getTaskType() {
return taskType;
}
public void setTaskType(MetaProbeTaskType taskType) {
this.taskType = taskType;
}
@ManyToOne
@JoinColumn(name = "PROBE_ID", nullable = false)
public Probe getProbe() {
return probe;
}
public void setProbe(Probe probe) {
this.probe = probe;
}
@Column(name = "DATA", nullable = true, length = 255)
public String getData() {
return data;
}
public void setData(String data) {
this.data = data;
}
@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;
}
@Column(name = "SEND_DATE", nullable = true)
public Date getSendDate() {
return sendDate;
}
public void setSendDate(Date sendDate) {
this.sendDate = sendDate;
}
@Column(name = "START_DATE", nullable = true)
public Date getStartDate() {
return startDate;
}
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
@Column(name = "END_DATE", nullable = true)
public Date getEndDate() {
return endDate;
}
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
@Column(name = "SUCCEED", nullable = true)
public Boolean getSucceed() {
return succeed;
}
public void setSucceed(Boolean succeed) {
this.succeed = succeed;
}
// @Override
// public boolean equals(Object o) {
// if (this == o) return true;
// if (o == null || getClass() != o.getClass()) return false;
//
// ProbeTask that = (ProbeTask) o;
//
// if (id != that.id) return false;
// if (typeId != that.typeId) return false;
// if (probeId != that.probeId) return false;
// if (data != null ? !data.equals(that.data) : that.data != null) return false;
// if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;
// if (sendDate != null ? !sendDate.equals(that.sendDate) : that.sendDate != null) return false;
// if (startDate != null ? !startDate.equals(that.startDate) : that.startDate != null) return false;
// if (endDate != null ? !endDate.equals(that.endDate) : that.endDate != null) return false;
// if (succeed != null ? !succeed.equals(that.succeed) : that.succeed != null) return false;
//
// return true;
// }
//
// @Override
// public int hashCode() {
// int result = (int) (id ^ (id >>> 32));
// result = 31 * result + (int) typeId;
// result = 31 * result + (int) (probeId ^ (probeId >>> 32));
// result = 31 * result + (data != null ? data.hashCode() : 0);
// result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
// result = 31 * result + (sendDate != null ? sendDate.hashCode() : 0);
// result = 31 * result + (startDate != null ? startDate.hashCode() : 0);
// result = 31 * result + (endDate != null ? endDate.hashCode() : 0);
// result = 31 * result + (succeed != null ? succeed.hashCode() : 0);
// return result;
// }
}

View File

@@ -0,0 +1,95 @@
package com.loafle.overflow.model.sensor;
import com.loafle.overflow.model.meta.MetaCrawler;
import com.loafle.overflow.model.meta.MetaSensorStatus;
import com.loafle.overflow.model.target.Target;
import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "SENSOR", schema = "public")
public class Sensor {
private long id;
private Date createDate;
private String description;
private MetaSensorStatus status;
private Target target;
private MetaCrawler crawler;
private String crawlerInputItems;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@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;
}
@Column(name = "DESCRIPTION", nullable = true, length = 50)
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@ManyToOne
@JoinColumn(name = "STATUS")
public MetaSensorStatus getStatus() {
return status;
}
public void setStatus(MetaSensorStatus status) {
this.status = status;
}
@ManyToOne
@OnDelete(action = OnDeleteAction.CASCADE)
@JoinColumn(name = "TARGET_ID", nullable = false)
public Target getTarget() {
return target;
}
public void setTarget(Target target) {
this.target = target;
}
@ManyToOne
@JoinColumn(name = "CRAWLER_ID", nullable = false)
public MetaCrawler getCrawler() {
return crawler;
}
public void setCrawler(MetaCrawler crawler) {
this.crawler = crawler;
}
@Column(name = "CRAWLER_INPUT_ITEMS", nullable = true, length = 50)
public String getCrawlerInputItems() {
return crawlerInputItems;
}
public void setCrawlerInputItems(String crawlerInputItems) {
this.crawlerInputItems = crawlerInputItems;
}
}

View File

@@ -0,0 +1,62 @@
package com.loafle.overflow.model.sensor;
import com.loafle.overflow.model.meta.MetaSensorDisplayItem;
import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "SENSOR_ITEM", schema = "public")
public class SensorItem {
private long id;
private Sensor sensor;
private MetaSensorDisplayItem item;
private Date createDate;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@ManyToOne
@JoinColumn(name = "SENSOR_ID", nullable = false)
@OnDelete(action = OnDeleteAction.CASCADE)
public Sensor getSensor() {
return this.sensor;
}
public void setSensor(Sensor sensor) {
this.sensor = sensor;
}
@ManyToOne
@JoinColumn(name = "ITEM_ID", nullable = false)
public MetaSensorDisplayItem getItem() {
return item;
}
public void setItem(MetaSensorDisplayItem item) {
this.item = item;
}
@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;
}
}

View File

@@ -0,0 +1,48 @@
package com.loafle.overflow.model.sensor;
import com.loafle.overflow.model.meta.MetaSensorDisplayItem;
import com.loafle.overflow.model.meta.MetaSensorItemKey;
import javax.persistence.*;
/**
* Created by insanity on 17. 9. 20.
*/
@Entity
@Table(name = "SENSOR_ITEM_DEPENDENCY", schema = "public")
public class SensorItemDependency {
private long id;
private MetaSensorDisplayItem displayItem;
private MetaSensorItemKey sensorItem;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@ManyToOne
@JoinColumn(name = "DISPLAY_ITEM_ID", nullable = false)
public MetaSensorDisplayItem getDisplayItem() {
return displayItem;
}
public void setDisplayItem(MetaSensorDisplayItem displayItem) {
this.displayItem = displayItem;
}
@ManyToOne
@JoinColumn(name = "SENSOR_ITEM_ID", nullable = false)
public MetaSensorItemKey getSensorItem() {
return sensorItem;
}
public void setSensorItem(MetaSensorItemKey sensorItem) {
this.sensorItem = sensorItem;
}
}

View File

@@ -0,0 +1,45 @@
package com.loafle.overflow.model.sensorconfig;
import com.loafle.overflow.core.type.PortType;
/**
* Connection
*/
public class Connection {
private String ip;
private int port;
private PortType portType;
private boolean ssl;
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip;
}
public int getPort() {
return port;
}
public void setPort(int port) {
this.port = port;
}
public PortType getPortType() {
return portType;
}
public void setPortType(PortType portType) {
this.portType = portType;
}
public boolean isSsl() {
return ssl;
}
public void setSsl(boolean ssl) {
this.ssl = ssl;
}
}

View File

@@ -0,0 +1,25 @@
package com.loafle.overflow.model.sensorconfig;
/**
* Crawler
*/
public class Crawler {
private String name;
private String container;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getContainer() {
return container;
}
public void setContainer(String container) {
this.container = container;
}
}

View File

@@ -0,0 +1,37 @@
package com.loafle.overflow.model.sensorconfig;
import java.util.List;
/**
* Item
*/
public class Item {
private List<Keys> keys;
private QueryInfo queryInfo;
private MappingInfo mappingInfo;
public List<Keys> getKeys() {
return keys;
}
public void setKeys(List<Keys> keys) {
this.keys = keys;
}
public QueryInfo getQueryInfo() {
return queryInfo;
}
public void setQueryInfo(QueryInfo queryInfo) {
this.queryInfo = queryInfo;
}
public MappingInfo getMappingInfo() {
return mappingInfo;
}
public void setMappingInfo(MappingInfo mappingInfo) {
this.mappingInfo = mappingInfo;
}
}

View File

@@ -0,0 +1,36 @@
package com.loafle.overflow.model.sensorconfig;
import java.util.HashMap;
import java.util.Map;
/**
* Keys
*/
public class Keys {
private String metric;
private String key;
public String getMetric() {
return metric;
}
public void setMetric(String metric) {
this.metric = metric;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public static Map<String, String> keysToMap(Keys[] keys) {
Map<String, String> map = new HashMap<>();
for (Keys k : keys) {
map.put(k.key, k.metric);
}
return map;
}
}

View File

@@ -0,0 +1,45 @@
package com.loafle.overflow.model.sensorconfig;
import java.util.List;
/**
* MappingInfo
*/
public class MappingInfo {
private String parseDirection;
private List<String> arrayColumns;
private List<String> keyColumns;
private String valueColumn;
public String getParseDirection() {
return parseDirection;
}
public void setParseDirection(String parseDirection) {
this.parseDirection = parseDirection;
}
public List<String> getArrayColumns() {
return arrayColumns;
}
public void setArrayColumns(List<String> arrayColumns) {
this.arrayColumns = arrayColumns;
}
public List<String> getKeyColumns() {
return keyColumns;
}
public void setKeyColumns(List<String> keyColumns) {
this.keyColumns = keyColumns;
}
public String getValueColumn() {
return valueColumn;
}
public void setValueColumn(String valueColumn) {
this.valueColumn = valueColumn;
}
}

View File

@@ -0,0 +1,27 @@
package com.loafle.overflow.model.sensorconfig;
import java.util.Map;
/**
* QueryInfo
*/
public class QueryInfo {
private String query;
private Map<String, Object> extend;
public String getQuery() {
return query;
}
public void setQuery(String query) {
this.query = query;
}
public Map<String, Object> getExtend() {
return extend;
}
public void setExtend(Map<String, Object> extend) {
this.extend = extend;
}
}

View File

@@ -0,0 +1,71 @@
package com.loafle.overflow.model.sensorconfig;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* ResultSet
*/
public abstract class ResultSet {
protected Item item;
protected List<List<String>> rows;
protected Map<String, Integer> meta;
// methods
public static ResultSet newInstance(Item item) {
if (item.getMappingInfo() == null) {
item.setMappingInfo(new MappingInfo());
}
String type = (String) item.getMappingInfo().getParseDirection();
if (type != null && type.equals("row")) {
return new ResultSetRow(item);
} else {
return new ResultSetCol(item);
}
}
public ResultSet(Item item) {
this.item = item;
this.rows = new ArrayList<>();
this.setMeta();
}
public void addRow(List<String> row) {
rows.add(row);
}
public List<List<String>> getRows() {
return rows;
}
public void setRows(List<List<String>> rows) {
this.rows = rows;
}
public Map<String, Integer> getMeta() {
return meta;
}
public void setMeta(Map<String, Integer> meta) {
this.meta = meta;
}
public Item getItem() {
return item;
}
public void setItem(Item item) {
this.item = item;
}
public Map<String, String> getData() {
return parse();
}
// abstracts
public abstract void setMeta();
public abstract Map<String, String> parse();
}

View File

@@ -0,0 +1,102 @@
package com.loafle.overflow.model.sensorconfig;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* ResultSetCol
*/
public class ResultSetCol extends ResultSet {
public ResultSetCol(Item item) {
super(item);
}
public void setMeta() {
List<Keys> meta = this.item.getKeys();
List<String> arrayColumns = this.item.getMappingInfo().getArrayColumns();
if (this.meta == null) {
this.meta = new HashMap<>();
}
for (int indexI = 0; indexI < meta.size(); ++indexI) {
this.meta.put(meta.get(indexI).getKey(), indexI);
}
if (arrayColumns != null) {
for (int indexI = 0; indexI < arrayColumns.size(); ++indexI) {
if (this.meta.containsKey(arrayColumns.get(indexI))) {
continue;
}
this.meta.put(arrayColumns.get(indexI), indexI + meta.size());
}
}
}
public Map<String, String> parse() {
List<Keys> metrics = this.item.getKeys();
List<String> arrayColumns = this.item.getMappingInfo().getArrayColumns();
Map<String, String> resultMap = new HashMap<>();
List<String> row = null;
String metric = null;
List<String> arrayValue = new ArrayList<>();
int columnIdx = 0;
for (int indexI = 0; indexI < this.rows.size(); ++indexI) {
row = this.rows.get(indexI);
for (int indexJ = 0; indexJ < row.size(); ++indexJ) {
arrayValue.clear();
if (arrayColumns != null) {
for (int indexL = 0; indexL < arrayColumns.size(); ++indexL) {
columnIdx = this.meta.get(arrayColumns.get(indexL));
arrayValue.add(row.get(columnIdx));
}
}
for (int indexK = 0; indexK < metrics.size(); ++indexK) {
metric = metrics.get(indexK).getMetric();
metric = convertMetric(metric, arrayValue);
resultMap.put(metric, row.get(indexK));
}
}
}
return resultMap;
}
private String convertMetric(String metric, List<String> arrayValue) {
if (arrayValue == null || arrayValue.size() <= 0) {
return metric;
}
String convertChar = "$";
String convertStr = null;
for (int indexI = 0; indexI < arrayValue.size(); ++indexI) {
convertStr = convertChar + String.valueOf(indexI);
metric = metric.replace(convertStr, arrayValue.get(indexI));
}
return metric;
}
}

View File

@@ -0,0 +1,107 @@
package com.loafle.overflow.model.sensorconfig;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* ResultSetRow
*/
public class ResultSetRow extends ResultSet {
public ResultSetRow(Item item) {
super(item);
}
public void setMeta() {
List<String> meta = new ArrayList<>();
List<String> arrayColumns = (List<String>) this.item.getMappingInfo().getArrayColumns();
List<String> keyColumns = (List<String>) this.item.getMappingInfo().getKeyColumns();
String valueColumn = (String) this.item.getMappingInfo().getValueColumn();
if (arrayColumns != null) {
for (String c : arrayColumns) {
meta.add(c);
}
}
if (keyColumns != null) {
for (String c : keyColumns) {
meta.add(c);
}
}
if (valueColumn != null && !valueColumn.equals(""))
meta.add(valueColumn);
if (this.meta == null) {
this.meta = new HashMap<>();
}
for (int indexI = 0; indexI < meta.size(); ++indexI) {
this.meta.put(meta.get(indexI), indexI);
}
}
public Map<String, String> parse() {
Map<String, String> returnMap = new HashMap<>();
String valueColumn = (String) this.item.getMappingInfo().getValueColumn();
for (List<String> row : this.rows) {
String key = makeKey(row);
if (key == null)
continue;
returnMap.put(key, row.get(this.meta.get(valueColumn)));
}
return returnMap;
}
private String makeKey(List<String> data) {
List<Keys> metrics = this.item.getKeys();
List<String> arrayColumns = (List<String>) this.item.getMappingInfo().getArrayColumns();
List<String> keyColumns = (List<String>) this.item.getMappingInfo().getKeyColumns();
List<Keys> keys = this.item.getKeys();
boolean find = false;
int findIndex = -1;
for (String keyColumn : keyColumns) {
String row = data.get(this.meta.get(keyColumn));
for (int i = 0; i < keys.size(); ++i) {
if (row.equals(keys.get(i).getKey())) {
findIndex = i;
find = true;
break;
}
}
if (find == true) {
break;
}
}
if (findIndex < 0) {
return null;
}
String metric = metrics.get(findIndex).getMetric();
if (arrayColumns != null) {
for (int i = 0; i < arrayColumns.size(); ++i) {
// replace
String k = "$" + i;
int dataIndex = this.meta.get(arrayColumns.get(i));
String replaceString = data.get(dataIndex);
metric = metric.replace(k, "'" + replaceString + "'");
}
}
return metric;
}
}

View File

@@ -0,0 +1,16 @@
package com.loafle.overflow.model.sensorconfig;
/**
* Schedule
*/
public class Schedule {
private String interval;
public String getInterval() {
return interval;
}
public void setInterval(String interval) {
this.interval = interval;
}
}

View File

@@ -0,0 +1,63 @@
package com.loafle.overflow.model.sensorconfig;
import java.util.List;
/**
* SensorConfig
*/
public class SensorConfig {
private long id;
private String configID;
private Target target;
private Schedule schedule;
private Crawler crawler;
private List<Item> items;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getConfigID() {
return configID;
}
public void setConfigID(String configID) {
this.configID = configID;
}
public Target getTarget() {
return target;
}
public void setTarget(Target target) {
this.target = target;
}
public Schedule getSchedule() {
return schedule;
}
public void setSchedule(Schedule schedule) {
this.schedule = schedule;
}
public Crawler getCrawler() {
return crawler;
}
public void setCrawler(Crawler crawler) {
this.crawler = crawler;
}
public List<Item> getItems() {
return items;
}
public void setItems(List<Item> items) {
this.items = items;
}
}

View File

@@ -0,0 +1,27 @@
package com.loafle.overflow.model.sensorconfig;
import java.util.Map;
/**
* Target
*/
public class Target {
private Map<String, Object> auth;
private Connection connection;
public Map<String, Object> getAuth() {
return auth;
}
public void setAuth(Map<String, Object> auth) {
this.auth = auth;
}
public Connection getConnection() {
return connection;
}
public void setConnection(Connection connection) {
this.connection = connection;
}
}

View File

@@ -0,0 +1,98 @@
package com.loafle.overflow.model.target;
import com.loafle.overflow.model.sensor.Sensor;
import javax.persistence.*;
import java.util.Date;
import java.util.List;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "TARGET", schema = "public")
public class Target {
private long id;
private Date createDate;
private String displayName;
private String description;
private List<Sensor> sensors;
/*
private long id;
private Date createDate;
private String displayName;
private String description;
*/
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@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;
}
@Column(name = "DISPLAY_NAME")
public String getDisplayName() {
return displayName;
}
public void setDisplayName(String displayName) {
this.displayName = displayName;
}
@Column(name = "DESCRIPTION")
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
// @ManyToOne
// @JoinColumn(name = "PROBE_ID", nullable = false)
// @OnDelete(action = OnDeleteAction.CASCADE)
// public Probe getProbe() {
// return probe;
// }
//
// public void setProbe(Probe probe) {
// this.probe = probe;
// }
//
// @ManyToOne
// @JoinColumn(name = "INFRA_ID", nullable = false)
// public Infra getInfra() {
// return infra;
// }
//
// public void setInfra(Infra infra) {
// this.infra = infra;
// }
@Transient
public List<Sensor> getSensors() {
return sensors;
}
public void setSensors(List<Sensor> sensors) {
this.sensors = sensors;
}
}

View File

@@ -0,0 +1,35 @@
package com.loafle.overflow.model.websocket;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "UI_WEBSOCKET", schema = "public")
public class UiWebsocket {
private long id;
private Date createDate;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@Basic
@Column(name = "CREATE_DATE", nullable = true)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}