arranging

This commit is contained in:
insanity 2018-06-07 22:23:21 +09:00
parent f91f92c815
commit 05f1cd8eff
11 changed files with 57 additions and 323 deletions

View File

@ -1,92 +0,0 @@
package com.loafle.overflow.model.discovery;
import java.util.List;
/**
* Created by snoop on 17. 9. 29.
*/
public class DiscoveryStartInfo {
String startIpv4;
String endIPv4;
String excludeIpv4;
String startIpv6;
String endIPv6;
String excludeIpv6;
String startPort;
String endPort;
List<String> services;
public String getStartIpv4() {
return startIpv4;
}
public void setStartIpv4(String startIpv4) {
this.startIpv4 = startIpv4;
}
public String getEndIPv4() {
return endIPv4;
}
public void setEndIPv4(String endIPv4) {
this.endIPv4 = endIPv4;
}
public String getExcludeIpv4() {
return excludeIpv4;
}
public void setExcludeIpv4(String excludeIpv4) {
this.excludeIpv4 = excludeIpv4;
}
public String getStartIpv6() {
return startIpv6;
}
public void setStartIpv6(String startIpv6) {
this.startIpv6 = startIpv6;
}
public String getEndIPv6() {
return endIPv6;
}
public void setEndIPv6(String endIPv6) {
this.endIPv6 = endIPv6;
}
public String getExcludeIpv6() {
return excludeIpv6;
}
public void setExcludeIpv6(String excludeIpv6) {
this.excludeIpv6 = excludeIpv6;
}
public String getStartPort() {
return startPort;
}
public void setStartPort(String startPort) {
this.startPort = startPort;
}
public String getEndPort() {
return endPort;
}
public void setEndPort(String endPort) {
this.endPort = endPort;
}
public List<String> getServices() {
return services;
}
public void setServices(List<String> services) {
this.services = services;
}
}

View File

