its.app
Class SddFilter
java.lang.Object
its.backbone.frame.ItsFrameReceiver
its.backbone.sdd.SddReceiver
its.backbone.sdd.SddOperator
its.app.SddFilter
- All Implemented Interfaces:
- AcceptRow, java.lang.Runnable
- public class SddFilter
- extends SddOperator
- implements AcceptRow
SDDFilter illustrates how to build an SDD Operator. It receives an
SDD data stream, filters according to the deny and allow configuration
files, and sends the remaining data out on the specified port as SDD.
Usage: SddFilter < request port > < server > < server port > < deny file > [allow file] -logallow -logdeny
< request port > is the port this transmitter will accept connections on
< server > is the computer of upstream sdd transmitter
< server port > is the port of the upstream sdd transmitter
< deny file > the file with deny filter elements
[allow file] the optional file with allow filter elements
The language of filter files is:
< table name > . < field name > < operator > < value >
OR
< table name > .all
The < value > can be a string, integer, or a bit sequence.
A bit sequence is specified as:
< table name > . < field name > [< start index > - < end index > ]
The < start index > and optional [end index] are inclusive indices of bits.
The < operator > is an operator from the user specified language. See also its.util.Filter
The < val > is the value to match against.
-logallow flag results in any allowed row to be logged to the ErrorLogger
-logdeny flag results in any denied row to be logged to the ErrorLogger
|
Constructor Summary |
SddFilter(int requestPort,
java.lang.String serverName,
int serverPort)
|
|
Method Summary |
boolean |
acceptRow(ContentsData cd)
implementation of the AcceptRow.acceptRow method
This method is used by ContentsData.filter to determine if a
row should be removed. |
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. |
static void |
main(java.lang.String[] args)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SddFilter
public SddFilter(int requestPort,
java.lang.String serverName,
int serverPort)
throws java.io.IOException
main
public static void main(java.lang.String[] args)
extractedDataReceived
public void extractedDataReceived(java.util.Hashtable ht,
java.lang.String serialNum)
- Description copied from class:
SddReceiver
- Subclasses can override this method to receive the incoming SDD data after it has
been processed into a table of ContentsData objects.
- Overrides:
extractedDataReceived in class SddOperator
acceptRow
public boolean acceptRow(ContentsData cd)
- implementation of the AcceptRow.acceptRow method
This method is used by ContentsData.filter to determine if a
row should be removed. The ContentsData object calls this method
once for each row it contains after adjusting it's internal
index accordingly.
The logic here is as follows:
if (match an allow value) then allow the row
else if (match a deny value) then deny the row
else allow the row
- Specified by:
acceptRow in interface AcceptRow
- Parameters:
cd - the ContentsData who's current row is being questioned