This commit is contained in:
crusader 2018-06-11 17:28:51 +09:00
parent 607892cadb
commit 0ce95767d1
9 changed files with 137 additions and 199 deletions

View File

@ -1,20 +0,0 @@
package com.loafle.overflow.core.type;
/**
* Created by snoop on 17. 6. 27.
*/
public enum CryptoType {
NONE(""),
TLS("TLS");
private String stringValue;
CryptoType(String string) {
stringValue = string;
}
@Override
public String toString() {
return stringValue;
}
}

View File

@ -1,21 +0,0 @@
package com.loafle.overflow.core.type;
/**
* Created by snoop on 17. 6. 27.
*/
public enum PortType {
TCP("TCP"),
UDP("UDP"),
TLS("TLS");
private String stringValue;
PortType(String string) {
stringValue = string;
}
@Override
public String toString() {
return stringValue;
}
}

View File

@ -3,48 +3,23 @@ package com.loafle.overflow.model.discovery;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import com.loafle.overflow.model.meta.MetaIPType;
/** /**
* Created by root on 17. 6. 4. * Created by root on 17. 6. 4.
*/ */
public class Host { public class Host {
private Long id; private MetaIPType metaIPType;
private String ipv4; private String address;
private String ipv6;
private String mac; private String mac;
private String os;
private Date discoveredDate; private Date discoveredDate;
private Zone zone; private Zone zone;
private boolean target;
private List<Port> portList; private List<Port> portList;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getIpv4() {
return ipv4;
}
public void setIpv4(String ipv4) {
this.ipv4 = ipv4;
}
public String getIpv6() {
return ipv6;
}
public void setIpv6(String ipv6) {
this.ipv6 = ipv6;
}
public String getMac() { public String getMac() {
return mac; return mac;
@ -54,14 +29,6 @@ public class Host {
this.mac = mac; this.mac = mac;
} }
public String getOs() {
return os;
}
public void setOs(String os) {
this.os = os;
}
public Date getDiscoveredDate() { public Date getDiscoveredDate() {
return discoveredDate; return discoveredDate;
} }
@ -78,14 +45,6 @@ public class Host {
this.zone = zone; this.zone = zone;
} }
public boolean isTarget() {
return target;
}
public void setTarget(boolean target) {
this.target = target;
}
public List<Port> getPortList() { public List<Port> getPortList() {
return portList; return portList;
} }
@ -93,4 +52,32 @@ public class Host {
public void setPortList(List<Port> portList) { public void setPortList(List<Port> portList) {
this.portList = portList; this.portList = portList;
} }
/**
* @return the metaIPType
*/
public MetaIPType getMetaIPType() {
return metaIPType;
}
/**
* @param metaIPType the metaIPType to set
*/
public void setMetaIPType(MetaIPType metaIPType) {
this.metaIPType = metaIPType;
}
/**
* @return the address
*/
public String getAddress() {
return address;
}
/**
* @param address the address to set
*/
public void setAddress(String address) {
this.address = address;
}
} }

View File

@ -1,6 +1,6 @@
package com.loafle.overflow.model.discovery; package com.loafle.overflow.model.discovery;
import com.loafle.overflow.core.type.PortType; import com.loafle.overflow.model.meta.MetaPortType;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -10,34 +10,16 @@ import java.util.List;
*/ */
public class Port { public class Port {
private Long id; private MetaPortType metaPortType;
private PortType portType;
private Integer portNumber; private Integer portNumber;
private Date discoveredDate; private Date discoveredDate;
private Host host; private Host host;
private Boolean target;
private List<Service> serviceList; private List<Service> serviceList;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public PortType getPortType() {
return portType;
}
public void setPortType(PortType portType) {
this.portType = portType;
}
public Integer getPortNumber() { public Integer getPortNumber() {
return portNumber; return portNumber;
} }
@ -62,14 +44,6 @@ public class Port {
this.host = host; this.host = host;
} }
public Boolean isTarget() {
return target;
}
public void setTarget(Boolean target) {
this.target = target;
}
public List<Service> getServiceList() { public List<Service> getServiceList() {
return serviceList; return serviceList;
} }
@ -77,4 +51,18 @@ public class Port {
public void setServiceList(List<Service> serviceList) { public void setServiceList(List<Service> serviceList) {
this.serviceList = serviceList; this.serviceList = serviceList;
} }
/**
* @return the metaPortType
*/
public MetaPortType getMetaPortType() {
return metaPortType;
}
/**
* @param metaPortType the metaPortType to set
*/
public void setMetaPortType(MetaPortType metaPortType) {
this.metaPortType = metaPortType;
}
} }

View File

@ -2,47 +2,21 @@ package com.loafle.overflow.model.discovery;
import java.util.Date; import java.util.Date;
import com.loafle.overflow.core.type.CryptoType; import com.loafle.overflow.model.meta.MetaCryptoType;
/** /**
* Created by root on 17. 6. 4. * Created by root on 17. 6. 4.
*/ */
public class Service { public class Service {
private Long id; private MetaCryptoType metaCryptoType;
private CryptoType cryptoType;
private String serviceName; private String name;
private Date discoveredDate; private Date discoveredDate;
private Port port; private Port port;
private Boolean target;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public CryptoType getCryptoType() {
return cryptoType;
}
public void setCryptoType(CryptoType cryptoType) {
this.cryptoType = cryptoType;
}
public String getServiceName() {
return serviceName;
}
public void setServiceName(String serviceName) {
this.serviceName = serviceName;
}
public Date getDiscoveredDate() { public Date getDiscoveredDate() {
return discoveredDate; return discoveredDate;
} }
@ -59,11 +33,32 @@ public class Service {
this.port = port; this.port = port;
} }
public Boolean isTarget() { /**
return target; * @return the metaCryptoType
*/
public MetaCryptoType getMetaCryptoType() {
return metaCryptoType;
} }
public void setTarget(Boolean target) { /**
this.target = target; * @param metaCryptoType the metaCryptoType to set
*/
public void setMetaCryptoType(MetaCryptoType metaCryptoType) {
this.metaCryptoType = metaCryptoType;
} }
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
} }

