public class ThingmagicReaderSession extends AbstractPollIPSensorSession
Constructor and Description |
---|
ThingmagicReaderSession(AbstractSensor<?> sensor,
java.lang.String id,
java.lang.String host,
int port,
int reconnectionInterval,
int maxConAttempts,
NotifierService notifierService,
java.lang.String readerID,
java.util.Set<AbstractCommandConfiguration<?>> commands)
Constructor
|
Modifier and Type | Method and Description |
---|---|
MessageParsingStrategyFactory |
getMessageParsingStrategyFactory()
Get a factory for MessageParsingStrategy objects
|
void |
killComand(java.lang.Integer id)
This method deletes a command from the session, including the DTO.
|
boolean |
onConnect()
Called after the initial socket connection got established.
|
void |
sendMessage(ByteMessage message)
Send a message over the line.
|
java.lang.Integer |
submit(java.lang.String commandID,
long interval,
java.util.concurrent.TimeUnit unit)
Submit a command to a reader session for execution.
|
getMessageProcessingStrategyFactory, isMessageAvailable, receiveMessage, receiveMessage
disconnect, getHost, getPort, toString
getCommandInstance, getStatus, submit, submit, submitAndBlock, suspendCommand
connect, getCommands, getDTO, getID, getSensor, getTimeout, handleTimeout, killAllCommands, restoreCommands
public ThingmagicReaderSession(AbstractSensor<?> sensor, java.lang.String id, java.lang.String host, int port, int reconnectionInterval, int maxConAttempts, NotifierService notifierService, java.lang.String readerID, java.util.Set<AbstractCommandConfiguration<?>> commands)
sensor
- id
- The FACTORY_ID of the sessionhost
- The IP to connect toport
- The port to connect toreconnectionInterval
- The wait time between reconnect attemptsmaxConAttempts
- The maximum number of times to try to connectdestination
- The JMS destination for tagstemplate
- The JSM template for tagsnotifierService
- The service for sending client notificationsreaderID
- The FACTORY_ID of the reader that created this sessioncommands
- A thread safe set containing all available commandspublic MessageParsingStrategyFactory getMessageParsingStrategyFactory()
AbstractIPSensorSession
public boolean onConnect() throws java.io.IOException
AbstractIPSensorSession
java.io.IOException
- if a connection problem occurspublic 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 killComand(java.lang.Integer id)
SensorSession
killComand
in class AbstractSensorSession
id
- The ID of the command to killpublic void sendMessage(ByteMessage message) throws java.io.IOException
AbstractIPSensorSession
java.io.IOException