|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.alien.enterpriseRFID.discovery.DiscoveryItem
DiscoveryItem details an individual reader that is discovered on a serial port or on the network.
Both of the discovery classes (SerialDiscoveryListenerService
and
NetworkDiscoveryListenerService
) return discovered readers as
DiscoveryItems
. This class contains a number of key information
points that allow any software system to identify and contact the reader in
question, such as the reader name, type and address.
The DiscoveryItem
, although just a collection of keyword-value
pairs, does have a single method, getReader()
, to translate this information into a usable
reader class. Calling this method on a DiscoveryItem
returns an
AlienClass1Reader
object.
Field Summary | |
static java.lang.String |
AUTOMATIC
Constant used to specify how a reader was discovered. |
boolean |
isUpdated
Flag to indicate if this discovery item has been updated with new reader info. |
static java.lang.String |
MANUAL
Constant used to specify how a reader was discovered. |
static java.lang.String |
NETWORK
Constant defining a "Network" connection method. |
static java.lang.String |
SERIAL
Constant defining a "Serial" connection method. |
Constructor Summary | |
DiscoveryItem()
Constructs a DiscoveryItem object, setting the first and last heartbeat fields to the current time, and the discovery method to AUTOMATIC . |
Method Summary | |
boolean |
equals(java.lang.Object comparison)
Decides if a given object is identical to this DiscoveryItem. |
int |
getCommandPort()
Returns the port number that this DiscoveryItem's reader uses to accept and respond to host commands over the network. |
java.lang.String |
getConnection()
Returns the connection method of the reader represented by this DiscoveryItem. |
java.lang.String |
getDiscoveryMethod()
Returns the method with which this DiscoveryItem's reader was discovered. |
long |
getFirstHeartbeat()
Returns the time that this DiscoveryItem first registered a heartbeat signal from its reader. |
long |
getLastHeartbeat()
Returns the time that this DiscoveryItem last registered a heartbeat signal from its reader. |
int |
getLeaseTime()
Returns the amount of time the reader represented by this DiscoveryItem waits between sending its heartbeat messages across the network. |
java.lang.String |
getPassword()
Returns the password associated with this DiscoveryItem's reader. |
AlienClass1Reader |
getReader()
Instantiates a new AlienClass1Reader object, based on the attributes
of this DiscoveryItem. |
java.lang.String |
getReaderAddress()
Returns the address of the reader represented by this DiscoveryItem. |
java.lang.String |
getReaderMACAddress()
Returns the MAC address of the reader represented by this DiscoveryItem. |
java.lang.String |
getReaderName()
Returns this DiscoveryItem's ReaderName value. |
java.lang.String |
getReaderType()
Returns this DiscoveryItem's ReaderType value. |
java.lang.String |
getReaderVersion()
Returns this DiscoveryItem's ReaderVersion value. |
java.lang.String |
getUsername()
Returns the username associated with this DiscoveryItem's reader. |
boolean |
setCommandPort(int commandPort)
Sets the port number that this DiscoveryItem's reader uses to accept and respond to host commands over the network. |
boolean |
setCommandPort(java.lang.String commandPort)
Sets the port number that this DiscoveryItem's reader uses to accept and respond to host commands over the network. |
boolean |
setConnection(java.lang.String connection)
Sets this DiscoveryItem's connection method. |
void |
setDiscoveryMethod(java.lang.String discoveryMethod)
Specifies the method with which this DiscoveryItem's reader was discovered. |
void |
setFirstHeartbeat(long firstHeartbeat)
Specifies the time that this DiscoveryItem first registered a heartbeat signal from its reader. |
void |
setLastHeartbeat(long lastHeartbeat)
Specifies the time that this DiscoveryItem last registered a heartbeat signal from its reader. |
boolean |
setLeaseTime(int leaseTime)
Sets the amount of time that this DiscoveryItem's reader waits between sending heartbeat messages across the network. |
boolean |
setLeaseTime(java.lang.String leaseTime)
Sets the amount of time that this DiscoveryItem's reader waits between sending heartbeat messages across the network. |
void |
setPassword(java.lang.String password)
Specifies the password associated with this DiscoveryItem's reader. |
boolean |
setReaderAddress(java.lang.String readerAddress)
Changes the reader address of this DiscoveryItem. |
boolean |
setReaderMACAddress(java.lang.String readerMACAddress)
Changes the reader MAC address of this DiscoveryItem. |
boolean |
setReaderName(java.lang.String readerName)
Changes this DiscoveryItem's ReaderName value. |
boolean |
setReaderType(java.lang.String readerType)
Changes this DiscoveryItem's ReaderType value. |
boolean |
setReaderVersion(java.lang.String readerVersion)
Changes this DiscoveryItem's ReaderVersion value. |
void |
setUsername(java.lang.String username)
Specifies the username associated with this DiscoveryItem's reader. |
java.lang.String |
toKey()
Generates a String that uniquely identifies this DiscoveryItem. |
java.lang.String |
toString()
Generates a String that displays all of the attributes of this DiscoveryItem. |
java.lang.String |
toTerseString()
Generates a String that displays ReaderName and address of this DiscoveryItem. |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String NETWORK
getReader()
to set up the proper connection method.
SERIAL
,
Constant Field Valuespublic static final java.lang.String SERIAL
getReader()
to set up the proper connection method.
NETWORK
,
Constant Field Valuespublic static final java.lang.String AUTOMATIC
MANUAL
,
Constant Field Valuespublic static final java.lang.String MANUAL
AUTOMATIC
,
Constant Field Valuespublic boolean isUpdated
Constructor Detail |
public DiscoveryItem()
AUTOMATIC
.
Method Detail |
public java.lang.String getReaderName()
setReaderName(String)
public boolean setReaderName(java.lang.String readerName)
readerName
- the new name of the reader in this DiscoveryItem
getReaderName()
public java.lang.String getReaderType()
setReaderType(String)
public boolean setReaderType(java.lang.String readerType)
readerType
- the new value for the reader type
getReaderType()
public java.lang.String getReaderVersion()
setReaderVersion(String)
public boolean setReaderVersion(java.lang.String readerVersion)
readerVersion
- the new value for the reader version
getReaderVersion()
public java.lang.String getReaderAddress()
setReaderAddress(String)
public boolean setReaderAddress(java.lang.String readerAddress)
readerAddress
- the new Address of this DiscoveryItem
getReaderAddress()
public java.lang.String getReaderMACAddress()
setReaderMACAddress(String)
public boolean setReaderMACAddress(java.lang.String readerMACAddress)
readerMACAddress
- the new MACAddress of this DiscoveryItem
getReaderMACAddress()
public java.lang.String getConnection()
NETWORK
or SERIAL
.
setConnection(String)
public boolean setConnection(java.lang.String connection)
NETWORK
or AUTOMATIC
. Leading and trailing whitespace are
stripped off.
connection
- the method of connecting to this DiscoveryItem's reader
getConnection()
public int getCommandPort()
setCommandPort(int)
,
setCommandPort(String)
public boolean setCommandPort(int commandPort)
commandPort
- the new port for commands (as an int)
setCommandPort(String)
,
getCommandPort()
public boolean setCommandPort(java.lang.String commandPort)
This method simply converts the command port that is passed in as a String into an integer before calling setCommandPort(int).
commandPort
- the new port for commands (as a String)
setCommandPort(int)
,
getCommandPort()
public int getLeaseTime()
setLeaseTime(int)
,
setLeaseTime(String)
public boolean setLeaseTime(int leaseTime)
leaseTime
- the time between heartbeats
setLeaseTime(String)
,
getLeaseTime()
public boolean setLeaseTime(java.lang.String leaseTime)
This method simply converts the leaseTime that is passed in as a String into an integer before calling setLeaseTime(int).
leaseTime
- the time between heartbeats (as a String)
setLeaseTime(int)
,
getLeaseTime()
public long getFirstHeartbeat()
setFirstHeartbeat(long)
,
getLastHeartbeat()
,
setLastHeartbeat(long)
public void setFirstHeartbeat(long firstHeartbeat)
firstHeartbeat
- the time of the first heartbeat from this DiscoveryItem's readergetFirstHeartbeat()
,
getLastHeartbeat()
,
setLastHeartbeat(long)
public long getLastHeartbeat()
setLastHeartbeat(long)
,
getFirstHeartbeat()
,
setFirstHeartbeat(long)
public void setLastHeartbeat(long lastHeartbeat)
lastHeartbeat
- the time of the last heartbeatgetLastHeartbeat()
,
getFirstHeartbeat()
,
setFirstHeartbeat(long)
public java.lang.String getUsername()
setUsername(String)
,
getPassword()
,
setPassword(String)
public void setUsername(java.lang.String username)
username
- the new username for this DiscoveryItem's readergetUsername()
,
getPassword()
,
setPassword(String)
public java.lang.String getPassword()
setPassword(String)
,
getUsername()
,
setUsername(String)
public void setPassword(java.lang.String password)
password
- the new password for this DiscoveryItem's readergetPassword()
,
getUsername()
,
setUsername(String)
public java.lang.String getDiscoveryMethod()
AUTOMATIC
, otherwise it should be MANUAL
.
public void setDiscoveryMethod(java.lang.String discoveryMethod)
AUTOMATIC
, while readers created manually are MANUAL
.
discoveryMethod
- the method used to discover the readerpublic java.lang.String toKey()
If the MACAddress is known, then the hash is
public java.lang.String toString()
public java.lang.String toTerseString()
public boolean equals(java.lang.Object comparison)
true
false otherwise.
comparison
- object to compare with - to be cast into a DiscoveryItem
true
if equal, false
otherwisepublic AlienClass1Reader getReader() throws AlienDiscoveryUnknownReaderException
AlienClass1Reader
object, based on the attributes
of this DiscoveryItem. If the readerType contains the phrase "Class BPT",
then the reader will be created as an AlienClassBPTReader
. The new
reader object's connection method will be set according to the DiscoveryItem's
connection attribute.
AlienDiscoveryUnknownReaderException
- if the readerType is an unknown value
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |