|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.alien.enterpriseRFID.notify.Message
Message encapsulates the information contained in a reader's notification messages.
When a MessageListenerService
receives a notification message, it parses
the contents of the message, and uses the pieces of data to construct a Message
.
A typical notification message takes the form:
<Alien-RFID-Reader-Auto-Notification> <ReaderName>Alien RFID Reader</ReaderName> <ReaderType>Alien RFID Tag Reader, Model: ALR-9780 (Four Antenna / EPC Class 1 / 915Mhz)</ReaderType> <IPAddress>10.1.70.42</IPAddress> <CommandPort>23</CommandPort> <MACAddress>00:80:66:10:2D:17</MACAddress> <Time>2003/12/09 16:16:59</Time> <Reason>TEST MESSAGE</Reason> <StartTriggerLines>1</StartTriggerLines> <StopTriggerLines>2</StopTriggerLines> <Alien-RFID-Tag-List> <Alien-RFID-Tag> <TagID>0203 0405 0607 0809</TagID> <DiscoveryTime>2003/12/09 16:16:16</DiscoveryTime> <LastSeenTime>2003/12/09 16:16:57</LastSeenTime> <Antenna>0</Antenna> <ReadCount>48</ReadCount> </Alien-RFID-Tag> <Alien-RFID-Tag> <TagID>8000 8004 0000 003B</TagID> <DiscoveryTime>2003/12/09 16:16:16</DiscoveryTime> <LastSeenTime>2003/12/09 16:16:58</LastSeenTime> <Antenna>0</Antenna> <ReadCount>222</ReadCount> </Alien-RFID-Tag> </Alien-RFID-Tag-List> </Alien-RFID-Reader-Auto-Notification>Each element of the XML message corresponds to a field in the
Message
object. Each field has accompanying get/set methods for accessing it. This
includes the list of tags, which are represented in the Message
object as an array of Tags
. Furthermore, the entire contents of
the notification message are stored in the Message
.
Some newer readers can also track events on the external I/O pins, and include this even data in notification messages. The MessageListenerService will extract this data and populate the IOList field of this Message class with an array of ExternalIO objects (similar to the TagList field storing an array of Tag objects).
The MessageListenerService also supports the IOStream and TagStream functions of newer readers. When the reader streams tag read or digital I/O events, the MessageListenerService decodes each event and generates an appropriate Message object with the tag external I/O data read from the stream.
Field Summary | |
static java.lang.String |
REASON_IOSTREAM
|
static java.lang.String |
REASON_TAGSTREAM
|
Constructor Summary | |
Message()
Constructs a new empty Message object. |
Method Summary | |
java.util.Date |
getDate()
Returns the Date of this Message. |
ExternalIO |
getIO(int index)
Returns the ExternalIO that holds position index in
this Message 's IOList. |
int |
getIOCount()
Returns the number of ExternalIOs in this Message 's IOList. |
ExternalIO[] |
getIOList()
Returns the IOList of this notification message, as an array of ExternalIO s. |
java.lang.String |
getRawData()
Returns the raw data content of the notification message sent by the reader. |
int |
getReaderCommandPort()
Returns the Command port number of the reader as indicated in the reader's notification message. |
java.lang.String |
getReaderHostname()
Returns the network hostname of the reader as indicated in the reader's notification message. |
java.lang.String |
getReaderIPAddress()
Returns the IP Address of the reader as indicated in the reader's notification message. |
java.lang.String |
getReaderMACAddress()
Returns the MAC Address of the reader as indicated in the reader's notification message. |
java.lang.String |
getReaderName()
Returns the name of the reader as indicated in the reader's notification message. |
java.lang.String |
getReaderType()
Returns the type of the reader as indicated in the reader's notification message. |
java.lang.String |
getReason()
Gets the Reason value for this Message. |
int |
getStartTriggerLines()
Returns the external input lines that triggered this autonomous cycle to start. |
int |
getStopTriggerLines()
Returns the external input lines that triggered this autonomous cycle to stop. |
Tag |
getTag(int index)
Returns the Tag that holds position index in this
Message 's TagList . |
int |
getTagCount()
Returns the number of tags in this Message 's TagList. |
Tag[] |
getTagList()
Returns the TagList of this notification message, as an array of Tag s. |
java.lang.String |
getXML()
Deprecated. Use getRawData() instead. |
void |
setDate(java.util.Date date)
Sets the Date for this Message. |
void |
setIOList(ExternalIO[] ioList)
Sets the IOList of this Message as an array of ExternalIO s. |
void |
setRawData(java.lang.String rawData)
Sets the raw content of this Message. |
void |
setReaderCommandPort(int readerCommandPort)
Sets the ReaderCommandPort value for this Message. |
void |
setReaderHostname(java.lang.String readerHostname)
Sets the network hostname value for this Message. |
void |
setReaderIPAddress(java.lang.String readerIPAddress)
Sets the IPAddress value for this Message. |
void |
setReaderMACAddress(java.lang.String readerMACAddress)
Sets the MACAddress value for this Message. |
void |
setReaderName(java.lang.String readerName)
Sets the ReaderName value for this Message. |
void |
setReaderType(java.lang.String readerType)
Sets the ReaderType value for this Message. |
void |
setReason(java.lang.String reason)
Sets the Reason value for this Message. |
void |
setStartTriggerLines(int startTriggerLines)
Sets the external input lines that triggered this autonomous cycle to start. |
void |
setStopTriggerLines(int stopTriggerLines)
Sets the external input lines that triggered this autonomous cycle to stop. |
void |
setTagList(Tag[] tagList)
Sets the TagList of this Message as an array of Tag s. |
void |
setXML(java.lang.String rawXML)
Deprecated. Use setRawData(String) instead. |
java.lang.String |
toString()
Returns a string representation of this Message object. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String REASON_TAGSTREAM
public static final java.lang.String REASON_IOSTREAM
Constructor Detail |
public Message()
Method Detail |
public java.lang.String getRawData()
setRawData(String)
public void setRawData(java.lang.String rawData)
rawData
- the raw content of this MessagegetRawData()
public java.lang.String getXML()
getRawData()
instead.
public void setXML(java.lang.String rawXML)
setRawData(String)
instead.
rawXML
- the original XML content of this Messagepublic java.lang.String getReaderName()
setReaderName(String)
public void setReaderName(java.lang.String readerName)
readerName
- the ReaderName attribute for this MessagegetReaderName()
public java.lang.String getReaderType()
setReaderType(String)
public void setReaderType(java.lang.String readerType)
readerType
- the ReaderType attribute for this MessagegetReaderType()
public java.lang.String getReaderIPAddress()
setReaderIPAddress(String)
public void setReaderIPAddress(java.lang.String readerIPAddress)
readerIPAddress
- the IPAddress attribute for this MessagegetReaderIPAddress()
public int getReaderCommandPort()
setReaderCommandPort(int)
public void setReaderCommandPort(int readerCommandPort)
readerCommandPort
- the CommandPort attribute for this MessagegetReaderCommandPort()
public java.lang.String getReaderMACAddress()
setReaderMACAddress(String)
public void setReaderMACAddress(java.lang.String readerMACAddress)
readerMACAddress
- the readerMACAddress attribute for this MessagegetReaderMACAddress()
public java.lang.String getReaderHostname()
setReaderHostname(String)
public void setReaderHostname(java.lang.String readerHostname)
readerHostname
- the ReaderName attribute for this MessagegetReaderHostname()
public java.lang.String getReason()
true
or false
, or a timed event.
setReason(String)
public void setReason(java.lang.String reason)
true
or false
, or a timed event.
reason
- the Reason attribute for this MessagegetReason()
public java.util.Date getDate()
setDate(Date)
public void setDate(java.util.Date date)
date
- the Date attribute for this MessagegetDate()
public int getStartTriggerLines()
setStartTriggerLines(int)
public void setStartTriggerLines(int startTriggerLines)
startTriggerLines
- the StartTriggerLines attribute for this MessagegetStartTriggerLines()
public int getStopTriggerLines()
setStopTriggerLines(int)
public void setStopTriggerLines(int stopTriggerLines)
stopTriggerLines
- the StopTriggerLines attribute for this MessagegetStopTriggerLines()
public void setTagList(Tag[] tagList)
Message
as an array of Tag
s.
tagList
- the TagList as an array of Tag
sgetTagList()
public Tag[] getTagList()
Tag
s.
Tag
ssetTagList(Tag[])
,
getTagCount()
,
getTag(int)
public int getTagCount()
Message
's TagList.
getTagList()
,
getTag(int)
public Tag getTag(int index)
Tag
that holds position index
in this
Message
's TagList
. Use getTagCount()
to
retrieve the number of tags in the list, or simple use getTagList()
to retrieve the entire TagList.
index
- the index into the TagList of the tag to get
Tag
at the position in the TagList given by index
getTagList()
,
getTagCount()
public void setIOList(ExternalIO[] ioList)
Message
as an array of ExternalIO
s.
ioList
- the IOList as an array of ExternalIO
sgetIOList()
public ExternalIO[] getIOList()
ExternalIO
s.
ExternalIO
ssetIOList(ExternalIO[])
,
getIOCount()
,
getIO(int)
public int getIOCount()
Message
's IOList.
getIOList()
,
getIO(int)
public ExternalIO getIO(int index)
ExternalIO
that holds position index
in
this Message
's IOList. Use getIOCount()
to
retrieve the number of ExternalIOs in the list, or simple use getIOList()
to retrieve the entire IOList.
index
- the index into the IOList of the ExternalIO to get
ExternalIO
at the position in the IOList given by index
getIOList()
,
getIOCount()
public java.lang.String toString()
Message
object.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |