diff --git a/src/main/java/net/floodlightcontroller/core/IOFSwitch.java b/src/main/java/net/floodlightcontroller/core/IOFSwitch.java index 5678035f4741afc6e4eba05b4f47bca9c660e870..6bc92c98fae1e9866c99606d352f6115d1b0c618 100644 --- a/src/main/java/net/floodlightcontroller/core/IOFSwitch.java +++ b/src/main/java/net/floodlightcontroller/core/IOFSwitch.java @@ -116,6 +116,17 @@ public interface IOFSwitch { */ public void writeThrottled(OFMessage msg, FloodlightContext cntx) throws IOException; + /** + * Writes the list of messages to the output stream, subject to rate limiting. + * The message will be handed to the floodlightProvider for possible filtering + * and processing by message listeners. + * @param msglist + * @param bc + * @throws IOException + */ + void writeThrottled(List<OFMessage> msglist, FloodlightContext bc) + throws IOException; + /** * Writes to the OFMessage to the output stream, bypassing rate limiting. * The message will be handed to the floodlightProvider for possible filtering @@ -127,7 +138,7 @@ public interface IOFSwitch { public void write(OFMessage m, FloodlightContext bc) throws IOException; /** - * Writes the list of messages to the output stream + * Writes the list of messages to the output stream, bypassing rate limiting. * The message will be handed to the floodlightProvider for possible filtering * and processing by message listeners. * @param msglist @@ -498,5 +509,4 @@ public interface IOFSwitch { * @return */ public List<Short> getUplinkPorts(); - } diff --git a/src/main/java/net/floodlightcontroller/core/OFSwitchBase.java b/src/main/java/net/floodlightcontroller/core/OFSwitchBase.java index 6e99419612625291ce01718374ef9075f26dace1..31c1ae0753637cbffff5a410f8864ca68ea81848 100644 --- a/src/main/java/net/floodlightcontroller/core/OFSwitchBase.java +++ b/src/main/java/net/floodlightcontroller/core/OFSwitchBase.java @@ -190,6 +190,13 @@ public abstract class OFSwitchBase implements IOFSwitch { write(m, bc); } + @Override + public void writeThrottled(List<OFMessage> msglist, FloodlightContext bc) + throws IOException { + // By default, there is no throttling + write(msglist, bc); + } + @Override public void write(OFMessage m, FloodlightContext bc) throws IOException { @@ -209,7 +216,6 @@ public abstract class OFSwitchBase implements IOFSwitch { msg_buffer.clear(); } } - @Override @LogMessageDoc(level="WARN", message="Sending OF message that modifies switch " + diff --git a/src/test/java/net/floodlightcontroller/util/OFMessageDamperMockSwitch.java b/src/test/java/net/floodlightcontroller/util/OFMessageDamperMockSwitch.java index 14a92d1fe1eb08f428c40744bc52ad6518846280..29191365cddad3344d7390f4d363cfcd0eaf8820 100644 --- a/src/test/java/net/floodlightcontroller/util/OFMessageDamperMockSwitch.java +++ b/src/test/java/net/floodlightcontroller/util/OFMessageDamperMockSwitch.java @@ -111,6 +111,13 @@ public class OFMessageDamperMockSwitch implements IOFSwitch { //------------------------------------------------------- // IOFSwitch: not-implemented methods + + @Override + public void writeThrottled(List<OFMessage> msglist, FloodlightContext bc) + throws IOException { + assertTrue("Unexpected method call", false); + } + @Override public void write(List<OFMessage> msglist, FloodlightContext bc) throws IOException {