Changed controllers to be singleton in the manager and moved isAvailable to AbstractController

This commit is contained in:
Ziver Koc 2021-06-09 23:27:42 +02:00
parent a80a1c5cdc
commit 267054e4ba
5 changed files with 31 additions and 27 deletions

View file

@ -3,7 +3,6 @@ package se.hal.plugin.netscan;
import se.hal.HalContext;
import se.hal.intf.*;
import se.hal.struct.devicedata.AvailabilityEventData;
import se.hal.struct.devicedata.OnOffEventData;
import zutil.InetUtil;
import zutil.log.LogUtil;
import zutil.net.InetScanner;
@ -91,7 +90,7 @@ public class NetScanController implements HalEventController, HalAutostartContro
if (listener != null)
listener.reportReceived(
new NetworkDevice(ip.getHostAddress()),
new OnOffEventData(true, System.currentTimeMillis()));
new AvailabilityEventData(true, System.currentTimeMillis()));
}

View file

@ -3,7 +3,7 @@ package se.hal.plugin.netscan;
import se.hal.intf.HalEventConfig;
import se.hal.intf.HalEventController;
import se.hal.intf.HalEventData;
import se.hal.struct.devicedata.OnOffEventData;
import se.hal.struct.devicedata.AvailabilityEventData;
import zutil.ui.conf.Configurator;
public class NetworkDevice implements HalEventConfig {
@ -30,7 +30,7 @@ public class NetworkDevice implements HalEventConfig {
}
@Override
public Class<? extends HalEventData> getDeviceDataClass() {
return OnOffEventData.class;
return AvailabilityEventData.class;
}