306 lines
7.4 KiB
Java
306 lines
7.4 KiB
Java
package org.kne.cloud.network.klalb;
|
|
|
|
import java.net.InetAddress;
|
|
import java.net.UnknownHostException;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.Objects;
|
|
|
|
import org.kne.cloud.network.MultipurposeSocketAddress;
|
|
|
|
import com.google.gson.Gson;
|
|
import com.google.gson.GsonBuilder;
|
|
|
|
public class KLALBControllerConfigItem extends KLALBConfigItem {
|
|
private String language;
|
|
private boolean nogui;
|
|
private String VirtualAddress;
|
|
private Long VirtualASN;
|
|
private List<InetAddress> DNS;
|
|
private MultipurposeSocketAddress TCPListen;
|
|
private MultipurposeSocketAddress UDPListen;
|
|
private String VirtualSocketName;
|
|
private List<MultipurposeSocketAddress>LineTable=new ArrayList<>();
|
|
private List<MultipurposeSocketAddress>ConnectLineTable=new ArrayList<>();
|
|
private List<MultipurposeSocketAddress>ntpServerTable=new ArrayList<>();
|
|
public void setNetworkInterfaceExcepts(List<String> networkInterfaceExcepts) {
|
|
NetworkInterfaceExcepts = networkInterfaceExcepts;
|
|
}
|
|
|
|
|
|
|
|
private List<String>NetworkInterfaceExcepts=new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
public KLALBControllerConfigItem(String type, boolean nogui, String virtualAddress, Long virtualASN,
|
|
List<InetAddress> dNS, MultipurposeSocketAddress tCPListen, MultipurposeSocketAddress uDPListen,
|
|
String virtualSocketName, List<MultipurposeSocketAddress> lineTable,
|
|
List<MultipurposeSocketAddress> connectLineTable) {
|
|
super(type);
|
|
this.nogui = nogui;
|
|
VirtualAddress = virtualAddress;
|
|
VirtualASN = virtualASN;
|
|
DNS = dNS;
|
|
TCPListen = tCPListen;
|
|
UDPListen = uDPListen;
|
|
VirtualSocketName = virtualSocketName;
|
|
LineTable = lineTable;
|
|
ConnectLineTable = connectLineTable;
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<String> getNetworkInterfaceExcepts() {
|
|
return NetworkInterfaceExcepts;
|
|
}
|
|
|
|
|
|
public void setLanguage(String language) {
|
|
this.language = language;
|
|
}
|
|
|
|
|
|
|
|
public KLALBControllerConfigItem(String type) {
|
|
super(type);
|
|
}
|
|
|
|
|
|
|
|
public String getLanguage() {
|
|
return language;
|
|
}
|
|
|
|
|
|
|
|
public String getVirtualSocketName() {
|
|
return VirtualSocketName;
|
|
}
|
|
|
|
|
|
|
|
public void setVirtualSocketName(String virtualSocketName) {
|
|
VirtualSocketName = virtualSocketName;
|
|
}
|
|
|
|
|
|
|
|
public boolean isNogui() {
|
|
return nogui;
|
|
}
|
|
|
|
|
|
|
|
public void setNogui(boolean nogui) {
|
|
this.nogui = nogui;
|
|
}
|
|
|
|
|
|
|
|
public String getVirtualAddress() {
|
|
return VirtualAddress;
|
|
}
|
|
|
|
|
|
|
|
public void setVirtualAddress(String virtualAddress) {
|
|
VirtualAddress = virtualAddress;
|
|
}
|
|
|
|
|
|
|
|
public Long getVirtualASN() {
|
|
return VirtualASN;
|
|
}
|
|
|
|
|
|
|
|
public void setVirtualASN(Long virtualASN) {
|
|
VirtualASN = virtualASN;
|
|
}
|
|
|
|
|
|
|
|
public List<InetAddress> getDNS() {
|
|
return DNS;
|
|
}
|
|
|
|
|
|
|
|
public void setDNS(List<InetAddress> dNS) {
|
|
DNS = dNS;
|
|
}
|
|
|
|
|
|
|
|
public MultipurposeSocketAddress getTCPListen() {
|
|
return TCPListen;
|
|
}
|
|
|
|
|
|
|
|
public void setTCPListen(MultipurposeSocketAddress tCPListen) {
|
|
TCPListen = tCPListen;
|
|
}
|
|
|
|
|
|
|
|
public MultipurposeSocketAddress getUDPListen() {
|
|
return UDPListen;
|
|
}
|
|
|
|
|
|
|
|
public void setUDPListen(MultipurposeSocketAddress uDPListen) {
|
|
UDPListen = uDPListen;
|
|
}
|
|
|
|
|
|
|
|
public List<MultipurposeSocketAddress> getLineTable() {
|
|
return LineTable;
|
|
}
|
|
|
|
|
|
|
|
public void setLineTable(List<MultipurposeSocketAddress> lineTable) {
|
|
LineTable = lineTable;
|
|
}
|
|
|
|
|
|
|
|
public List<MultipurposeSocketAddress> getConnectLineTable() {
|
|
return ConnectLineTable;
|
|
}
|
|
|
|
|
|
|
|
public void setConnectLineTable(List<MultipurposeSocketAddress> connectLineTable) {
|
|
ConnectLineTable = connectLineTable;
|
|
}
|
|
|
|
|
|
|
|
public List<MultipurposeSocketAddress> getNtpServerTable() {
|
|
return ntpServerTable;
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setNtpServerTable(List<MultipurposeSocketAddress> ntpServerTable) {
|
|
this.ntpServerTable = ntpServerTable;
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "KLALBControllerConfigItem [language=" + language + ", nogui=" + nogui + ", VirtualAddress="
|
|
+ VirtualAddress + ", VirtualASN=" + VirtualASN + ", DNS=" + DNS + ", TCPListen=" + TCPListen
|
|
+ ", UDPListen=" + UDPListen + ", VirtualSocketName=" + VirtualSocketName + ", LineTable=" + LineTable
|
|
+ ", ConnectLineTable=" + ConnectLineTable + ", ntpServerTable=" + ntpServerTable
|
|
+ ", NetworkInterfaceExcepts=" + NetworkInterfaceExcepts + "]";
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
final int prime = 31;
|
|
int result = super.hashCode();
|
|
result = prime * result + ((ConnectLineTable == null) ? 0 : ConnectLineTable.hashCode());
|
|
result = prime * result + ((DNS == null) ? 0 : DNS.hashCode());
|
|
result = prime * result + ((LineTable == null) ? 0 : LineTable.hashCode());
|
|
result = prime * result + ((NetworkInterfaceExcepts == null) ? 0 : NetworkInterfaceExcepts.hashCode());
|
|
result = prime * result + ((TCPListen == null) ? 0 : TCPListen.hashCode());
|
|
result = prime * result + ((UDPListen == null) ? 0 : UDPListen.hashCode());
|
|
result = prime * result + ((VirtualASN == null) ? 0 : VirtualASN.hashCode());
|
|
result = prime * result + ((VirtualAddress == null) ? 0 : VirtualAddress.hashCode());
|
|
result = prime * result + ((VirtualSocketName == null) ? 0 : VirtualSocketName.hashCode());
|
|
result = prime * result + ((language == null) ? 0 : language.hashCode());
|
|
result = prime * result + (nogui ? 1231 : 1237);
|
|
result = prime * result + ((ntpServerTable == null) ? 0 : ntpServerTable.hashCode());
|
|
return result;
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
public boolean equals(Object obj) {
|
|
if (this == obj)
|
|
return true;
|
|
if (!super.equals(obj))
|
|
return false;
|
|
if (getClass() != obj.getClass())
|
|
return false;
|
|
KLALBControllerConfigItem other = (KLALBControllerConfigItem) obj;
|
|
if (ConnectLineTable == null) {
|
|
if (other.ConnectLineTable != null)
|
|
return false;
|
|
} else if (!ConnectLineTable.equals(other.ConnectLineTable))
|
|
return false;
|
|
if (DNS == null) {
|
|
if (other.DNS != null)
|
|
return false;
|
|
} else if (!DNS.equals(other.DNS))
|
|
return false;
|
|
if (LineTable == null) {
|
|
if (other.LineTable != null)
|
|
return false;
|
|
} else if (!LineTable.equals(other.LineTable))
|
|
return false;
|
|
if (NetworkInterfaceExcepts == null) {
|
|
if (other.NetworkInterfaceExcepts != null)
|
|
return false;
|
|
} else if (!NetworkInterfaceExcepts.equals(other.NetworkInterfaceExcepts))
|
|
return false;
|
|
if (TCPListen == null) {
|
|
if (other.TCPListen != null)
|
|
return false;
|
|
} else if (!TCPListen.equals(other.TCPListen))
|
|
return false;
|
|
if (UDPListen == null) {
|
|
if (other.UDPListen != null)
|
|
return false;
|
|
} else if (!UDPListen.equals(other.UDPListen))
|
|
return false;
|
|
if (VirtualASN == null) {
|
|
if (other.VirtualASN != null)
|
|
return false;
|
|
} else if (!VirtualASN.equals(other.VirtualASN))
|
|
return false;
|
|
if (VirtualAddress == null) {
|
|
if (other.VirtualAddress != null)
|
|
return false;
|
|
} else if (!VirtualAddress.equals(other.VirtualAddress))
|
|
return false;
|
|
if (VirtualSocketName == null) {
|
|
if (other.VirtualSocketName != null)
|
|
return false;
|
|
} else if (!VirtualSocketName.equals(other.VirtualSocketName))
|
|
return false;
|
|
if (language == null) {
|
|
if (other.language != null)
|
|
return false;
|
|
} else if (!language.equals(other.language))
|
|
return false;
|
|
if (nogui != other.nogui)
|
|
return false;
|
|
if (ntpServerTable == null) {
|
|
if (other.ntpServerTable != null)
|
|
return false;
|
|
} else if (!ntpServerTable.equals(other.ntpServerTable))
|
|
return false;
|
|
return true;
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|