Skip to content

Commit

Permalink
chore: additional cleanup of stale properties
Browse files Browse the repository at this point in the history
Signed-off-by: MMaiero <[email protected]>
  • Loading branch information
MMaiero committed Sep 13, 2024
1 parent 1b1eb3c commit 9dd4bdf
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 145 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
import org.eclipse.kura.web.shared.model.GwtFirewallNatEntry;
import org.eclipse.kura.web.shared.model.GwtFirewallOpenPortEntry;
import org.eclipse.kura.web.shared.model.GwtFirewallPortForwardEntry;
import org.eclipse.kura.web.shared.model.GwtModemPdpEntry;
import org.eclipse.kura.web.shared.model.GwtNetInterfaceConfig;
import org.eclipse.kura.web.shared.model.GwtWifiChannelFrequency;
import org.eclipse.kura.web.shared.model.GwtWifiConfig;
Expand Down Expand Up @@ -106,16 +105,7 @@ public ArrayList<GwtWifiHotspotEntry> findWifiHotspots(GwtXSRFToken xsrfToken, S
throw new GwtKuraException(GwtKuraErrorCode.INTERNAL_ERROR, e);
}
}

@Override
public List<GwtModemPdpEntry> findPdpContextInfo(GwtXSRFToken xsrfToken, String interfaceName)
throws GwtKuraException {
checkXSRFToken(xsrfToken);

logger.debug("Method findPdpContextInfo not implemented yet. Returning empty list.");
return new ArrayList<>();
}


@Override
public boolean verifyWifiCredentials(GwtXSRFToken xsrfToken, String interfaceName, GwtWifiConfig gwtWifiConfig)
throws GwtKuraException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,6 @@ private void setModemProperties() {
GwtModemInterfaceConfig gwtModemConfig = (GwtModemInterfaceConfig) this.gwtConfig;

gwtModemConfig.setAuthType(EnumsParser.getGwtModemAuthType(this.properties.getModemAuthType(this.ifName)));
gwtModemConfig.setPdpType(EnumsParser.getGwtModemPdpType(this.properties.getModemPdpType(this.ifName)));

gwtModemConfig.setDialString(this.properties.getModemDialString(this.ifName));
gwtModemConfig.setUsername(this.properties.getModemUsername(this.ifName));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,6 @@ private void setModemProperties() {

this.properties.setModemAuthType(this.ifname,
EnumsParser.getAuthType(Optional.ofNullable(gwtModemConfig.getAuthType())));
this.properties.setModemPdpType(this.ifname,
EnumsParser.getPdpType(Optional.ofNullable(gwtModemConfig.getPdpType())));
this.properties.setModemDialString(this.ifname, gwtModemConfig.getDialString());
this.properties.setModemUsername(this.ifname, gwtModemConfig.getUsername());

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2023 Eurotech and/or its affiliates and others
* Copyright (c) 2023, 2024 Eurotech and/or its affiliates and others
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
Expand All @@ -16,13 +16,11 @@

import org.eclipse.kura.net.NetInterfaceStatus;
import org.eclipse.kura.net.modem.ModemConfig.AuthType;
import org.eclipse.kura.net.modem.ModemConfig.PdpType;
import org.eclipse.kura.net.wifi.WifiCiphers;
import org.eclipse.kura.net.wifi.WifiMode;
import org.eclipse.kura.net.wifi.WifiRadioMode;
import org.eclipse.kura.net.wifi.WifiSecurity;
import org.eclipse.kura.web.shared.model.GwtModemAuthType;
import org.eclipse.kura.web.shared.model.GwtModemPdpType;
import org.eclipse.kura.web.shared.model.GwtNetIfStatus;
import org.eclipse.kura.web.shared.model.GwtWifiCiphers;
import org.eclipse.kura.web.shared.model.GwtWifiRadioMode;
Expand Down Expand Up @@ -358,48 +356,4 @@ public static String getAuthType(Optional<GwtModemAuthType> gwtModemAuthType) {
return AuthType.NONE.name();
}

/**
* Converts values of {@link PdpType} to {@link GwtModemPdpType}
*
*/
public static GwtModemPdpType getGwtModemPdpType(Optional<String> pdpType) {
if (pdpType.isPresent()) {
if (pdpType.get().equals(PdpType.IP.name())) {
return GwtModemPdpType.netModemPdpIP;
}

if (pdpType.get().equals(PdpType.PPP.name())) {
return GwtModemPdpType.netModemPdpPPP;
}

if (pdpType.get().equals(PdpType.IPv6.name())) {
return GwtModemPdpType.netModemPdpIPv6;
}
}

return GwtModemPdpType.netModemPdpUnknown;
}

/**
* Converts values of {@link GwtModemPdpType} to {@link PdpType.name()}
*
*/
public static String getPdpType(Optional<GwtModemPdpType> gwtModemPdpType) {
if (gwtModemPdpType.isPresent()) {
switch (gwtModemPdpType.get()) {
case netModemPdpIP:
return PdpType.IP.name();
case netModemPdpIPv6:
return PdpType.IPv6.name();
case netModemPdpPPP:
return PdpType.PPP.name();
case netModemPdpUnknown:
default:
break;
}
}

return PdpType.UNKNOWN.name();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -168,18 +168,6 @@ public void setProfileID(int id) {
set("profileID", id);
}

public GwtModemPdpType getPdpType() {
if (get("pdpType") != null) {
return GwtModemPdpType.valueOf((String) get("pdpType"));
} else {
return null;
}
}

public void setPdpType(GwtModemPdpType pdpType) {
set("pdpType", pdpType.name());
}

public String getApn() {
return get("apn");
}
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.eclipse.kura.web.shared.model.GwtFirewallNatEntry;
import org.eclipse.kura.web.shared.model.GwtFirewallOpenPortEntry;
import org.eclipse.kura.web.shared.model.GwtFirewallPortForwardEntry;
import org.eclipse.kura.web.shared.model.GwtModemPdpEntry;
import org.eclipse.kura.web.shared.model.GwtNetInterfaceConfig;
import org.eclipse.kura.web.shared.model.GwtWifiChannelFrequency;
import org.eclipse.kura.web.shared.model.GwtWifiConfig;
Expand Down Expand Up @@ -99,9 +98,6 @@ public List<GwtWifiChannelFrequency> findFrequencies(GwtXSRFToken xsrfToken, Str
public boolean verifyWifiCredentials(GwtXSRFToken xsrfToken, String interfaceName, GwtWifiConfig gwtWifiConfig)
throws GwtKuraException;

public List<GwtModemPdpEntry> findPdpContextInfo(GwtXSRFToken xsrfToken, String interfaceName)
throws GwtKuraException;

public boolean isIEEE80211ACSupported(GwtXSRFToken xsrfToken, String ifaceName) throws GwtKuraException;

public List<String> getDhcpLeases(GwtXSRFToken xsrfToken, String interfaceName) throws GwtKuraException;
Expand Down

0 comments on commit 9dd4bdf

Please sign in to comment.