Bees v0.5.0 API

apps.health
Class NodeHealthCapsule

java.lang.Object
  |
  +--bees.core.Packet
        |
        +--bees.core.ANEPPacket
              |
              +--bees.core.Capsule
                    |
                    +--apps.pathfinder.SinkCapsule
                          |
                          +--apps.health.NodeHealthCapsule
All Implemented Interfaces:
NodeCache.EventHandler

public class NodeHealthCapsule
extends SinkCapsule
implements NodeCache.EventHandler

The NodeHealthCapsule is used to poll and haul a NodeHealth object back to the server.

The NodeHealth and NodeHealthCapsule classes were expressly designed so that, with some modification, more than one NodeHealth object could be carried in a capsule. This would allow packet fusion at router nodes and hopefully better overall performance.

See Also:
SignedXdrByteArray, HealthSession

Field Summary
protected  NodeHealth nh
          The NodeHealth object to be polled when this object is being used as the client's source capsule.
 
Constructor Summary
NodeHealthCapsule()
          Construct an empty NodeHealthCapsule.
NodeHealthCapsule(NodeHealth nh)
          Construct a NodeHealthCapsule with the given value.
 
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.
 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.
 void removed(Node node, ProtocolSession ps)
          This is called when the element is manually removed from from the cache.
 void reset()
          Reset this Capsule's state.
 java.lang.String toString()
           
 
Methods inherited from class apps.pathfinder.SinkCapsule
evaluate
 
Methods inherited from class bees.core.Capsule
addToPool, checkPermission, clone, decodingException, equals, evaluate, fromCapsule, fromExternal, getCapsuleID, getFlowDesc, getSession, getSession, getSource, internalDecode, internalEncode, internalReset, skipOptions, specializeCapsule
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

nh

protected final NodeHealth nh
The NodeHealth object to be polled when this object is being used as the client's source capsule.
Constructor Detail

NodeHealthCapsule

public NodeHealthCapsule(NodeHealth nh)
Construct a NodeHealthCapsule with the given value.
Parameters:
nh - The NodeHealth object to poll when this capsule is being collected by the NodeCache.

NodeHealthCapsule

public NodeHealthCapsule()
Construct an empty NodeHealthCapsule.
Method Detail

reset

public void reset()
Description copied from class: Capsule
Reset this Capsule's state. This method will be called when this object is added back into a pool via addToPool().
Overrides:
reset in class Capsule
See Also:
Capsule.reset()

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)
            throws java.security.SignatureException,
                   java.security.InvalidKeyException,
                   java.security.NoSuchAlgorithmException
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)
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 SinkCapsule
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/