org.ka2ddo.yaac.ax25
Class Digipeater

java.lang.Object
  extended by org.ka2ddo.yaac.ax25.Digipeater
All Implemented Interfaces:
AprsMessageListener, AX25FrameListener, ParsedAX25MessageListener

public class Digipeater
extends java.lang.Object
implements AX25FrameListener, AprsMessageListener, ParsedAX25MessageListener

This singleton handles digipeating operations.


Nested Class Summary
static class Digipeater.TXIGatedStationStatus
          Status of stations trying to RF-transmit through this station from the Internet.
static interface Digipeater.TXIGatedStationStatusListener
          Interface for listeners to be informed of changes to the list of Tx I-gated stations.
 
Field Summary
 java.util.ArrayList<java.lang.String> listOfBlacklistedStations
          List of callsigns on the sender's blacklist (do not digipeat or I-gate).
 java.util.ArrayList<Digipeater.TXIGatedStationStatus> listOfTXIGatedStations
          List of stations currently being forwarded from the Internet to local RF networks by this station.
 
Method Summary
 void addDuplicateCheckedAX25Listener(DuplicateCheckedAX25Listener l)
          Register a listener to be informed of receipt of AX25Messages who wants to know if the frame is a duplicate.
 int addToBlacklist(java.lang.String callsign)
          Add a callsign to the blacklist.
 void addTXIGatedStationStatusListener(Digipeater.TXIGatedStationStatusListener l)
          Register a listener to be informed when a station is added, updated, or removed from the list of stations that this station will Tx I-gate to.
 void aprsMessageReceived(Message msg)
          DO NOT CALL.
 void consumeAX25Frame(AX25Frame frame, Connector connector)
          DO NOT CALL.
 int getCountDigiFromIgateToRf()
          Report the number of APRS messages forwarded by this station from APRS-IS to RF.
static Digipeater getInstance()
          Get the singleton instance of the digipeater logic.
static long getMaxAgeForLocal()
          Get the maximum age of RF-received messages that will be considered in deciding if a station is local.
static int getMaxHopsForLocal()
          Get the maximum number of hops to be considered a "local" station.
 boolean isBlacklisted(java.lang.String callsign)
          Test if the specified callsign is on the blacklist.
 boolean isDoRxIGate()
          Reports if RF-to-IP packet gating is allowed.
 boolean isDoTxIGate()
          Reports if IP-to-RF packet gating is allowed.
 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 rememberLocallyOriginatedMessage(AX25Frame frame)
          Record in the short-term memory that the specified frame has been locally originated by this station and should not be digipeated again.
 void removeDuplicateCheckedAX25Listener(DuplicateCheckedAX25Listener l)
          Unregister a listener who no longer wants to be informed of receipt of AX25Messages.
 int removeFromBlacklist(java.lang.String callsign)
          Remove a callsign from the blacklist.
 void removeTXIGatedStationStatusListener(Digipeater.TXIGatedStationStatusListener l)
          Unregister a listener who no longer want to be informed when a station is added, updated, or removed from the list of stations that this station will Tx I-gate to.
 void setDoRxIGate(boolean doRxIGate)
          Specify if RF-to-IP packet gating is allowed.
 void setDoTxIGate(boolean doTxIGate)
          Specify if IP-to-RF packet gating is allowed.
static void setMaxAgeForLocal(long maxAgeForLocal)
          Set the maximum age of RF-received messages that will be considered in deciding if a station is local.
static void setMaxHopsForLocal(int maxHopsForLocal)
          Set the maximum number of hops to be considered a "local" station.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listOfTXIGatedStations

public final java.util.ArrayList<Digipeater.TXIGatedStationStatus> listOfTXIGatedStations
List of stations currently being forwarded from the Internet to local RF networks by this station.


listOfBlacklistedStations

public final java.util.ArrayList<java.lang.String> listOfBlacklistedStations
List of callsigns on the sender's blacklist (do not digipeat or I-gate).

Method Detail

getInstance

public static Digipeater getInstance()
Get the singleton instance of the digipeater logic.

Returns:
Digipeater instance

isDoRxIGate

public boolean isDoRxIGate()
Reports if RF-to-IP packet gating is allowed.

Returns:
boolean true if RF-to-IP packet gating is allowed

setDoRxIGate

