import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
+import org.opendaylight.mdsal.binding.api.NotificationService.Listener;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.IetfYangUtil;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.DropActionCase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.DropActionCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingListener;
import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketReceived;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.common.Uint16;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-abstract class AbstractDropTest implements PacketProcessingListener, AutoCloseable {
+abstract class AbstractDropTest implements Listener<PacketReceived>, AutoCloseable {
private static final Logger LOG = LoggerFactory.getLogger(AbstractDropTest.class);
protected static final Uint16 PRIORITY = Uint16.valueOf(4);
protected volatile int runablesRejected;
public final DropTestStats getStats() {
- return new DropTestStats(this.sent, this.rcvd, this.excs, this.ftrFailed, this.ftrSuccess,
- this.runablesExecuted, this.runablesRejected);
+ return new DropTestStats(sent, rcvd, excs, ftrFailed, ftrSuccess, runablesExecuted, runablesRejected);
}
AbstractDropTest() {
}
public final void clearStats() {
- this.sent = 0;
- this.rcvd = 0;
- this.excs = 0;
- this.ftrSuccess = 0;
- this.ftrFailed = 0;
- this.runablesExecuted = 0;
- this.runablesRejected = 0;
+ sent = 0;
+ rcvd = 0;
+ excs = 0;
+ ftrSuccess = 0;
+ ftrFailed = 0;
+ runablesExecuted = 0;
+ runablesRejected = 0;
}
private void incrementRunableExecuted() {
}
@Override
- public final void onPacketReceived(final PacketReceived notification) {
+ public final void onNotification(final PacketReceived notification) {
LOG.debug("onPacketReceived - Entering - {}", notification);
RCVD_UPDATER.incrementAndGet(this);
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Instructions;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketReceived;
+import org.opendaylight.yangtools.concepts.Registration;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.common.Uint64;
import org.opendaylight.yangtools.yang.common.Uint8;
private NotificationService notificationService;
- private ListenerRegistration<DropTestCommiter> notificationRegistration;
+ private Registration notificationRegistration;
/**
* start listening on packetIn.
final SimpleTaskRetryLooper looper = new SimpleTaskRetryLooper(STARTUP_LOOP_TICK,
STARTUP_LOOP_MAX_RETRIES);
try {
- notificationRegistration = looper.loopUntilNoException(() ->
- notificationService.registerNotificationListener(DropTestCommiter.this));
+ notificationRegistration = looper.loopUntilNoException(
+ () -> notificationService.registerListener(PacketReceived.class, this));
} catch (Exception e) {
LOG.warn("DropTest committer notification listener registration fail!");
LOG.debug("DropTest committer notification listener registration fail! ..", e);
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketReceived;
+import org.opendaylight.yangtools.concepts.Registration;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.Uint64;
private NotificationService notificationService;
- private ListenerRegistration<DropTestRpcSender> notificationRegistration;
+ private Registration notificationRegistration;
/**
* Start listening on packetIn.
STARTUP_LOOP_MAX_RETRIES);
try {
notificationRegistration = looper.loopUntilNoException(
- () -> notificationService.registerNotificationListener(DropTestRpcSender.this));
+ () -> notificationService.registerListener(PacketReceived.class, this));
} catch (Exception e) {
LOG.warn("DropTest sender notification listener registration fail!");
LOG.debug("DropTest sender notification listener registration fail! ..", e);