Added copyright and updated appropriate log levels
[vpnservice.git] / mdsalutil / mdsalutil-api / src / main / java / org / opendaylight / vpnservice / mdsalutil / BucketInfo.java
1 /*
2  * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. 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.vpnservice.mdsalutil;
9
10 import java.io.Serializable;
11 import java.util.List;
12
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;
14
15 public class BucketInfo implements Serializable {
16     private static final long serialVersionUID = 1L;
17     private final List<ActionInfo> m_listActionInfo;
18     private Integer weight = 0;
19     private Long watchPort = 0xffffffffL;
20     private Long watchGroup = 0xffffffffL;
21
22     public BucketInfo(List<ActionInfo> listActions) {
23         m_listActionInfo = listActions;
24     }
25
26     public BucketInfo(List<ActionInfo> m_listActionInfo, Integer weight, Long watchPort, Long watchGroup) {
27         super();
28         this.m_listActionInfo = m_listActionInfo;
29         this.weight = weight;
30         this.watchPort = watchPort;
31         this.watchGroup = watchGroup;
32     }
33
34     public void buildAndAddActions(List<Action> listActionOut) {
35         int key = 0;
36         if (m_listActionInfo != null) {
37             for (ActionInfo actionInfo : m_listActionInfo) {
38                 actionInfo.setActionKey(key++);
39                 listActionOut.add(actionInfo.buildAction());
40             }
41         }
42     }
43
44     public void setWeight(Integer bucketWeight) {
45         weight = bucketWeight;
46     }
47
48     public Integer getWeight() {
49         return weight;
50     }
51
52     public List<ActionInfo> getActionInfoList() {
53         return m_listActionInfo;
54     }
55
56     public Long getWatchPort() {
57         return watchPort;
58     }
59
60     public void setWatchPort(Long watchPort) {
61         this.watchPort = watchPort;
62     }
63
64     public Long getWatchGroup() {
65         return watchGroup;
66     }
67
68     public void setWatchGroup(Long watchGroup) {
69         this.watchGroup = watchGroup;
70     }
71 }