package art.servers.lighting.lightstudsserver.controller; import art.library.interop.InteropParameters; import art.library.interop.InteropResponse; import art.library.interop.serialization.SerializationException; import art.library.model.devices.DeviceAction; import art.library.model.devices.lighting.lightstuds.LightStuds; import art.servers.ServerException; import art.servers.lighting.lightstudsserver.Shared; public class ListenerImplementation extends art.servers.controller.ListenerImplementation { public InteropResponse sendCommands(InteropParameters parameters) throws SerializationException { String language = (String)parameters.getParameterValue("language"); LightStuds device = null; try { String identifier = (parameters.hasParameter("device") == true) ? (String)parameters.getParameterValue("device") : null; ControllerLigthStuds controller = (ControllerLigthStuds)Shared.getDeviceController(identifier); device = controller.getDevice(); DeviceAction[] laction = controller.sendCommands(parameters); return(new InteropResponse(laction)); } catch (ServerException exception) { throw new SerializationException(Shared.getMessage(language, exception.getMessage())); } catch (Exception exception) { throw new SerializationException(Shared.getMessage(language, exception.getMessage()), exception); } } }