public final class SnifferDataModel extends java.lang.Object implements AX25FrameListener, AprsMessageListener, ParsedAX25MessageListener, java.lang.Runnable, ClearableTableModel
ClearableTableModel.ClearType| Modifier and Type | Field and Description |
|---|---|
static Connector |
LOGFILE_PLAYBACK_CONNECTOR
Bogus Connector instance used to identify historical packets loaded from a log file.
|
| Constructor and Description |
|---|
SnifferDataModel()
Create the singleton SnifferDataModel that collects incoming packet traffic for tabular display.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addSnifferDataListener(SnifferDataListener l)
Register a SnifferDataListener.
|
static void |
addSnifferLogFilter(SnifferLogFilter filter)
Register a
SnifferLogFilter. |
void |
aprsMessageReceived(Message msg)
Delivers the next packet received by YAAC that is an APRS message.
|
void |
consumeAX25Frame(AX25Frame frame,
Connector connector)
Receive an incoming frame from the specified input Connector.
|
int |
deleteAllRows(ClearableTableModel.ClearType clearType)
Delete all rows from this table.
|
void |
exportMessages(java.io.OutputStream o,
PacketExportMode exportMode,
boolean saveAll)
Export packets passing the current filters in the SnifferDataModel to a file in the specified file format.
|
PacketExportMode |
getLoggerFormat()
Get the current format for AX.25 message logging.
|
AX25Frame |
getMessage(int rowIndex)
Get the Nth packet stored in the SnifferDataModel.
|
java.lang.String |
getRecordTypeTag()
Get a tag that can be given to the
Localizer to return the
term for the records to be or that have been deleted. |
int |
getRowCount()
Get the number of packets currently stored in the SnifferDataModel.
|
void |
importMessages(java.io.InputStream in,
PacketExportMode exportMode,
int scaleFactor,
StatusListener statusListener,
long fileSize,
Filter filter)
Import a file of AX.25 frames in any of three formats into YAAC.
|
void |
parsedAX25MessageReceived(byte pid,
AX25Message msg)
Delivers the next message received by YAAC that is some sort of parsed AX.25 higher-level message.
|
void |
removeSnifferDataListener(SnifferDataListener l)
Unregister a SnifferDataListener.
|
static void |
removeSnifferLogFilter(SnifferLogFilter filter)
Unregister a
SnifferLogFilter. |
void |
run()
Do not call.
|
void |
setLoggerFormat(PacketExportMode pem)
Set the format for AX.25 message logging.
|
boolean |
tableCanContainPlayback()
Identifies whether this table can contain playback (historical) data.
|
boolean |
tableCanContainRealtime()
Identifies whether this table can contain realtime data.
|
public static final Connector LOGFILE_PLAYBACK_CONNECTOR
public SnifferDataModel()
public int getRowCount()
public void addSnifferDataListener(SnifferDataListener l)
l - SnifferDataListener to registerpublic void removeSnifferDataListener(SnifferDataListener l)
l - SnifferDataListener to unregisterpublic void consumeAX25Frame(AX25Frame frame, Connector connector)
consumeAX25Frame in interface AX25FrameListenerframe - AX25Frame that was receivedconnector - Connector that was the source of the frame.public static void addSnifferLogFilter(SnifferLogFilter filter)
SnifferLogFilter.filter - SnifferLogFilter to registerpublic static void removeSnifferLogFilter(SnifferLogFilter filter)
SnifferLogFilter.filter - SnifferLogFilter to registerpublic void aprsMessageReceived(Message msg)
aprsMessageReceived in interface AprsMessageListenermsg - some subclass of Message containing the message contents; the message should have
an AX25Frame connected to itAX25Frame,
AX25Message.ax25Frame,
AX25Message.getAx25Frame()public void parsedAX25MessageReceived(byte pid,
AX25Message msg)
parsedAX25MessageReceived in interface ParsedAX25MessageListenerpid - AX.25 protocol IDmsg - some subclass of Message containing the message contents; the message should have
an AX25Frame connected to itAX25Frame,
AX25Message.ax25Frame,
AX25Message.getAx25Frame()public void run()
run in interface java.lang.Runnablepublic void importMessages(java.io.InputStream in,
PacketExportMode exportMode,
int scaleFactor,
StatusListener statusListener,
long fileSize,
Filter filter)
throws java.io.IOException
in - InputStream to read the file data fromexportMode - expected format of the data streamscaleFactor - the speed-up factor for simulated playback, or zero for as-fast-as-possiblestatusListener - StatusListener to receive file reading progress reports, or null if not desiredfileSize - total length of file being read infilter - Filter to use to discard unwanted messages, or null to keep all messagesjava.io.IOException - if file reading fails for an unexpected reasonpublic void exportMessages(java.io.OutputStream o,
PacketExportMode exportMode,
boolean saveAll)
throws java.io.IOException
o - OutputStream to write the file data toexportMode - PacketExportMode specifying the format of the saved packet datasaveAll - boolean true if filters should be ignored and all currently held packets should be savedjava.io.IOException - if packets could not be written to the stream for any reasonpublic AX25Frame getMessage(int rowIndex)
rowIndex - zero-based index of the AX25Frame to returnjava.lang.IndexOutOfBoundsException - if rowIndex is not in range of the available framespublic PacketExportMode getLoggerFormat()
public void setLoggerFormat(PacketExportMode pem)
pem - PacketExportMode to usepublic int deleteAllRows(ClearableTableModel.ClearType clearType)
deleteAllRows in interface ClearableTableModelclearType - type of rows to deletepublic boolean tableCanContainPlayback()
tableCanContainPlayback in interface ClearableTableModelpublic boolean tableCanContainRealtime()
tableCanContainRealtime in interface ClearableTableModelpublic java.lang.String getRecordTypeTag()
Localizer to return the
term for the records to be or that have been deleted. Should translate
to a plural term, i.e., "messages" rather than "message".getRecordTypeTag in interface ClearableTableModel