org.ka2ddo.yaac.io
Class AprsIsConnector

java.lang.Object
  extended by org.ka2ddo.ax25.Connector
      extended by org.ka2ddo.yaac.io.PortConnector
          extended by org.ka2ddo.yaac.io.TransmittingPortConnector
              extended by org.ka2ddo.yaac.io.TNCConnector
                  extended by org.ka2ddo.yaac.io.AprsIsConnector
All Implemented Interfaces:
java.lang.Runnable, java.lang.Thread.UncaughtExceptionHandler, NeedsAppVersionInfoIfc, PortFailureReportListener

public class AprsIsConnector
extends TNCConnector
implements java.lang.Runnable, java.lang.Thread.UncaughtExceptionHandler, PortFailureReportListener, NeedsAppVersionInfoIfc

This class defines a potentially bidirectional connection to an APRS-IS server. New functionality includes support for SOCKS5 proxy server relay connections (RFC1928), supporting username/password authentication (RFC1929). TODO: support GSSAPI authentication (RFC1961)


Nested Class Summary
 
Nested classes/interfaces inherited from class org.ka2ddo.ax25.Connector
Connector.PortStats
 
Field Summary
static java.lang.String CONFIG_GUI
          Specify the fully-qualified platform-wildcarded class name for the editor for AprsIsConnector.
static java.lang.String TYPE_NAME
          Specify the PortConnector type name for AprsIsConnector.
 
Fields inherited from class org.ka2ddo.yaac.io.PortConnector
currentCfg, portConfig
 
Fields inherited from class org.ka2ddo.ax25.Connector
CAP_FULL_DUPLEX, CAP_GPS_DATA, CAP_HF, CAP_IGATE, CAP_OPENTRAC, CAP_RCV_PACKET_DATA, CAP_RF, CAP_WAYPOINT_SENDER, CAP_WEATHER, CAP_XMT_PACKET_DATA, stats
 
Constructor Summary
AprsIsConnector()
          Create an uninitialized instance of AprsIsConnector.
 
Method Summary
 void close()
          Shut down this PortConnector.
 void configure(PortConfig config)
          Update the configuration of the connector to match the updated setup.
 void failureGuiCreated(PortFailureReporterIfc failureGui)
          Specify the lazily-created failure reporting GUI object for the reported failure.
 void failureGuiDismissed()
          The GUI object has been dismissed by the user and should not be used any more by the requesting I/O code.
 int getBitRate()
          Get the bit transmission rate on this port.
 int getCapabilities()
          Specify what capabilities a port of this type has.
 boolean isOpen()
          Reports whether this PortConnector has an open connection to its port.
 void run()
          Private internal method used to read the incoming APRS messages from the socket connection to the selected APRS-IS server.
 void sendFrame(AX25Frame frame)
          Transmit a AX.25 frame to the connected APRS-IS server.
 void setAppVersion(java.lang.String name, java.lang.String version)
          Sets the name and version of the containing application.
 java.lang.String toString()
          Returns a string representation of the AprsIsConnector object.
 void uncaughtException(java.lang.Thread t, java.lang.Throwable e)
          Method invoked when the given thread terminates due to the given uncaught exception.
 
Methods inherited from class org.ka2ddo.yaac.io.TNCConnector
convertTNC2FormatToAX25Frame, getCallsign, getPortAddress, setPortAddress
 
Methods inherited from class org.ka2ddo.yaac.io.PortConnector
addFrameListener, addPortEventListener, createPort, fireConsumeFrame, fireConsumeFrame, fireFailed, fireReceiving, fireTransmitting, getPortConnectorClass, portConnectorClasses, portTypeNames, registerPortConnectorType, removeFrameListener, removePortEventListener, setPortConfig
 
Methods inherited from class org.ka2ddo.ax25.Connector
finalize, getStats, hasCapability
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_NAME

public static final java.lang.String TYPE_NAME
Specify the PortConnector type name for AprsIsConnector.

See Also:
Constant Field Values

CONFIG_GUI

public static final java.lang.String CONFIG_GUI
Specify the fully-qualified platform-wildcarded class name for the editor for AprsIsConnector.

See Also:
Constant Field Values
Constructor Detail

AprsIsConnector

public AprsIsConnector()
Create an uninitialized instance of AprsIsConnector.

Method Detail

setAppVersion

public void setAppVersion(java.lang.String name,
                          java.lang.String version)
Sets the name and version of the containing application.

Specified by:
setAppVersion in interface NeedsAppVersionInfoIfc
Parameters:
name - String name of the application (cannot contain whitespace)
version - String version of the application (cannot contain whitespace)

configure

public void configure(PortConfig config)
               throws java.io.IOException,
                      java.lang.IllegalArgumentException
Update the configuration of the connector to match the updated setup.

Specified by:
configure in class PortConnector
Parameters:
config - PortConfig defining new port settings
Throws:
java.io.IOException - if interface changes could not be applied
java.lang.IllegalArgumentException - if type information is invalid for changing the settings of this PortConnector

isOpen

public boolean isOpen()
Reports whether this PortConnector has an open connection to its port.

Specified by:
isOpen in class Connector
Returns:
boolean true if PortConnector is open

run

public final void run()
Private internal method used to read the incoming APRS messages from the socket connection to the selected APRS-IS server.

Specified by:
run in interface java.lang.Runnable

getBitRate

public int getBitRate()
Get the bit transmission rate on this port.

Overrides:
getBitRate in class TNCConnector
Returns:
bit rate in bits per second

failureGuiCreated

public void failureGuiCreated(PortFailureReporterIfc failureGui)
Specify the lazily-created failure reporting GUI object for the reported failure.

Specified by:
failureGuiCreated in interface PortFailureReportListener
Parameters:
failureGui - PortFailureReporterIfc object for the GUI
See Also:
GuiIfc.showIOFailureDialog(org.ka2ddo.yaac.io.PortConfig, String, org.ka2ddo.yaac.io.PortFailureReportListener)

failureGuiDismissed

public void failureGuiDismissed()
The GUI object has been dismissed by the user and should not be used any more by the requesting I/O code.

Specified by:
failureGuiDismissed in interface PortFailureReportListener

uncaughtException

public final void uncaughtException(java.lang.Thread t,
                                    java.lang.Throwable e)
Method invoked when the given thread terminates due to the given uncaught exception.

Any exception thrown by this method will be ignored by the Java Virtual Machine.

Specified by:
uncaughtException in interface java.lang.Thread.UncaughtExceptionHandler
Parameters:
t - the thread
e - the exception

sendFrame

public void sendFrame(AX25Frame frame)
Transmit a AX.25 frame to the connected APRS-IS server. Note this will silently do nothing if the connection is not open or transmission is not enabled for this PortConnector.

Specified by:
sendFrame in class TransmittingPortConnector
Parameters:
frame - AX25Frame to transmit

close

public void close()
Shut down this PortConnector.

Overrides:
close in class Connector

toString

public java.lang.String toString()
Returns a string representation of the AprsIsConnector object.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the object.

getCapabilities

public int getCapabilities()
Specify what capabilities a port of this type has.

Overrides:
getCapabilities in class Connector
Returns:
bitmask of capability flags
See Also:
Connector.CAP_RCV_PACKET_DATA, Connector.CAP_XMT_PACKET_DATA, Connector.CAP_FULL_DUPLEX, Connector.CAP_GPS_DATA, Connector.CAP_IGATE, Connector.CAP_OPENTRAC, Connector.CAP_RF, Connector.CAP_WAYPOINT_SENDER, Connector.CAP_WEATHER