2 * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. 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.vpnservice.mdsalutil;
10 import java.io.Serializable;
11 import java.util.List;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;
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;
22 public BucketInfo(List<ActionInfo> listActions) {
23 m_listActionInfo = listActions;
26 public BucketInfo(List<ActionInfo> m_listActionInfo, Integer weight, Long watchPort, Long watchGroup) {
28 this.m_listActionInfo = m_listActionInfo;
30 this.watchPort = watchPort;
31 this.watchGroup = watchGroup;
34 public void buildAndAddActions(List<Action> listActionOut) {
36 if (m_listActionInfo != null) {
37 for (ActionInfo actionInfo : m_listActionInfo) {
38 actionInfo.setActionKey(key++);
39 listActionOut.add(actionInfo.buildAction());
44 public void setWeight(Integer bucketWeight) {
45 weight = bucketWeight;
48 public Integer getWeight() {
52 public List<ActionInfo> getActionInfoList() {
53 return m_listActionInfo;
56 public Long getWatchPort() {
60 public void setWatchPort(Long watchPort) {
61 this.watchPort = watchPort;
64 public Long getWatchGroup() {
68 public void setWatchGroup(Long watchGroup) {
69 this.watchGroup = watchGroup;