hypercast
Class RouteRecord

java.lang.Object
  |
  +--hypercast.Extension
        |
        +--hypercast.RouteRecord

public class RouteRecord
extends Extension

This class defines the route record of an OL_Message. It stores a sequence of logical addresses of the nodes this message passed through.


Field Summary
 
Fields inherited from class hypercast.Extension
FSM, HEADER_NONE, RAW_DATA, ROUTE_RECORD, SECURITY
 
Constructor Summary
RouteRecord()
          Constructs a empty route record.
RouteRecord(byte[] contents, hypercast.I_Node node)
          Constructs the route record from an byte array.
RouteRecord(hypercast.RouteRecord old_rr)
          Constructs a route record by cloning the given route record instance.
 
Method Summary
 hypercast.Extension Clone()
          Return a new RouteRecord extension instance by cloning this extension.
 boolean contains(hypercast.I_LogicalAddress query)
          Checks if the specified logical address is contained in this RouteRecord.
 byte getExtensionType()
          Returns the type of extension.
 int getSize()
          Returns the length of the byte array of this extension.
 void insertLA(hypercast.I_LogicalAddress la, int max_size)
          Deprecated. use insertLogicalAddress
 void insertLogicalAddress(hypercast.I_LogicalAddress la, int max_size)
          Inserts a logical address to the route record
 byte[] toByteArray()
          Returns the byte array of the extension header.
 
Methods inherited from class hypercast.Extension
createExtension, createExtension, createExtension, createExtension, createExtension, isValidHeader, toString, typeToString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RouteRecord

public RouteRecord()
Constructs a empty route record.


RouteRecord

public RouteRecord(hypercast.RouteRecord old_rr)
Constructs a route record by cloning the given route record instance.


RouteRecord

public RouteRecord(byte[] contents,
                   hypercast.I_Node node)
Constructs the route record from an byte array.

Parameters:
contents - the overlay message
node - the node used to construct logical address
Method Detail

Clone

public hypercast.Extension Clone()
Return a new RouteRecord extension instance by cloning this extension.

Specified by:
Clone in class Extension

getExtensionType

public byte getExtensionType()
Returns the type of extension.

Specified by:
getExtensionType in class Extension

getSize

public int getSize()
Returns the length of the byte array of this extension.

Specified by:
getSize in class Extension

insertLA

public void insertLA(hypercast.I_LogicalAddress la,
                     int max_size)
Deprecated. use insertLogicalAddress

Inserts a logical address to the route record

Parameters:
la - the address to be inserted

insertLogicalAddress

public void insertLogicalAddress(hypercast.I_LogicalAddress la,
                                 int max_size)
Inserts a logical address to the route record

Parameters:
la - the address to be inserted

toByteArray

public byte[] toByteArray()
Returns the byte array of the extension header.

Specified by:
toByteArray in class Extension

contains

public boolean contains(hypercast.I_LogicalAddress query)
Checks if the specified logical address is contained in this RouteRecord.

Parameters:
query - The logical address for which the search is being done.
Returns:
true if the logical address is contained in the record, false otherwise.