public void setDoRxIGate(boolean doRxIGate)
Specify if RF-to-IP packet gating is allowed.

Parameters:
doRxIGate - boolean true if RF-to-IP packet gating is allowed

isDoTxIGate

public boolean isDoTxIGate()
Reports if IP-to-RF packet gating is allowed.

Returns:
boolean true if IP-to-RF packet gating is allowed

setDoTxIGate

public void setDoTxIGate(boolean doTxIGate)
Specify if IP-to-RF packet gating is allowed.

Parameters:
doTxIGate - boolean true if IP-to-RF packet gating is allowed

getMaxHopsForLocal

public static int getMaxHopsForLocal()
Get the maximum number of hops to be considered a "local" station.

Returns:
maximum hop count where 1 is direct (not digipeated), 2 is digipeated once, etc.

setMaxHopsForLocal

public static void setMaxHopsForLocal(int maxHopsForLocal)
Set the maximum number of hops to be considered a "local" station.

Parameters:
maxHopsForLocal - maximum hop count where 1 is direct (not digipeated), 2 is digipeated once, etc.

getMaxAgeForLocal

public static long getMaxAgeForLocal()
Get the maximum age of RF-received messages that will be considered in deciding if a station is local.

Returns:
maximum acceptable age in milliseconds

setMaxAgeForLocal

public static void setMaxAgeForLocal(long maxAgeForLocal)
Set the maximum age of RF-received messages that will be considered in deciding if a station is local.

Parameters:
maxAgeForLocal - maximum acceptable age in milliseconds

addToBlacklist

public int addToBlacklist(java.lang.String callsign)
Add a callsign to the blacklist.

Parameters:
callsign - String of callsign
Returns:
index of list where callsign was added, or -1 if callsign was already on list

removeFromBlacklist

public int removeFromBlacklist(java.lang.String callsign)
Remove a callsign from the blacklist.

Parameters:
callsign - String of callsign
Returns:
index of list where callsign was removed, or -1 if callsign wasn't on list

isBlacklisted

public boolean isBlacklisted(java.lang.String callsign)
Test if the specified callsign is on the blacklist.

Parameters:
callsign - String calsign to test
Returns:
boolean true if the callsign is on the blacklist

rememberLocallyOriginatedMessage

public void rememberLocallyOriginatedMessage(AX25Frame frame)
Record in the short-term memory that the specified frame has been locally originated by this station and should not be digipeated again.

Parameters:
frame - AX25Frame to be remembered

aprsMessageReceived

public void aprsMessageReceived(Message msg)
DO NOT CALL. Listener to deliver APRS packets to the Digipeater.

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()

consumeAX25Frame

public void consumeAX25Frame(AX25Frame frame,
                             Connector connector)
DO NOT CALL. Listener to deliver AX.25 frames to the Digipeater.

Specified by:
consumeAX25Frame in interface AX25FrameListener
Parameters:
frame - AX25Frame to consider digipeating
connector - Connector that frame was received from

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()

addDuplicateCheckedAX25Listener

public void addDuplicateCheckedAX25Listener(DuplicateCheckedAX25Listener l)
Register a listener to be informed of receipt of AX25Messages who wants to know if the frame is a duplicate.

Parameters:
l - DuplicateCheckedAX25Listener

removeDuplicateCheckedAX25Listener

public void removeDuplicateCheckedAX25Listener(DuplicateCheckedAX25Listener l)
Unregister a listener who no longer wants to be informed of receipt of AX25Messages.

Parameters:
l - DuplicateCheckedAX25Listener

getCountDigiFromIgateToRf

public int getCountDigiFromIgateToRf()
Report the number of APRS messages forwarded by this station from APRS-IS to RF.

Returns:
forwarded message count

addTXIGatedStationStatusListener

public void addTXIGatedStationStatusListener(Digipeater.TXIGatedStationStatusListener l)
Register a listener to be informed when a station is added, updated, or removed from the list of stations that this station will Tx I-gate to.

Parameters:
l - TXIGatedStationStatusListener

removeTXIGatedStationStatusListener

public void removeTXIGatedStationStatusListener(Digipeater.TXIGatedStationStatusListener l)
Unregister a listener who no longer want to be informed when a station is added, updated, or removed from the list of stations that this station will Tx I-gate to.

Parameters:
l - TXIGatedStationStatusListener