You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.6 KiB
59 lines
1.6 KiB
package network.Messages;
|
|
|
|
|
|
import network.Messages.Enums.MessageType;
|
|
|
|
import java.io.InputStream;
|
|
|
|
/**
|
|
* 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;
|
|
|
|
/**
|
|
* Constructor for an 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){
|
|
super(MessageType.XMLMESSAGE);
|
|
this.ackNumber = ackNumber;
|
|
this.timeStamp = timeStamp;
|
|
this.xmlMsgSubType = xmlMsgSubType;
|
|
this.sequenceNumber = sequenceNumber;
|
|
this.xmlMsgLength = xmlMsgLength;
|
|
this.xmlMessage = xmlMessage;
|
|
}
|
|
|
|
/**
|
|
* Get the XML Message
|
|
* @return the XML message as an input stream
|
|
*/
|
|
public InputStream getXmlMessage() {
|
|
return xmlMessage;
|
|
}
|
|
|
|
/**
|
|
* Get the type of message
|
|
* @return Gets the type of message the XML message is
|
|
*/
|
|
public int getXmlMsgSubType() {
|
|
return xmlMsgSubType;
|
|
}
|
|
}
|