date
   status
This commit is contained in:
snoop 2017-06-23 15:51:01 +09:00
parent 2611e33327
commit a21826dd10
4 changed files with 32 additions and 12 deletions

View File

@ -66,7 +66,7 @@ public class NoAuthProbe {
this.ipAddress = ipAddress; this.ipAddress = ipAddress;
} }
@Column(name = "STATUS", nullable = false) @Column(name = "STATUS", nullable = false, length = 1)
@Enumerated(EnumType.STRING) @Enumerated(EnumType.STRING)
public AuthType getStatus() { public AuthType getStatus() {
return status; return status;
@ -76,7 +76,7 @@ public class NoAuthProbe {
this.status = status; this.status = status;
} }
@Column(name = "TEMP_PROBE_KEY", nullable = false, length = 50) @Column(name = "TEMP_PROBE_KEY", nullable = false, length = 50, unique = true)
public String getTempProbeKey() { public String getTempProbeKey() {
return tempProbeKey; return tempProbeKey;
} }

View File

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

View File

@ -1,6 +1,7 @@
package com.loafle.overflow.module.probe.model; package com.loafle.overflow.module.probe.model;
import com.loafle.overflow.module.domain.Domain; import com.loafle.overflow.module.domain.Domain;
import com.loafle.overflow.module.probe.type.ProbeStatusType;
import javax.persistence.*; import javax.persistence.*;
import java.sql.Timestamp; import java.sql.Timestamp;
@ -13,7 +14,7 @@ import java.util.Date;
@Table(name = "PROBE", schema = "public", catalog = "postgres") @Table(name = "PROBE", schema = "public", catalog = "postgres")
public class Probe { public class Probe {
private long id; private long id;
private String status; private ProbeStatusType status;
private String description; private String description;
private Date createDate; private Date createDate;
private Date lastPollingDate; private Date lastPollingDate;
@ -33,12 +34,13 @@ public class Probe {
} }
@Column(name = "STATUS", nullable = true) @Column(name = "STATUS", nullable = false, length = 1)
public String getStatus() { @Enumerated(EnumType.STRING)
public ProbeStatusType getStatus() {
return status; return status;
} }
public void setStatus(String status) { public void setStatus(ProbeStatusType status) {
this.status = status; this.status = status;
} }
@ -53,7 +55,7 @@ public class Probe {
} }
@Temporal(TemporalType.TIMESTAMP) @Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Date getCreateDate() { public Date getCreateDate() {
return createDate; return createDate;
} }
@ -93,7 +95,7 @@ public class Probe {
} }
@Column(name = "PROBE_KEY", nullable = false) @Column(name = "PROBE_KEY", nullable = false, unique = true)
public String getProbeKey() { public String getProbeKey() {
return probeKey; return probeKey;
} }
@ -103,7 +105,7 @@ public class Probe {
} }
@Column(name = "ENCRYPTION_KEY", nullable = false, length = 50) @Column(name = "ENCRYPTION_KEY", nullable = false, length = 50, unique = true)
public String getEncryptionKey() { public String getEncryptionKey() {
return encryptionKey; return encryptionKey;
} }

View File

@ -0,0 +1,18 @@
package com.loafle.overflow.module.probe.type;
/**
* Created by root on 17. 6. 23.
*/
public enum ProbeStatusType {
I("INITIAL"),
N("NORMAL");
private String stringValue;
ProbeStatusType(String string) {stringValue = string;}
@Override
public String toString() {
return stringValue;
}
}