LatestMessages can hold MarkRounding messages. It also holds XMLMessage for each message type.
MockOutput now uses LatestMessages for xml messages. Moved xml message encoding into RaceVisionByteEncoder. Removed XMLMessageEncoder. Moved XML message sub types into an enumeration (XMLMessageType). XMLMessage can now be queried for its attributes (like timestamp, length, etc...). VisualiserInput now uses LatestMessages. VisualiserInput now (as it did previously) uses switch statements for checking packet type, instead of if statements. VisualiserRace now uses LatestMessages instead of VisualiserInput.
This commit is contained in:
@@ -151,7 +151,7 @@ public class BinaryMessageDecoder {
|
||||
//System.out.println("XML Message!");
|
||||
XMLMessageDecoder xmdecoder = new XMLMessageDecoder(messageBody);
|
||||
xmdecoder.decode();
|
||||
return new XMLMessage(xmdecoder.getAckNumber(), xmdecoder.getTimeStamp(), xmdecoder.getXmlMsgSubType(), xmdecoder.getSequenceNumber(), xmdecoder.getXmlMsgLength(), xmdecoder.getXmlMessageInputStream());
|
||||
return new XMLMessage(XMLMessage.currentVersionNumber, xmdecoder.getAckNumber(), xmdecoder.getTimeStamp(), xmdecoder.getXmlMsgSubType(), xmdecoder.getSequenceNumber(), xmdecoder.getXmlMessageContents());
|
||||
|
||||
case RACESTARTSTATUS:
|
||||
//System.out.println("Race Start Status Message");
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package network.MessageDecoders;
|
||||
|
||||
import network.Messages.Enums.XMLMessageType;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
@@ -42,7 +44,7 @@ public class XMLMessageDecoder {
|
||||
|
||||
this.sequenceNumber = bytesToShort(sequenceNumberBytes);
|
||||
this.xmlMsgLength = bytesToShort(xmlMsgLengthBytes);
|
||||
this.xmlMessage = new String(xmlMessagebytes);
|
||||
this.xmlMessage = new String(xmlMessagebytes).trim();
|
||||
}
|
||||
|
||||
public byte getMessageVersionNumber() {
|
||||
@@ -57,8 +59,8 @@ public class XMLMessageDecoder {
|
||||
return timeStamp;
|
||||
}
|
||||
|
||||
public byte getXmlMsgSubType() {
|
||||
return xmlMsgSubType;
|
||||
public XMLMessageType getXmlMsgSubType() {
|
||||
return XMLMessageType.fromByte(xmlMsgSubType);
|
||||
}
|
||||
|
||||
public short getSequenceNumber() {
|
||||
@@ -69,14 +71,14 @@ public class XMLMessageDecoder {
|
||||
return xmlMsgLength;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* this will be used latter for the vis
|
||||
* @return xml string as inputsource
|
||||
* Returns the contents of the XML message (e.g., the contents of a race.xml file).
|
||||
* @return The contents of the XML message.
|
||||
*/
|
||||
public InputStream getXmlMessageInputStream() {
|
||||
InputStream is = new ByteArrayInputStream(xmlMessage.trim().getBytes(StandardCharsets.UTF_8));
|
||||
// InputSource is = new InputSource(new StringReader(xmlMessage.trim()));
|
||||
return is;
|
||||
public String getXmlMessageContents() {
|
||||
return xmlMessage;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import network.Messages.*;
|
||||
import static network.Utils.ByteConverter.*;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -18,13 +19,16 @@ public class RaceVisionByteEncoder {
|
||||
|
||||
/**
|
||||
* Serializes a heartbeat message.
|
||||
* @param seq Heartbeat value.
|
||||
* @param heartbeat Heartbeat message.
|
||||
* @return Serialized message.
|
||||
*/
|
||||
public static byte[] heartBeat(long seq){
|
||||
public static byte[] heartBeat(Heartbeat heartbeat) {
|
||||
|
||||
ByteBuffer heartBeat = ByteBuffer.allocate(4);
|
||||
heartBeat.put(longToBytes(seq, 4));
|
||||
byte [] result = heartBeat.array();
|
||||
heartBeat.put(longToBytes(heartbeat.getSequenceNumber(), 4));
|
||||
|
||||
byte[] result = heartBeat.array();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -176,6 +180,44 @@ public class RaceVisionByteEncoder {
|
||||
return result.array();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Serializes an xml message into a byte array.
|
||||
* @param xmlMessage The message to serialize.
|
||||
* @return byte array contaning serialized message.
|
||||
*/
|
||||
public static byte[] xmlMessage(XMLMessage xmlMessage) {
|
||||
|
||||
|
||||
byte[] messageBytes = xmlMessage.getXmlMessage().getBytes(StandardCharsets.UTF_8);
|
||||
|
||||
ByteBuffer tempOutputByteBuffer = ByteBuffer.allocate(14 + messageBytes.length);
|
||||
|
||||
//ackNumber converted to bytes
|
||||
byte[] ackNumberBytes = intToBytes(xmlMessage.getAckNumber(), 2);
|
||||
|
||||
//Timestamp converted to bytes.
|
||||
byte[] timestampBytes = longToBytes(xmlMessage.getTimeStamp(), 6);
|
||||
|
||||
//sequenceNumber converted to bytes
|
||||
byte[] sequenceNumberBytes = intToBytes(xmlMessage.getSequenceNumber(), 2);
|
||||
|
||||
//xmlMsgLength converted to bytes
|
||||
byte[] xmlMsgLengthBytes = intToBytes(xmlMessage.getXmlMsgLength(), 2);
|
||||
|
||||
|
||||
tempOutputByteBuffer.put(xmlMessage.getVersionNumber());
|
||||
tempOutputByteBuffer.put(ackNumberBytes);
|
||||
tempOutputByteBuffer.put(timestampBytes);
|
||||
tempOutputByteBuffer.put(xmlMessage.getXmlMsgSubType().getValue());
|
||||
tempOutputByteBuffer.put(sequenceNumberBytes);
|
||||
tempOutputByteBuffer.put(xmlMsgLengthBytes);
|
||||
tempOutputByteBuffer.put(messageBytes);
|
||||
|
||||
return tempOutputByteBuffer.array();
|
||||
|
||||
}
|
||||
|
||||
public static byte[] boatLocation(BoatLocation boatLocation){
|
||||
int messageVersionNumber = 0b1;
|
||||
byte[] time = longToBytes(boatLocation.getTime(), 6);
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
package network.MessageEncoders;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import static network.Utils.ByteConverter.*;
|
||||
|
||||
|
||||
/**
|
||||
* Encodes a XML file into a message of AC35 format
|
||||
*/
|
||||
public class XMLMessageEncoder {
|
||||
private byte[] messageVersionNumber;
|
||||
private short ackNumber;
|
||||
private long timeStamp;
|
||||
private byte[] xmlMsgSubType;
|
||||
private short sequenceNumber;
|
||||
private short xmlMsgLength;
|
||||
private String xmlMessage;
|
||||
|
||||
public XMLMessageEncoder(short ackNumber, long timeStamp, int xmlMsgSubType, short sequenceNumber, short xmlMsgLength, String xmlMessage) {
|
||||
this.messageVersionNumber = intToBytes(1, 1);
|
||||
this.ackNumber = ackNumber;
|
||||
this.timeStamp = timeStamp;
|
||||
this.xmlMsgSubType = intToBytes(xmlMsgSubType, 1);
|
||||
this.sequenceNumber = sequenceNumber;
|
||||
this.xmlMsgLength = xmlMsgLength;
|
||||
this.xmlMessage = xmlMessage;
|
||||
}
|
||||
|
||||
public byte[] encode() {
|
||||
byte[] messageBytes = xmlMessage.getBytes();
|
||||
if (messageBytes.length > this.xmlMsgLength) {
|
||||
//System.err.println("Xml message is to big");
|
||||
return null;
|
||||
}
|
||||
ByteBuffer tempOutputByteBuffer = ByteBuffer.allocate(14 + messageBytes.length);
|
||||
|
||||
//ackNumber converted to bytes
|
||||
byte[] ackNumberBytes = shortToBytes(ackNumber, 2);
|
||||
|
||||
//sequenceNumber converted to bytes
|
||||
byte[] sequenceNumberBytes = shortToBytes(sequenceNumber, 2);
|
||||
|
||||
//xmlMsgLength converted to bytes
|
||||
byte[] xmlMsgLengthBytes = shortToBytes(xmlMsgLength, 2);
|
||||
|
||||
|
||||
tempOutputByteBuffer.put(messageVersionNumber);
|
||||
tempOutputByteBuffer.put(ackNumberBytes);
|
||||
tempOutputByteBuffer.put(longToBytes(timeStamp, 6));
|
||||
tempOutputByteBuffer.put(xmlMsgSubType);
|
||||
tempOutputByteBuffer.put(sequenceNumberBytes);
|
||||
tempOutputByteBuffer.put(xmlMsgLengthBytes);
|
||||
tempOutputByteBuffer.put(messageBytes);
|
||||
|
||||
return tempOutputByteBuffer.array();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,7 +8,9 @@ import network.Messages.Enums.MessageType;
|
||||
*/
|
||||
public abstract class AC35Data {
|
||||
|
||||
///Message type from the header.
|
||||
/**
|
||||
* Message type from the header.
|
||||
*/
|
||||
private MessageType type;
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
package network.Messages.Enums;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Enumeration that encapsulates the various types of XML messages that can be sent.
|
||||
*/
|
||||
public enum XMLMessageType {
|
||||
|
||||
/**
|
||||
* A regatta.xml message.
|
||||
*/
|
||||
REGATTA(5),
|
||||
|
||||
/**
|
||||
* A race.xml message.
|
||||
*/
|
||||
RACE(6),
|
||||
|
||||
/**
|
||||
* A boats.xml message.
|
||||
*/
|
||||
BOAT(7),
|
||||
|
||||
/**
|
||||
* Used for unrecognised byte values.
|
||||
*/
|
||||
NOT_A_MESSAGE_TYPE(0);
|
||||
|
||||
|
||||
///Primitive value of the enum.
|
||||
private byte value;
|
||||
|
||||
/**
|
||||
* Ctor. Creates a XMLMessageType enum from a given primitive integer value, cast to a byte.
|
||||
* @param value Integer, which is cast to byte, to construct from.
|
||||
*/
|
||||
private XMLMessageType(int value) {
|
||||
this.value = (byte)value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the primitive value of the enum.
|
||||
* @return Primitive value of the enum.
|
||||
*/
|
||||
public byte getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
///Stores a mapping between Byte values and XMLMessageType values.
|
||||
private static final Map<Byte, XMLMessageType> byteToTypeMap = new HashMap<>();
|
||||
|
||||
|
||||
/*
|
||||
Static initialization block. Initializes the byteToTypeMap.
|
||||
*/
|
||||
static {
|
||||
for (XMLMessageType type : XMLMessageType.values()) {
|
||||
byteToTypeMap.put(type.value, type);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the enumeration value which corresponds to a given byte value.
|
||||
* @param messageTypeByte Byte value to convert to a XMLMessageType value.
|
||||
* @return The XMLMessageType value which corresponds to the given byte value.
|
||||
*/
|
||||
public static XMLMessageType fromByte(byte messageTypeByte) {
|
||||
//Gets the corresponding XMLMessageType from the map.
|
||||
XMLMessageType type = byteToTypeMap.get(messageTypeByte);
|
||||
|
||||
if (type == null) {
|
||||
//If the byte value wasn't found, return the NOTAMESSAGE XMLMessageType.
|
||||
return XMLMessageType.NOT_A_MESSAGE_TYPE;
|
||||
}
|
||||
else {
|
||||
//Otherwise, return the XMLMessageType.
|
||||
return type;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -8,7 +8,9 @@ import network.Messages.Enums.MessageType;
|
||||
*/
|
||||
public class Heartbeat extends AC35Data {
|
||||
|
||||
///Sequence number of the heartbeat.
|
||||
/**
|
||||
* Sequence number of the heartbeat.
|
||||
*/
|
||||
private long sequenceNumber;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package network.Messages;
|
||||
|
||||
import network.Messages.Enums.XMLMessageType;
|
||||
import shared.dataInput.RaceDataSource;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -23,6 +26,11 @@ public class LatestMessages {
|
||||
*/
|
||||
private final Map<Integer, BoatLocation> boatLocationMap = new HashMap<>();
|
||||
|
||||
/**
|
||||
* A map of the last MarkRounding message received, for each boat.
|
||||
*/
|
||||
private final Map<Integer, MarkRounding> markRoundingMap = new HashMap<>();
|
||||
|
||||
/**
|
||||
* The last AverageWind message received.
|
||||
*/
|
||||
@@ -34,6 +42,22 @@ public class LatestMessages {
|
||||
private CourseWinds courseWinds;
|
||||
|
||||
|
||||
/**
|
||||
* The latest race data XML message.
|
||||
*/
|
||||
private XMLMessage raceXMLMessage;
|
||||
|
||||
/**
|
||||
* The latest boat data XML message.
|
||||
*/
|
||||
private XMLMessage boatXMLMessage;
|
||||
|
||||
/**
|
||||
* The latest regatta data XML message.
|
||||
*/
|
||||
private XMLMessage regattaXMLMessage;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@@ -100,6 +124,24 @@ public class LatestMessages {
|
||||
boatLocationMap.put(boatLocation.getSourceID(), boatLocation);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the latest MarkRounding message received for a given boat.
|
||||
* @param sourceID Source ID of the boat.
|
||||
* @return The latest MarkRounding message for the specified boat.
|
||||
*/
|
||||
public MarkRounding getMarkRounding(int sourceID) {
|
||||
return markRoundingMap.get(sourceID);
|
||||
}
|
||||
|
||||
/**
|
||||
* Inserts a MarkRounding message for a given boat.
|
||||
* @param markRounding The MarkRounding message to set.
|
||||
*/
|
||||
public void setMarkRounding(MarkRounding markRounding) {
|
||||
//TODO should compare the sequence number of the new boatLocation with the existing boatLocation for this boat (if it exists), and use the newer one.
|
||||
markRoundingMap.put(markRounding.getSourceID(), markRounding);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@@ -136,7 +178,115 @@ public class LatestMessages {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the map of boat sourceIDs to BoatLocation messages.
|
||||
* @return Map between boat sourceID and BoatLocation.
|
||||
*/
|
||||
public Map<Integer, BoatLocation> getBoatLocationMap() {
|
||||
return boatLocationMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the map of boat sourceIDs to BoatStatus messages.
|
||||
* @return Map between boat sourceID and BoatStatus.
|
||||
*/
|
||||
public Map<Integer, BoatStatus> getBoatStatusMap() {
|
||||
return boatStatusMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the map of boat sourceIDs to MarkRounding messages.
|
||||
* @return Map between boat sourceID and MarkRounding.
|
||||
*/
|
||||
public Map<Integer, MarkRounding> getMarkRoundingMap() {
|
||||
return markRoundingMap;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Returns the latest race xml message.
|
||||
* @return The latest race xml message.
|
||||
*/
|
||||
public XMLMessage getRaceXMLMessage() {
|
||||
return raceXMLMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the latest race xml message to a specified race XML message.
|
||||
* @param raceXMLMessage The new race XML message to use.
|
||||
*/
|
||||
public void setRaceXMLMessage(XMLMessage raceXMLMessage) {
|
||||
this.raceXMLMessage = raceXMLMessage;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the latest boat xml message.
|
||||
* @return The latest boat xml message.
|
||||
*/
|
||||
public XMLMessage getBoatXMLMessage() {
|
||||
return boatXMLMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the latest boat xml message to a specified boat XML message.
|
||||
* @param boatXMLMessage The new boat XML message to use.
|
||||
*/
|
||||
public void setBoatXMLMessage(XMLMessage boatXMLMessage) {
|
||||
this.boatXMLMessage = boatXMLMessage;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the latest regatta xml message.
|
||||
* @return The latest regatta xml message.
|
||||
*/
|
||||
public XMLMessage getRegattaXMLMessage() {
|
||||
return regattaXMLMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the latest regatta xml message to a specified regatta XML message.
|
||||
* @param regattaXMLMessage The new regatta XML message to use.
|
||||
*/
|
||||
public void setRegattaXMLMessage(XMLMessage regattaXMLMessage) {
|
||||
this.regattaXMLMessage = regattaXMLMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the type of xml message, and places it in this LatestMessages object.
|
||||
* @param xmlMessage The new xml message to use.
|
||||
*/
|
||||
public void setXMLMessage(XMLMessage xmlMessage) {
|
||||
|
||||
if (xmlMessage.getXmlMsgSubType() == XMLMessageType.RACE) {
|
||||
this.setRaceXMLMessage(xmlMessage);
|
||||
|
||||
} else if (xmlMessage.getXmlMsgSubType() == XMLMessageType.REGATTA) {
|
||||
this.setRegattaXMLMessage(xmlMessage);
|
||||
|
||||
} else if (xmlMessage.getXmlMsgSubType() == XMLMessageType.BOAT) {
|
||||
this.setBoatXMLMessage(xmlMessage);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether or not there is an xml message for each message type.
|
||||
* @return True if race, boat, and regatta have an xml message, false otherwise.
|
||||
*/
|
||||
public boolean hasAllXMLMessages() {
|
||||
|
||||
if ((this.regattaXMLMessage == null) || (this.boatXMLMessage == null) || (this.raceXMLMessage == null)) {
|
||||
return false;
|
||||
|
||||
} else {
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,49 +2,86 @@ package network.Messages;
|
||||
|
||||
|
||||
import network.Messages.Enums.MessageType;
|
||||
import network.Messages.Enums.XMLMessageType;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
/**
|
||||
* Created by fwy13 on 25/04/17.
|
||||
*/
|
||||
public class XMLMessage extends AC35Data {
|
||||
|
||||
private int ackNumber;
|
||||
private long timeStamp;
|
||||
private int xmlMsgSubType;
|
||||
private int sequenceNumber;
|
||||
private int xmlMsgLength;
|
||||
private InputStream xmlMessage;
|
||||
|
||||
public static int XMLTypeRegatta = 5;
|
||||
public static int XMLTypeRace = 6;
|
||||
public static int XMLTypeBoat = 7;
|
||||
/**
|
||||
* The current version number for xml messages is 1.
|
||||
*/
|
||||
public static byte currentVersionNumber = 1;
|
||||
|
||||
/**
|
||||
* The version number of the message.
|
||||
*/
|
||||
private byte versionNumber;
|
||||
|
||||
/**
|
||||
* The ack number of the message.
|
||||
*/
|
||||
private int ackNumber;
|
||||
|
||||
/**
|
||||
* The timestamp of the message.
|
||||
* Milliseconds since unix epoch.
|
||||
*/
|
||||
private long timeStamp;
|
||||
|
||||
/**
|
||||
* The subtype of the xml message (e.g., race xml message).
|
||||
*/
|
||||
private XMLMessageType xmlMsgSubType;
|
||||
|
||||
/**
|
||||
* The sequence number of this specific xml subtype.
|
||||
* Increments whenever the xml contents for a specific xml subtype changes.
|
||||
*/
|
||||
private int sequenceNumber;
|
||||
|
||||
/**
|
||||
* The length of the xml message.
|
||||
* Number of bytes.
|
||||
*/
|
||||
private int xmlMsgLength;
|
||||
|
||||
/**
|
||||
* The contents of the xml message.
|
||||
*/
|
||||
private String xmlMessage;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor for an XML Message
|
||||
* @param versionNumber The version number of the xml message.
|
||||
* @param ackNumber Number for acknowledgement inherited for the AC35Data Packet
|
||||
* @param timeStamp Time received
|
||||
* @param xmlMsgSubType Type of XML message
|
||||
* @param sequenceNumber Order that it has arrived in
|
||||
* @param xmlMsgLength Length of the xml message
|
||||
* @param xmlMessage XML message
|
||||
*/
|
||||
public XMLMessage(int ackNumber, long timeStamp, int xmlMsgSubType, int sequenceNumber, int xmlMsgLength, InputStream xmlMessage){
|
||||
public XMLMessage(byte versionNumber, int ackNumber, long timeStamp, XMLMessageType xmlMsgSubType, int sequenceNumber, String xmlMessage) {
|
||||
super(MessageType.XMLMESSAGE);
|
||||
this.versionNumber = versionNumber;
|
||||
this.ackNumber = ackNumber;
|
||||
this.timeStamp = timeStamp;
|
||||
this.xmlMsgSubType = xmlMsgSubType;
|
||||
this.sequenceNumber = sequenceNumber;
|
||||
this.xmlMsgLength = xmlMsgLength;
|
||||
this.xmlMsgLength = xmlMessage.getBytes(StandardCharsets.UTF_8).length;
|
||||
this.xmlMessage = xmlMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the XML Message
|
||||
* @return the XML message as an input stream
|
||||
* Get the XML Message.
|
||||
* @return the XML message as string.
|
||||
*/
|
||||
public InputStream getXmlMessage() {
|
||||
public String getXmlMessage() {
|
||||
return xmlMessage;
|
||||
}
|
||||
|
||||
@@ -52,7 +89,48 @@ public class XMLMessage extends AC35Data {
|
||||
* Get the type of message
|
||||
* @return Gets the type of message the XML message is
|
||||
*/
|
||||
public int getXmlMsgSubType() {
|
||||
public XMLMessageType getXmlMsgSubType() {
|
||||
return xmlMsgSubType;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the version number of this xml message.
|
||||
* @return The version number of this xml message.
|
||||
*/
|
||||
public byte getVersionNumber() {
|
||||
return versionNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the ack number of this xml message.
|
||||
* @return The ack number of this xml message.
|
||||
*/
|
||||
public int getAckNumber() {
|
||||
return ackNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the timestamp of this xml message.
|
||||
* @return The timestamp of this xml message.
|
||||
*/
|
||||
public long getTimeStamp() {
|
||||
return timeStamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sequence number of this xml message. This is specific to each message subtype.
|
||||
* @return The sequence number of this xml message.
|
||||
*/
|
||||
public int getSequenceNumber() {
|
||||
return sequenceNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the length, in number of bytes, of the xml message.
|
||||
* @return The length, in bytes, of the xml message.
|
||||
*/
|
||||
public int getXmlMsgLength() {
|
||||
return xmlMsgLength;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user