From 6176dd00628d6ce7e99ac4e540b4ce00b19005bc Mon Sep 17 00:00:00 2001 From: crusader Date: Tue, 12 Jun 2018 18:02:12 +0900 Subject: [PATCH] ing --- pom.xml | 2 +- .../model/meta/MetaTargetHostTypeMapping.java | 58 +++++++++++++++++++ .../loafle/overflow/model/probe/Probe.java | 2 +- .../service/central/infra/InfraService.java | 14 ++++- .../MetaTargetHostTypeMappingService.java | 19 ++++++ 5 files changed, 90 insertions(+), 5 deletions(-) create mode 100644 src/main/java/com/loafle/overflow/model/meta/MetaTargetHostTypeMapping.java create mode 100644 src/main/java/com/loafle/overflow/service/central/meta/MetaTargetHostTypeMappingService.java diff --git a/pom.xml b/pom.xml index 1e8d0ee..6a97f6c 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ com.loafle.overflow commons-java jar - 1.0.53-SNAPSHOT + 1.0.54-SNAPSHOT com.loafle.overflow.commons-java diff --git a/src/main/java/com/loafle/overflow/model/meta/MetaTargetHostTypeMapping.java b/src/main/java/com/loafle/overflow/model/meta/MetaTargetHostTypeMapping.java new file mode 100644 index 0000000..6280bba --- /dev/null +++ b/src/main/java/com/loafle/overflow/model/meta/MetaTargetHostTypeMapping.java @@ -0,0 +1,58 @@ +package com.loafle.overflow.model.meta; + +import java.util.Date; + +import javax.persistence.*; + +/** + * Created by snoop on 18. 4. 24. + */ +@Entity +@Table(name = "META_TARGET_HOST_TYPE_MAPPING", schema = "public") +public class MetaTargetHostTypeMapping { + + private Long id; + private MetaTargetHostType metaTargetHostType; + private String pattern; + private Date createDate; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + @ManyToOne + @JoinColumn(name = "META_TARGET_HOST_TYPE_ID", nullable = false) + public MetaTargetHostType getMetaTargetHostType() { + return metaTargetHostType; + } + + public void setMetaTargetHostType(MetaTargetHostType metaTargetHostType) { + this.metaTargetHostType = metaTargetHostType; + } + + @Column(name = "PATTERN", nullable = false, length = 50) + public String getPattern() { + return pattern; + } + + public void setPattern(String pattern) { + this.pattern = pattern; + } + + @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; + } + +} diff --git a/src/main/java/com/loafle/overflow/model/probe/Probe.java b/src/main/java/com/loafle/overflow/model/probe/Probe.java index e32fe79..3069fdc 100644 --- a/src/main/java/com/loafle/overflow/model/probe/Probe.java +++ b/src/main/java/com/loafle/overflow/model/probe/Probe.java @@ -17,7 +17,6 @@ public class Probe { private Long id; private MetaProbeStatus metaProbeStatus; private String description; - private Date createDate; private Domain domain; private String probeKey; private String encryptionKey; @@ -28,6 +27,7 @@ public class Probe { private Integer targetCount; private Date connectDate; private String connectAddress; + private Date createDate; public Probe() { diff --git a/src/main/java/com/loafle/overflow/service/central/infra/InfraService.java b/src/main/java/com/loafle/overflow/service/central/infra/InfraService.java index bff2812..7751837 100644 --- a/src/main/java/com/loafle/overflow/service/central/infra/InfraService.java +++ b/src/main/java/com/loafle/overflow/service/central/infra/InfraService.java @@ -10,6 +10,7 @@ import com.loafle.overflow.model.discovery.Service; import com.loafle.overflow.model.discovery.Zone; import com.loafle.overflow.model.infra.Infra; import com.loafle.overflow.model.infra.InfraHost; +import com.loafle.overflow.model.infra.InfraHostIP; import com.loafle.overflow.model.infra.InfraZone; import org.springframework.data.domain.Page; @@ -23,17 +24,24 @@ public interface InfraService { Infra regist(Infra infra) throws OverflowException; @WebappAPI - InfraZone registZone(Long probeID, Zone zone) throws OverflowException; + InfraZone registByZone(Long probeID, Zone zone) throws OverflowException; @WebappAPI - InfraHost registHost(Long probeID, Host host) throws OverflowException; + InfraHost registByHost(Long probeID, Host host) throws OverflowException; @WebappAPI - com.loafle.overflow.model.infra.InfraService registService(Long probeID, Service service) throws OverflowException; + com.loafle.overflow.model.infra.InfraService registByService(Long probeID, Service service) throws OverflowException; @WebappAPI List registDiscoverd(Long probeID, List hosts, List services) throws OverflowException; + + @WebappAPI + InfraZone registInfraZoneByInfraHostIP(Long probeID, InfraHostIP infraHostIP) throws OverflowException; + + @WebappAPI + InfraHost registInfraHostByInfraHost(Long probeID, InfraHost infraHost) throws OverflowException; + @WebappAPI Infra read(Long id) throws OverflowException; diff --git a/src/main/java/com/loafle/overflow/service/central/meta/MetaTargetHostTypeMappingService.java b/src/main/java/com/loafle/overflow/service/central/meta/MetaTargetHostTypeMappingService.java new file mode 100644 index 0000000..b957039 --- /dev/null +++ b/src/main/java/com/loafle/overflow/service/central/meta/MetaTargetHostTypeMappingService.java @@ -0,0 +1,19 @@ +package com.loafle.overflow.service.central.meta; + +import com.loafle.overflow.core.annotation.WebappAPI; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.meta.MetaTargetHostTypeMapping; + +import java.util.List; + +/** + * Created by snoop on 17. 7. 27. + */ +public interface MetaTargetHostTypeMappingService { + + @WebappAPI + List readAll() throws OverflowException; + + @WebappAPI + List readAllByPattern(String pattern) throws OverflowException; +}