Merge "OFPGC_ADD_OR_MOD support in openflowplugin"
[openflowplugin.git] / applications / forwardingrules-sync / src / main / java / org / opendaylight / openflowplugin / applications / frsync / util / SyncCrudCounters.java
1 /**
2  * Copyright (c) 2016 Cisco Systems, Inc. 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 org.opendaylight.openflowplugin.applications.frsync.util;
9
10 /**
11  * One-shot (per sync) placeholder for counts of added/updated/removed flows/groups/meters.
12  */
13 public class SyncCrudCounters {
14
15     private final CrudCounts flowCrudCounts;
16     private final CrudCounts groupCrudCounts;
17     private final CrudCounts meterCrudCounts;
18
19     public SyncCrudCounters() {
20         flowCrudCounts = new CrudCounts();
21         groupCrudCounts = new CrudCounts();
22         meterCrudCounts = new CrudCounts();
23     }
24
25     public CrudCounts getFlowCrudCounts() {
26         return flowCrudCounts;
27     }
28
29     public CrudCounts getGroupCrudCounts() {
30         return groupCrudCounts;
31     }
32
33     public CrudCounts getMeterCrudCounts() {
34         return meterCrudCounts;
35     }
36
37     public void resetAll() {
38         getGroupCrudCounts().setUpdated(0);
39         getGroupCrudCounts().setAdded(0);
40         getGroupCrudCounts().setRemoved(0);
41
42         getFlowCrudCounts().setUpdated(0);
43         getFlowCrudCounts().setAdded(0);
44         getFlowCrudCounts().setRemoved(0);
45
46         getMeterCrudCounts().setUpdated(0);
47         getMeterCrudCounts().setAdded(0);
48         getMeterCrudCounts().setRemoved(0);
49     }
50 }