Alejandro Acuña
2024-09-16 adba74e107bcda9e1cb510bc14364b02e781baef
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
44
45
package art.servers.tickermachineserver.controller;
 
import art.library.interop.InteropParameters;
import art.library.interop.InteropResponse;
import art.library.interop.serialization.SerializationException;
import art.library.model.devices.DeviceActionResult;
import art.servers.ServerException;
import art.servers.tickermachineserver.Shared;
 
 
 
public class ListenerImplementation extends art.servers.controller.ListenerImplementation
{
    // <editor-fold defaultstate="collapsed" desc="Commands">
    
    
    /**
     *  device = VMS identifier to turn off
     *  username = Username of user that send order
     *  computer = Computer name from user send order
     */
 
    public InteropResponse sendCommands(InteropParameters parameters) throws SerializationException
    {
        String language = (String)parameters.getParameterValue("language");
 
        try
        {
            String identifier = (String)parameters.getParameterValue("device");
            ControllerTicketMachine controller = (ControllerTicketMachine)Shared.getDeviceController(identifier);
            return(new InteropResponse(controller.sendCommands(parameters)));
        }
        catch (ServerException exception)
        {
            return (new InteropResponse(new DeviceActionResult(DeviceActionResult.RESULT_ERROR, Shared.getMessage(language, exception.getMessage()))));
        }
        catch (Exception exception)
        {
            throw new SerializationException(Shared.getMessage(language, exception.getMessage()), exception);
        }
    }
 
    
    // </editor-fold>  
}