|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ka2ddo.ax25.Connector
org.ka2ddo.yaac.io.PortConnector
public abstract class PortConnector
This class defines the generic API for an object that connects a bidirectional real-time data stream to this application.
To support the dynamically plugin-built support for multiple port types, each non-abstract PortConnector subclass must define the following public static final fields:
PortConfig.portType
field of PortConfig records)
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.ka2ddo.ax25.Connector |
---|
Connector.PortStats |
Field Summary | |
---|---|
PortConfig.Cfg |
currentCfg
The port type-specific configuration associated with this PortConnector. |
PortConfig |
portConfig
The port configuration associated with this PortConnector. |
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 | |
---|---|
PortConnector()
|
Method Summary | |
---|---|
static void |
addFrameListener(FrameListener l)
Add an object that wants to be informed of incoming raw AX.25 frames. |
void |
addPortEventListener(PortEventListener l)
Register a listener for port transmission and/or reception events. |
abstract void |
configure(PortConfig cfg)
Update the configuration of the connector to match the updated setup. |
static PortConnector |
createPort(PortConfig cfg)
Instantiate a PortConnector object of the type specified in the configuration object. |
static void |
fireConsumeFrame(AX25Frame frame,
long rcptTimeInMsecSinceEpoch)
Send an AX.25 frame to all the listeners expecting to process raw frames, |
protected AX25Frame |
fireConsumeFrame(byte[] buf,
int offset,
int length,
long rcptTimeInMsecSinceEpoch)
Extract an AX.25 frame from a byte array and send it to all the listeners expecting to process raw frames, |
void |
fireFailed()
Report to interested listeners that the port has failed for some reason. |
void |
fireReceiving(boolean isReceiving)
Report to interested listeners that the port has started or stopped receiving. |
protected void |
fireTransmitting(boolean isTransmitting)
Report to interested listeners that the port has started or stopped transmitting. |
static java.lang.Class<? extends PortConnector> |
getPortConnectorClass(java.lang.String portTypeName)
Get the class corresponding to a particular port type name. |
static java.util.Collection<java.lang.Class<? extends PortConnector>> |
portConnectorClasses()
Get all the concrete subclasses of PortConnector currently registered in YAAC for which instances can be created and configured. |
static java.util.Set<java.lang.String> |
portTypeNames()
Get all the registered PortConnector names that should be displayed in the port configuration dialog as a port type. |
static void |
registerPortConnectorType(java.lang.String typeName,
java.lang.Class<? extends PortConnector> pcClazz)
Add a new subclass of PortConnector to the supported map of PortConnector types. |
static void |
removeFrameListener(FrameListener l)
Remove an object that used to be informed about incoming raw AX.25 frames. |
void |
removePortEventListener(PortEventListener l)
Unregister a listener so it no longer is informed of transmission and reception events. |
void |
setPortConfig(PortConfig portConfig)
Store the configuration associated with this PortConnector. |
Methods inherited from class org.ka2ddo.ax25.Connector |
---|
close, finalize, getCallsign, getCapabilities, getStats, hasCapability, isOpen |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public PortConfig portConfig
public PortConfig.Cfg currentCfg
Constructor Detail |
---|
public PortConnector()
Method Detail |
---|
public static void registerPortConnectorType(java.lang.String typeName, java.lang.Class<? extends PortConnector> pcClazz)
typeName
- String name of PortConnector subclasspcClazz
- the Class object for instantiating objects of this typepublic static java.util.Set<java.lang.String> portTypeNames()
public static java.util.Collection<java.lang.Class<? extends PortConnector>> portConnectorClasses()
public static java.lang.Class<? extends PortConnector> getPortConnectorClass(java.lang.String portTypeName)
portTypeName
- String name of port connector type
public static void addFrameListener(FrameListener l)
l
- FrameListener to addpublic static void removeFrameListener(FrameListener l)
l
- FrameListener to unregisterpublic void addPortEventListener(PortEventListener l)
l
- PortEventListener to registerpublic void removePortEventListener(PortEventListener l)
l
- PortEventListener to unregisterprotected AX25Frame fireConsumeFrame(byte[] buf, int offset, int length, long rcptTimeInMsecSinceEpoch)
buf
- byte array supposedly containing an AX.25 frameoffset
- zero-based index into byte array where frame startslength
- number of consecutive bytes in buffer that make up the framercptTimeInMsecSinceEpoch
- time since Unix epoch when frame started arriving
public static void fireConsumeFrame(AX25Frame frame, long rcptTimeInMsecSinceEpoch)
frame
- AX25Frame to processrcptTimeInMsecSinceEpoch
- time since Unix epoch when frame started arrivingprotected void fireTransmitting(boolean isTransmitting)
isTransmitting
- boolean true if transmission has started, false if stoppedpublic void fireReceiving(boolean isReceiving)
isReceiving
- boolean true if reception has started, false if stoppedpublic void fireFailed()
public static PortConnector createPort(PortConfig cfg) throws java.net.UnknownServiceException, java.io.IOException
cfg
- PortConfig object identifying what type of port to create
java.io.IOException
- if port could not be instantiated
java.net.UnknownServiceException
- if port type not recognizedpublic abstract void configure(PortConfig cfg) throws java.io.IOException, java.lang.IllegalArgumentException
cfg
- PortConfig defining new port settings
java.io.IOException
- if interface changes could not be applied
java.lang.IllegalArgumentException
- if type information is invalid for
changing the settings of this PortConnectorpublic void setPortConfig(PortConfig portConfig)
portConfig
- PortConfig matching the PortConnector subclass's type
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |