its.backbone.sdd
Class SddReceiver

java.lang.Object
  extended byits.backbone.frame.ItsFrameReceiver
      extended byits.backbone.sdd.SddReceiver
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
SddAutoExtractReceiver, SddFlash, SddOperator

public class SddReceiver
extends ItsFrameReceiver

Generic SDD Receiver base class. After connecting to an SDD data stream, analyzes incoming frames and classifies them according to type: Schema, Contents, Extractor, and Data. Subclasses can implement methods to receive any of the information obtained from the frames.

The receiver also verifies that:


Field Summary
 
Fields inherited from class its.backbone.frame.ItsFrameReceiver
ignoreStreamTimeout
 
Constructor Summary
SddReceiver(java.lang.String serverName, int serverPort)
          Constructs an SddReceiver that connects to the given server.
SddReceiver(java.lang.String serverName, int serverPort, boolean autoStart)
          Deprecated. As of SDD 2.2.0, it's always necessary to explicitly start the receiver by calling start(), so the autoStart parameter is irrelevant.
 
Method Summary
 void contentsReceived(Contents contents, java.lang.String serialNum)
          Subclasses can override this method to receive the incoming SDD Contents.
 void dataReceived(byte[] data, java.lang.String serialNum)
          Subclasses can override this method to receive the incoming SDD Data in its raw form.
 void extractedDataReceived(java.util.Hashtable ht, java.lang.String serialNum)
          Subclasses can override this method to receive the incoming SDD data after it has been processed into a table of ContentsData objects.
 void extractorReceived(byte[] extractor, java.lang.String serialNum)
          Subclasses can override this method to receive the incoming SDD Extractor in its raw form.
 void frameReceived(ItsFrame f)
          called by the superclass with an incoming frame.
protected  java.lang.String getContentsSerialNumber()
           
protected  java.lang.String getSchemaSerialNumber()
           
 void schemaReceived(Schema schema, java.lang.String serialNum)
          Subclasses can override this method to receive the incoming SDD Schema.
 
Methods inherited from class its.backbone.frame.ItsFrameReceiver
getFrameQueue, getInputBuffer, run, start, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SddReceiver

public SddReceiver(java.lang.String serverName,
                   int serverPort)
            throws java.io.IOException
Constructs an SddReceiver that connects to the given server. After calling the constructor, it's necessary to call the start method to begin running the thread that reads the frames.

Throws:
java.io.IOException - if a connection to the given server is impossible

SddReceiver

public SddReceiver(java.lang.String serverName,
                   int serverPort,
                   boolean autoStart)
            throws java.io.IOException
Deprecated. As of SDD 2.2.0, it's always necessary to explicitly start the receiver by calling start(), so the autoStart parameter is irrelevant.

Constructs an SddReceiver that connects to the given server.

Parameters:
autoStart - if true, the start() method is called automatically
Throws:
java.io.IOException - if a connection to the given server is impossible
Method Detail

frameReceived

public void frameReceived(ItsFrame f)
called by the superclass with an incoming frame. uncompresses the frame if it was compressed by SddTransmitter. verifies correct ordering and format of the sdd frame types. generates calls to the xxxReceived methods.

Overrides:
frameReceived in class ItsFrameReceiver

schemaReceived

public void schemaReceived(Schema schema,
                           java.lang.String serialNum)
Subclasses can override this method to receive the incoming SDD Schema.


contentsReceived

public void contentsReceived(Contents contents,
                             java.lang.String serialNum)
Subclasses can override this method to receive the incoming SDD Contents.


dataReceived

public void dataReceived(byte[] data,
                         java.lang.String serialNum)
Subclasses can override this method to receive the incoming SDD Data in its raw form.


extractorReceived

public void extractorReceived(byte[] extractor,
                              java.lang.String serialNum)
Subclasses can override this method to receive the incoming SDD Extractor in its raw form.


extractedDataReceived

public void extractedDataReceived(java.util.Hashtable ht,
                                  java.lang.String serialNum)
Subclasses can override this method to receive the incoming SDD data after it has been processed into a table of ContentsData objects.


getSchemaSerialNumber

protected java.lang.String getSchemaSerialNumber()

getContentsSerialNumber

protected java.lang.String getContentsSerialNumber()