Skip to content
Snippets Groups Projects
Commit bfed2d45 authored by Shudong Zhou's avatar Shudong Zhou
Browse files

BSC-3397 Add writeThrottled() for list of messages

parent b3e05d08
No related branches found
No related tags found
No related merge requests found
...@@ -116,6 +116,17 @@ public interface IOFSwitch { ...@@ -116,6 +116,17 @@ public interface IOFSwitch {
*/ */
public void writeThrottled(OFMessage msg, FloodlightContext cntx) throws IOException; 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. * Writes to the OFMessage to the output stream, bypassing rate limiting.
* The message will be handed to the floodlightProvider for possible filtering * The message will be handed to the floodlightProvider for possible filtering
...@@ -127,7 +138,7 @@ public interface IOFSwitch { ...@@ -127,7 +138,7 @@ public interface IOFSwitch {
public void write(OFMessage m, FloodlightContext bc) throws IOException; 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 * The message will be handed to the floodlightProvider for possible filtering
* and processing by message listeners. * and processing by message listeners.
* @param msglist * @param msglist
...@@ -498,5 +509,4 @@ public interface IOFSwitch { ...@@ -498,5 +509,4 @@ public interface IOFSwitch {
* @return * @return
*/ */
public List<Short> getUplinkPorts(); public List<Short> getUplinkPorts();
} }
...@@ -190,6 +190,13 @@ public abstract class OFSwitchBase implements IOFSwitch { ...@@ -190,6 +190,13 @@ public abstract class OFSwitchBase implements IOFSwitch {
write(m, bc); write(m, bc);
} }
@Override
public void writeThrottled(List<OFMessage> msglist, FloodlightContext bc)
throws IOException {
// By default, there is no throttling
write(msglist, bc);
}
@Override @Override
public void write(OFMessage m, FloodlightContext bc) public void write(OFMessage m, FloodlightContext bc)
throws IOException { throws IOException {
...@@ -209,7 +216,6 @@ public abstract class OFSwitchBase implements IOFSwitch { ...@@ -209,7 +216,6 @@ public abstract class OFSwitchBase implements IOFSwitch {
msg_buffer.clear(); msg_buffer.clear();
} }
} }
@Override @Override
@LogMessageDoc(level="WARN", @LogMessageDoc(level="WARN",
message="Sending OF message that modifies switch " + message="Sending OF message that modifies switch " +
......
...@@ -111,6 +111,13 @@ public class OFMessageDamperMockSwitch implements IOFSwitch { ...@@ -111,6 +111,13 @@ public class OFMessageDamperMockSwitch implements IOFSwitch {
//------------------------------------------------------- //-------------------------------------------------------
// IOFSwitch: not-implemented methods // IOFSwitch: not-implemented methods
@Override
public void writeThrottled(List<OFMessage> msglist, FloodlightContext bc)
throws IOException {
assertTrue("Unexpected method call", false);
}
@Override @Override
public void write(List<OFMessage> msglist, FloodlightContext bc) public void write(List<OFMessage> msglist, FloodlightContext bc)
throws IOException { throws IOException {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment