versus
Class VersusSource
java.lang.Object
|
+--solar.service.dan.GraphNode
|
+--solar.service.dan.Source
|
+--versus.VersusSource
- All Implemented Interfaces:
- DanConstants, Identifiable
- public class VersusSource
- extends Source
A location source that connects to the Versus badge server.
It parses the badge event stream, and produces location events.
It generates and publish an event every time it receives
a new badge event from the badge server.
The published events contain following attributes:
- badge_num (badge number)
- col_num (collector number)
- sen_num (sensor number)
- button (whether button is pressed)
- battery (whether battery is still good)
- motion (whether the badge is moving)
- tcount (a rotating event counter for a badge)
- timestamp (when the event is received)
- Version:
- $Id: VersusSource.java,v 1.5 2003/09/19 00:38:32 glchen Exp $
- Author:
- Guanling Chen, Kazuhiro Minami
Method Summary |
java.lang.Object |
handleQuery(Request query)
Handle the query being actively pulled by downstream operators. |
private void |
init(java.lang.String badgeHost,
int badgePort)
Open the connection to the badge server, and creates the
input stream. |
static void |
main(java.lang.String[] args)
Read the configuration from command line and start the source
as Versus client or a standalone program. |
void |
run()
The execution body of this source. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SEPARATOR
private static final byte SEPARATOR
- See Also:
- Constant Field Values
BADGE_HEADER
private static final int BADGE_HEADER
- See Also:
- Constant Field Values
BADGE_ID
private static final int BADGE_ID
- See Also:
- Constant Field Values
QUALIFIERS
private static final int QUALIFIERS
- See Also:
- Constant Field Values
COLLECTOR_NO
private static final int COLLECTOR_NO
- See Also:
- Constant Field Values
SENSOR_NO
private static final int SENSOR_NO
- See Also:
- Constant Field Values
FIELDS_NUM
private static final int FIELDS_NUM
- See Also:
- Constant Field Values
START_INDEX
private static final int START_INDEX
- See Also:
- Constant Field Values
_badgeHost
private java.lang.String _badgeHost
_badgePort
private int _badgePort
_standalone
private boolean _standalone
_in
private java.io.DataInputStream _in
VersusSource
public VersusSource()
VersusSource
public VersusSource(boolean standalone)
run
public void run()
throws java.lang.Exception
- Description copied from class:
Source
- The execution body of this source.
- Specified by:
run
in class Source
java.lang.Exception
handleQuery
public java.lang.Object handleQuery(Request query)
throws java.lang.Exception
- Description copied from class:
GraphNode
- Handle the query being actively pulled by downstream operators.
- Specified by:
handleQuery
in class GraphNode
java.lang.Exception
init
private void init(java.lang.String badgeHost,
int badgePort)
- Open the connection to the badge server, and creates the
input stream.
main
public static void main(java.lang.String[] args)
throws java.lang.Exception
- Read the configuration from command line and start the source
as Versus client or a standalone program. The recognized options
are:
-standalone: whether to run the source without Solar.
-host: the host address of the connecting Planet.
-port: the port number of the connecting Planet.
-badgehost: the badge server address to connect.
-badgeport: the badge server port to connect.
The Solar name assigned for this source is:
[source=versus, building=sudikoff, campus=dartmouth]
java.lang.Exception