|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--edu.virginia.cs.mng.hypercast.DT.DT_Message
This class encapsulates a DT protocol message. The message contains a type (byte), a Overlay hash(int) and 4 AddressPairs. The Src and Dst AddressPairs can not both be null.
It is immutable.
| Field Summary | |
private DT_AddressPair |
CCW
Logical and Physical address of the neighbor of the sender immediately counterclockwise (CCW) of the destination. |
private DT_AddressPair |
CW
Logical and Physical address of the neighbor of the sender immediately clockwise (CW) of the destination. |
private DT_AddressPair |
Dst
Logical and Physical address of the destination. |
static byte |
Goodbye
A message type |
static byte |
HelloNeighbor
A message type |
static byte |
HelloNotNeighbor
A message type |
static byte |
NewNode
A message type |
static byte |
NodePing
A message type |
static byte |
NodePong
A message type |
private int |
overlayHash
A hash of Overlay properties. |
static byte |
ServerReply
A message type |
static byte |
ServerRequest
A message type |
private DT_AddressPair |
Src
Logical and Physical address of the sender. |
static byte |
TestMessage
A test type |
private byte |
Type
The protocol message type. |
| Constructor Summary | |
DT_Message(byte[] A,
I_UnicastAdapter adapter)
Creates a message from a byte array. |
|
DT_Message(DT_Message A)
Copy Constructor. |
|
DT_Message(int T,
int gh,
DT_AddressPair Src_arg,
DT_AddressPair Dst_arg,
DT_AddressPair CW_arg,
DT_AddressPair CCW_arg)
Construct a new DT_Message. |
|
| Method Summary | |
DT_AddressPair |
getCCW()
|
DT_LogicalAddress |
getCCWLA()
|
I_PhysicalAddress |
getCCWPA()
|
DT_AddressPair |
getCW()
|
DT_LogicalAddress |
getCWLA()
|
I_PhysicalAddress |
getCWPA()
|
DT_AddressPair |
getDst()
|
DT_LogicalAddress |
getDstLA()
|
I_PhysicalAddress |
getDstPA()
|
java.lang.String |
getLabel()
Returns a string dependant on the message type. |
DT_AddressPair |
getLeader()
the same as getCW |
DT_LogicalAddress |
getLeaderLA()
|
I_PhysicalAddress |
getLeaderPA()
|
int |
getOverlayHash()
Returns the overlayHash of this message. |
DT_AddressPair |
getSrc()
|
DT_LogicalAddress |
getSrcLA()
|
I_PhysicalAddress |
getSrcPA()
|
(package private) byte |
getType()
Returns the type of the message. |
static DT_Message |
restoreMessage(byte[] A,
int[] beginValidBytes,
int endValidBytes,
I_UnicastAdapter adapter,
int thisOverlayHash)
Creates a message, if possible, from a byte array. |
byte[] |
toByteArray()
Converts the message into a byte array for transmission. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
public static final byte HelloNeighbor
public static final byte HelloNotNeighbor
public static final byte Goodbye
public static final byte ServerRequest
public static final byte ServerReply
public static final byte NewNode
public static final byte NodePing
public static final byte NodePong
public static final byte TestMessage
private byte Type
private int overlayHash
private DT_AddressPair Src
private DT_AddressPair Dst
private DT_AddressPair CW
private DT_AddressPair CCW
| Constructor Detail |
public DT_Message(DT_Message A)
public DT_Message(int T,
int gh,
DT_AddressPair Src_arg,
DT_AddressPair Dst_arg,
DT_AddressPair CW_arg,
DT_AddressPair CCW_arg)
public DT_Message(byte[] A,
I_UnicastAdapter adapter)
adapter - used to create new PhysicalAddress from the byte array.| Method Detail |
public static DT_Message restoreMessage(byte[] A,
int[] beginValidBytes,
int endValidBytes,
I_UnicastAdapter adapter,
int thisOverlayHash)
adapter - used to create new PhysicalAddress from the byte array.public byte[] toByteArray()
public java.lang.String getLabel()
byte getType()
public int getOverlayHash()
public I_PhysicalAddress getSrcPA()
public I_PhysicalAddress getDstPA()
public I_PhysicalAddress getCCWPA()
public I_PhysicalAddress getCWPA()
public I_PhysicalAddress getLeaderPA()
public DT_LogicalAddress getSrcLA()
public DT_LogicalAddress getDstLA()
public DT_LogicalAddress getCCWLA()
public DT_LogicalAddress getCWLA()
public DT_LogicalAddress getLeaderLA()
public DT_AddressPair getSrc()
public DT_AddressPair getDst()
public DT_AddressPair getCCW()
public DT_AddressPair getCW()
public DT_AddressPair getLeader()
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||