From ae7472b6084088ecbf3ed9ffb78e23ee49bc92a1 Mon Sep 17 00:00:00 2001 From: crusader Date: Mon, 11 Jun 2018 23:44:36 +0900 Subject: [PATCH] ing --- pom.xml | 2 +- .../overflow/model/infra/InfraZone.java | 58 ++++++++----------- .../overflow/model/meta/MetaIPType.java | 24 -------- .../service/central/target/TargetService.java | 2 - 4 files changed, 25 insertions(+), 61 deletions(-) diff --git a/pom.xml b/pom.xml index 9c18abb..42119a4 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ com.loafle.overflow commons-java jar - 1.0.42-SNAPSHOT + 1.0.43-SNAPSHOT com.loafle.overflow.commons-java diff --git a/src/main/java/com/loafle/overflow/model/infra/InfraZone.java b/src/main/java/com/loafle/overflow/model/infra/InfraZone.java index 08eca2b..1d8158a 100644 --- a/src/main/java/com/loafle/overflow/model/infra/InfraZone.java +++ b/src/main/java/com/loafle/overflow/model/infra/InfraZone.java @@ -2,6 +2,7 @@ package com.loafle.overflow.model.infra; import javax.persistence.*; +import com.loafle.overflow.model.meta.MetaIPType; import com.loafle.overflow.model.meta.MetaTargetZoneType; /** @@ -15,8 +16,8 @@ public class InfraZone extends Infra { private String network; private String iface; - private String addressV4; - private String addressV6; + private MetaIPType metaIPType; + private String address; private String mac; private String gateway; @@ -30,6 +31,7 @@ public class InfraZone extends Infra { this.metaTargetZoneType = metaTargetZoneType; } + @Basic @Column(name = "NETWORK", nullable = true) public String getNetwork() { @@ -50,6 +52,26 @@ public class InfraZone extends Infra { this.iface = iface; } + @ManyToOne + @JoinColumn(name = "META_IP_TYPE_ID", nullable = true) + public MetaIPType getMetaIPType() { + return metaIPType; + } + + public void setMetaIPType(MetaIPType metaIPType) { + this.metaIPType = metaIPType; + } + + @Basic + @Column(name = "ADDRESS", nullable = true) + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + @Basic @Column(name = "MAC", nullable = true) public String getMac() { @@ -70,36 +92,4 @@ public class InfraZone extends Infra { this.gateway = gateway; } - /** - * @return the addressV4 - */ - @Basic - @Column(name = "ADDRESS_V4", nullable = true) - public String getAddressV4() { - return addressV4; - } - - /** - * @param addressV4 the addressV4 to set - */ - public void setAddressV4(String addressV4) { - this.addressV4 = addressV4; - } - - /** - * @return the addressV6 - */ - @Basic - @Column(name = "ADDRESS_V6", nullable = true) - public String getAddressV6() { - return addressV6; - } - - /** - * @param addressV6 the addressV6 to set - */ - public void setAddressV6(String addressV6) { - this.addressV6 = addressV6; - } - } diff --git a/src/main/java/com/loafle/overflow/model/meta/MetaIPType.java b/src/main/java/com/loafle/overflow/model/meta/MetaIPType.java index 55cd083..b6419bd 100644 --- a/src/main/java/com/loafle/overflow/model/meta/MetaIPType.java +++ b/src/main/java/com/loafle/overflow/model/meta/MetaIPType.java @@ -68,32 +68,8 @@ public class MetaIPType { this.value = value; } - public Short getValue() { - return this.value; - } - public MetaIPType to() { return new MetaIPType(this.value); } } - - public static Enum from(MetaIPType metaIPType) { - switch (metaIPType.id) { - case 2: - return Enum.V6; - - default: - return Enum.V4; - } - } - - public Enum from(String metaIPTypeKey) { - switch (metaIPTypeKey) { - case "V6": - return Enum.V6; - - default: - return Enum.V4; - } - } } 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 9d5fff8..d1c2564 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 @@ -5,8 +5,6 @@ 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.discovery.Host; -import com.loafle.overflow.model.discovery.Service; import com.loafle.overflow.model.target.Target; import org.springframework.data.domain.Page;