Merge "L2 Gw create changes related to ITM Tunnels creation in neutronvpn module"
[vpnservice.git] / interfacemgr / interfacemgr-api / src / main / java / org / opendaylight / vpnservice / interfacemgr / globals / InterfaceInfo.java
1 /*
2  * Copyright (c) 2015 - 2016 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.interfacemgr.globals;
9
10 import java.io.Serializable;
11 import java.math.BigInteger;
12
13 public class InterfaceInfo implements Serializable {
14
15     /**
16      *
17      */
18     private static final long serialVersionUID = 1L;
19
20     public enum InterfaceType  {
21         VLAN_INTERFACE,
22         VXLAN_TRUNK_INTERFACE,
23         GRE_TRUNK_INTERFACE,
24         VXLAN_VNI_INTERFACE,
25         MPLS_OVER_GRE,
26         LOGICAL_GROUP_INTERFACE,
27         UNKNOWN_INTERFACE;
28     }
29
30     public enum InterfaceAdminState {
31         ENABLED,
32         DISABLED
33     }
34
35     public enum InterfaceOpState {
36         UP,
37         DOWN
38     }
39
40     protected InterfaceType interfaceType;
41     protected int interfaceTag;
42     protected BigInteger dpId = IfmConstants.INVALID_DPID;
43     protected InterfaceAdminState adminState = InterfaceAdminState.ENABLED;
44     protected InterfaceOpState opState;
45     protected long groupId;
46     protected long l2domainGroupId;
47     protected int portNo = IfmConstants.INVALID_PORT_NO;
48     protected String portName;
49     protected String interfaceName;
50     protected boolean isUntaggedVlan;
51
52     public String getInterfaceName() {
53         return interfaceName;
54     }
55
56     public void setInterfaceName(String interfaceName) {
57         this.interfaceName = interfaceName;
58     }
59
60     public InterfaceInfo(BigInteger dpId, String portName) {
61         this.dpId = dpId;
62         this.portName = portName;
63     }
64
65     public InterfaceInfo(String portName) {
66         this.portName = portName;
67     }
68
69     public boolean isOperational() {
70         return adminState == InterfaceAdminState.ENABLED && opState == InterfaceOpState.UP;
71     }
72
73     public InterfaceType getInterfaceType() {
74         return interfaceType;
75     }
76     public void setInterfaceType(InterfaceType lportType) {
77         this.interfaceType = lportType;
78     }
79     public int getInterfaceTag() {
80         return interfaceTag;
81     }
82     public void setInterfaceTag(int interfaceTag) {
83         this.interfaceTag = interfaceTag;
84     }
85     public void setUntaggedVlan(boolean isUntaggedVlan) {
86         this.isUntaggedVlan = isUntaggedVlan;
87     }
88     public boolean isUntaggedVlan() {
89         return  isUntaggedVlan;
90     }
91     public BigInteger getDpId() {
92         return dpId;
93     }
94     public void setDpId(BigInteger dpId) {
95         this.dpId = dpId;
96     }
97     public InterfaceAdminState getAdminState() {
98         return adminState;
99     }
100     public void setAdminState(InterfaceAdminState adminState) {
101         this.adminState = adminState;
102     }
103     public InterfaceOpState getOpState() {
104         return opState;
105     }
106     public void setOpState(InterfaceOpState opState) {
107         this.opState = opState;
108     }
109     public long getGroupId() {
110         return groupId;
111     }
112     public void setGroupId(long groupId) {
113         this.groupId = groupId;
114     }
115     public long getL2domainGroupId() {
116         return l2domainGroupId;
117     }
118     public void setL2domainGroupId(long l2domainGroupId) {
119         this.l2domainGroupId = l2domainGroupId;
120     }
121
122     public int getPortNo() {
123         return portNo;
124     }
125
126     public void setPortNo(int portNo) {
127         this.portNo = portNo;
128     }
129
130     public void setPortName(String portName) {
131         this.portName = portName;
132     }
133     public String getPortName(){
134         return this.portName;
135     }
136 }