View File

@ -2,27 +2,20 @@ package com.loafle.overflow.model.discovery;
import java.util.Date; import java.util.Date;
import com.loafle.overflow.model.meta.MetaIPType;
/** /**
* Created by snoop on 17. 10. 31. * Created by snoop on 17. 10. 31.
*/ */
public class Zone { public class Zone {
private Long id;
private String network; private String network;
private String ipv4;
private String ipv6;
private String iface; private String iface;
private MetaIPType metaIPType;
private String address;
private String mac; private String mac;
private Date discoveredDate; private Date discoveredDate;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getNetwork() { public String getNetwork() {
return network; return network;
} }
@ -31,22 +24,6 @@ public class Zone {
this.network = network; this.network = network;
} }
public String getIpv4() {
return ipv4;
}
public void setIpv4(String ipv4) {
this.ipv4 = ipv4;
}
public String getIpv6() {
return ipv6;
}
public void setIpv6(String ipv6) {
this.ipv6 = ipv6;
}
public String getIface() { public String getIface() {
return iface; return iface;
} }
@ -70,4 +47,32 @@ public class Zone {
public void setDiscoveredDate(Date discoveredDate) { public void setDiscoveredDate(Date discoveredDate) {
this.discoveredDate = discoveredDate; this.discoveredDate = discoveredDate;
} }
/**
* @return the metaIPType
*/
public MetaIPType getMetaIPType() {
return metaIPType;
}
/**
* @param metaIPType the metaIPType to set
*/
public void setMetaIPType(MetaIPType metaIPType) {
this.metaIPType = metaIPType;
}
/**
* @return the address
*/
public String getAddress() {
return address;
}
/**
* @param address the address to set
*/
public void setAddress(String address) {
this.address = address;
}
} }

