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:

Version:
$Id: VersusSource.java,v 1.5 2003/09/19 00:38:32 glchen Exp $
Author:
Guanling Chen, Kazuhiro Minami

Field Summary
private  java.lang.String _badgeHost
           
private  int _badgePort
           
private  java.io.DataInputStream _in
           
private  boolean _standalone
           
private static int BADGE_HEADER
           
private static int BADGE_ID
           
private static int COLLECTOR_NO
           
private static int FIELDS_NUM
           
private static int QUALIFIERS
           
private static int SENSOR_NO
           
private static byte SEPARATOR
           
private static int START_INDEX
           
 
Fields inherited from class solar.service.dan.GraphNode
_gid
 
Fields inherited from interface solar.service.dan.DanConstants
DAN_INPORT, DAN_OUTPORT
 
Constructor Summary
VersusSource()
           
VersusSource(boolean standalone)
           
 
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 solar.service.dan.Source
getInputPorts, handleEvent
 
Methods inherited from class solar.service.dan.GraphNode
getId, getOutputPorts, handleEvent, handleQuery, init, init, publish, publish, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

VersusSource

public VersusSource()

VersusSource

public VersusSource(boolean standalone)
Method Detail

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: The Solar name assigned for this source is: [source=versus, building=sudikoff, campus=dartmouth]

java.lang.Exception