2 * Copyright (c) 2015 Cisco Systems and others. All rights reserved.
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
9 package ntfbenchmark.impl;
11 import java.util.ArrayList;
12 import java.util.List;
13 import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ntfbench.payload.rev150709.Ntfbench;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ntfbench.payload.rev150709.NtfbenchBuilder;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ntfbench.payload.rev150709.payload.Payload;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ntfbench.payload.rev150709.payload.PayloadBuilder;
19 public abstract class AbstractNtfbenchProducer implements Runnable {
20 protected final NotificationPublishService publishService;
21 protected final int iterations;
22 protected final Ntfbench ntf;
27 public int getNtfOk() {
32 * @return the ntfError
34 public int getNtfError() {
38 protected int ntfOk = 0;
39 protected int ntfError = 0;
41 public AbstractNtfbenchProducer(final NotificationPublishService publishService, final int iterations,
42 final int payloadSize) {
43 this.publishService = publishService;
44 this.iterations = iterations;
46 final List<Payload> listVals = new ArrayList<>();
47 for (int i = 0; i < payloadSize; i++) {
48 listVals.add(new PayloadBuilder().setId(i).build());
51 ntf = new NtfbenchBuilder().setPayload(listVals).build();