public class SendableMessageWrapper extends java.lang.Object implements AX25FrameSource, java.io.Serializable
| Constructor and Description |
|---|
SendableMessageWrapper(SendableMessage msg)
Wrap a SendableMessage for one transmission cycle with the default proportional pathing path set.
|
SendableMessageWrapper(SendableMessage msg,
int maxRetries)
Wrap a SendableMessage for the specified number of transmission cycles with the default proportional pathing path set.
|
SendableMessageWrapper(SendableMessage msg,
java.lang.String[] relays)
Wrap a SendableMessage for one transmission cycle with the specified proportional pathing path set.
|
SendableMessageWrapper(SendableMessage msg,
java.lang.String[] relays,
int maxRetries)
Wrap a SendableMessage for the specified number of transmission cycles with the specified proportional pathing path set.
|
| Modifier and Type | Method and Description |
|---|---|
static AX25Frame |
buildAX25FrameForMessage(java.lang.String[] relays,
SendableMessage msg,
int numTransmissions,
byte protocolId,
java.lang.String senderCallsign)
Convert a SendableMessage object into a transmittable AX.25 frame, ready to send via KISS
protocol to a TNC/radio.
|
void |
cancelPermanently(boolean isGuiDispatchThread)
Delete this SendableMessageWrapper from the transmission queue.
|
void |
cancelTransmission(boolean isGuiDispatchThread)
Stop trying to transmit this message, but still keep track of it in the model.
|
protected void |
cleanup()
Do any cleanup work involved in removing this wrapped message from the
transmission queue.
|
void |
computeRandomizedTransmitTime()
Set the first time for this SendableMessage to transmit, so all the ones being started at
YAAC startup time don't pile out at one time.
|
static SendableMessageWrapper |
findWrapperOf(SendableMessage sm)
Find any wrapper outstanding for the specified SendableMessage.
|
Connector |
getConnector()
Get the port to which this message should be sent.
|
java.lang.String[] |
getDigipeatPaths()
Get the proportional pathing ordered set of digipeat paths.
|
int |
getFastSendRate()
Get the fast retransmission rate for this message.
|
AX25Frame[] |
getFrames(boolean incrementXmtCount,
byte protocolId,
java.lang.String senderCallsign)
Get one or more AX25Frames of the data to transmit.
|
int |
getId()
Get the internal sequence ID assigned to this wrapper
|
long |
getLastTransmitTime() |
int |
getMaxTransmits()
Get the maximum number of transmissions allowed for this message.
|
SendableMessage |
getMsg()
Get the SendableMessage wrapped in this object
|
SendableMessageWrapper |
getNextMessage()
Get the next message in a chain of linked outgoing messages.
|
int |
getNumTransmissions()
Get the number of times this message has been transmitted.
|
int |
getNumTransmitsBeforeDecay()
Get the number of times the message will be transmitted before the transmission rate is slowed.
|
static java.util.ArrayList<SendableMessageWrapper> |
getObjectsInGroup(java.lang.String groupName)
Search the list of outgoing messages for local Objects tagged with the specified QRU group.
|
static java.util.Vector<SendableMessageWrapper> |
getOutstandingMessages()
Get a reference to the vector of outstanding locally originated messages.
|
static java.util.HashMap<java.lang.String,int[]> |
getQruGroupCounts()
Get a map of all the QRU groups known to have locally originated objects on this
station, and return the count of objects per group.
|
int |
getRemainingTransmits()
Get the number of transmissions remaining until the message has been sent.
|
int |
getSlowSendRate()
Get the slow retransmission rate for this message.
|
boolean |
isActive()
Report whether this SendableMessageWrapper is still queued for upcoming transmissions.
|
boolean |
isRejected()
Report whether this message was rejected by its recipient.
|
void |
queueForTransmission()
Put this SendableMessageWrapper on the list of messages to be transmitted and start transmitting it
according to its transmit parameters.
|
static void |
removeObsoleteMessage(Message msg,
boolean isGuiDispatchThread)
Find and cancel any queued messages matching the passed message.
|
static void |
removeObsoleteMessage(SendableMessageWrapper smw,
boolean isGuiDispatchThread)
Find and cancel any queued messages matching the passed message.
|
void |
resetTransmitCount(boolean isGuiDispatchThread)
Reset the retransmission counters as if this was a brand-new message using the initial
fast transmission rate.
|
void |
setFastSendRate(int fastSendRate)
Set the fast retransmission rate for this message.
|
void |
setMaxTransmits(int maxTransmits)
Get the maximum number of transmissions allowed for this message.
|
void |
setNextMessage(SendableMessageWrapper nextMessage)
Set the message after this message in a chain of sequenced messages.
|
void |
setRejected(boolean rejected)
Indicate that this message has been rejected.
|
static void |
setSendableMessageListener(SendableMessageListener l) |
void |
setSlowSendRate(int slowSendRate)
Set the slow retransmission rate for this message.
|
java.lang.String |
toString()
Returns a string representation of the object.
|
public SendableMessageWrapper(SendableMessage msg)
msg - SendableMessage to transmitpublic SendableMessageWrapper(SendableMessage msg, java.lang.String[] relays)
msg - SendableMessage to transmitrelays - ordered array of digipeat paths for proportional pathing (1-element array to not use proportional pathing)public SendableMessageWrapper(SendableMessage msg, int maxRetries)
msg - SendableMessage to transmitmaxRetries - number of times (times 2^N length of proportional path set) the message should be transmittedpublic SendableMessageWrapper(SendableMessage msg, java.lang.String[] relays, int maxRetries)
msg - SendableMessage to transmitrelays - ordered array of digipeat paths for proportional pathing (1-element array to not use proportional pathing)maxRetries - number of times (times 2^N length of proportional path set) the message should be transmittedpublic static void setSendableMessageListener(SendableMessageListener l)
public SendableMessage getMsg()
public AX25Frame[] getFrames(boolean incrementXmtCount, byte protocolId, java.lang.String senderCallsign)
getFrames in interface AX25FrameSourceincrementXmtCount - indicate whether the transmit counter (used to cycle through
proportional pathing) should be incrementedprotocolId - indicate the protocol to generate this frame for (not relevant for
digipeated frames); zero to indicate current protocolsenderCallsign - String of local callsign sending this message (may be ignored if digipeating
a message from another station)public static AX25Frame buildAX25FrameForMessage(java.lang.String[] relays, SendableMessage msg, int numTransmissions, byte protocolId, java.lang.String senderCallsign)
relays - digipeater to specify in the AX.25 framemsg - the SendableMessage to encapsulate in an AX.25 framenumTransmissions - number of times the message has been transmitted.protocolId - AX.25 protocol ID to generate the message in; currently,
only NOLVL3 (APRS) and OPENTRAC are supported.senderCallsign - String of local callsign sending this message (may be ignored if digipeating
a message from another station)public int getNumTransmitsBeforeDecay()
getNumTransmitsBeforeDecay in interface AX25FrameSourcepublic long getLastTransmitTime()
public int getNumTransmissions()
public void resetTransmitCount(boolean isGuiDispatchThread)
isGuiDispatchThread - boolean true if caller is the GUI dispatch threadpublic int getFastSendRate()
public void setFastSendRate(int fastSendRate)
fastSendRate - fast retransmit rate in secondspublic int getSlowSendRate()
public void setSlowSendRate(int slowSendRate)
slowSendRate - slow retransmission rate in secondspublic SendableMessageWrapper getNextMessage()
public void setNextMessage(SendableMessageWrapper nextMessage)
nextMessage - SendableMessageWrapper around the next message after this one, or null for no next messagepublic Connector getConnector()
getConnector in interface AX25FrameSourceConnector.CAP_XMT_PACKET_DATApublic static java.util.Vector<SendableMessageWrapper> getOutstandingMessages()
public static SendableMessageWrapper findWrapperOf(SendableMessage sm)
sm - SendableMessage to look for in queuepublic static java.util.HashMap<java.lang.String,int[]> getQruGroupCounts()
public static java.util.ArrayList<SendableMessageWrapper> getObjectsInGroup(java.lang.String groupName)
groupName - QRU category namepublic boolean isRejected()
public void setRejected(boolean rejected)
rejected - the new setting of the rejected boolean flagpublic void queueForTransmission()
public void cancelTransmission(boolean isGuiDispatchThread)
isGuiDispatchThread - boolean true if caller is the GUI dispatch threadprotected void cleanup()
public void cancelPermanently(boolean isGuiDispatchThread)
isGuiDispatchThread - boolean true if caller is the GUI dispatch threadpublic static void removeObsoleteMessage(Message msg, boolean isGuiDispatchThread)
msg - Message to compare against queued messagesisGuiDispatchThread - boolean true if caller is the GUI dispatch threadpublic static void removeObsoleteMessage(SendableMessageWrapper smw, boolean isGuiDispatchThread)
smw - SendableMessageWrapper to compare against queued messagesisGuiDispatchThread - boolean true if caller is the GUI dispatch threadpublic void computeRandomizedTransmitTime()
public boolean isActive()
public int getRemainingTransmits()
public int getMaxTransmits()
public void setMaxTransmits(int maxTransmits)
maxTransmits - maximum number of transmissionspublic java.lang.String[] getDigipeatPaths()
public java.lang.String toString()
toString method returns a string that
"textually represents" this object.toString in class java.lang.Objectpublic int getId()