1 package org.opendaylight.openflowplugin.api.openflow.md.queue;
3 import org.opendaylight.openflowjava.protocol.api.connection.ConnectionAdapter;
4 import org.slf4j.Logger;
5 import org.slf4j.LoggerFactory;
7 import com.google.common.base.Preconditions;
9 public class WaterMarkListenerImpl implements WaterMarkListener {
11 private static final Logger LOG = LoggerFactory
12 .getLogger(WaterMarkListenerImpl.class);
14 private ConnectionAdapter connectionAdapter;
16 public WaterMarkListenerImpl(ConnectionAdapter connectionAdapter) {
17 this.connectionAdapter = Preconditions.checkNotNull(connectionAdapter);
23 * @see org.opendaylight.openflowplugin.api.openflow.md.queue.QueueListener#
25 * (org.opendaylight.openflowjava.protocol.api.connection.ConnectionAdapter)
28 public void onHighWaterMark() {
29 connectionAdapter.setAutoRead(false);
30 LOG.debug("AutoRead is set on false.");
36 * @see org.opendaylight.openflowplugin.api.openflow.md.queue.QueueListener#
38 * (org.opendaylight.openflowjava.protocol.api.connection.ConnectionAdapter)
41 public void onLowWaterMark() {
42 connectionAdapter.setAutoRead(true);
43 LOG.debug("AutoRead is set on true.");