jist.swans.route
Class RouteZrpZdp.MessageZdp

java.lang.Object
  extended by jist.swans.route.RouteZrpZdp.MessageZdp
All Implemented Interfaces:
JistAPI.Timeless, Message, RouteInterface.Zrp.MessageIarp, RouteInterface.Zrp.MessageZrp
Enclosing class:
RouteZrpZdp

public static class RouteZrpZdp.MessageZdp
extends java.lang.Object
implements RouteInterface.Zrp.MessageIarp

ZDP (Zone Discovery Protocol) packet.

    todo: TBD (see draft ZDP specification)
  


Field Summary
 
Fields inherited from interface jist.swans.misc.Message
NULL
 
Constructor Summary
RouteZrpZdp.MessageZdp(int capacity, byte compress)
          Create new packet with given initial capacity.
 
Method Summary
 void addLink(Link link, short id, boolean drop)
          Add link to the packet structure.
 void freeze()
          Freeze packet; make it immutable.
 void getBytes(byte[] b, int offset)
          Store packet into byte array.
 Link getLink(int i)
          Return link source-destination pair.
 boolean getLinkDrop(int i)
          Return whether link has drop bit set.
 short getLinkId(int i)
          Return link identifier.
 int getNumLinks()
          Return number of links in packet.
 int getSize()
          Return packet size or Constants.ZERO_WIRE_SIZE.
 boolean isFrozen()
          Return whether packet is immutable.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RouteZrpZdp.MessageZdp

public RouteZrpZdp.MessageZdp(int capacity,
                              byte compress)
Create new packet with given initial capacity.

Parameters:
capacity - initial packet link capacity
compress - packet compression mode/format
Method Detail

addLink

public void addLink(Link link,
                    short id,
                    boolean drop)
Add link to the packet structure.

Parameters:
link - source-destination pair
id - destination sequenced link identifier
drop - whether link is up or down

freeze

public void freeze()
Freeze packet; make it immutable.


isFrozen

public boolean isFrozen()
Return whether packet is immutable.

Returns:
whether packet is immutable

getNumLinks

public int getNumLinks()
Return number of links in packet.

Returns:
number of links in packet

getLink

public Link getLink(int i)
Return link source-destination pair.

Parameters:
i - link number
Returns:
link source-destination pair

getLinkId

public short getLinkId(int i)
Return link identifier.

Parameters:
i - link number
Returns:
link identifier

getLinkDrop

public boolean getLinkDrop(int i)
Return whether link has drop bit set.

Parameters:
i - link number
Returns:
whether link has drop bit set

getSize

public int getSize()
Return packet size or Constants.ZERO_WIRE_SIZE.

Specified by:
getSize in interface Message
Returns:
packet size [in bytes]

getBytes

public void getBytes(byte[] b,
                     int offset)
Store packet into byte array.

Specified by:
getBytes in interface Message
Parameters:
b - destination byte array
offset - byte array starting offset

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object