|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.fosstrak.llrp.client.repository.sql.roaccess.AbstractSQLROAccessReportsRepository
public abstract class AbstractSQLROAccessReportsRepository
Gives access to the database holding logged RO_ACCESS_REPORTS. There are
several constants helping you to simplify your SQL code. If your database
does not support the datatypes used in DerbyROAccessReportsRepository
you should subclass from this class and invoke the respective class from
your repository implementation Repository
.
Field Summary | |
---|---|
static int |
CINDEX_AccessSpecID
column index of the access spec ID. |
static int |
CINDEX_ADAPTER
column index of the adapter name. |
static int |
CINDEX_AntennaID
column index of the antenna ID. |
static int |
CINDEX_C1G2_CRC
column index of the c1g2 crc. |
static int |
CINDEX_C1G2_PC
column index of the c1g2 pc. |
static int |
CINDEX_ChannelIndex
column index of the channel index. |
static int |
CINDEX_EPC
column index of the EPC value. |
static int |
CINDEX_FirstSeenTimestampUptime
column index of the first seen time stamp since uptime. |
static int |
CINDEX_FirstSeenTimestampUTC
column index of the first seen time stamp in UTC. |
static int |
CINDEX_InventoryParameterSpecID
column index of the inventory parameter spec ID. |
static int |
CINDEX_LastSeenTimestampUptime
column index of the last seen time stamp since uptime. |
static int |
CINDEX_LastSeenTimestampUTC
column index of the last seen time stamp in UTC. |
static int |
CINDEX_LOGTIME
column index of the log time. |
static int |
CINDEX_PeakRSSI
column index of the peak RSSI. |
static int |
CINDEX_READER
column index of the reader name. |
static int |
CINDEX_ROSpecID
column index of the RO spec ID. |
static int |
CINDEX_SpecIndex
column index of the spec index. |
static int |
CINDEX_TagSeenCount
column index of the tag seen count. |
protected boolean |
initialized
flag, whether this repository is initialized or not. |
static int |
NUM_COLUMNS
the number of columns in the table. |
protected Repository |
repository
the repository "owning" this item. |
static java.lang.String |
TABLE_RO_ACCESS_REPORTS
the name of the RO_ACCESS_REPORTS table. |
protected boolean |
wipe
whether to wipe the database at startup or not. |
Constructor Summary | |
---|---|
AbstractSQLROAccessReportsRepository()
creates a new handle to the RO_ACCESS_REPORTS repository. |
Method Summary | |
---|---|
protected boolean |
checkIfTableOk()
checks whether the required tables exist or not. |
void |
clear()
drop all the messages in the repository. |
protected boolean |
createTable()
create a new log table. |
protected boolean |
dropTable()
drop the log table. |
static java.sql.Timestamp |
extractTimestamp(org.llrp.ltk.types.UnsignedLong ulong)
Creates a TimeStamp object from a UnsignedLong object. |
java.util.List<ROAccessItem> |
getAll()
retrieves all the RO_ACCESS_REPORTS elements in the database. |
void |
handle(java.lang.String adapterName,
java.lang.String readerName,
org.llrp.ltk.types.LLRPMessage message)
This method is invoked from the adapter management whenever a new LLRP message arrives on an attached reader. |
protected void |
handleROAccessReport(java.lang.String adapterName,
java.lang.String readerName,
org.llrp.ltk.generated.messages.RO_ACCESS_REPORT message)
write an RO_ACCESS_REPORT into the database. |
void |
initialize(Repository repository)
Initializer for the RO_ACCESS_REPORTS repository. |
boolean |
isTableOK()
|
void |
setRepository(Repository repository)
set the repository that "owns" this RO_ACCESS_REPORTS repository. |
protected abstract java.lang.String |
sqlCreateTable()
|
protected abstract java.lang.String |
sqlDropTable()
|
protected abstract java.lang.String |
sqlInsert()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String TABLE_RO_ACCESS_REPORTS
public static final int CINDEX_LOGTIME
public static final int CINDEX_ADAPTER
public static final int CINDEX_READER
public static final int CINDEX_EPC
public static final int CINDEX_ROSpecID
public static final int CINDEX_SpecIndex
public static final int CINDEX_InventoryParameterSpecID
public static final int CINDEX_AntennaID
public static final int CINDEX_PeakRSSI
public static final int CINDEX_ChannelIndex
public static final int CINDEX_FirstSeenTimestampUTC
public static final int CINDEX_FirstSeenTimestampUptime
public static final int CINDEX_LastSeenTimestampUTC
public static final int CINDEX_LastSeenTimestampUptime
public static final int CINDEX_TagSeenCount
public static final int CINDEX_C1G2_CRC
public static final int CINDEX_C1G2_PC
public static final int CINDEX_AccessSpecID
public static final int NUM_COLUMNS
protected Repository repository
protected boolean wipe
protected boolean initialized
Constructor Detail |
---|
public AbstractSQLROAccessReportsRepository()
DerbyRepository
.
Method Detail |
---|
public void setRepository(Repository repository)
ROAccessReportsRepository
setRepository
in interface ROAccessReportsRepository
repository
- the repository that "owns" this RO_ACCESS_REPORTS repository.protected abstract java.lang.String sqlCreateTable()
protected abstract java.lang.String sqlDropTable()
protected abstract java.lang.String sqlInsert()
public void initialize(Repository repository) throws LLRPRuntimeException
ROAccessReportsRepository
initialize
in interface ROAccessReportsRepository
repository
- the repository belonging to this RO_ACCESS_REPORTS DB.
LLRPRuntimeException
protected boolean dropTable()
protected boolean createTable()
protected boolean checkIfTableOk()
public boolean isTableOK()
public void handle(java.lang.String adapterName, java.lang.String readerName, org.llrp.ltk.types.LLRPMessage message)
MessageHandler
handle
in interface MessageHandler
adapterName
- the name of the adapter where the reader belongs to.readerName
- the name of the receiving reader.message
- the LLRP message.protected void handleROAccessReport(java.lang.String adapterName, java.lang.String readerName, org.llrp.ltk.generated.messages.RO_ACCESS_REPORT message)
adapterName
- name of the adapter.readerName
- name of the reader.message
- the LLRP RO_ACCESS_REPORT to be logged.public java.util.List<ROAccessItem> getAll() throws java.lang.Exception
ROAccessReportsRepository
getAll
in interface ROAccessReportsRepository
ROAccessItem
.
java.lang.Exception
- when there is an error of any kind.public void clear() throws java.lang.Exception
ROAccessReportsRepository
clear
in interface ROAccessReportsRepository
java.lang.Exception
- when there is an error of any kind.public static java.sql.Timestamp extractTimestamp(org.llrp.ltk.types.UnsignedLong ulong)
UnsignedLong
object.
ulong
- the unsigned long TimeStamp object.
Timestamp
object.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |