Class ObjectReportSender

java.lang.Object
org.ka2ddo.yaac.io.SendableMessageWrapper
org.ka2ddo.yaac.io.ObjectReportSender
All Implemented Interfaces:
Serializable, SetBeaconRatesIfc, AX25FrameSource, TrackerListener

public class ObjectReportSender extends SendableMessageWrapper implements TrackerListener
This class extends SendableMessageWrapper to cancel transmission when the ObjectReport is overridden by another source (i.e., taken over).
Author:
Andrew Pavlin, KA2DDO
See Also:
  • Constructor Details

    • ObjectReportSender

      public ObjectReportSender(ObjectReport msg)
      Wrap an ObjectReport for locally initiated transmission as many times as the object definition says (3 times for transient objects, forever for permanent objects),
      Parameters:
      msg - ObjectReport to transmit
    • ObjectReportSender

      public ObjectReportSender(ObjectReport msg, int maxTransmits)
      Wrap an ObjectReport for locally initiated transmission the specified number of times,
      Parameters:
      msg - ObjectReport to transmit
      maxTransmits - number of times the ObjectReport should be transmitted
  • Method Details

    • stationAdded

      public void stationAdded(StationState ss, int index)
      Called when a new station is initially added to the tracker.
      Specified by:
      stationAdded in interface TrackerListener
      Parameters:
      ss - StationState containing the station's information; the initial AX25Message will not yet be stored within the StationState object
      index - zero-based integer sequence number for this station in the StationTracker
    • stationUpdated

      public void stationUpdated(StationState ss)
      Called when an existing station is updated with new information in the tracker.
      Specified by:
      stationUpdated in interface TrackerListener
      Parameters:
      ss - StationState containing the station's information; the new AX25Message will not yet be stored within the StationState object
    • stationDeleted

      public void stationDeleted(StationState ss, int index)
      Called when an existing station is deleted from the tracker.
      Specified by:
      stationDeleted in interface TrackerListener
      Parameters:
      ss - StationState containing the station's information
      index - zero-based integer sequence number for this station in the StationTracker
    • messageAdded

      public void messageAdded(StationState ss, int index, AX25Message msg)
      Called when a Message is added to the history for a station in the tracker.
      Specified by:
      messageAdded in interface TrackerListener
      Parameters:
      ss - StationState containing the station's information
      index - zero-based index of the message added to the StationState object
      msg - APRS Message object being added to the tracker; note that non-APRS packets that can still be decoded (such as OpenTRAC) will also be passed here; AX25Frames that cannot be decoded will pass null here
    • messageDeleted

      public void messageDeleted(StationState ss, int index, AX25Message msg)
      Called when a AX25Message is deleted from the history for a station in the tracker.
      Specified by:
      messageDeleted in interface TrackerListener
      Parameters:
      ss - StationState containing the station's information; the AX25Message will already be removed from the StationState object
      index - zero-based index of the message removed from the StationState object
      msg - APRS Message object being removed from the tracker; note that non-APRS packets that can still be decoded (such as OpenTRAC) will also be passed here; AX25Frames that cannot be decoded will pass null here
    • writeToPreferences

      public void writeToPreferences(Preferences prefs)
      Store this ObjectReportSender and its contained ObjectReport in the preferences cache.
      Parameters:
      prefs - Preferences node to contain the object record
    • cleanup

      protected void cleanup()
      Do any cleanup work involved in removing this wrapped message from the transmission queue.
      Overrides:
      cleanup in class SendableMessageWrapper
    • removeFromPreferences

      public void removeFromPreferences(Preferences prefs)
      Delete this ObjectReportSender and its contained ObjectReport from the preferences cache.
      Parameters:
      prefs - Preferences node containing the object record
    • readFromPreferences

      public static ObjectReportSender readFromPreferences(Preferences prefs, String objectName)
      Recreate an ObjectReport and its encapsulating ObjectReportSender from the preferences cache.
      Parameters:
      prefs - the Preferences node containing the object information
      objectName - String name of cached Object/Item
      Returns:
      ObjectReportSender containing the restored Object