discovery mode
     not entity
This commit is contained in:
snoop 2017-06-27 16:11:55 +09:00
parent f5491dcc7f
commit 5f8e647564
4 changed files with 329 additions and 0 deletions

View File

@ -0,0 +1,100 @@
package com.loafle.overflow.module.discovery.model;
import java.util.Date;
import java.util.List;
/**
* Created by root on 17. 6. 4.
*/
public class Host {
private long id;
private long ip;
private long mac;
private Date createDate;
private Date updateDate;
private String os;
private boolean target;
private List<Port> ports;
public List<Port> getPorts() {
return ports;
}
public void setPorts(List<Port> ports) {
this.ports = ports;
}
public Host(){}
public Host(long ip, long mac){
this.ip = ip;
this.mac = mac;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public long getIp() {
return ip;
}
public void setIp(long ip) {
this.ip = ip;
}
public long getMac() {
return mac;
}
public void setMac(long mac) {
this.mac = mac;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public Date getUpdateDate() {
return updateDate;
}
public void setUpdateDate(Date updateDate) {
this.updateDate = updateDate;
}
public String getOs() {
return os;
}
public void setOs(String os) {
this.os = os;
}
public boolean isTarget() {
return target;
}
public void setTarget(boolean target) {
this.target = target;
}
}

View File

@ -0,0 +1,124 @@
package com.loafle.overflow.module.discovery.model;
/**
* Created by snoop on 17. 6. 27.
*/
import com.loafle.overflow.module.discovery.type.PortType;
import java.util.Date;
import java.util.List;
/**
* Created by root on 17. 6. 4.
*/
public class Port {
private long id;
private Host host;
public Host getHost() {
return host;
}
public void setHost(Host host) {
this.host = host;
}
private PortType portType;
private int portNumber;
private List<Service> services;
public List<Service> getServices() {
return services;
}
public void setServices(List<Service> services) {
this.services = services;
}
private Date createDate;
private Date updateDate;
public Port() {}
public Port(PortType type, int portNumber) {
this.portType = type;
this.portNumber = portNumber;
}
public Port(Host host, PortType type, int portNumber) {
this.host = host;
this.portType = type;
this.portNumber = portNumber;
}
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 int getPortNumber() {
return portNumber;
}
public void setPortNumber(int portNumber) {
this.portNumber = portNumber;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public Date getUpdateDate() {
return updateDate;
}
public void setUpdateDate(Date updateDate) {
this.updateDate = updateDate;
}
public void mappingChildren(Host discoveryHost) {
this.setHost(discoveryHost);
List<Service> discoveryServices = this.getServices();
if (discoveryServices != null) {
for (int z = 0 ; z < discoveryServices.size() ; ++z) {
discoveryServices.get(z).setPort(this);
}
}
}
}

View File

@ -0,0 +1,87 @@
package com.loafle.overflow.module.discovery.model;
import com.loafle.overflow.module.discovery.type.PortType;
import java.util.Date;
/**
* Created by root on 17. 6. 4.
*/
public class Service {
private long id;
private Port port;
public Port getPort() {
return port;
}
public void setPort(Port port) {
this.port = port;
}
private PortType portType;
private String serviceName;
private Date createDate;
private Date updateDate;
public Service() {}
public Service(Port port,PortType t, String serviceName) {
this.port = port;
this.portType = t;
this.serviceName = serviceName;
}
public PortType getPortType() {
return portType;
}
public void setPortType(PortType portType) {
this.portType = portType;
}
public String getServiceName() {
return serviceName;
}
public void setServiceName(String serviceName) {
this.serviceName = serviceName;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public Date getUpdateDate() {
return updateDate;
}
public void setUpdateDate(Date updateDate) {
this.updateDate = updateDate;
}
}

View File

@ -0,0 +1,18 @@
package com.loafle.overflow.module.discovery.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;
}
}