its.backbone.domain
Class Extractor

java.lang.Object
  extended byits.backbone.domain.Extractor

public class Extractor
extends java.lang.Object

Extractor.java This implementation takes a schema with the blob 'data table' definitions and a DataFactory object as inputs. It has one method (@see Extractor#getExtractionHashtable(ContentsData,ContentsData)) that produces a Hashtable of resultant ContentsData objects, one for each sensor table type detected. The hashing keys are the schema data table names. The sensors ContentsData object specifies which sensors to produce data against, while the data ContentsData object contains the blobs to be processed. This implementation assumes that the user has some means (either a database or utilizing methods in ContentsData) to construct sensor and data CD objects to fit his or her needs. Last change: NSF 2 Feb 98 11:06 am


Constructor Summary
Extractor(Schema schema, DataFactory factory)
          constructor
 
Method Summary
 java.lang.String getDataOffsetTableName()
          This method returns the name of the data offset table within the datastream schema.
 java.util.Hashtable getExtractionHashtable(ContentsData sensors, ContentsData data)
          getExtractionHashtable this method takes the ContentsData object with the contents of a (possibly filtered) loop table and a ContentsData object of blobs represented as byte arrays and produces a hashtable of ContentsData objects, hashed on their associated data blob schema table names.
 boolean hasDataOffsetTable()
          this method indicates whether the datafactory's datastream (schema, contents, datafactory) has a data offset table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Extractor

public Extractor(Schema schema,
                 DataFactory factory)
          throws java.lang.IllegalArgumentException
constructor

Parameters:
schema - the output schema that will be used to produce the output ContentsData objects
Throws:
java.lang.IllegalArgumentException - thrown id bad inputs
Method Detail

hasDataOffsetTable

public boolean hasDataOffsetTable()
this method indicates whether the datafactory's datastream (schema, contents, datafactory) has a data offset table. A data offset table is a relation that specifies the sensor type, its name and the offset into the blob where the relevant data is located. If the blob contains several different types of data, this table also needs to contain the data type (and account for its size). For an example:

Consider a system that produces three types of binary sensor data, all of whom are packaged into a single blob (Binary Large Object). The first type is of size 3 bytes, the second type is of 6 bytes and the third type is of 18 bytes. These sensors readings can appear in arbitrary order within the blob. To gain access to any specific sensor reading a data offset table is required in the SDD data stream's schema. This table should contains columns that describe the following:

For an operational example, consider the "LOOPS" table in the SDD data flow at host sdd.its.washington.edu, port 9033.

Returns:
true if the given datastream has a data offset table defined

getDataOffsetTableName

public java.lang.String getDataOffsetTableName()
This method returns the name of the data offset table within the datastream schema. Please see comments above.

Returns:
the given data factory's data offset table name

getExtractionHashtable

public java.util.Hashtable getExtractionHashtable(ContentsData sensors,
                                                  ContentsData data)
                                           throws java.lang.IllegalArgumentException,
                                                  BadOffsetException
getExtractionHashtable this method takes the ContentsData object with the contents of a (possibly filtered) loop table and a ContentsData object of blobs represented as byte arrays and produces a hashtable of ContentsData objects, hashed on their associated data blob schema table names.

Parameters:
sensors - the ContentsData object with the sensors information in it
data - the ContentsData with the associated blob data
Throws:
java.lang.IllegalArgumentException - thrown if any input is invalid
BadOffsetException - thrown for bad sensor offset in a given blob in data