ing
This commit is contained in:
parent
92371d6df5
commit
ae7472b608
2
pom.xml
2
pom.xml
|
@ -13,7 +13,7 @@
|
|||
<groupId>com.loafle.overflow</groupId>
|
||||
<artifactId>commons-java</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.0.42-SNAPSHOT</version>
|
||||
<version>1.0.43-SNAPSHOT</version>
|
||||
<name>com.loafle.overflow.commons-java</name>
|
||||
|
||||
<properties>
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user