From 0ce95767d10afc79512b15a287c5dd0846ef8fcd Mon Sep 17 00:00:00 2001 From: crusader Date: Mon, 11 Jun 2018 17:28:51 +0900 Subject: [PATCH] ing --- .../loafle/overflow/core/type/CryptoType.java | 20 ----- .../loafle/overflow/core/type/PortType.java | 21 ----- .../loafle/overflow/model/discovery/Host.java | 77 ++++++++----------- .../loafle/overflow/model/discovery/Port.java | 46 ++++------- .../overflow/model/discovery/Service.java | 63 +++++++-------- .../loafle/overflow/model/discovery/Zone.java | 59 +++++++------- .../overflow/model/infra/InfraHostPort.java | 13 ---- .../overflow/model/infra/InfraService.java | 11 +++ .../model/sensorconfig/Connection.java | 26 ++++--- 9 files changed, 137 insertions(+), 199 deletions(-) delete mode 100644 src/main/java/com/loafle/overflow/core/type/CryptoType.java delete mode 100644 src/main/java/com/loafle/overflow/core/type/PortType.java diff --git a/src/main/java/com/loafle/overflow/core/type/CryptoType.java b/src/main/java/com/loafle/overflow/core/type/CryptoType.java deleted file mode 100644 index 7694869..0000000 --- a/src/main/java/com/loafle/overflow/core/type/CryptoType.java +++ /dev/null @@ -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; - } -} \ No newline at end of file diff --git a/src/main/java/com/loafle/overflow/core/type/PortType.java b/src/main/java/com/loafle/overflow/core/type/PortType.java deleted file mode 100644 index e46caa3..0000000 --- a/src/main/java/com/loafle/overflow/core/type/PortType.java +++ /dev/null @@ -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; - } -} \ No newline at end of file diff --git a/src/main/java/com/loafle/overflow/model/discovery/Host.java b/src/main/java/com/loafle/overflow/model/discovery/Host.java index fb7b292..b08161b 100644 --- a/src/main/java/com/loafle/overflow/model/discovery/Host.java +++ b/src/main/java/com/loafle/overflow/model/discovery/Host.java @@ -3,48 +3,23 @@ package com.loafle.overflow.model.discovery; import java.util.Date; import java.util.List; +import com.loafle.overflow.model.meta.MetaIPType; + /** * Created by root on 17. 6. 4. */ public class Host { - private Long id; - private String ipv4; - private String ipv6; + private MetaIPType metaIPType; + private String address; private String mac; - private String os; private Date discoveredDate; private Zone zone; - private boolean target; - private List 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() { return mac; @@ -54,14 +29,6 @@ public class Host { this.mac = mac; } - public String getOs() { - return os; - } - - public void setOs(String os) { - this.os = os; - } - public Date getDiscoveredDate() { return discoveredDate; } @@ -78,14 +45,6 @@ public class Host { this.zone = zone; } - public boolean isTarget() { - return target; - } - - public void setTarget(boolean target) { - this.target = target; - } - public List getPortList() { return portList; } @@ -93,4 +52,32 @@ public class Host { public void setPortList(List 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; + } } diff --git a/src/main/java/com/loafle/overflow/model/discovery/Port.java b/src/main/java/com/loafle/overflow/model/discovery/Port.java index e8a5097..985328a 100644 --- a/src/main/java/com/loafle/overflow/model/discovery/Port.java +++ b/src/main/java/com/loafle/overflow/model/discovery/Port.java @@ -1,6 +1,6 @@ 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.List; @@ -10,34 +10,16 @@ import java.util.List; */ public class Port { - private Long id; - private PortType portType; + private MetaPortType metaPortType; + private Integer portNumber; private Date discoveredDate; private Host host; - private Boolean target; - private List 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() { return portNumber; } @@ -62,14 +44,6 @@ public class Port { this.host = host; } - public Boolean isTarget() { - return target; - } - - public void setTarget(Boolean target) { - this.target = target; - } - public List getServiceList() { return serviceList; } @@ -77,4 +51,18 @@ public class Port { public void setServiceList(List 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; + } } diff --git a/src/main/java/com/loafle/overflow/model/discovery/Service.java b/src/main/java/com/loafle/overflow/model/discovery/Service.java index 22bf142..784978d 100644 --- a/src/main/java/com/loafle/overflow/model/discovery/Service.java +++ b/src/main/java/com/loafle/overflow/model/discovery/Service.java @@ -2,47 +2,21 @@ package com.loafle.overflow.model.discovery; 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. */ public class Service { - private Long id; - private CryptoType cryptoType; - private String serviceName; + private MetaCryptoType metaCryptoType; + + private String name; private Date discoveredDate; 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() { return discoveredDate; } @@ -59,11 +33,32 @@ public class Service { 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; + } + } diff --git a/src/main/java/com/loafle/overflow/model/discovery/Zone.java b/src/main/java/com/loafle/overflow/model/discovery/Zone.java index 33612af..36e3a3e 100644 --- a/src/main/java/com/loafle/overflow/model/discovery/Zone.java +++ b/src/main/java/com/loafle/overflow/model/discovery/Zone.java @@ -2,27 +2,20 @@ package com.loafle.overflow.model.discovery; import java.util.Date; +import com.loafle.overflow.model.meta.MetaIPType; + /** * Created by snoop on 17. 10. 31. */ public class Zone { - private Long id; private String network; - private String ipv4; - private String ipv6; private String iface; + private MetaIPType metaIPType; + private String address; private String mac; private Date discoveredDate; - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - public String getNetwork() { return network; } @@ -31,22 +24,6 @@ public class Zone { 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() { return iface; } @@ -70,4 +47,32 @@ public class Zone { public void setDiscoveredDate(Date 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; + } } \ No newline at end of file diff --git a/src/main/java/com/loafle/overflow/model/infra/InfraHostPort.java b/src/main/java/com/loafle/overflow/model/infra/InfraHostPort.java index 9e493dc..d3b34e6 100644 --- a/src/main/java/com/loafle/overflow/model/infra/InfraHostPort.java +++ b/src/main/java/com/loafle/overflow/model/infra/InfraHostPort.java @@ -2,7 +2,6 @@ package com.loafle.overflow.model.infra; import javax.persistence.*; -import com.loafle.overflow.model.meta.MetaCryptoType; import com.loafle.overflow.model.meta.MetaPortType; import java.util.Date; @@ -17,7 +16,6 @@ public class InfraHostPort { private InfraHost infraHost; private MetaPortType metaPortType; private Integer port; - private MetaCryptoType metaCryptoType; private Date createDate; @Id @@ -60,17 +58,6 @@ public class InfraHostPort { 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) @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false) public Date getCreateDate() { diff --git a/src/main/java/com/loafle/overflow/model/infra/InfraService.java b/src/main/java/com/loafle/overflow/model/infra/InfraService.java index ffead62..3148ca6 100644 --- a/src/main/java/com/loafle/overflow/model/infra/InfraService.java +++ b/src/main/java/com/loafle/overflow/model/infra/InfraService.java @@ -2,6 +2,7 @@ package com.loafle.overflow.model.infra; import javax.persistence.*; +import com.loafle.overflow.model.meta.MetaCryptoType; import com.loafle.overflow.model.meta.MetaTargetServiceType; /** @@ -15,6 +16,7 @@ public class InfraService extends Infra { private MetaTargetServiceType metaTargetServiceType; private InfraHostIP infraHostIP; private InfraHostPort infraHostPort; + private MetaCryptoType metaCryptoType; @ManyToOne @@ -47,4 +49,13 @@ public class InfraService extends Infra { 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; + } } diff --git a/src/main/java/com/loafle/overflow/model/sensorconfig/Connection.java b/src/main/java/com/loafle/overflow/model/sensorconfig/Connection.java index bf680c2..3f4d849 100644 --- a/src/main/java/com/loafle/overflow/model/sensorconfig/Connection.java +++ b/src/main/java/com/loafle/overflow/model/sensorconfig/Connection.java @@ -1,6 +1,6 @@ package com.loafle.overflow.model.sensorconfig; -import com.loafle.overflow.core.type.PortType; +import com.loafle.overflow.model.meta.MetaPortType; /** * Connection @@ -8,7 +8,7 @@ import com.loafle.overflow.core.type.PortType; public class Connection { private String ip; private Integer port; - private PortType portType; + private MetaPortType metaPortType; private boolean ssl; public String getIp() { @@ -27,14 +27,6 @@ public class Connection { this.port = port; } - public PortType getPortType() { - return portType; - } - - public void setPortType(PortType portType) { - this.portType = portType; - } - public boolean isSsl() { return ssl; } @@ -42,4 +34,18 @@ public class Connection { public void setSsl(boolean 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; + } }