Bees v0.5.0 API

bees.core
Class ReliableDataRequestCapsule

java.lang.Object
  |
  +--bees.core.Packet
        |
        +--bees.core.ANEPPacket
              |
              +--bees.core.Capsule
                    |
                    +--bees.core.DataRequestCapsule
                          |
                          +--bees.core.ReliableDataRequestCapsule
All Implemented Interfaces:
NodeCache.EventHandler

public abstract class ReliableDataRequestCapsule
extends DataRequestCapsule
implements NodeCache.EventHandler

The ReliableDataRequestCapsule is a base class for Capsule classes that wish to transmit chunks of data reliably.


Field Summary
static int DEFAULT_RETRY_COUNT
          Default number of times to try and resend a Capsule.
static IntegerPermission DEFAULT_RETRY_INTERVAL
          Default interval for resending a request Capsule.
 
Constructor Summary
protected ReliableDataRequestCapsule()
          Construct an empty ReliableDataRequestCapsule.
protected ReliableDataRequestCapsule(DataAggregator da)
          Construct a ReliableDataRequestCapsule with the given values.
 
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.
 int getRetriesLeft()
           
 void removed(Node node, ProtocolSession ps)
          This is called when the element is manually removed from from the cache.
protected abstract  void resend(Node node, ProtocolSession ps)
          Call back used to resend this capsule.
 void setRetriesLeft(int retriesLeft)
           
 java.lang.String toString()
           
 
Methods inherited from class bees.core.DataRequestCapsule
decode, encode, getCurrentWindow, getWindowChunks
 
Methods inherited from class bees.core.Capsule
addToPool, checkPermission, clone, decodingException, equals, evaluate, 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
 

Field Detail

DEFAULT_RETRY_INTERVAL

public static final IntegerPermission DEFAULT_RETRY_INTERVAL
Default interval for resending a request Capsule.

DEFAULT_RETRY_COUNT

public static final int DEFAULT_RETRY_COUNT
Default number of times to try and resend a Capsule.
Constructor Detail

ReliableDataRequestCapsule

protected ReliableDataRequestCapsule()
Construct an empty ReliableDataRequestCapsule.

ReliableDataRequestCapsule

protected ReliableDataRequestCapsule(DataAggregator da)
Construct a ReliableDataRequestCapsule with the given values.
Parameters:
da - The DataAggregator that is managing the transfer of data.
Method Detail

setRetriesLeft

public void setRetriesLeft(int retriesLeft)
Parameters:
retriesLeft - The number of retries left.

getRetriesLeft

public int getRetriesLeft()
Returns:
The number of retries left.

resend

protected abstract void resend(Node node,
                               ProtocolSession ps)
Call back used to resend this capsule.
Parameters:
node - The current Node object.
ps - The ProtocolSession for this flow and protocol.

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
Following copied from interface: bees.core.NodeCache.EventHandler
Parameters:
node - The current Node object.
ps - The ProtocolSession that the NodeCache is

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
Following copied from interface: bees.core.NodeCache.EventHandler
Parameters:
node - The current Node object.
ps - The ProtocolSession that the NodeCache is attached to.
Returns:
Null if the element should be collected or an IntegerPermission specifying the number of milliseconds to delay before this element should be collected again.

toString

public java.lang.String toString()
Overrides:
toString in class DataRequestCapsule
Following copied from class: bees.core.DataRequestCapsule
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/