public class MessageMessage extends Message implements LimitedSendableMessage, AprsSignableMessage
Query
,
Serialized FormAX25Message.Precedence
SignableMessage.SignatureState
Modifier and Type | Field and Description |
---|---|
boolean |
acked
Flag indicating if a locally-originated message has been acknowledged.
|
java.lang.String |
addressee
Addressee of the message.
|
int |
numTransmissions
Number of times the message should be transmitted before giving up.
|
java.lang.String |
serialNumber
Sequence number of this message used for acknowledgment.
|
SignableMessage.SignatureState |
signatureState
Quality of the signature (if any) associated with this message.
|
appendCR, APRS_AND_OPENTRAC_AND_RAW, APRS_AND_RAW, comment, msgType, S_PERMANENT, S_PERMANENT_UC, symbolCode, symTableId
APRS_AND_OPENTRAC, ax25Frame, extensions, invalid, originatingCallsign, originatingDest, PERMANENT, rcptTime, thirdParty, timestamp, UTC
Constructor and Description |
---|
MessageMessage(byte[] body,
int offset,
java.lang.String tp,
long rcvTimestamp)
Decode a MessageMessage from a byte array.
|
MessageMessage(java.lang.String addressee,
java.lang.String body)
Create a new partially-initialized MessageMessage, suitable for transmission.
|
MessageMessage(java.lang.String addressee,
java.lang.String body,
java.lang.String serialNum)
Create a new partially-initialized MessageMessage, suitable for transmission.
|
Modifier and Type | Method and Description |
---|---|
boolean |
bodyEquals(AX25Message o)
Compare the contents of the body of the message, reporting if they match.
|
int |
compareTo(AX25Message o)
Compares this object with the specified object for order.
|
void |
disableForTransmit()
Specify that message should no longer be transmitted.
|
java.lang.String |
getAddressee()
Report the addressee of this message.
|
byte[] |
getBody(boolean countTransmission,
ProtocolFamily protocolId,
AX25Frame frame)
Get an instance of this message, suitable for transmitting.
|
java.lang.String |
getKeyAlias()
Get the alias for the key that should be used to sign this message at transmission time.
|
java.lang.String |
getQuery()
Test whether this MessageMessage contains a directed query (APRS protocol specification chapter 15).
|
java.lang.String |
getSignature()
Get the ASCII-encoded signature of this message.
|
SignableMessage.SignatureState |
getSignatureState()
Report the status of the signature of this message.
|
boolean |
isEnabled()
Test if message should still be transmitted.
|
boolean |
isSelfAddressed()
Indicate if this text message is self-addressed.
|
java.lang.String |
paramString()
Descriptive text about this message, to be included in the toString() method's response.
|
void |
setKeyAlias(java.lang.String alias)
Set the alias for the key that should be used to sign this message at transmission time.
|
void |
setMaxTransmits(int maxTransmits)
Specify the maximum number of times this message should be transmitted.
|
void |
setSignature(java.lang.String signature)
Set the ASCII-encoded signature of this message.
|
void |
writeToSigningBuf(java.io.DataOutput dos,
java.io.PrintWriter pw)
Write the appropriate part of the body of this message to the signing buffer.
|
decodeDatestamp, decodeHurricaneParams, decodeTimestamp, decodeWeatherParams, decodeWeatherParams, dup, encodeTimestamp, extractComment, extractComment, extractSymbol, formatBody, getComment, getExtensionString, getMsgType, getPrecedence, getProtocols, getSymbolCode, getSymTableId, hasWeather, inferSymbol, isAppendCR, isSymbolInferred, looksLikeLongFormatLatitude, setAppendCR, setComment, setSymbolCode, setSymTableId, toString
equals, extractSource, getAx25Frame, getExtension, getFirstDigipeat, getLastDigipeat, getNthDigipeat, getOriginalDestination, getOriginalSource, getOriginatingCallsign, getOriginatingDest, getRcptTime, getReadOnlyExtensionMap, getTimestamp, hashCode, hasPosition, hasThisFirstDigi, indexOf, indexOf, isDirect, isInvalid, isRf, onlyDigits, onlyDigits, onlyDigitsOrMinus, onlyDigitsOrPeriod, onlyDigitsOrSpace, onlyDigitsPlus, onlyPeriods, setAx25Frame, setInvalid, setOriginatingCallsign, setRcptTime, setTimestamp, split, storeExtension
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getOriginatingCallsign, getTimestamp
dup
public java.lang.String addressee
public java.lang.String serialNumber
public boolean acked
public int numTransmissions
public SignableMessage.SignatureState signatureState
public MessageMessage(byte[] body, int offset, java.lang.String tp, long rcvTimestamp)
body
- byte array containing the messageoffset
- index into the array where the message startstp
- third-party routing String, or null if not routed from another networkrcvTimestamp
- time in Java milliseconds since 1 Jan 1970 UTC when the message was receivedpublic MessageMessage(java.lang.String addressee, java.lang.String body)
addressee
- String addressee for the messagebody
- String body text of the messagepublic MessageMessage(java.lang.String addressee, java.lang.String body, java.lang.String serialNum)
addressee
- String addressee for the messagebody
- String body text of the messageserialNum
- String serial number for the message (indicates it should be acknowledged)public java.lang.String paramString()
paramString
in class Message
Message.toString()
public boolean bodyEquals(AX25Message o)
bodyEquals
in class Message
o
- another AX25Message to compare againstpublic int compareTo(AX25Message o)
compareTo
in interface java.lang.Comparable<AX25Message>
compareTo
in class Message
o
- the object to be compared.java.lang.ClassCastException
- if the specified object's type prevents it
from being compared to this object.public java.lang.String getAddressee()
public java.lang.String getQuery()
public byte[] getBody(boolean countTransmission, ProtocolFamily protocolId, AX25Frame frame)
getBody
in interface SendableMessage
countTransmission
- number of times the message has been transmittedprotocolId
- ProtocolFamily for this messageframe
- AX25Frame into which the message will be placed, so any alternate AX25Message can be linked to itAX25Frame.parsedAX25Msg
public boolean isEnabled()
isEnabled
in interface SendableMessage
public void disableForTransmit()
disableForTransmit
in interface SendableMessage
public void setMaxTransmits(int maxTransmits)
setMaxTransmits
in interface LimitedSendableMessage
maxTransmits
- non-negative number of transmits before this message should go idlepublic boolean isSelfAddressed()
public SignableMessage.SignatureState getSignatureState()
getSignatureState
in interface SignableMessage
public void setKeyAlias(java.lang.String alias)
setKeyAlias
in interface SignableMessage
alias
- String name that should match a secret key in the key managerpublic java.lang.String getKeyAlias()
getKeyAlias
in interface SignableMessage
public java.lang.String getSignature()
getSignature
in interface AprsSignableMessage
public void setSignature(java.lang.String signature)
setSignature
in interface AprsSignableMessage
signature
- String of the signature, or null to remove any pre-existing signaturepublic void writeToSigningBuf(java.io.DataOutput dos, java.io.PrintWriter pw)
writeToSigningBuf
in interface SignableMessage
dos
- DataOutput that will accept binary writes of the message datapw
- PrintWriter that will accept character writes of the message data