Package nl.tue.id.oocsi.client.protocol
Class RateLimitedClientEventHandler
java.lang.Object
nl.tue.id.oocsi.client.protocol.Handler
nl.tue.id.oocsi.client.protocol.EventHandler
nl.tue.id.oocsi.client.protocol.RateLimitedEventHandler
nl.tue.id.oocsi.client.protocol.RateLimitedClientEventHandler
public abstract class RateLimitedClientEventHandler extends RateLimitedEventHandler
rate limited event handler for events with structured data that will only let through "rate" events per "second"
secs; this counts for all incoming events per sender which protects against single senders overloading the system
- Author:
- matsfunk
-
Field Summary
Fields inherited from class nl.tue.id.oocsi.client.protocol.RateLimitedEventHandler
rate, seconds, timestamp
-
Constructor Summary
Constructors Constructor Description RateLimitedClientEventHandler(int rate, int seconds)
creates a rate limited event handler that will at most let through "rate" event per "second" secs -
Method Summary
Modifier and Type Method Description void
receive(java.lang.String sender, java.util.Map<java.lang.String,java.lang.Object> data, long timestamp, java.lang.String channel, java.lang.String recipient)
abstract method to be implemented in anonymous classes that are instantiated by subscribing and registering for eventsMethods inherited from class nl.tue.id.oocsi.client.protocol.RateLimitedEventHandler
exceeded, internalReceive, limit
Methods inherited from class nl.tue.id.oocsi.client.protocol.EventHandler
receive
Methods inherited from class nl.tue.id.oocsi.client.protocol.Handler
parseData, parseTimestamp, send
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
RateLimitedClientEventHandler
public RateLimitedClientEventHandler(int rate, int seconds)creates a rate limited event handler that will at most let through "rate" event per "second" secs- Parameters:
rate
-seconds
-
-
-
Method Details
-
receive
public void receive(java.lang.String sender, java.util.Map<java.lang.String,java.lang.Object> data, long timestamp, java.lang.String channel, java.lang.String recipient)Description copied from class:Handler
abstract method to be implemented in anonymous classes that are instantiated by subscribing and registering for events- Overrides:
receive
in classRateLimitedEventHandler
-