This commit is contained in:
crusader 2018-06-11 23:44:36 +09:00
parent 92371d6df5
commit ae7472b608
4 changed files with 25 additions and 61 deletions

View File

@ -13,7 +13,7 @@
<groupId>com.loafle.overflow</groupId> <groupId>com.loafle.overflow</groupId>
<artifactId>commons-java</artifactId> <artifactId>commons-java</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<version>1.0.42-SNAPSHOT</version> <version>1.0.43-SNAPSHOT</version>
<name>com.loafle.overflow.commons-java</name> <name>com.loafle.overflow.commons-java</name>
<properties> <properties>

View File

@ -2,6 +2,7 @@ package com.loafle.overflow.model.infra;
import javax.persistence.*; import javax.persistence.*;
import com.loafle.overflow.model.meta.MetaIPType;
import com.loafle.overflow.model.meta.MetaTargetZoneType; import com.loafle.overflow.model.meta.MetaTargetZoneType;
/** /**
@ -15,8 +16,8 @@ public class InfraZone extends Infra {
private String network; private String network;
private String iface; private String iface;
private String addressV4; private MetaIPType metaIPType;
private String addressV6; private String address;
private String mac; private String mac;
private String gateway; private String gateway;
@ -30,6 +31,7 @@ public class InfraZone extends Infra {
this.metaTargetZoneType = metaTargetZoneType; this.metaTargetZoneType = metaTargetZoneType;
} }
@Basic @Basic
@Column(name = "NETWORK", nullable = true) @Column(name = "NETWORK", nullable = true)
public String getNetwork() { public String getNetwork() {
@ -50,6 +52,26 @@ public class InfraZone extends Infra {
this.iface = iface; 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 @Basic
@Column(name = "MAC", nullable = true) @Column(name = "MAC", nullable = true)
public String getMac() { public String getMac() {
@ -70,36 +92,4 @@ public class InfraZone extends Infra {
this.gateway = gateway; 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;
}
} }

View File

@ -68,32 +68,8 @@ public class MetaIPType {
this.value = value; this.value = value;
} }
public Short getValue() {
return this.value;
}
public MetaIPType to() { public MetaIPType to() {
return new MetaIPType(this.value); 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;
}
}
} }

View File

@ -5,8 +5,6 @@ import java.util.List;
import com.loafle.overflow.core.annotation.WebappAPI; import com.loafle.overflow.core.annotation.WebappAPI;
import com.loafle.overflow.core.exception.OverflowException; import com.loafle.overflow.core.exception.OverflowException;
import com.loafle.overflow.core.model.PageParams; 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 com.loafle.overflow.model.target.Target;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;