@ -1,147 +0,0 @@
package com.loafle.overflow.model.probe;
import com.loafle.overflow.model.meta.MetaProbeTaskType;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "PROBE_TASK", schema = "public")
public class ProbeTask {
private Long id;
private MetaProbeTaskType metaProbeTaskType;
private Probe probe;
private String data;
private Date createDate;
private Date sendDate;
private Date startDate;
private Date endDate;
private Boolean succeed;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
@ManyToOne
@JoinColumn(name = "META_PROBE_TASK_TYPE_ID", nullable = false)
public MetaProbeTaskType getMetaProbeTaskType() {
return metaProbeTaskType;
}
public void setMetaProbeTaskType(MetaProbeTaskType metaProbeTaskType) {
this.metaProbeTaskType = metaProbeTaskType;
}
@ManyToOne
@JoinColumn(name = "PROBE_ID", nullable = false)
public Probe getProbe() {
return probe;
}
public void setProbe(Probe probe) {
this.probe = probe;
}
@Column(name = "DATA", nullable = true, length = 255)
public String getData() {
return data;
}
public void setData(String data) {
this.data = data;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
@Column(name = "SEND_DATE", nullable = true)
public Date getSendDate() {
return sendDate;
}
public void setSendDate(Date sendDate) {
this.sendDate = sendDate;
}
@Column(name = "START_DATE", nullable = true)
public Date getStartDate() {
return startDate;
}
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
@Column(name = "END_DATE", nullable = true)
public Date getEndDate() {
return endDate;
}
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
@Column(name = "SUCCEED", nullable = true)
public Boolean getSucceed() {
return succeed;
}
public void setSucceed(Boolean succeed) {
this.succeed = succeed;
}
// @Override
// public boolean equals(Object o) {
// if (this == o) return true;
// if (o == null || getClass() != o.getClass()) return false;
//
// ProbeTask that = (ProbeTask) o;
//
// if (id != that.id) return false;
// if (typeId != that.typeId) return false;
// if (probeId != that.probeId) return false;
// if (data != null ? !data.equals(that.data) : that.data != null) return false;
// if (createDate != null ? !createDate.equals(that.createDate) :
// that.createDate != null) return false;
// if (sendDate != null ? !sendDate.equals(that.sendDate) : that.sendDate !=
// null) return false;
// if (startDate != null ? !startDate.equals(that.startDate) : that.startDate !=
// null) return false;
// if (endDate != null ? !endDate.equals(that.endDate) : that.endDate != null)
// return false;
// if (succeed != null ? !succeed.equals(that.succeed) : that.succeed != null)
// return false;
//
// return true;
// }
//
// @Override
// public int hashCode() {
// int result = (int) (id ^ (id >>> 32));
// result = 31 * result + (int) typeId;
// result = 31 * result + (int) (probeId ^ (probeId >>> 32));
// result = 31 * result + (data != null ? data.hashCode() : 0);
// result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
// result = 31 * result + (sendDate != null ? sendDate.hashCode() : 0);
// result = 31 * result + (startDate != null ? startDate.hashCode() : 0);
// result = 31 * result + (endDate != null ? endDate.hashCode() : 0);
// result = 31 * result + (succeed != null ? succeed.hashCode() : 0);
// return result;
// }
}

View File

@ -8,6 +8,7 @@ import com.loafle.overflow.model.infra.InfraHost;
*/
public interface InfraHostService {
InfraHost regist(InfraHost infraHost) throws OverflowException;
InfraHost read(Long id) throws OverflowException;

View File

@ -1,31 +1,27 @@
package com.loafle.overflow.service.central.infra;
import java.util.List;
import com.loafle.overflow.core.annotation.WebappAPI;
import com.loafle.overflow.core.exception.OverflowException;
import com.loafle.overflow.core.model.PageParams;
import com.loafle.overflow.model.infra.Infra;
import com.loafle.overflow.model.probe.Probe;
import com.loafle.overflow.model.target.Target;
import org.springframework.data.domain.Page;
/**
* Created by insanity on 17. 6. 28.
*/
public interface InfraService {
@WebappAPI
Infra regist(Infra infra) throws OverflowException;
@WebappAPI
Infra read(Long id) throws OverflowException;
@WebappAPI
Page<Infra> readAllByProbeID(Long probeID, PageParams pageParams) throws OverflowException;
@WebappAPI
Page<Infra> readAllByDomainID(Long domainID, PageParams pageParams) throws OverflowException;
List<Target> readAllTargetByDomainID(Long domainID) throws OverflowException;
List<Target> readAllTargetByProbes(List<Probe> probes) throws OverflowException;
Infra readByTargetID(Long targetID) throws OverflowException;
}

View File

@ -1,7 +1,13 @@
package com.loafle.overflow.service.central.infra;
import com.loafle.overflow.core.exception.OverflowException;
/**
* Created by insanity on 17. 6. 28.
*/
public interface InfraServiceService {
InfraService regist(InfraService infraService) throws OverflowException;
InfraService read(Long id) throws OverflowException;
}

View File

@ -10,12 +10,15 @@ import com.loafle.overflow.model.probe.ProbeHost;
* Created by snoop on 17. 8. 21.
*/
public interface ProbeHostService {
ProbeHost read(Long id) throws OverflowException;
ProbeHost readByProbeID(Long probeID) throws OverflowException;
ProbeHost regist(ProbeHost probeHost) throws OverflowException;
@WebappAPI
ProbeHost read(Long id) throws OverflowException;
@WebappAPI
ProbeHost readByProbeID(Long probeID) throws OverflowException;
@WebappAPI
List<ProbeHost> readAllByDomainID(Long domainID) throws OverflowException;
}

View File

@ -11,11 +11,8 @@ import java.util.List;
* Created by snoop on 17. 6. 28.
*/
public interface ProbeService {
// NoauthProbe.acceptNoAuthProbe
Probe regist(Probe probe) throws OverflowException;
// NoauthProbe.acceptNoAuthProbe
List<Probe> regist(List<Probe> probes) throws OverflowException;
Probe regist(Probe probe) throws OverflowException;
@WebappAPI
List<Probe> readAllByDomainID(Long id) throws OverflowException;
@ -24,12 +21,6 @@ public interface ProbeService {
Probe read(Long id) throws OverflowException;
@WebappAPI
Probe modifyDisplayName(Long probeId, String displayName) throws OverflowException;
@ProbeAPI // ?
Probe readByProbeKey(String probeKey) throws OverflowException;
@ProbeAPI // ?
Probe modify(Probe probe) throws OverflowException;
@ProbeAPI
@ -38,4 +29,8 @@ public interface ProbeService {
@ProbeAPI
void onDisconnect(String probeKey) throws OverflowException;
Probe increaseTargetCount(Long id) throws OverflowException;
Probe decreaseTargetCount(Long id) throws OverflowException;
}

View File

@ -1,18 +0,0 @@
package com.loafle.overflow.service.central.probe;
import com.loafle.overflow.core.annotation.ProbeAPI;
import com.loafle.overflow.core.exception.OverflowException;
import com.loafle.overflow.model.probe.ProbeTask;
import java.util.List;
/**
* Created by snoop on 17. 6. 28.
*/
public interface ProbeTaskService {
@ProbeAPI
ProbeTask regist(ProbeTask probeTask) throws OverflowException;
@ProbeAPI
List<ProbeTask> readAllByProbeID(Long probeID) throws OverflowException;
}

View File

@ -14,13 +14,29 @@ import java.util.List;
*/
public interface SensorService {
@WebappAPI
Sensor regist(Sensor sensor) throws OverflowException;
Sensor regist(Sensor sensor, Long targetID) throws OverflowException;
@WebappAPI
Sensor read(Long id) throws OverflowException;
@WebappAPI
void remove(Long id) throws OverflowException;
void remove(Long id, Long targetID) throws OverflowException;
@WebappAPI
Page<Sensor> readAllByProbeID(Long probeID, PageParams pageParams) throws OverflowException;
@WebappAPI
Page<Sensor> readAllByDomainID(Long domainID, PageParams pageParams) throws OverflowException;
@WebappAPI
Page<Sensor> readAllByInfraID(Long infraID, PageParams pageParams) throws OverflowException;
@WebappAPI
Page<Sensor> readAllByTargetID(Long targetID, PageParams pageParams) throws OverflowException;
Sensor increaseSensorItemCount(Long id) throws OverflowException;
Sensor decreaseSensorItemCount(Long id) throws OverflowException;
@WebappAPI
Sensor start(Long id) throws OverflowException;
@ -34,12 +50,4 @@ public interface SensorService {
@WebappAPI
String generateSensorConfig(Sensor sensor) throws OverflowException;
@WebappAPI
Page<Sensor> readAllByDomainID(Long domainID, PageParams pageParams) throws OverflowException;
@WebappAPI
Page<Sensor> readAllByInfraID(Long infraID, PageParams pageParams) throws OverflowException;
@WebappAPI
Page<Sensor> readAllByTargetID(Long targetID, PageParams pageParams) throws OverflowException;
}

View File

@ -1,17 +0,0 @@
package com.loafle.overflow.service.central.target;
import com.loafle.overflow.core.annotation.WebappAPI;
import com.loafle.overflow.core.exception.OverflowException;
import com.loafle.overflow.model.discovery.Host;
import com.loafle.overflow.model.probe.Probe;
import java.util.List;
/**
* Created by snoop on 17. 6. 28.
*/
public interface TargetDiscoveryService {
@WebappAPI
boolean saveAllTarget(List<Host> hosts, Probe probe) throws OverflowException;
}

View File

@ -16,33 +16,32 @@ import org.springframework.data.domain.Page;
*/
public interface TargetService {
public Target regist(Target target, Probe probe) throws OverflowException;
public void remove(Target target, Probe probe) throws OverflowException;
public Target read(String id) throws OverflowException;
public Target increaseSensorCount(Target target) throws OverflowException;
public Target decreaseSensorCount(Target target) throws OverflowException;
Target regist(Target target, String probeID) throws OverflowException;
@WebappAPI
public Target modify(Target target) throws OverflowException;
void remove(Target target, String probeID) throws OverflowException;
@WebappAPI
void remove(Target target) throws OverflowException;
Target read(Long id) throws OverflowException;
@WebappAPI
public List<Target> registDiscoveredTargets(Long probeId, List<Host> hosts, List<Service> services)
Target modify(Target target) throws OverflowException;
@WebappAPI
List<Target> registDiscoveredTargets(Long probeId, List<Host> hosts, List<Service> services)
throws OverflowException;
@WebappAPI
public Target readExistHostTarget(Long probeId, String ip) throws OverflowException;
Target readExistHostTarget(Long probeId, String ip) throws OverflowException;
@WebappAPI
public Target readExistServiceTarget(Long hostId, int portNumber, String portType) throws OverflowException;
Target readExistServiceTarget(Long hostId, int portNumber, String portType) throws OverflowException;
@WebappAPI
public Page<Target> readAllByProbeID(Long probeID, PageParams pageParams) throws OverflowException;
Page<Target> readAllByProbeID(Long probeID, PageParams pageParams) throws OverflowException;
Target increaseSensorCount(Long id) throws OverflowException;
Target decreaseSensorCount(Long id) throws OverflowException;
}