|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectits.backbone.frame.ItsFrameReceiver
its.backbone.sdd.SddReceiver
its.app.SddAutoExtractReceiver
A sample SDD Receiver that saves incoming SDD information to files on disk. This class demonstrates how to create an SddReceiver object and receive the events it generates. There is also an example of how to handle exceptions thrown within the SddReceiver.
This receiver displays a graphical interface that allows the user to set options about the files it creates. If the default options are accepted, the receiver will create files for the incoming schema, contents, extractor, raw data, and extracted data. If the "Produce SQL data files" option is checked, the extracted data file will be structured as a series of SQL INSERT statements. By default, the arrival of new data causes the previously received extracted data file to be overwritten. If the "Append Data files" option is chosen instead, the receiver will continuously append new data to the existing file.
If both the "Append" option and the "Produce Blob data files" are chosen, the receiver will produce a raw data log file. This file will contain a listing of all the blobs that have been appended into the raw data file. This listing includes the blob's date of creation, size, and its offset within the appended file.
Users who would like to view specific sensor outputs can either make modifications to this code, or parse the desired sensors out of the text data files.
The current implemenation of the receiver does not queue up data events. If, during the course of the extraction process thread, a data event is received, it will be dropped, though users running on faster machines (or with jits) should not see this problem with the current SDD data streams.
| Field Summary |
| Fields inherited from class its.backbone.frame.ItsFrameReceiver |
ignoreStreamTimeout |
| Constructor Summary | |
SddAutoExtractReceiver(java.lang.String host,
int port)
constructor initializes the Automagical sdd receiver |
|
SddAutoExtractReceiver(java.lang.String host,
int port,
boolean makeschema,
boolean makecontents,
boolean makeextractor,
boolean makeblob,
boolean makeextracteddata,
boolean makesqldata,
boolean append)
constructor initializes the Auto Extract sdd receiver |
|
| Method Summary | |
void |
contentsReceived(Contents contents,
java.lang.String serialNum)
Method for contents received, takes the contents and overwrites the contents file. |
void |
dataReceived(byte[] data,
java.lang.String serialNum)
Method for data received, takes the blob data and overwrites the blob file. |
void |
extractedDataReceived(java.util.Hashtable ht,
java.lang.String serialNum)
evokes the expander thread (if it isn't busy) and overwrites (or appends to) the expanded data file. |
void |
extractorReceived(byte[] extractor,
java.lang.String serialNum)
Method for receiving the extractor portion of the sdd data flow. |
static void |
main(java.lang.String[] args)
|
void |
schemaReceived(Schema schema,
java.lang.String serialNum)
Method for schema received, takes the schema and overwrites the schema file. |
java.lang.String |
toSQLBuffer(java.lang.String tablename,
ContentsData cd)
Creates a SQL INSERT INTO statement for each row in this ContentsData object. |
java.lang.String |
toTextBuffer(ContentsData cd)
Creates a text representation of the data values on all rows |
| Methods inherited from class its.backbone.sdd.SddReceiver |
frameReceived, getContentsSerialNumber, getSchemaSerialNumber |
| 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 |
public SddAutoExtractReceiver(java.lang.String host,
int port)
throws java.lang.IllegalArgumentException,
java.io.IOException
host - the sdd data source host nameport - the sdd data host's port number
java.lang.IllegalArgumentException - thrown if host is null or port < 0
java.io.IOException
public SddAutoExtractReceiver(java.lang.String host,
int port,
boolean makeschema,
boolean makecontents,
boolean makeextractor,
boolean makeblob,
boolean makeextracteddata,
boolean makesqldata,
boolean append)
throws java.lang.IllegalArgumentException,
java.io.IOException
host - the sdd data source host nameport - the sdd data host's port numbermakeschema - make schema flagmakecontents - make contents flagmakeextractor - make extractor flagmakeblob - make blob flagmakeextracteddata - make extracted data flagmakesqldata - make sql data flagappend - append or overwrite flag (overwrites if false)
java.lang.IllegalArgumentException - thrown if host is null or port < 0
java.io.IOException| Method Detail |
public void schemaReceived(Schema schema,
java.lang.String serialNum)
schemaReceived in class SddReceiverjava.lang.IllegalArgumentException - thrown if null event
public void contentsReceived(Contents contents,
java.lang.String serialNum)
contentsReceived in class SddReceiverjava.lang.IllegalArgumentException - thrown if null event
public void dataReceived(byte[] data,
java.lang.String serialNum)
dataReceived in class SddReceiverjava.lang.IllegalArgumentException - thrown if null event
public void extractedDataReceived(java.util.Hashtable ht,
java.lang.String serialNum)
extractedDataReceived in class SddReceiverjava.lang.IllegalArgumentException - thrown if null eventpublic java.lang.String toTextBuffer(ContentsData cd)
public java.lang.String toSQLBuffer(java.lang.String tablename,
ContentsData cd)
public void extractorReceived(byte[] extractor,
java.lang.String serialNum)
extractorReceived in class SddReceiverjava.lang.IllegalArgumentException - thrown if event is null or empty
public static void main(java.lang.String[] args)
throws java.io.IOException,
BadTypeException
java.io.IOException
BadTypeException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||