Merge "BUG-6890:Flow-Removed Notification configuration"
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / services / batch / BatchPlanStep.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
9 package org.opendaylight.openflowplugin.impl.services.batch;
10
11 import java.util.ArrayList;
12 import java.util.List;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.service.batch.common.rev160322.BatchOrderGrouping;
14
15 /**
16  * Container of CRUD actions for one type of object (flow, group, meter, ..) of same type (add, remove, update).
17  */
18 public class BatchPlanStep {
19     private final List<? extends BatchOrderGrouping> taskBag;
20     private final BatchStepType stepType;
21     private boolean barrierAfter = false;
22
23     public BatchPlanStep(final BatchStepType stepType) {
24         this.stepType = stepType;
25         taskBag = new ArrayList<>();
26     }
27
28     public <T extends BatchOrderGrouping> List<T> getTaskBag() {
29         return (List<T>) taskBag;
30     }
31
32     public BatchStepType getStepType() {
33         return stepType;
34     }
35
36     public boolean isEmpty() {
37         return taskBag.isEmpty();
38     }
39
40     public void setBarrierAfter(final boolean barrier) {
41         this.barrierAfter = barrier;
42     }
43
44     public boolean isBarrierAfter() {
45         return barrierAfter;
46     }
47 }