net.floodlightcontroller.util
Class OFMessageDamper
java.lang.Object
net.floodlightcontroller.util.OFMessageDamper
public class OFMessageDamper
- extends java.lang.Object
Dampens OFMessages sent to an OF switch. A message is only written to
a switch if the same message (as defined by .equals()) has not been written
in the last n milliseconds. Timer granularity is based on TimedCache
- Author:
- gregor
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OFMessageDamper
public OFMessageDamper(int capacity,
java.util.Set<OFType> typesToDampen,
int timeout)
- Parameters:
capacity
- the maximum number of messages that should be
kepttypesToDampen
- The set of OFMessageTypes that should be
dampened by this instance. Other types will be passed throughtimeout
- The dampening timeout. A message will only be
written if the last write for the an equal message more than
timeout ms ago.
write
public boolean write(IOFSwitch sw,
OFMessage msg,
FloodlightContext cntx)
throws java.io.IOException
- write the messag to the switch according to our dampening settings
- Parameters:
sw
- msg
- cntx
-
- Returns:
- true if the message was written to the switch, false if
the message was dampened.
- Throws:
java.io.IOException
write
public boolean write(IOFSwitch sw,
OFMessage msg,
FloodlightContext cntx,
boolean flush)
throws java.io.IOException
- write the messag to the switch according to our dampening settings
- Parameters:
sw
- msg
- cntx
- flush
- true to flush the packet immidiately
- Returns:
- true if the message was written to the switch, false if
the message was dampened.
- Throws:
java.io.IOException