package art.servers.asfserver.controller;
|
|
import art.library.model.devices.Device;
|
import art.library.model.devices.vms.asf.Asf;
|
import art.library.model.devices.vms.asf.AsfInformation;
|
import art.servers.Shared;
|
import art.servers.controller.ControllerDevice;
|
|
public class FactoryController extends art.servers.controller.FactoryController
|
{
|
|
public FactoryController()
|
{
|
super();
|
}
|
|
public ControllerDevice addController(Device device)
|
{
|
|
ControllerDevice controller = null;
|
|
try
|
{
|
try
|
{
|
ControllerAsf controllerAsf = (ControllerAsf) Shared.getDeviceController(device.getIdentifier());
|
return (controllerAsf);
|
} catch (Exception e)
|
{
|
Shared.printerr("Exception on device " + device.getIdentifier(), e.getMessage());
|
}
|
|
Asf asf = (Asf) device;
|
|
AsfInformation information = asf.getDeviceInformation();
|
|
if (asf.getDeviceInformation().type == AsfInformation.TYPE_DGT)
|
{
|
if (asf.getDeviceInformation().connectionEru != null)
|
{
|
controller = new ControllerAsfDGTEru(asf);
|
Shared.lcontroller.add(controller);
|
controller.start();
|
}
|
|
if (asf.getDeviceInformation().connectionTcp != null)
|
{
|
controller = new ControllerAsfDGTTcp(asf);
|
Shared.lcontroller.add(controller);
|
controller.start();
|
}
|
} else
|
{
|
Shared.printerr("Unexpected asf with identifier", asf.getIdentifier());
|
}
|
} catch (Exception e)
|
{
|
Shared.printerr("Exception on asf " + device.getIdentifier(), e.getMessage());
|
}
|
|
return controller;
|
}
|
|
public void removeController(ControllerDevice controller)
|
{
|
|
}
|
|
}
|