public abstract class AbstractSensorSession extends SensorSession
Constructor and Description |
---|
AbstractSensorSession(AbstractSensor<?> sensor,
java.lang.String ID,
java.util.Set<AbstractCommandConfiguration<?>> commandConfigurations)
Constructor
|
Modifier and Type | Method and Description |
---|---|
Command |
getCommandInstance(java.lang.String commandID)
Used to aquire a command instance.
|
SessionStatus |
getStatus()
Get the status of the sensorSession.
|
void |
killComand(java.lang.Integer id)
This method deletes a command from the session, including the DTO.
|
void |
submit(Command command)
Submit a command for a one-time execution.
|
void |
submit(Command command,
long interval,
java.util.concurrent.TimeUnit unit)
Schedule a command for a repeated 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.
|
boolean |
submitAndBlock(Command command,
long timeout,
java.util.concurrent.TimeUnit unit)
Submit a command for a one-time execution.
|
void |
suspendCommand(java.lang.String commandID)
Called if a command configuration temporarily disappears.
|
connect, disconnect, getCommands, getDTO, getID, getSensor, getTimeout, handleTimeout, killAllCommands, restoreCommands
public AbstractSensorSession(AbstractSensor<?> sensor, java.lang.String ID, java.util.Set<AbstractCommandConfiguration<?>> commandConfigurations)
sensor
- ID
- ID of this SensorSessiondestination
- The JMS Queue to add Tag Data totemplate
- The Template used to send Tag data to the internal queuecommandConfigurations
- Provided by springpublic SessionStatus getStatus()
SensorSession
getStatus
in class SensorSession
public void killComand(java.lang.Integer id)
SensorSession
killComand
in class SensorSession
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 SensorSession
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 SensorSession
command
- The command to executepublic boolean submitAndBlock(Command command, long timeout, java.util.concurrent.TimeUnit unit)
SensorSession
submitAndBlock
in class SensorSession
command
- The command to executetimeout
- The amount of time to wait. If -1, wait forever before
throwing a TimoutExceptionpublic void submit(Command command, long interval, java.util.concurrent.TimeUnit unit)
SensorSession
submit
in class SensorSession
command
- The command to executepublic void suspendCommand(java.lang.String commandID)
commandID
- public Command getCommandInstance(java.lang.String commandID)
commandID
-