2 * Copyright (c) 2016 Cisco Systems, Inc. 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
8 package org.opendaylight.openflowplugin.applications.frsync.util;
11 * One-shot (per sync) placeholder for counts of added/updated/removed flows/groups/meters.
13 public class SyncCrudCounters {
15 private final CrudCounts flowCrudCounts;
16 private final CrudCounts groupCrudCounts;
17 private final CrudCounts meterCrudCounts;
18 private long startNano;
20 public SyncCrudCounters() {
21 flowCrudCounts = new CrudCounts();
22 groupCrudCounts = new CrudCounts();
23 meterCrudCounts = new CrudCounts();
26 public CrudCounts getFlowCrudCounts() {
27 return flowCrudCounts;
30 public CrudCounts getGroupCrudCounts() {
31 return groupCrudCounts;
34 public CrudCounts getMeterCrudCounts() {
35 return meterCrudCounts;
39 public long getStartNano() {
43 public void setStartNano(final long startNano) {
44 this.startNano = startNano;
47 public void resetAll() {
48 getGroupCrudCounts().setUpdated(0);
49 getGroupCrudCounts().setAdded(0);
50 getGroupCrudCounts().setRemoved(0);
52 getFlowCrudCounts().setUpdated(0);
53 getFlowCrudCounts().setAdded(0);
54 getFlowCrudCounts().setRemoved(0);
56 getMeterCrudCounts().setUpdated(0);
57 getMeterCrudCounts().setAdded(0);
58 getMeterCrudCounts().setRemoved(0);