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>
|
}
|