udt.packets
Class ControlPacket

java.lang.Object
  extended by udt.packets.ControlPacket
All Implemented Interfaces:
Comparable<UDTPacket>, UDTPacket
Direct Known Subclasses:
Acknowledgement, Acknowledgment2, ConnectionHandshake, KeepAlive, MessageDropRequest, NegativeAcknowledgement, Shutdown, UserDefined

public abstract class ControlPacket
extends Object
implements UDTPacket


Nested Class Summary
static class ControlPacket.ControlPacketType
           
 
Field Summary
protected  long ackSequenceNumber
           
protected  byte[] controlInformation
           
protected  int controlPacketType
           
protected  long destinationID
           
protected  long messageNumber
           
protected  long timeStamp
           
 
Constructor Summary
ControlPacket()
           
 
Method Summary
 int compareTo(UDTPacket other)
           
abstract  byte[] encodeControlInformation()
          this method builds the control information from the control parameters
 boolean equals(Object obj)
           
 boolean forSender()
          return true if this packet should be routed to the UDTSender
 long getAckSequenceNumber()
           
 int getControlPacketType()
           
 long getDestinationID()
           
 byte[] getEncoded()
          complete header+ControlInformation packet for transmission
 byte[] getHeader()
          return the header according to specification p.5
 long getMessageNumber()
           
 long getPacketSequenceNumber()
           
 UDTSession getSession()
           
 long getTimeStamp()
           
 boolean isConnectionHandshake()
           
 boolean isControlPacket()
           
 void setAckSequenceNumber(long ackSequenceNumber)
           
 void setDestinationID(long destinationID)
           
 void setMessageNumber(long messageNumber)
           
 void setSession(UDTSession session)
           
 void setTimeStamp(long timeStamp)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

controlPacketType

protected int controlPacketType

ackSequenceNumber

protected long ackSequenceNumber

messageNumber

protected long messageNumber

timeStamp

protected long timeStamp

destinationID

protected long destinationID

controlInformation

protected byte[] controlInformation
Constructor Detail

ControlPacket

public ControlPacket()
Method Detail

getControlPacketType

public int getControlPacketType()
Specified by:
getControlPacketType in interface UDTPacket

getAckSequenceNumber

public long getAckSequenceNumber()

setAckSequenceNumber

public void setAckSequenceNumber(long ackSequenceNumber)

getMessageNumber

public long getMessageNumber()
Specified by:
getMessageNumber in interface UDTPacket

setMessageNumber

public void setMessageNumber(long messageNumber)
Specified by:
setMessageNumber in interface UDTPacket

getTimeStamp

public long getTimeStamp()
Specified by:
getTimeStamp in interface UDTPacket

setTimeStamp

public void setTimeStamp(long timeStamp)
Specified by:
setTimeStamp in interface UDTPacket

getDestinationID

public long getDestinationID()
Specified by:
getDestinationID in interface UDTPacket

setDestinationID

public void setDestinationID(long destinationID)
Specified by:
setDestinationID in interface UDTPacket

getHeader

public byte[] getHeader()
return the header according to specification p.5

Specified by:
getHeader in interface UDTPacket
Returns:

encodeControlInformation

public abstract byte[] encodeControlInformation()
this method builds the control information from the control parameters

Returns:

getEncoded

public byte[] getEncoded()
complete header+ControlInformation packet for transmission

Specified by:
getEncoded in interface UDTPacket

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

isControlPacket

public boolean isControlPacket()
Specified by:
isControlPacket in interface UDTPacket

forSender

public boolean forSender()
Description copied from interface: UDTPacket
return true if this packet should be routed to the UDTSender

Specified by:
forSender in interface UDTPacket
Returns:

isConnectionHandshake

public boolean isConnectionHandshake()
Specified by:
isConnectionHandshake in interface UDTPacket

getSession

public UDTSession getSession()
Specified by:
getSession in interface UDTPacket

setSession

public void setSession(UDTSession session)

getPacketSequenceNumber

public long getPacketSequenceNumber()
Specified by:
getPacketSequenceNumber in interface UDTPacket

compareTo

public int compareTo(UDTPacket other)
Specified by:
compareTo in interface Comparable<UDTPacket>


Copyright © 2013 LittleShoot. All Rights Reserved.