Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.ka2ddo.yaac.core
Class SnifferDataModel

    java.lang.Object
      org.ka2ddo.yaac.core.SnifferDataModel

All Implemented Interfaces:
  java.lang.Runnable, AprsMessageListener, AX25FrameListener, ParsedAX25MessageListener, ClearableTableModel

    public final class SnifferDataModel

extends java.lang.Object
implements AX25FrameListener, AprsMessageListener, ParsedAX25MessageListener, java.lang.Runnable, ClearableTableModel

This class maintains a list of all messages heard by the application.

Nested Class Summary

Nested classes/interfaces inherited from interface org.ka2ddo.yaac.util.ClearableTableModel
`ClearableTableModel.ClearType`

Field Summary
`static Connector` | `LOGFILE_PLAYBACK_CONNECTOR` Bogus Connector instance used to identify historical packets loaded from a log file.

Constructor Summary
`SnifferDataModel()` Create the singleton SnifferDataModel that collects incoming packet traffic for tabular display.

Method Summary
`void` | `addSnifferDataListener(SnifferDataListener l)` Register a SnifferDataListener.
`void` | `aprsMessageReceived(Message msg)` Delivers the next packet received by YAAC that is an APRS message.
`void` | `consumeAX25Frame(AX25Frame frame, Connector 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.
`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.
`void` | `run()` Do not call.
`void` | `setLoggerFormat(PacketExportMode pem)` Set the format for AX.25 message logging.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### LOGFILE_PLAYBACK_CONNECTOR

    public static final Connector LOGFILE_PLAYBACK_CONNECTOR

  Bogus Connector instance used to identify historical packets loaded from a log file.

Constructor Detail

### SnifferDataModel

    public SnifferDataModel()

  Create the singleton SnifferDataModel that collects incoming packet traffic for tabular display.

Method Detail

### getRowCount

    public int getRowCount()

  Get the number of packets currently stored in the SnifferDataModel.

  Returns:
    packet count

### addSnifferDataListener

    public void addSnifferDataListener(SnifferDataListener l)

  Register a SnifferDataListener.

  Parameters:
    `l` - SnifferDataListener to register

### removeSnifferDataListener

    public void removeSnifferDataListener(SnifferDataListener l)

  Unregister a SnifferDataListener.

  Parameters:
    `l` - SnifferDataListener to unregister

### consumeAX25Frame

    public void consumeAX25Frame(AX25Frame frame,
                                 Connector connector)

  Specified by:
    `consumeAX25Frame` in interface `AX25FrameListener`

### aprsMessageReceived

    public void aprsMessageReceived(Message msg)

  Delivers the next packet received by YAAC that is an APRS message.

  Specified by:
    `aprsMessageReceived` in interface `AprsMessageListener`
  Parameters:
    `msg` - some subclass of Message containing the message contents; the message should have an AX25Frame connected to it
  See Also:
    `AX25Frame`, `AX25Message.ax25Frame`, `AX25Message.getAx25Frame()`

### parsedAX25MessageReceived

    public void parsedAX25MessageReceived(byte pid,
                                          AX25Message msg)

  Delivers the next message received by YAAC that is some sort of parsed AX.25 higher-level message.

  Specified by:
    `parsedAX25MessageReceived` in interface `ParsedAX25MessageListener`
  Parameters:
    `pid` - AX.25 protocol ID
    `msg` - some subclass of Message containing the message contents; the message should have an AX25Frame connected to it
  See Also:
    `AX25Frame`, `AX25Message.ax25Frame`, `AX25Message.getAx25Frame()`

### run

    public void run()

  Do not call. Invoked by GUI dispatch thread to update the GUI with recently received packets.

  Specified by:
    `run` in interface `java.lang.Runnable`

### importMessages

    public void importMessages(java.io.InputStream in,
                               PacketExportMode exportMode,
                               int scaleFactor,
                               StatusListener statusListener,
                               long fileSize,
                               Filter filter)
                        throws java.io.IOException

  Import a file of AX.25 frames in any of three formats into YAAC.

  Parameters:
    `in` - InputStream to read the file data from
    `exportMode` - expected format of the data stream
    `scaleFactor` - the speed-up factor for simulated playback, or zero for as-fast-as-possible
    `statusListener` - StatusListener to receive file reading progress reports, or null if not desired
    `fileSize` - total length of file being read in
    `filter` - Filter to use to discard unwanted messages, or null to keep all messages
  Throws:
    `java.io.IOException` - if file reading fails for an unexpected reason

### exportMessages

    public void exportMessages(java.io.OutputStream o,
                               PacketExportMode exportMode,
                               boolean saveAll)
                        throws java.io.IOException

  Export packets passing the current filters in the SnifferDataModel to a file in the specified file format.

  Parameters:
    `o` - OutputStream to write the file data to
    `exportMode` - PacketExportMode specifying the format of the saved packet data
    `saveAll` - boolean true if filters should be ignored and all currently held packets should be saved
  Throws:
    `java.io.IOException` - if packets could not be written to the stream for any reason

### getMessage

    public AX25Frame getMessage(int rowIndex)

  Get the Nth packet stored in the SnifferDataModel.

  Parameters:
    `rowIndex` - zero-based index of the AX25Frame to return
  Returns:
    AX25Frame
  Throws:
    `java.lang.IndexOutOfBoundsException` - if rowIndex is not in range of the available frames

### getLoggerFormat

    public PacketExportMode getLoggerFormat()

  Get the current format for AX.25 message logging.

  Returns:
    PacketExportMode in use

### setLoggerFormat

    public void setLoggerFormat(PacketExportMode pem)

  Set the format for AX.25 message logging.

  Parameters:
    `pem` - PacketExportMode to use

### deleteAllRows

    public int deleteAllRows(ClearableTableModel.ClearType clearType)

  Delete all rows from this table.

  Specified by:
    `deleteAllRows` in interface `ClearableTableModel`
  Parameters:
    `clearType` - type of rows to delete
  Returns:
    number of rows deleted

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD