SSF.OS.BGP4.Timing
Class Timer

java.lang.Object
  |
  +--com.renesys.raceway.SSF.Entity
        |
        +--SSF.OS.Timer
              |
              +--SSF.OS.BGP4.Timing.Timer
Direct Known Subclasses:
DampReuseTimer, EventTimer, IdealMRAITimer

public abstract class Timer
extends Timer

This class is just an intermediate class between SSF.OS.Timer and the more specific BGP timers (SSF.OS.BGP4.EventTimer, SSF.OS.BGP4.MRAITimer) so that generic methods for setting the time at which the timer was set can be included.


Field Summary
static int CONNRETRY
          Indicates the Connect Retry Timer.
static int HOLD
          Indicates the Hold Timer.
 boolean is_expired
          Whether or not the timer is expired.
static int KEEPALIVE
          Indicates the Keep Alive Timer.
static int MASO
          Indicates the Minimum AS Origination Timer.
static int MRAI
          Indicates the Minimum Route Advertisement Interval Timer.
 
Constructor Summary
Timer(ProtocolGraph pg, long dt)
          Initialize the timer data.
 
Method Summary
abstract  void callback()
          An abstract version of the method that is called when the timer expires.
 void canc()
          Cancel the timer.
 boolean is_expired()
          Returns whether or not the timer is expired (also returns true if the timer is not currently set)
 void set_at(long set_time)
          Since it's not done automatically by the timers, this method sets the time at which the timer was set.
 void set_expiry(boolean b)
          Assign a value for whether or not the timer is expired.
 long when_set()
          Returns the time at which the timer was set.
 
Methods inherited from class SSF.OS.Timer
cancel, isCancelled, set, set
 
Methods inherited from class com.renesys.raceway.SSF.Entity
alignment, alignTo, coalignedEntities, inChannels, init, joinAll, makeIndependent, now, outChannels, pauseAll, playRole, processes, resetSimulation, resumeAll, startAll, startAll, startClient, startClient, startServer, Vx, Yx
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONNRETRY

public static final int CONNRETRY
Indicates the Connect Retry Timer.

See Also:
Constant Field Values

HOLD

public static final int HOLD
Indicates the Hold Timer.

See Also:
Constant Field Values

KEEPALIVE

public static final int KEEPALIVE
Indicates the Keep Alive Timer.

See Also:
Constant Field Values

MASO

public static final int MASO
Indicates the Minimum AS Origination Timer.

See Also:
Constant Field Values

MRAI

public static final int MRAI
Indicates the Minimum Route Advertisement Interval Timer.

See Also:
Constant Field Values

is_expired

public boolean is_expired
Whether or not the timer is expired. It is also true if timer is not set. It is the opposite of whether or not the timer is ticking. That is, if the timer is not expired, then it is ticking.

Constructor Detail

Timer

public Timer(ProtocolGraph pg,
             long dt)
Initialize the timer data.

Parameters:
pg - The protocol graph in which the associated BGP session resides.
dt - The length of time (in ticks) that the timer is set for.
Method Detail

callback

public abstract void callback()
An abstract version of the method that is called when the timer expires.

Specified by:
callback in class Timer

when_set

public long when_set()
Returns the time at which the timer was set.

Returns:
the time (in ticks) when the timer was set

set_at

public void set_at(long set_time)
Since it's not done automatically by the timers, this method sets the time at which the timer was set.

Parameters:
set_time - The time (in ticks) at which the timer was set.

is_expired

public boolean is_expired()
Returns whether or not the timer is expired (also returns true if the timer is not currently set)

Returns:
whether or not the timer has expired

set_expiry

public void set_expiry(boolean b)
Assign a value for whether or not the timer is expired. This method is available since a timer does not automatically change the value to false when set is called.

Parameters:
b - Whether or not the timer has expired.

canc

public void canc()
Cancel the timer.