public class LLRPReaderSession extends AbstractSensorSession
Modifier and Type | Class and Description |
---|---|
static class |
LLRPReaderSession.LLRP_OPERATION_CODE
Operation names
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_ACCESS_PASSWORD
Default access password value if there is no property read from jvm.
|
static int |
DEFAULT_ACCESS_PASSWORD_LOCK_PRIVILEGE
Default access password lock privilege if there is no property read from
jvm.
|
static int |
DEFAULT_EPC_LOCK_PRIVILEGE
Default EPC lock privilege if there is no property read from jvm.
|
static int |
DEFAULT_EPC_WORD_COUNT
default number of blocks for EPC to be read
|
static java.lang.String |
DEFAULT_KILL_PASSWORD
Default kill password value if there is no property read from jvm.
|
static int |
DEFAULT_KILL_PASSWORD_LOCK_PRIVILEGE
Default kill password lock privilege if there is no property read from
jvm.
|
static java.lang.String |
DEFAULT_OLD_ACCESS_PASSWORD
Default old access password value if there is no property read from jvm.
|
static int |
DEFAULT_OPERATIONS_TIMEOUT
Default operations timeout value if there is no property read from jvm.
|
static java.lang.String |
DEFAULT_TAG_MASK
Default tag mask value if there is no property read from jvm.
|
static java.lang.String |
DEFAULT_TARGET_EPC
Default target Epc value if there is no property read from jvm
|
static int |
DEFAULT_USER_MEMORY_LOCK_PRIVILEGE
Default user memory lock privilege if there is no property read from jvm.
|
static int |
DEFAULT_USER_MEMORY_WORD_COUNT
default number of blocks for user memory to be read
|
java.lang.Long |
lastTagTimestamp |
static java.lang.String |
PERMA_LOCK_PRIVILEGE
Expected value for Perma_Lock lock privilege taken from jvm
|
static java.lang.String |
READ_WRITE_LOCK_PRIVILEGE
Expected value for Read_Write lock privilege taken from jvm
|
static java.lang.String |
UNLOCK_PRIVILEGE
Expected value for Unlock lock privilege taken from jvm
|
Constructor and Description |
---|
LLRPReaderSession(AbstractSensor<?> sensor,
java.lang.String id,
java.lang.String host,
int port,
int reconnectionInterval,
int maxConAttempts,
java.lang.String readerConfigPath,
NotifierService notifierService,
java.lang.String readerID,
java.util.Set<AbstractCommandConfiguration<?>> commands) |
Modifier and Type | Method and Description |
---|---|
C1G2Read |
buildAccessPassRead() |
AccessSpec |
buildAccessSpec(int accessSpecID,
java.lang.String epcId) |
C1G2Read |
buildEpcReadOpSpec() |
C1G2BlockWrite |
buildEpcWriteAccessPass() |
C1G2BlockWrite |
buildEpcWriteKillPass() |
C1G2BlockWrite |
buildEpcWriteOpSpec(java.lang.String epcId) |
C1G2Read |
buildKillPassRead() |
C1G2Lock |
buildLockOpSpec(UnsignedShort opSpecId,
int lockPrivilege,
int lockDataField) |
C1G2Read |
buildUserMemoryReadOpSpec() |
C1G2Write |
buildUserMemoryWriteOpSpec() |
void |
cleanupSession()
Cleans up the session and access specs
|
SET_READER_CONFIG |
createSetReaderConfig()
This method creates a SET_READER_CONFIG method.
|
void |
deleteAccessSpecs() |
void |
disconnect()
Close the connection and stop processing of commands.
|
void |
enableAccessSpec(int accessSpecID) |
void |
errorOccured(java.lang.String arg0) |
java.lang.String |
getAccessPwd() |
int |
getAccessPwdLockPrivilege() |
int |
getEpcLockPrivilege() |
java.lang.String |
getKillPwd() |
int |
getKillPwdLockPrivilege() |
static int |
getLockPrivilege(java.lang.String lockPrivilege)
Converts string representation of lock privilege into int representation
|
java.lang.String |
getMqttBroker() |
java.lang.String |
getMqttClientId() |
int |
getMqttQos() |
java.lang.String |
getOldAccessPwd() |
java.lang.Integer |
getOperationsTimeout() |
java.lang.String |
getReaderConfig()
Gets the reader config and returns the xml representation.
|
java.lang.String |
getRospecs() |
java.lang.String |
getTagMask() |
java.lang.String |
getTargetEpc() |
java.lang.String |
getUserMemoryData() |
int |
getUserMemoryLockPrivilege() |
int |
getWordCount() |
int |
getWriteDataBlockLength() |
boolean |
isExecuteOperationsInAsynchronousMode() |
boolean |
isRunningLLRPEncoding() |
void |
killComand(java.lang.Integer id)
This method deletes a command from the session, including the DTO.
|
LLRPEncodeMessageDto |
llrpEncode(java.lang.String strTag) |
LLRPEncodeMessageDto |
llrpLockAccessPasswordOperation() |
LLRPEncodeMessageDto |
llrpLockEpcOperation() |
LLRPEncodeMessageDto |
llrpLockKillPasswordOperation() |
LLRPEncodeMessageDto |
llrpLockUserMemoryOperation() |
LLRPEncodeMessageDto |
llrpReadAccessPasswordOperation() |
LLRPEncodeMessageDto |
llrpReadEpcOperation() |
LLRPEncodeMessageDto |
llrpReadKillPasswordOperation() |
LLRPEncodeMessageDto |
llrpReadUserMemoryOperation() |
LLRPEncodeMessageDto |
llrpWriteAccessPasswordOperation() |
LLRPEncodeMessageDto |
llrpWriteEpcOperation(java.lang.String epc) |
LLRPEncodeMessageDto |
llrpWriteKillPasswordOperation() |
LLRPEncodeMessageDto |
llrpWriteUserMemoryOperation() |
void |
messageReceived(LLRPMessage arg0)
This method receives asynchronous messages back from the LLRP reader.
|
java.lang.Integer |
numTagsOnLLRP() |
void |
send(LLRPMessage message)
This command sends a message and does not wait for a response.
|
java.lang.String |
sendLLRPMessage(Document xmlMessage) |
void |
setAccessPwd(java.lang.String accessPwd) |
void |
setAccessPwdLockPrivilege(int accessPwdLockPrivilege) |
void |
setEpcLockPrivilege(int epcLockPrivilege) |
void |
setExecuteOperationsInAsynchronousMode(boolean executeOperationsInAsynchronousMode) |
void |
setKillPwd(java.lang.String killPwd) |
void |
setKillPwdLockPrivilege(int killPwdLockPrivilege) |
void |
setMqttBroker(java.lang.String mqttBroker) |
void |
setMqttClientId(java.lang.String mqttClientId) |
void |
setMqttQos(int mqttQos) |
void |
setOldAccessPwd(java.lang.String oldAccessPwd) |
void |
setOperationsTimeout(java.lang.Integer operationsTimeout) |
void |
setRunningLLRPEncoding(boolean isRunningLLRPEncoding) |
void |
setTagMask(java.lang.String tagMask) |
void |
setTargetEpc(java.lang.String targetEpc) |
void |
setUserMemoryData(java.lang.String userMemoryData) |
void |
setUserMemoryLockPrivilege(int userMemoryLockPrivilege) |
void |
setWordCount(int wordCount) |
void |
setWriteDataBlockLength(int writeDataBlockLength) |
java.lang.String[] |
splitHexArray(java.lang.String arg)
Split the hex array into groups of 4 by splitting on a colon charater.
|
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() |
LLRPMessage |
transact(LLRPMessage message)
This method sends a message and waits for an LLRP response message.
|
getCommandInstance, getStatus, submit, submit, submitAndBlock, suspendCommand
connect, getCommands, getDTO, getID, getSensor, getTimeout, handleTimeout, killAllCommands, restoreCommands
public java.lang.Long lastTagTimestamp
public static final java.lang.String DEFAULT_TARGET_EPC
public static final java.lang.String DEFAULT_TAG_MASK
public static final int DEFAULT_OPERATIONS_TIMEOUT
public static final java.lang.String DEFAULT_ACCESS_PASSWORD
public static final java.lang.String DEFAULT_OLD_ACCESS_PASSWORD
public static final java.lang.String DEFAULT_KILL_PASSWORD
public static final int DEFAULT_KILL_PASSWORD_LOCK_PRIVILEGE
public static final int DEFAULT_ACCESS_PASSWORD_LOCK_PRIVILEGE
public static final int DEFAULT_EPC_LOCK_PRIVILEGE
public static final int DEFAULT_USER_MEMORY_LOCK_PRIVILEGE
public static final java.lang.String READ_WRITE_LOCK_PRIVILEGE
public static final java.lang.String PERMA_LOCK_PRIVILEGE
public static final java.lang.String UNLOCK_PRIVILEGE
public static final int DEFAULT_EPC_WORD_COUNT
public static final int DEFAULT_USER_MEMORY_WORD_COUNT
public LLRPReaderSession(AbstractSensor<?> sensor, java.lang.String id, java.lang.String host, int port, int reconnectionInterval, int maxConAttempts, java.lang.String readerConfigPath, NotifierService notifierService, java.lang.String readerID, java.util.Set<AbstractCommandConfiguration<?>> commands)
sensor
- id
- host
- port
- reconnectionInterval
- maxConAttempts
- readerConfigPath
- timeout
- notifierService
- readerID
- commands
- public java.lang.String getUserMemoryData()
public void setUserMemoryData(java.lang.String userMemoryData)
userMemoryData
- the userMemoryData to setpublic int getWordCount()
public void setWordCount(int wordCount)
wordCount
- the wordCount to setpublic boolean isExecuteOperationsInAsynchronousMode()
public void setExecuteOperationsInAsynchronousMode(boolean executeOperationsInAsynchronousMode)
executeOperationsInAsynchronousMode
- the executeOperationsInAsynchronousMode to setpublic int getMqttQos()
public void setMqttQos(int mqttQos)
mqttQos
- the mqttQos to setpublic java.lang.String getMqttBroker()
public void setMqttBroker(java.lang.String mqttBroker)
mqttBroker
- the mqttBroker to setpublic java.lang.String getMqttClientId()
public void setMqttClientId(java.lang.String mqttClientId)
mqttClientId
- the mqttClientId to setpublic int getWriteDataBlockLength()
public void setWriteDataBlockLength(int writeDataBlockLength)
writeDataBlockLength
- the writeDataBlockLength to setpublic boolean isRunningLLRPEncoding()
public void setRunningLLRPEncoding(boolean isRunningLLRPEncoding)
isRunningLLRPEncoding
- the isRunningLLRPEncoding to setpublic java.lang.String getTargetEpc()
public void setTargetEpc(java.lang.String targetEpc)
targetEpc
- the targetEpc to setpublic java.lang.String getTagMask()
public void setTagMask(java.lang.String tagMask)
tagMask
- the tagMask to setpublic java.lang.Integer getOperationsTimeout()
public void setOperationsTimeout(java.lang.Integer operationsTimeout)
operationsTimeout
- the operationsTimeout to setpublic java.lang.String getAccessPwd()
public void setAccessPwd(java.lang.String accessPwd)
accessPwd
- the accessPwd to setpublic java.lang.String getOldAccessPwd()
public void setOldAccessPwd(java.lang.String oldAccessPwd)
oldAccessPwd
- the oldAccessPwd to setpublic java.lang.String getKillPwd()
public void setKillPwd(java.lang.String killPwd)
killPwd
- the killPwd to setpublic int getKillPwdLockPrivilege()
public void setKillPwdLockPrivilege(int killPwdLockPrivilege)
killPwdLockPrivilege
- the killPwdLockPrivilege to setpublic int getAccessPwdLockPrivilege()
public void setAccessPwdLockPrivilege(int accessPwdLockPrivilege)
accessPwdLockPrivilege
- the accessPwdLock to setpublic int getEpcLockPrivilege()
public void setEpcLockPrivilege(int epcLockPrivilege)
epcLockPrivilege
- the epcLockPrivilege to setpublic int getUserMemoryLockPrivilege()
public void setUserMemoryLockPrivilege(int userMemoryLockPrivilege)
userMemoryLockPrivilege
- the userMemoryLockPrivilege to setpublic void disconnect()
SensorSession
disconnect
in class SensorSession
public LLRPMessage transact(LLRPMessage message) throws java.util.concurrent.TimeoutException
message
- The LLRP message to send to the readerjava.util.concurrent.TimeoutException
- If there was a timeout when processing this command.public void send(LLRPMessage message)
message
- public void errorOccured(java.lang.String arg0)
public SET_READER_CONFIG createSetReaderConfig()
public java.lang.String getReaderConfig() throws InvalidLLRPMessageException, java.util.concurrent.TimeoutException
java.util.concurrent.TimeoutException
InvalidLLRPMessageException
public java.lang.String getRospecs() throws InvalidLLRPMessageException, java.util.concurrent.TimeoutException
rospecID
- java.util.concurrent.TimeoutException
InvalidLLRPMessageException
public 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 LLRPEncodeMessageDto llrpWriteEpcOperation(java.lang.String epc) throws InvalidLLRPMessageException, java.util.concurrent.TimeoutException, java.lang.Exception
InvalidLLRPMessageException
java.util.concurrent.TimeoutException
java.lang.Exception
public LLRPEncodeMessageDto llrpReadEpcOperation() throws InvalidLLRPMessageException, java.util.concurrent.TimeoutException, java.lang.Exception
InvalidLLRPMessageException
java.util.concurrent.TimeoutException
java.lang.Exception
public LLRPEncodeMessageDto llrpWriteAccessPasswordOperation() throws InvalidLLRPMessageException, java.util.concurrent.TimeoutException, java.lang.Exception
InvalidLLRPMessageException
java.util.concurrent.TimeoutException
java.lang.Exception
public LLRPEncodeMessageDto llrpReadAccessPasswordOperation() throws InvalidLLRPMessageException, java.util.concurrent.TimeoutException, java.lang.Exception
InvalidLLRPMessageException
java.util.concurrent.TimeoutException
java.lang.Exception
public LLRPEncodeMessageDto llrpReadKillPasswordOperation() throws InvalidLLRPMessageException, java.util.concurrent.TimeoutException, java.lang.Exception
InvalidLLRPMessageException
java.util.concurrent.TimeoutException
java.lang.Exception
public LLRPEncodeMessageDto llrpWriteKillPasswordOperation() throws InvalidLLRPMessageException, java.util.concurrent.TimeoutException, java.lang.Exception
InvalidLLRPMessageException
java.util.concurrent.TimeoutException
java.lang.Exception
public LLRPEncodeMessageDto llrpReadUserMemoryOperation() throws InvalidLLRPMessageException, java.util.concurrent.TimeoutException, java.lang.Exception
InvalidLLRPMessageException
java.util.concurrent.TimeoutException
java.lang.Exception
public LLRPEncodeMessageDto llrpWriteUserMemoryOperation() throws InvalidLLRPMessageException, java.util.concurrent.TimeoutException, java.lang.Exception
InvalidLLRPMessageException
java.util.concurrent.TimeoutException
java.lang.Exception
public LLRPEncodeMessageDto llrpLockEpcOperation() throws InvalidLLRPMessageException, java.util.concurrent.TimeoutException, java.lang.Exception
InvalidLLRPMessageException
java.util.concurrent.TimeoutException
java.lang.Exception
public LLRPEncodeMessageDto llrpLockAccessPasswordOperation() throws InvalidLLRPMessageException, java.util.concurrent.TimeoutException, java.lang.Exception
InvalidLLRPMessageException
java.util.concurrent.TimeoutException
java.lang.Exception
public LLRPEncodeMessageDto llrpLockKillPasswordOperation() throws InvalidLLRPMessageException, java.util.concurrent.TimeoutException, java.lang.Exception
InvalidLLRPMessageException
java.util.concurrent.TimeoutException
java.lang.Exception
public LLRPEncodeMessageDto llrpLockUserMemoryOperation() throws InvalidLLRPMessageException, java.util.concurrent.TimeoutException, java.lang.Exception
InvalidLLRPMessageException
java.util.concurrent.TimeoutException
java.lang.Exception
public LLRPEncodeMessageDto llrpEncode(java.lang.String strTag) throws java.util.concurrent.TimeoutException, InvalidLLRPMessageException, java.lang.Exception
java.util.concurrent.TimeoutException
InvalidLLRPMessageException
java.lang.Exception
public java.lang.String[] splitHexArray(java.lang.String arg)
arg
- public java.lang.String sendLLRPMessage(Document xmlMessage)
public void messageReceived(LLRPMessage arg0)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Integer numTagsOnLLRP()
public void enableAccessSpec(int accessSpecID)
public void deleteAccessSpecs()
public AccessSpec buildAccessSpec(int accessSpecID, java.lang.String epcId)
public C1G2BlockWrite buildEpcWriteOpSpec(java.lang.String epcId)
public C1G2BlockWrite buildEpcWriteAccessPass()
public C1G2BlockWrite buildEpcWriteKillPass()
public static int getLockPrivilege(java.lang.String lockPrivilege) throws java.lang.Exception
lockPrivilege
- the string lock value to be parsed into int representationjava.lang.Exception
- if lockPrivilege is invalid, that is, is not any of
Read_Write, Perma_Lock or Unlock string valuespublic C1G2Lock buildLockOpSpec(UnsignedShort opSpecId, int lockPrivilege, int lockDataField)
opSpecId
- lockPrivilege
- lockDataField
- public void cleanupSession()
public C1G2Read buildEpcReadOpSpec()
public C1G2Read buildAccessPassRead()
public C1G2Read buildKillPassRead()
public C1G2Read buildUserMemoryReadOpSpec()
public C1G2Write buildUserMemoryWriteOpSpec()