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) 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         LOGICAL_GROUP_INTERFACE,
26         UNKNOWN_INTERFACE;
27     }
28
29     public enum InterfaceAdminState {
30         ENABLED,
31         DISABLED
32     }
33
34     public enum InterfaceOpState {
35         UP,
36         DOWN
37     }
38
39     protected InterfaceType interfaceType;
40     protected int interfaceTag;
41     protected BigInteger dpId = IfmConstants.INVALID_DPID;
42     protected InterfaceAdminState adminState = InterfaceAdminState.ENABLED;
43     protected InterfaceOpState opState;
44     protected long groupId;
45     protected long l2domainGroupId;
46     protected int portNo = IfmConstants.INVALID_PORT_NO;
47     protected String portName;
48     protected String interfaceName;
49     protected boolean isUntaggedVlan;
50
51     public String getInterfaceName() {
52         return interfaceName;
53     }
54
55     public void setInterfaceName(String interfaceName) {
56         this.interfaceName = interfaceName;
57     }
58
59     public InterfaceInfo(BigInteger dpId, String portName) {
60         this.dpId = dpId;
61         this.portName = portName;
62     }
63
64     public InterfaceInfo(String portName) {
65         this.portName = portName;
66     }
67
68     public boolean isOperational() {
69         return adminState == InterfaceAdminState.ENABLED && opState == InterfaceOpState.UP;
70     }
71
72     public InterfaceType getInterfaceType() {
73         return interfaceType;
74     }
75     public void setInterfaceType(InterfaceType lportType) {
76         this.interfaceType = lportType;
77     }
78     public int getInterfaceTag() {
79         return interfaceTag;
80     }
81     public void setInterfaceTag(int interfaceTag) {
82         this.interfaceTag = interfaceTag;
83     }
84     public void setUntaggedVlan(boolean isUntaggedVlan) {
85         this.isUntaggedVlan = isUntaggedVlan;
86     }
87     public boolean isUntaggedVlan() {
88         return  isUntaggedVlan;
89     }
90     public BigInteger getDpId() {
91         return dpId;
92     }
93     public void setDpId(BigInteger dpId) {
94         this.dpId = dpId;
95     }
96     public InterfaceAdminState getAdminState() {
97         return adminState;
98     }
99     public void setAdminState(InterfaceAdminState adminState) {
100         this.adminState = adminState;
101     }
102     public InterfaceOpState getOpState() {
103         return opState;
104     }
105     public void setOpState(InterfaceOpState opState) {
106         this.opState = opState;
107     }
108     public long getGroupId() {
109         return groupId;
110     }
111     public void setGroupId(long groupId) {
112         this.groupId = groupId;
113     }
114     public long getL2domainGroupId() {
115         return l2domainGroupId;
116     }
117     public void setL2domainGroupId(long l2domainGroupId) {
118         this.l2domainGroupId = l2domainGroupId;
119     }
120
121     public int getPortNo() {
122         return portNo;
123     }
124
125     public void setPortNo(int portNo) {
126         this.portNo = portNo;
127     }
128
129     public void setPortName(String portName) {
130         this.portName = portName;
131     }
132     public String getPortName(){
133         return this.portName;
134     }
135 }