Package org.ka2ddo.yaac.core
Class QueryResponder
java.lang.Object
org.ka2ddo.yaac.core.QueryResponder
- All Implemented Interfaces:
AprsMessageListener
This class handles processing queries sent to this station.
- Author:
- Andrew Pavlin, KA2DDO
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Wrap a AX25Frame so it will be sent to exactly one outgoing PortConnector. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
DO NOT CALL.static BeaconData
Find the beacon appropriate to the requesting message being sent (such as by which incoming port the message arrived).float
Get the maximum range in kilometers for responding to QRU queries.static QueryResponder
Get a handle to the QueryResponder singleton object.Get a read-only reference to the map of registered handlers.boolean
Test if QRU server should be enabled.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.void
registerQueryHandler
(String prefix, AbstractQueryHandler handler) Register a query handler with the QueryResponder to handle processing a specific incoming query string.void
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.static void
sendCurrentTacticalAliases
(boolean sendAllAliases) Scan the current list of stations and objects and broadcast any tactical callsigns (aliases) currently in use.void
setDefaultRangeLimit
(float defaultRangeLimit) Specify the maximum range in kilometers for responding to QRU queries.void
setEnableQruServer
(boolean enableQruServer) Specify whether this program should function as a QRU server.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.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.static void
Immediately transmit a position beacon message for this station.
-
Field Details
-
TACTICAL_AUTHORIZATION
Key string for StationState attachment indicating the future authorization for incoming TACTICAL messages.- See Also:
-
TACTICAL_SOURCE
Key string for StationState attachment indicating the remote source of a tactical callsign or symbol code.- See Also:
-
-
Method Details
-
getInstance
Get a handle to the QueryResponder singleton object.- Returns:
- QueryResponder instance
-
registerQueryHandler
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 ishandler
- AbstractQuery handler to call to handle this message- See Also:
-
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
DO NOT CALL. Callback to deliver the next message received by YAAC that is an APRS message.- Specified by:
aprsMessageReceived
in interfaceAprsMessageListener
- Parameters:
msg
- some subclass of Message containing the message contents; the message should have an AX25Frame connected to it- See Also:
-
findAppropriateBeacon
Find the beacon appropriate to the requesting message being sent (such as by which incoming port the message arrived).- Parameters:
msg
- APRSMessage
to extract port routing information from- Returns:
- preferred BeaconData for the specified port
-
processTactical
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 updatesbody
- 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
Immediately transmit a position beacon message for this station.- Parameters:
mm
- Message of received request
-
transmitBroadcast
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 messageanswer
- text of the message
-
transmitBroadcast
Transmit an APRS text Message to all recipients using the specified addressee and message body text.- Parameters:
addressee
- String addressee of text messageanswer
- text of the messagedelay
- number of milliseconds to delay this transmission
-