net.kano.joscar.ratelim
Interface RateListener


public interface RateListener

An interface for listening for rate-related events on a RateMonitor.


Method Summary
 void detached(RateMonitor rateMonitor, ClientSnacProcessor processor)
          Called when the given rate monitor was "detached" from the given SNAC processor.
 void gotRateClasses(RateMonitor monitor)
          Called when the given rate monitor receives a new set of rate class information.
 void rateClassLimited(RateMonitor rateMonitor, RateClassMonitor rateClassMonitor, boolean limited)
          Called when a single rate class becomes or stops becoming "rate-limited."
 void rateClassUpdated(RateMonitor rateMonitor, RateClassMonitor rateClassMonitor, RateClassInfo rateClassInfo)
          Called when a single rate class's information has been updated.
 void reset(RateMonitor rateMonitor)
          Called when the rate information for the given rate monitor has been reset.
 

Method Detail

gotRateClasses

public void gotRateClasses(RateMonitor monitor)
Called when the given rate monitor receives a new set of rate class information. This callback's invocation indicates that all previously held RateClassMonitors in the given RateMonitor have been discarded and a new set has been generated.

Parameters:
monitor - the rate monitor that received new rate class information

rateClassUpdated

public void rateClassUpdated(RateMonitor rateMonitor,
                             RateClassMonitor rateClassMonitor,
                             RateClassInfo rateClassInfo)
Called when a single rate class's information has been updated.

Parameters:
rateMonitor - the rate monitor whose rate class was updated
rateClassMonitor - the rate class monitor for the associated rate class
rateClassInfo - the new rate class information

rateClassLimited

public void rateClassLimited(RateMonitor rateMonitor,
                             RateClassMonitor rateClassMonitor,
                             boolean limited)
Called when a single rate class becomes or stops becoming "rate-limited."

Parameters:
rateMonitor - the rate monitor whose rate class's limited status changed
rateClassMonitor - the rate class monitor for the associated rate class
limited - whether or not the rate class is limited

detached

public void detached(RateMonitor rateMonitor,
                     ClientSnacProcessor processor)
Called when the given rate monitor was "detached" from the given SNAC processor. See RateMonitor.detach() for details; in brief, this callback's invocation indicates that no further work should be done involving the given rate monitor, and it is recommended that listeners remove themselves as listeners upon a call to this method.

Parameters:
rateMonitor - the rate monitor that was detached
processor - the SNAC processor from which the given rate monitor was detached

reset

public void reset(RateMonitor rateMonitor)
Called when the rate information for the given rate monitor has been reset. See RateMonitor.reset() for details.

Parameters:
rateMonitor - the rate monitor whose rate information was reset