Bees v0.5.0 API

apps.discovery
Class AdvertiseCapsule

java.lang.Object
  |
  +--bees.core.Packet
        |
        +--bees.core.ANEPPacket
              |
              +--bees.core.Capsule
                    |
                    +--apps.discovery.AdvertiseCapsule
All Implemented Interfaces:
NodeCache.EventHandler

public final class AdvertiseCapsule
extends Capsule
implements NodeCache.EventHandler

An AdvertiseCapsule is used to carry broadcast data for a host.


Constructor Summary
AdvertiseCapsule()
          Construct an empty AdvertiseCapsule.
AdvertiseCapsule(BroadcastNeighbor bn, byte[] material, byte[] signature, IntegerPermission frequency)
          Constructor for telling other neighbors about this node.
 
Method Summary
 IntegerPermission collected(Node node, ProtocolSession ps)
          This is called when this element is up for collection, the return value specifies the new expiration time.
 TypeID computeFingerPrint()
           
 void decode(Xdr xdr)
          Decode this Capsule's state from the given Xdr.
 void encode(Xdr xdr)
          Encode this Capsule's state into the given Xdr.
 void evaluate(Node node)
          Evaluate this capsule.
 IntegerPermission getFrequency()
           
 byte[] getMaterial()
           
 byte[] getSignature()
           
 void removed(Node node, ProtocolSession ps)
          This is called when the element is manually removed from from the cache.
 void setMaterial(byte[] material)
           
 void setSignature(byte[] signature)
           
 java.lang.String toString()
           
 
Methods inherited from class bees.core.Capsule
addToPool, checkPermission, clone, decodingException, equals, evaluate, fromCapsule, fromExternal, getCapsuleID, getFlowDesc, getSession, getSession, getSource, internalDecode, internalEncode, internalReset, reset, skipOptions, specializeCapsule
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AdvertiseCapsule

public AdvertiseCapsule()
Construct an empty AdvertiseCapsule.

AdvertiseCapsule

public AdvertiseCapsule(BroadcastNeighbor bn,
                        byte[] material,
                        byte[] signature,
                        IntegerPermission frequency)
Constructor for telling other neighbors about this node.
Parameters:
bn - The neighor to use when broadcasting this advertisement.
material - The material to advertise.
signature - Null or the signature covering this material.
frequency - The retransmit frequency expressed as a number of milliseconds.
Method Detail

computeFingerPrint

public TypeID computeFingerPrint()
Returns:
An MD5 hash covering the material.

setMaterial

public void setMaterial(byte[] material)
Parameters:
material - The material to advertise.

getMaterial

public byte[] getMaterial()
Returns:
The material to advertise.

setSignature

public void setSignature(byte[] signature)
Parameters:
signature - Null or the signature covering this material.

getSignature

public byte[] getSignature()
Returns:
Null or the signature covering this material.

getFrequency

public IntegerPermission getFrequency()
Returns:
The retransmit frequency expressed as a number of milliseconds.

removed

public void removed(Node node,
                    ProtocolSession ps)
Description copied from interface: NodeCache.EventHandler
This is called when the element is manually removed from from the cache.
Specified by:
removed in interface NodeCache.EventHandler
See Also:
NodeCache.EventHandler.removed(Node, ProtocolSession)

collected

public IntegerPermission collected(Node node,
                                   ProtocolSession ps)
Description copied from interface: NodeCache.EventHandler
This is called when this element is up for collection, the return value specifies the new expiration time. Null is returned if the element should really be collected.
Specified by:
collected in interface NodeCache.EventHandler
See Also:
NodeCache.EventHandler.collected(Node, ProtocolSession)

decode

public void decode(Xdr xdr)
Description copied from class: Capsule
Decode this Capsule's state from the given Xdr.
Overrides:
decode in class Capsule
See Also:
Capsule.decode(Xdr)

encode

public void encode(Xdr xdr)
Description copied from class: Capsule
Encode this Capsule's state into the given Xdr.
Overrides:
encode in class Capsule
See Also:
Capsule.encode(Xdr)

evaluate

public void evaluate(Node node)
              throws java.security.NoSuchAlgorithmException,
                     java.security.InvalidKeyException,
                     java.security.SignatureException
Description copied from class: Capsule
Evaluate this capsule. Basically, this is the function that performs any computation and forwarding.
Overrides:
evaluate in class Capsule
See Also:
Capsule.evaluate(Node)

toString

public java.lang.String toString()
Overrides:
toString in class Capsule
See Also:
Object.toString()

Bees v0.5.0 API

This documentation is Copyright (C) 2002 The University of Utah. All Rights Reserved. See the individual source files for distribution terms.
Documentation, software, and mailing lists for Bees v0.5.0 can be found at the Janos Project: http://www.cs.utah.edu/flux/janos/