public abstract class AbstractServerSocketSensorSession extends AbstractSensorSession
Constructor and Description |
---|
AbstractServerSocketSensorSession(AbstractSensor<?> sensor,
java.lang.String ID,
int serverSocketPort,
int maxNumSensors,
java.util.Set<AbstractCommandConfiguration<?>> commandConfigurations)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
disconnect()
Close the connection and stop processing of commands.
|
void |
killComand(java.lang.Integer id)
This method deletes a command from the session, including the DTO.
|
void |
restoreCommands(SessionDTO dto)
This method should be called by subclasses to restore the commands that
need to be submitted to a session from a SessionDTO.
|
void |
submit(Command command)
Submit a command for a one-time execution.
|
java.lang.Integer |
submit(java.lang.String commandID,
long interval,
java.util.concurrent.TimeUnit unit)
Submit a command to a reader session for execution.
|
java.lang.String |
toString() |
getCommandInstance, getStatus, submit, submitAndBlock, suspendCommand
connect, getCommands, getDTO, getID, getSensor, getTimeout, handleTimeout, killAllCommands
public AbstractServerSocketSensorSession(AbstractSensor<?> sensor, java.lang.String ID, int serverSocketPort, int maxNumSensors, java.util.Set<AbstractCommandConfiguration<?>> commandConfigurations)
sensor
- The sensor this session works forID
- The ID of the sessiondestination
- The JMS destinationtemplate
- The JMS template used for internal message busserverSocketPort
- The port of the socketmaxNumSensors
- The maximum number of concurrent clients supportedcommandConfigurations
- public void disconnect()
SensorSession
disconnect
in class SensorSession
public void killComand(java.lang.Integer id)
SensorSession
killComand
in class AbstractSensorSession
id
- The ID of the command to killpublic java.lang.Integer submit(java.lang.String commandID, long interval, java.util.concurrent.TimeUnit unit)
SensorSession
submit
in class AbstractSensorSession
commandID
- The command to executeinterval
- The interval between executionsunit
- The Unit of time to measure the intervalpublic void submit(Command command)
SensorSession
submit
in class AbstractSensorSession
command
- The command to executepublic void restoreCommands(SessionDTO dto)
SensorSession
restoreCommands
in class SensorSession
dto
- The DTO of the session which contains the DTOs of the commandspublic java.lang.String toString()
toString
in class java.lang.Object