Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(web2): Replace NetAdmin with ConfigurationService in GwtNetworkConfigurationService #3964

Merged
merged 17 commits into from
May 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ public List<? extends NetInterfaceConfig<? extends NetInterfaceAddressConfig>> g
* @param mtu
* - required MTU for the interface, -1 to keep the automatic default
* @throws KuraException
*
* @deprecated Since 2.4. Use the {@link ConfigurationService} to update the configuration of an Ethernet interface.
*/
@Deprecated
public void updateEthernetInterfaceConfig(String interfaceName, boolean autoConnect, int mtu,
List<NetConfig> netConfigs) throws KuraException;

Expand All @@ -78,7 +81,10 @@ public void updateEthernetInterfaceConfig(String interfaceName, boolean autoConn
* @param autoConnect
* - specifies the auto-connect value for the interface
* @throws KuraException
*
* @deprecated Since 2.4. Use the {@link ConfigurationService} to update the configuration of a Wifi interface.
*/
@Deprecated
public void updateWifiInterfaceConfig(String interfaceName, boolean autoConnect, WifiAccessPoint accessPoint,
List<NetConfig> netConfigs) throws KuraException;

Expand All @@ -100,7 +106,10 @@ public void updateWifiInterfaceConfig(String interfaceName, boolean autoConnect,
* @param netConfigs
* - list of NetConfigs for this interface
* @throws KuraException
*
* @deprecated Since 2.4. Use the {@link ConfigurationService} to update the configuration of a Modem interface.
*/
@Deprecated
public void updateModemInterfaceConfig(String interfaceName, String serialNum, String modemId, int pppNumber,
boolean autoConnect, int mtu, List<NetConfig> netConfigs) throws KuraException;

Expand Down Expand Up @@ -165,7 +174,10 @@ public void updateModemInterfaceConfig(String interfaceName, String serialNum, S
* @param firewallConfiguration
* A list of FirewallOpenPortConfigIP Objects representing the configuration to set
* @throws KuraException
*
* @deprecated Since 2.4
*/
@Deprecated
public void setFirewallOpenPortConfiguration(
List<FirewallOpenPortConfigIP<? extends IPAddress>> firewallConfiguration) throws KuraException;

Expand All @@ -175,10 +187,23 @@ public void setFirewallOpenPortConfiguration(
* @param firewallConfiguration
* A list of FirewallPortForwardConfigIP Objects representing the configuration to set
* @throws KuraException
*
* @deprecated Since 2.4
*/
@Deprecated
public void setFirewallPortForwardingConfiguration(
List<FirewallPortForwardConfigIP<? extends IPAddress>> firewallConfiguration) throws KuraException;

/**
* Sets the 'ip forwarding' portion of the firewall configuration
*
* @param natConfigs
* A list of FirewallNatConfig Objects representing the configuration to set
* @throws KuraException
*
* @deprecated Since 2.4
*/
@Deprecated
public void setFirewallNatConfiguration(List<FirewallNatConfig> natConfigs) throws KuraException;

/**
Expand Down Expand Up @@ -259,6 +284,7 @@ public void setFirewallPortForwardingConfiguration(

/**
* Obtains the DHCP Lease values
*
* @return list of ipAddresses, macAddresses, hostnames;
* @throws KuraException
* @since 2.3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
******************************************************************************/
package org.eclipse.kura.net.firewall;

import java.util.Objects;

import org.eclipse.kura.net.IPAddress;
import org.eclipse.kura.net.NetProtocol;
import org.eclipse.kura.net.NetworkPair;
Expand Down Expand Up @@ -176,17 +178,8 @@ public void setSourcePortRange(String sourcePortRange) {

@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + (this.permittedInterfaceName == null ? 0 : this.permittedInterfaceName.hashCode());
result = prime * result + (this.permittedMac == null ? 0 : this.permittedMac.hashCode());
result = prime * result + (this.permittedNetwork == null ? 0 : this.permittedNetwork.hashCode());
result = prime * result + this.port;
result = prime * result + (this.protocol == null ? 0 : this.protocol.hashCode());
result = prime * result + (this.sourcePortRange == null ? 0 : this.sourcePortRange.hashCode());
result = prime * result
+ (this.unpermittedInterfaceName == null ? 0 : this.unpermittedInterfaceName.hashCode());
return result;
return Objects.hash(permittedInterfaceName, permittedMac, permittedNetwork, port, portRange, protocol,
sourcePortRange, unpermittedInterfaceName);
}

@Override
Expand All @@ -201,48 +194,12 @@ public boolean equals(Object obj) {
return false;
}
FirewallOpenPortConfigIP<?> other = (FirewallOpenPortConfigIP<?>) obj;
if (this.permittedInterfaceName == null) {
if (other.permittedInterfaceName != null) {
return false;
}
} else if (!this.permittedInterfaceName.equals(other.permittedInterfaceName)) {
return false;
}
if (this.permittedMac == null) {
if (other.permittedMac != null) {
return false;
}
} else if (!this.permittedMac.equals(other.permittedMac)) {
return false;
}
if (this.permittedNetwork == null) {
if (other.permittedNetwork != null) {
return false;
}
} else if (!this.permittedNetwork.equals(other.permittedNetwork)) {
return false;
}
if (this.port != other.port) {
return false;
}
if (this.protocol != other.protocol) {
return false;
}
if (this.sourcePortRange == null) {
if (other.sourcePortRange != null) {
return false;
}
} else if (!this.sourcePortRange.equals(other.sourcePortRange)) {
return false;
}
if (this.unpermittedInterfaceName == null) {
if (other.unpermittedInterfaceName != null) {
return false;
}
} else if (!this.unpermittedInterfaceName.equals(other.unpermittedInterfaceName)) {
return false;
}
return true;
return Objects.equals(permittedInterfaceName, other.permittedInterfaceName)
&& Objects.equals(permittedMac, other.permittedMac)
&& Objects.equals(permittedNetwork, other.permittedNetwork) && port == other.port
&& Objects.equals(portRange, other.portRange) && protocol == other.protocol
&& Objects.equals(sourcePortRange, other.sourcePortRange)
&& Objects.equals(unpermittedInterfaceName, other.unpermittedInterfaceName);
}

@Override
Expand All @@ -265,6 +222,8 @@ public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("FirewallOpenPortConfigIP [port=");
builder.append(this.port);
builder.append(", portRange=");
builder.append(this.portRange);
builder.append(", protocol=");
builder.append(this.protocol);
builder.append(", permittedNetwork=");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,13 @@ public class WifiConfigurationInterpreter {
private static final String WIFI_PASSPHRASE_KEY = ".passphrase";
private static final String SECURITY_TYPE = ".securityType";
private static final String NET_INTERFACE = "net.interface.";

private static final String WIFI_CHANNELS_KEY = ".channel";

private static final String WIFI_IGNORE_SSID_KEY = ".ignoreSSID";

private static final String WIFI_PING_ACCESS_POINT_KEY = ".pingAccessPoint";

private static final String WIFI_RADIO_MODE_KEY = ".radioMode";

private static final String WIFI_GROUP_CIPHERS_KEY = ".groupCiphers";

private static final String WIFI_PAIRWISE_CIPHERS_KEY = ".pairwiseCiphers";

private static final String DRIVER_KEY = ".driver";

private static final String WIFI_SSID_KEY = ".ssid";

private WifiConfigurationInterpreter() {
Expand Down
Loading