Class QueryResponder

java.lang.Object
org.ka2ddo.yaac.core.QueryResponder
All Implemented Interfaces:
AprsMessageListener

public class QueryResponder extends Object implements AprsMessageListener
This class handles processing queries sent to this station.
Author:
Andrew Pavlin, KA2DDO
  • Field Details

    • TACTICAL_AUTHORIZATION

      public static final String TACTICAL_AUTHORIZATION
      Key string for StationState attachment indicating the future authorization for incoming TACTICAL messages.
      See Also:
    • TACTICAL_SOURCE

      public static final String TACTICAL_SOURCE
      Key string for StationState attachment indicating the remote source of a tactical callsign or symbol code.
      See Also:
  • Method Details

    • getInstance

      public static QueryResponder getInstance()
      Get a handle to the QueryResponder singleton object.
      Returns:
      QueryResponder instance
    • registerQueryHandler

      public void registerQueryHandler(String prefix, AbstractQueryHandler handler)
      Register a query handler with the QueryResponder to handle processing a specific incoming query string. Note that if a later plugin registers a handler with the same name as an earlier handler, the earlier handler is replaced. This allows plugins to augment the default handlers shipped with core YAAC.
      Parameters:
      prefix - the leading characters of the query that identifies which type of query it is
      handler - AbstractQuery handler to call to handle this message
      See Also:
    • getRegisteredHandlerMap

      public Map<String,AbstractQueryHandler> getRegisteredHandlerMap()
      Get a read-only reference to the map of registered handlers.
      Returns:
      Map of String prefixes to AbstractQueryHandler objects
    • isEnableQruServer

      public boolean isEnableQruServer()
      Test if QRU server should be enabled.
      Returns:
      boolean true if this program should function as a QRU server
    • setEnableQruServer

      public void setEnableQruServer(boolean enableQruServer)
      Specify whether this program should function as a QRU server.
      Parameters:
      enableQruServer - boolean true if this process should be a QRU server
    • getDefaultRangeLimit

      public float getDefaultRangeLimit()
      Get the maximum range in kilometers for responding to QRU queries.
      Returns:
      maximum response range in kilometers
    • setDefaultRangeLimit

      public void setDefaultRangeLimit(float defaultRangeLimit)
      Specify the maximum range in kilometers for responding to QRU queries.
      Parameters:
      defaultRangeLimit - maximum range in kilometers
    • aprsMessageReceived

      public void aprsMessageReceived(Message msg)
      DO NOT CALL. Callback to deliver the next message 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:
    • findAppropriateBeacon

      public static BeaconData findAppropriateBeacon(Message msg)
      Find the beacon appropriate to the requesting message being sent (such as by which incoming port the message arrived).
      Parameters:
      msg - APRS Message to extract port routing information from
      Returns:
      preferred BeaconData for the specified port
    • processTactical

      public static void processTactical(String originatingCallsign, String body)
      Process a message known to contain a tactical callsign directive (alias definitions) and approved to be processed by the user.
      Parameters:
      originatingCallsign - String callsign of station sending the tactical callsign updates
      body - String message text
    • reverifyMessages

      public void reverifyMessages()
      Re-run the verification of any signed messages that couldn't be done earlier because the user hadn't finished entering the keystore password yet.
    • sendCurrentTacticalAliases

      public static void sendCurrentTacticalAliases(boolean sendAllAliases)
      Scan the current list of stations and objects and broadcast any tactical callsigns (aliases) currently in use. Use an aggressive algorithm to maximally optimize the transmissions into the fewest possible number of APRS text message packets.
      Parameters:
      sendAllAliases - boolean true if all aliases should be sent, false if only locally defined ones should be sent
    • transmitPositionBeacon

      public static void transmitPositionBeacon(Message mm)
      Immediately transmit a position beacon message for this station.
      Parameters:
      mm - Message of received request
    • transmitBroadcast

      public static void transmitBroadcast(String addressee, String answer)
      Transmit an APRS text Message to all recipients using the specified addressee and message body text, specifying only RF transmission of the text message.
      Parameters:
      addressee - String addressee of text message
      answer - text of the message
    • transmitBroadcast

      public static void transmitBroadcast(String addressee, String answer, long delay)
      Transmit an APRS text Message to all recipients using the specified addressee and message body text.
      Parameters:
      addressee - String addressee of text message
      answer - text of the message
      delay - number of milliseconds to delay this transmission