Skip to content

Commit

Permalink
Removed old networking from web2; fixed distrib pom
Browse files Browse the repository at this point in the history
Signed-off-by: pierantoniomerlino <[email protected]>
  • Loading branch information
pierantoniomerlino committed Jul 15, 2024
1 parent 9f689cc commit 1fa021d
Show file tree
Hide file tree
Showing 15 changed files with 441 additions and 2,596 deletions.
6 changes: 0 additions & 6 deletions kura/distrib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -396,11 +396,6 @@
<artifactId>org.eclipse.kura.core.status</artifactId>
<version>${org.eclipse.kura.core.status.version}</version>
</artifactItem>
<artifactItem>
<groupId>org.eclipse.kura</groupId>
<artifactId>org.eclipse.kura.net.admin</artifactId>
<version>${org.eclipse.kura.net.admin.version}</version>
</artifactItem>
<artifactItem>
<groupId>org.eclipse.kura</groupId>
<artifactId>org.eclipse.kura.nm</artifactId>
Expand Down Expand Up @@ -798,7 +793,6 @@
<move file="target/plugins/org.eclipse.kura.localization.jar" tofile="target/plugins/org.eclipse.kura.localization_${org.eclipse.kura.localization.version}.jar" />
<move file="target/plugins/org.eclipse.kura.localization.resources.jar" tofile="target/plugins/org.eclipse.kura.localization.resources_${org.eclipse.kura.localization.resources.version}.jar" />
<move file="target/plugins/org.eclipse.kura.core.status.jar" tofile="target/plugins/org.eclipse.kura.core.status_${org.eclipse.kura.core.status.version}.jar" />
<move file="target/plugins/org.eclipse.kura.net.admin.jar" tofile="target/plugins/org.eclipse.kura.net.admin_${org.eclipse.kura.net.admin.version}.jar" />
<move file="target/plugins/org.eclipse.kura.nm.jar" tofile="target/plugins/org.eclipse.kura.nm_${org.eclipse.kura.nm.version}.jar" />
<move file="target/plugins/org.eclipse.kura.net.configuration.jar" tofile="target/plugins/org.eclipse.kura.net.configuration_${org.eclipse.kura.net.configuration.version}.jar" />
<move file="target/plugins/org.eclipse.kura.net.admin.firewall.jar" tofile="target/plugins/org.eclipse.kura.net.admin.firewall_${org.eclipse.kura.net.admin.firewall.version}.jar" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
import org.eclipse.kura.web.server.GwtKeystoreServiceImpl;
import org.eclipse.kura.web.server.GwtLogServiceImpl;
import org.eclipse.kura.web.server.GwtLoginInfoServiceImpl;
import org.eclipse.kura.web.server.GwtNetworkServiceImplFacade;
import org.eclipse.kura.web.server.GwtNetworkServiceImpl;
import org.eclipse.kura.web.server.GwtPackageServiceImpl;
import org.eclipse.kura.web.server.GwtPasswordAuthenticationServiceImpl;
import org.eclipse.kura.web.server.GwtSecurityServiceImpl;
Expand Down Expand Up @@ -505,7 +505,7 @@ private synchronized void initHTTPService() throws NamespaceException, ServletEx
this.sessionContext);
this.httpService.registerServlet(DENALI_MODULE_PATH + "/logservice", new GwtLogServiceImpl(), null,
this.sessionContext);
this.httpService.registerServlet(DENALI_MODULE_PATH + "/network", new GwtNetworkServiceImplFacade(), null,
this.httpService.registerServlet(DENALI_MODULE_PATH + "/network", new GwtNetworkServiceImpl(), null,
this.sessionContext);
this.httpService.registerServlet(DENALI_MODULE_PATH + "/component", new GwtComponentServiceImpl(), null,
this.sessionContext);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011, 2023 Eurotech and/or its affiliates and others
* Copyright (c) 2011, 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 @@ -15,7 +15,6 @@
import org.eclipse.kura.web.client.messages.Messages;
import org.eclipse.kura.web.client.ui.Tab;
import org.eclipse.kura.web.client.ui.Tab.RefreshHandler;
import org.eclipse.kura.web.client.util.FailureHandler;
import org.eclipse.kura.web.shared.service.GwtNetworkService;
import org.eclipse.kura.web.shared.service.GwtNetworkServiceAsync;
import org.gwtbootstrap3.client.ui.Anchor;
Expand All @@ -28,7 +27,6 @@
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.Widget;
Expand Down Expand Up @@ -86,7 +84,6 @@ interface FirewallPanelUiUiBinder extends UiBinder<Widget, FirewallPanelUi> {
private final Tab.RefreshHandler openPortsIPv6Handler;
private final Tab.RefreshHandler portForwardingIPv6Handler;
private final Tab.RefreshHandler ipForwardingIPv6Handler;
private boolean isNet2;

public FirewallPanelUi() {

Expand Down Expand Up @@ -126,15 +123,13 @@ public void initFirewallPanel() {

this.portForwardingIPv6Panel.clear();
this.ipForwardingIPv6Panel.clear();
if (this.isNet2) {
this.openPortsIPv6Panel.refresh();
} else {
this.openPortsIPv6Panel.clear();
}
this.openPortsIPv6Panel.refresh();

this.openPorts.showTab();
this.openPortsIPv6.setVisible(true);
this.portForwardingIPv6.setVisible(true);
this.ipForwardingIPv6.setVisible(true);

detectIfNet2();
this.openPorts.showTab();
}

public boolean isDirty() {
Expand Down Expand Up @@ -201,27 +196,4 @@ private Tab getTab(TabListItem item) {
return this.openPortsPanel;
}
}

private void detectIfNet2() {
this.gwtNetworkService.isNet2(new AsyncCallback<Boolean>() {

@Override
public void onFailure(Throwable caught) {
FirewallPanelUi.this.isNet2 = false;
FailureHandler.handle(caught);
}

@Override
public void onSuccess(Boolean result) {
FirewallPanelUi.this.isNet2 = result;
initNet2FeaturesOnly(result);
}
});
}

private void initNet2FeaturesOnly(boolean isNet2) {
this.openPortsIPv6.setVisible(isNet2);
this.portForwardingIPv6.setVisible(isNet2);
this.ipForwardingIPv6.setVisible(isNet2);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011, 2020 Eurotech and/or its affiliates and others
* Copyright (c) 2011, 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 @@ -13,7 +13,6 @@
package org.eclipse.kura.web.client.ui.network;

import org.eclipse.kura.web.client.messages.Messages;
import org.eclipse.kura.web.client.util.FailureHandler;
import org.eclipse.kura.web.shared.model.GwtSession;
import org.eclipse.kura.web.shared.service.GwtNetworkService;
import org.eclipse.kura.web.shared.service.GwtNetworkServiceAsync;
Expand All @@ -25,7 +24,6 @@
import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.Widget;
Expand Down Expand Up @@ -63,26 +61,8 @@ public NetworkPanelUi() {
}

public void initNetworkPanel() {

this.gwtNetworkService.isNet2(new AsyncCallback<Boolean>() {

@Override
public void onFailure(Throwable caught) {
initNetworkPanel(false);
FailureHandler.handle(caught);
}

@Override
public void onSuccess(Boolean result) {
initNetworkPanel(result);
}
});
}

private void initNetworkPanel(final boolean isNet2) {

if (!this.isInitialized) {
this.tabs = new NetworkTabsUi(this.session, isNet2);
this.tabs = new NetworkTabsUi(this.session);
this.tabsPanel.add(this.tabs);

table = new NetworkInterfacesTableUi(this.session, this.tabs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@
*******************************************************************************/
package org.eclipse.kura.web.client.ui.network;

import java.awt.Color;
import java.nio.channels.AsynchronousCloseException;
import java.util.LinkedList;
import java.util.List;
import java.util.logging.Logger;

import org.eclipse.kura.web.client.messages.Messages;
import org.eclipse.kura.web.client.util.MessageUtils;
Expand All @@ -38,9 +35,6 @@
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;

import com.google.gwt.dom.client.Style.BorderStyle;
import com.google.gwt.dom.client.Style.Unit;

public class NetworkTabsUi extends Composite {

private static final String WIFI_ACCESS_POINT = GwtWifiWirelessMode.netWifiWirelessModeAccessPoint.name();
Expand All @@ -60,8 +54,6 @@ interface NetworkTabsUiUiBinder extends UiBinder<Widget, NetworkTabsUi> {

private static final Messages MSGS = GWT.create(Messages.class);

private boolean isNet2 = false;

AnchorListItem ip4TabAnchorItem;
AnchorListItem ip6TabAnchorItem;
AnchorListItem dhcp4NatTabAnchorItem;
Expand Down Expand Up @@ -100,22 +92,21 @@ interface NetworkTabsUiUiBinder extends UiBinder<Widget, NetworkTabsUi> {
* Initialization
*/

public NetworkTabsUi(GwtSession session, final boolean isNet2) {
public NetworkTabsUi(GwtSession session) {
initWidget(uiBinder.createAndBindUi(this));
this.visibleTabs = new LinkedList<>();
this.session = session;
this.isNet2 = isNet2;
initTabs(isNet2);
initTabs();
}

private void initTabs(final boolean isNet2) {
private void initTabs() {
this.tabsPanel.clear();
this.visibleTabs.clear();

initIp4Tab(isNet2);
initIp4Tab();
initIp6Tab();
initWireless8021xTab();
initWirelessTab(isNet2);
initWirelessTab();
initModemTab();
initModemGpsTab();
initModemAntennaTab();
Expand All @@ -129,9 +120,9 @@ private void initTabs(final boolean isNet2) {
this.content.add(this.ip4Tab);
}

private void initIp4Tab(final boolean isNet2) {
private void initIp4Tab() {
this.ip4TabAnchorItem = new AnchorListItem(MSGS.netIPv4());
this.ip4Tab = new TabIp4Ui(this.session, this, isNet2);
this.ip4Tab = new TabIp4Ui(this.session, this);

this.ip4TabAnchorItem.addClickHandler(event -> {
setSelected(NetworkTabsUi.this.ip4TabAnchorItem);
Expand Down Expand Up @@ -165,10 +156,9 @@ private void initWireless8021xTab() {
});
}

private void initWirelessTab(final boolean isNet2) {
private void initWirelessTab() {
this.wirelessTabAnchorItem = new AnchorListItem(MSGS.netWifiWireless());
this.wirelessTab = new TabWirelessUi(this.session, this.ip4Tab, this.ip6Tab, this.net8021xTabAnchorItem, this,
isNet2);
this.wirelessTab = new TabWirelessUi(this.session, this.ip4Tab, this.ip6Tab, this.net8021xTabAnchorItem, this);

this.wirelessTabAnchorItem.addClickHandler(event -> {
setSelected(NetworkTabsUi.this.wirelessTabAnchorItem);
Expand Down Expand Up @@ -284,16 +274,9 @@ public void updateTabs() {
removeAllTabs();

insertTab(this.ip4TabAnchorItem);

if (this.isNet2) {
insertTab(this.ip6TabAnchorItem);
}

insertTab(this.ip6TabAnchorItem);
arrangeOptionalTabs();

if (this.isNet2) {
insertTab(this.advancedTabAnchorItem);
}
insertTab(this.advancedTabAnchorItem);
insertTab(this.hardwareTabAnchorItem);
}

Expand Down Expand Up @@ -360,13 +343,10 @@ private void showWirelessTabs(boolean interfaceNotEnabled) {
this.wirelessTabAnchorItem.setEnabled(!interfaceNotEnabled);

insertTab(this.wirelessTabAnchorItem);
if (this.isNet2) {
if (interfaceNotEnabled) {
this.net8021xTabAnchorItem.setEnabled(false);
}
insertTab(this.net8021xTabAnchorItem);
if (interfaceNotEnabled) {
this.net8021xTabAnchorItem.setEnabled(false);
}

insertTab(this.net8021xTabAnchorItem);
insertTab(this.dhcp4NatTabAnchorItem);
}

Expand Down Expand Up @@ -439,8 +419,8 @@ private void refreshAllVisibleTabs() {
if (this.visibleTabs.contains(this.net8021xTabAnchorItem)) {
this.set8021xTab.refresh();
}
if(this.visibleTabs.contains(this.advancedTabAnchorItem)) {
this.advancedTab.refresh();
if (this.visibleTabs.contains(this.advancedTabAnchorItem)) {
this.advancedTab.refresh();
}
}

Expand Down Expand Up @@ -481,7 +461,7 @@ public boolean isDirty() {
if (this.visibleTabs.contains(this.net8021xTabAnchorItem) && this.set8021xTab.isDirty()) {
return true;
}

if (this.visibleTabs.contains(this.advancedTabAnchorItem) && this.advancedTab.isDirty()) {
return true;
}
Expand Down Expand Up @@ -554,7 +534,7 @@ public GwtNetInterfaceConfig getUpdatedInterface() {
this.set8021xTab.getUpdatedNetInterface(updatedNetIf);
}
if (this.visibleTabs.contains(this.advancedTabAnchorItem)) {
this.advancedTab.getUpdatedNetInterface(updatedNetIf);
this.advancedTab.getUpdatedNetInterface(updatedNetIf);
}

return updatedNetIf;
Expand Down Expand Up @@ -623,7 +603,7 @@ public boolean isValid() {
errorTab(this.net8021xTabAnchorItem);
return false;
}

if (this.visibleTabs.contains(this.advancedTabAnchorItem) && this.advancedTabAnchorItem.isEnabled()
&& !this.advancedTab.isValid()) {
errorTab(this.advancedTabAnchorItem);
Expand Down
Loading

0 comments on commit 1fa021d

Please sign in to comment.