Migrate ntfbenchmark to MDSAL APIs
[controller.git] / benchmark / ntfbenchmark / src / main / java / ntfbenchmark / impl / NtfbenchTestListener.java
1 /*
2  * Copyright (c) 2015 Cisco Systems and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package ntfbenchmark.impl;
9
10 import com.google.common.util.concurrent.Futures;
11 import java.util.concurrent.Future;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ntfbench.payload.rev150709.Ntfbench;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ntfbench.payload.rev150709.NtfbenchPayloadListener;
14
15 public class NtfbenchTestListener implements NtfbenchPayloadListener {
16
17     private final int expectedSize;
18     private int received = 0;
19
20     public NtfbenchTestListener(final int expectedSize) {
21         this.expectedSize = expectedSize;
22     }
23
24     @Override
25     public void onNtfbench(final Ntfbench notification) {
26         if (expectedSize == notification.getPayload().size()) {
27             received++;
28         }
29     }
30
31     public int getReceived() {
32         return received;
33     }
34
35     public Future<?> getAllDone() {
36         return Futures.immediateFuture(null);
37     }
38 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.