ghy
Alejandro Acuña
2025-03-12 26319e4c5bfbee722c15b8e7ccca9b6127bb1cb8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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);
        }
    }
 
 
 
 
}