noauth probe
This commit is contained in:
snoop 2017-06-22 18:46:55 +09:00
parent d8292155ae
commit b6cc39c124
4 changed files with 182 additions and 162 deletions

View File

@ -1,158 +0,0 @@
package com.loafle.overflow.models;
import javax.persistence.*;
import java.sql.Timestamp;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "TBL_NOAUTH_PROBE", schema = "public", catalog = "postgres")
public class TblNoauthProbe {
private long id;
private String hostName;
private Integer macAddress;
private Integer ipAddress;
private String status;
private String tempProbeKey;
private Timestamp createDate;
private String apiKey;
private long domainId;
private Long probeId;
@Id
@Column(name = "ID", nullable = false)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@Basic
@Column(name = "HOST_NAME", nullable = true, length = 50)
public String getHostName() {
return hostName;
}
public void setHostName(String hostName) {
this.hostName = hostName;
}
@Basic
@Column(name = "MAC_ADDRESS", nullable = true)
public Integer getMacAddress() {
return macAddress;
}
public void setMacAddress(Integer macAddress) {
this.macAddress = macAddress;
}
@Basic
@Column(name = "IP_ADDRESS", nullable = true)
public Integer getIpAddress() {
return ipAddress;
}
public void setIpAddress(Integer ipAddress) {
this.ipAddress = ipAddress;
}
@Basic
@Column(name = "STATUS", nullable = false, length = -1)
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
@Basic
@Column(name = "TEMP_PROBE_KEY", nullable = true, length = 50)
public String getTempProbeKey() {
return tempProbeKey;
}
public void setTempProbeKey(String tempProbeKey) {
this.tempProbeKey = tempProbeKey;
}
@Basic
@Column(name = "CREATE_DATE", nullable = true)
public Timestamp getCreateDate() {
return createDate;
}
public void setCreateDate(Timestamp createDate) {
this.createDate = createDate;
}
@Basic
@Column(name = "API_KEY", nullable = true, length = 50)
public String getApiKey() {
return apiKey;
}
public void setApiKey(String apiKey) {
this.apiKey = apiKey;
}
@Basic
@Column(name = "DOMAIN_ID", nullable = false)
public long getDomainId() {
return domainId;
}
public void setDomainId(long domainId) {
this.domainId = domainId;
}
@Basic
@Column(name = "PROBE_ID", nullable = true)
public Long getProbeId() {
return probeId;
}
public void setProbeId(Long probeId) {
this.probeId = probeId;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
TblNoauthProbe that = (TblNoauthProbe) 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,14 @@
package com.loafle.overflow.module.noauthprobe.dao;
import com.loafle.overflow.module.noauthprobe.model.NoAuthProbe;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Created by root on 17. 5. 30.
*/
@Repository
public interface NoAuthProbeDAO extends JpaRepository<NoAuthProbe, Long> {
// NoAuthProbeDeprecate findByTempKey(NoAuthProbeDeprecate noAuthAgent);
// List<NoAuthProbeDeprecate> findAllByNoAuth(NoAuthProbeDeprecate noAuthAgent);
}

View File

@ -0,0 +1,164 @@
package com.loafle.overflow.module.noauthprobe.model;
import com.loafle.overflow.models.TblDomain;
import com.loafle.overflow.module.noauthprobe.type.AuthType;
import com.loafle.overflow.module.probe.model.TblProbe;
import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "TBL_NOAUTH_PROBE", schema = "public", catalog = "postgres")
public class NoAuthProbe {
private long id;
private String hostName;
private Integer macAddress;
private Integer ipAddress;
private AuthType status;
private String tempProbeKey;
private Date createDate;
private String apiKey;
private TblDomain domain;
private TblProbe probe;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@Basic
@Column(name = "HOST_NAME", nullable = true, length = 50)
public String getHostName() {
return hostName;
}
public void setHostName(String hostName) {
this.hostName = hostName;
}
@Basic
@Column(name = "MAC_ADDRESS", nullable = true)
public Integer getMacAddress() {
return macAddress;
}
public void setMacAddress(Integer macAddress) {
this.macAddress = macAddress;
}
@Basic
@Column(name = "IP_ADDRESS", nullable = true)
public Integer getIpAddress() {
return ipAddress;
}
public void setIpAddress(Integer ipAddress) {
this.ipAddress = ipAddress;
}
@Basic
@Column(name = "STATUS", nullable = false, length = -1)
@Enumerated(EnumType.STRING)
public AuthType getStatus() {
return status;
}
public void setStatus(AuthType status) {
this.status = status;
}
@Basic
@Column(name = "TEMP_PROBE_KEY", nullable = true, length = 50)
public String getTempProbeKey() {
return tempProbeKey;
}
public void setTempProbeKey(String tempProbeKey) {
this.tempProbeKey = tempProbeKey;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
@Basic
@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 TblDomain getDomainId() {
return domain;
}
public void setDomainId(TblDomain domain) {
this.domain = domain;
}
@ManyToOne
@JoinColumn(name = "PROBE_ID", nullable = true)
public TblProbe getProbeId() {
return probe;
}
public void setProbeId(TblProbe 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

@ -1,12 +1,12 @@
package com.loafle.overflow.module.noauthagent.type;
package com.loafle.overflow.module.noauthprobe.type;
/**
* Created by root on 17. 5. 31.
*/
public enum AuthType {
ACCEPT("ACCEPT"),
REFUSE("REFUSE"),
WAIT("WAIT");
ACCEPT("A"),
DENY("D"),
PROCESS("P");
private String stringValue;
AuthType(String string) {stringValue = string;}