diff --git a/pom.xml b/pom.xml
index f9d726f..11fa420 100644
--- a/pom.xml
+++ b/pom.xml
@@ -13,7 +13,7 @@
com.loafle.overflow
commons-java
jar
- 1.0.6-SNAPSHOT
+ 1.0.7-SNAPSHOT
com.loafle.overflow.commons-java
diff --git a/src/main/java/com/loafle/overflow/model/target/Target.java b/src/main/java/com/loafle/overflow/model/target/Target.java
index 6ce4bef..f2b4516 100644
--- a/src/main/java/com/loafle/overflow/model/target/Target.java
+++ b/src/main/java/com/loafle/overflow/model/target/Target.java
@@ -15,109 +15,109 @@ import java.util.List;
@Table(name = "TARGET", schema = "public")
public class Target {
- private Long id;
- private Date createDate;
- private String displayName;
- private String description;
- private Integer sensorCount;
- private Infra infra;
+ private Long id;
+ private Date createDate;
+ private String displayName;
+ private String description;
+ private Integer sensorCount;
+ private Infra infra;
- // Transient property
- private List sensors;
+ // Transient property
+ private List sensors;
- @Id
- @GeneratedValue(strategy = GenerationType.IDENTITY)
- public Long getId() {
- return id;
- }
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ public Long getId() {
+ return id;
+ }
- public void setId(Long id) {
- this.id = id;
- }
+ public void setId(Long id) {
+ this.id = id;
+ }
- @Temporal(TemporalType.TIMESTAMP)
- @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
- public Date getCreateDate() {
- return createDate;
- }
+ @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;
- }
+ public void setCreateDate(Date createDate) {
+ this.createDate = createDate;
+ }
- @Column(name = "DISPLAY_NAME")
- public String getDisplayName() {
- return displayName;
- }
+ @Column(name = "DISPLAY_NAME")
+ public String getDisplayName() {
+ return displayName;
+ }
- public void setDisplayName(String displayName) {
- this.displayName = displayName;
- }
+ public void setDisplayName(String displayName) {
+ this.displayName = displayName;
+ }
- @Column(name = "DESCRIPTION")
- public String getDescription() {
- return description;
- }
+ @Column(name = "DESCRIPTION")
+ public String getDescription() {
+ return description;
+ }
- public void setDescription(String description) {
- this.description = description;
- }
+ public void setDescription(String description) {
+ this.description = description;
+ }
- @Column(name = "SENSOR_COUNT", nullable = false)
- public Integer getSensorCount() {
- return sensorCount;
- }
+ @Column(name = "SENSOR_COUNT", nullable = false)
+ public Integer getSensorCount() {
+ return sensorCount;
+ }
- public void setSensorCount(Integer sensorCount) {
- this.sensorCount = sensorCount;
- }
+ public void setSensorCount(Integer sensorCount) {
+ this.sensorCount = sensorCount;
+ }
- @Transient
- public List getSensors() {
- return sensors;
- }
+ @Transient
+ public List getSensors() {
+ return sensors;
+ }
- public void setSensors(List sensors) {
- this.sensors = sensors;
- }
+ public void setSensors(List sensors) {
+ this.sensors = sensors;
+ }
- @PrePersist
- void preInsert() {
- this.sensorCount = 0;
- }
+ @PrePersist
+ void preInsert() {
+ this.sensorCount = 0;
+ }
- @OneToOne
- @JoinColumn(name = "INFRA_ID", nullable = false)
- public Infra getInfra() {
- return infra;
- }
+ @OneToOne
+ @JoinColumn(name = "INFRA_ID", nullable = false)
+ public Infra getInfra() {
+ return infra;
+ }
- /**
- * @param infra the infra to set
- */
- public void setInfra(Infra infra) {
- this.infra = infra;
- }
+ /**
+ * @param infra the infra to set
+ */
+ public void setInfra(Infra infra) {
+ this.infra = infra;
+ }
- // @ManyToOne
- // @JoinColumn(name = "PROBE_ID", nullable = false)
- // @OnDelete(action = OnDeleteAction.CASCADE)
- // public Probe getProbe() {
- // return probe;
- // }
- //
- // public void setProbe(Probe probe) {
- // this.probe = probe;
- // }
- //
- // @ManyToOne
- // @JoinColumn(name = "INFRA_ID", nullable = false)
- // public Infra getInfra() {
- // return infra;
- // }
- //
- // public void setInfra(Infra infra) {
- // this.infra = infra;
- // }
+ // @ManyToOne
+ // @JoinColumn(name = "PROBE_ID", nullable = false)
+ // @OnDelete(action = OnDeleteAction.CASCADE)
+ // public Probe getProbe() {
+ // return probe;
+ // }
+ //
+ // public void setProbe(Probe probe) {
+ // this.probe = probe;
+ // }
+ //
+ // @ManyToOne
+ // @JoinColumn(name = "INFRA_ID", nullable = false)
+ // public Infra getInfra() {
+ // return infra;
+ // }
+ //
+ // public void setInfra(Infra infra) {
+ // this.infra = infra;
+ // }
}
diff --git a/src/main/java/com/loafle/overflow/service/central/infra/InfraHostService.java b/src/main/java/com/loafle/overflow/service/central/infra/InfraHostService.java
index ee304b6..cb79ec5 100644
--- a/src/main/java/com/loafle/overflow/service/central/infra/InfraHostService.java
+++ b/src/main/java/com/loafle/overflow/service/central/infra/InfraHostService.java
@@ -12,5 +12,5 @@ public interface InfraHostService {
InfraHost read(Long id) throws OverflowException;
- InfraHost readByIp(String ip) throws OverflowException;
+ InfraHost findByProbeIdAndIpv4(String probeId, String ip) throws OverflowException;
}
diff --git a/src/main/java/com/loafle/overflow/service/central/target/TargetService.java b/src/main/java/com/loafle/overflow/service/central/target/TargetService.java
index d1f5965..41d6595 100644
--- a/src/main/java/com/loafle/overflow/service/central/target/TargetService.java
+++ b/src/main/java/com/loafle/overflow/service/central/target/TargetService.java
@@ -32,5 +32,12 @@ public interface TargetService {
@WebappAPI
public List registDiscoveredTargets(Long probeId, List hosts, List services)
- throws OverflowException;
+ throws OverflowException;
+
+ @WebappAPI
+ public Target readExistHostTarget(Long probeId, String ip) throws OverflowException;
+
+ @WebappAPI
+ public Target readExistServiceTarget(Long hostId, int portNumber, String portType) throws OverflowException;
+
}