All Known Implementing Classes:
RouterThrottleImpl

public interface RouterThrottle
Controls router load by throttling message processing and tunnel participation. Monitors system performance metrics to decide when to reject or limit activities based on current load and bandwidth constraints.
  • Method Summary

    All Methods
    Modifier and Type
    Method
    Description
    boolean
    Should we accept any more data from the network for any sort of message, taking into account our current load, or should we simply slow down?
    int
    Should we accept the request to participate in the given tunnel, taking into account our current load and bandwidth usage commitments?
    void
    Cancel a shutdown previously announced with setShutdownStatus().
    The tunnel status message, translated via the router resource bundle.
    long
    How backed up we are at the moment processing messages (in milliseconds).
    long
    How backed up our tunnels are at the moment (in milliseconds).
    Message on the state of participating tunnel acceptance.
    void
    Mark that the router is shutting down, so the console reports that state.
    void
    Update the tunnel acceptance status message.
  • Method Details

    • acceptNetworkMessage

      boolean acceptNetworkMessage()
      Should we accept any more data from the network for any sort of message, taking into account our current load, or should we simply slow down?
      Returns:
      true to take more network traffic, false to hold off for a while
    • acceptTunnelRequest

      int acceptTunnelRequest()
      Should we accept the request to participate in the given tunnel, taking into account our current load and bandwidth usage commitments?
      Returns:
      0 if it should be accepted, higher values for more severe rejection
    • getMessageDelay

      long getMessageDelay()
      How backed up we are at the moment processing messages (in milliseconds).
      Returns:
      how far behind schedule message processing is, in milliseconds
    • getTunnelLag

      long getTunnelLag()
      How backed up our tunnels are at the moment (in milliseconds).
      Returns:
      how far behind schedule tunnel management is, in milliseconds
    • getTunnelStatus

      String getTunnelStatus()
      Message on the state of participating tunnel acceptance.
      Returns:
      the tunnel status
    • setTunnelStatus

      void setTunnelStatus(String msg)
      Update the tunnel acceptance status message.
      Parameters:
      msg - the text to show on the console in place of the default status
    • getLocalizedTunnelStatus

      String getLocalizedTunnelStatus()
      The tunnel status message, translated via the router resource bundle.
      Returns:
      the tunnel status, translated via the router resource bundle
    • setShutdownStatus

      void setShutdownStatus()
      Mark that the router is shutting down, so the console reports that state.
    • cancelShutdownStatus

      void cancelShutdownStatus()
      Cancel a shutdown previously announced with setShutdownStatus().