View File

@ -2,7 +2,6 @@ package com.loafle.overflow.model.infra;
import javax.persistence.*; import javax.persistence.*;
import com.loafle.overflow.model.meta.MetaCryptoType;
import com.loafle.overflow.model.meta.MetaPortType; import com.loafle.overflow.model.meta.MetaPortType;
import java.util.Date; import java.util.Date;
@ -17,7 +16,6 @@ public class InfraHostPort {
private InfraHost infraHost; private InfraHost infraHost;
private MetaPortType metaPortType; private MetaPortType metaPortType;
private Integer port; private Integer port;
private MetaCryptoType metaCryptoType;
private Date createDate; private Date createDate;
@Id @Id
@ -60,17 +58,6 @@ public class InfraHostPort {
this.port = port; this.port = port;
} }
@ManyToOne
@JoinColumn(name = "META_PORT_TYPE_ID", nullable = true)
public MetaCryptoType getMetaCryptoType() {
return metaCryptoType;
}
public void setMetaCryptoType(MetaCryptoType metaCryptoType) {
this.metaCryptoType = metaCryptoType;
}
@Temporal(TemporalType.TIMESTAMP) @Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false) @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Date getCreateDate() { public Date getCreateDate() {

View File

@ -2,6 +2,7 @@ package com.loafle.overflow.model.infra;
import javax.persistence.*; import javax.persistence.*;
import com.loafle.overflow.model.meta.MetaCryptoType;
import com.loafle.overflow.model.meta.MetaTargetServiceType; import com.loafle.overflow.model.meta.MetaTargetServiceType;
/** /**
@ -15,6 +16,7 @@ public class InfraService extends Infra {
private MetaTargetServiceType metaTargetServiceType; private MetaTargetServiceType metaTargetServiceType;
private InfraHostIP infraHostIP; private InfraHostIP infraHostIP;
private InfraHostPort infraHostPort; private InfraHostPort infraHostPort;
private MetaCryptoType metaCryptoType;
@ManyToOne @ManyToOne
@ -47,4 +49,13 @@ public class InfraService extends Infra {
this.infraHostPort = infraHostPort; this.infraHostPort = infraHostPort;
} }
@ManyToOne
@JoinColumn(name = "META_PORT_TYPE_ID", nullable = true)
public MetaCryptoType getMetaCryptoType() {
return metaCryptoType;
}
public void setMetaCryptoType(MetaCryptoType metaCryptoType) {
this.metaCryptoType = metaCryptoType;
}
} }

View File

@ -1,6 +1,6 @@
package com.loafle.overflow.model.sensorconfig; package com.loafle.overflow.model.sensorconfig;
import com.loafle.overflow.core.type.PortType; import com.loafle.overflow.model.meta.MetaPortType;
/** /**
* Connection * Connection
@ -8,7 +8,7 @@ import com.loafle.overflow.core.type.PortType;
public class Connection { public class Connection {
private String ip; private String ip;
private Integer port; private Integer port;
private PortType portType; private MetaPortType metaPortType;
private boolean ssl; private boolean ssl;
public String getIp() { public String getIp() {
@ -27,14 +27,6 @@ public class Connection {
this.port = port; this.port = port;
} }
public PortType getPortType() {
return portType;
}
public void setPortType(PortType portType) {
this.portType = portType;
}
public boolean isSsl() { public boolean isSsl() {
return ssl; return ssl;
} }
@ -42,4 +34,18 @@ public class Connection {
public void setSsl(boolean ssl) { public void setSsl(boolean ssl) {
this.ssl = ssl; this.ssl = ssl;
} }
/**
* @return the metaPortType
*/
public MetaPortType getMetaPortType() {
return metaPortType;
}
/**
* @param metaPortType the metaPortType to set
*/
public void setMetaPortType(MetaPortType metaPortType) {
this.metaPortType = metaPortType;
}
} }