2 * Copyright (c) 2015 - 2016 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.interfacemgr.globals;
10 import java.io.Serializable;
11 import java.math.BigInteger;
13 public class InterfaceInfo implements Serializable {
18 private static final long serialVersionUID = 1L;
20 public enum InterfaceType {
22 VXLAN_TRUNK_INTERFACE,
26 LOGICAL_GROUP_INTERFACE,
30 public enum InterfaceAdminState {
35 public enum InterfaceOpState {
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;
52 public String getInterfaceName() {
56 public void setInterfaceName(String interfaceName) {
57 this.interfaceName = interfaceName;
60 public InterfaceInfo(BigInteger dpId, String portName) {
62 this.portName = portName;
65 public InterfaceInfo(String portName) {
66 this.portName = portName;
69 public boolean isOperational() {
70 return adminState == InterfaceAdminState.ENABLED && opState == InterfaceOpState.UP;
73 public InterfaceType getInterfaceType() {
76 public void setInterfaceType(InterfaceType lportType) {
77 this.interfaceType = lportType;
79 public int getInterfaceTag() {
82 public void setInterfaceTag(int interfaceTag) {
83 this.interfaceTag = interfaceTag;
85 public void setUntaggedVlan(boolean isUntaggedVlan) {
86 this.isUntaggedVlan = isUntaggedVlan;
88 public boolean isUntaggedVlan() {
89 return isUntaggedVlan;
91 public BigInteger getDpId() {
94 public void setDpId(BigInteger dpId) {
97 public InterfaceAdminState getAdminState() {
100 public void setAdminState(InterfaceAdminState adminState) {
101 this.adminState = adminState;
103 public InterfaceOpState getOpState() {
106 public void setOpState(InterfaceOpState opState) {
107 this.opState = opState;
109 public long getGroupId() {
112 public void setGroupId(long groupId) {
113 this.groupId = groupId;
115 public long getL2domainGroupId() {
116 return l2domainGroupId;
118 public void setL2domainGroupId(long l2domainGroupId) {
119 this.l2domainGroupId = l2domainGroupId;
122 public int getPortNo() {
126 public void setPortNo(int portNo) {
127 this.portNo = portNo;
130 public void setPortName(String portName) {
131 this.portName = portName;
133 public String getPortName(){
134 return this.portName;