Package org.onosproject.net.device
Class DefaultDeviceInterfaceDescription
- java.lang.Object
-
- org.onosproject.net.device.DefaultDeviceInterfaceDescription
-
- All Implemented Interfaces:
DeviceInterfaceDescription
public class DefaultDeviceInterfaceDescription extends java.lang.Object implements DeviceInterfaceDescription
Basic implementation of description of a legacy device interface.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.onosproject.net.device.DeviceInterfaceDescription
DeviceInterfaceDescription.Mode
-
-
Constructor Summary
Constructors Constructor Description DefaultDeviceInterfaceDescription(java.lang.String name, DeviceInterfaceDescription.Mode mode, java.util.List<VlanId> vlans, boolean isRateLimited, short rateLimit)
Device interface description object constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object other)
int
hashCode()
boolean
isRateLimited()
Indicates whether a rate limit has been set on the interface.DeviceInterfaceDescription.Mode
mode()
Returns the operation mode of the interface.java.lang.String
name()
Returns the name of the interface.short
rateLimit()
Returns the rate limit set on the interface bandwidth.java.util.List<VlanId>
vlans()
Returns the VLAN-IDs configured for the interface.
-
-
-
Constructor Detail
-
DefaultDeviceInterfaceDescription
public DefaultDeviceInterfaceDescription(java.lang.String name, DeviceInterfaceDescription.Mode mode, java.util.List<VlanId> vlans, boolean isRateLimited, short rateLimit)
Device interface description object constructor.- Parameters:
name
- the name of the interfacemode
- the operation mode of the interfacevlans
- the vlan-id of the interface (none, one or multiple can be specified based on if mode is normal, access or trunk).isRateLimited
- bandwidth limit application indicationrateLimit
- percentage of bandwidth limit
-
-
Method Detail
-
name
public java.lang.String name()
Returns the name of the interface.- Specified by:
name
in interfaceDeviceInterfaceDescription
- Returns:
- name of the interface
-
mode
public DeviceInterfaceDescription.Mode mode()
Returns the operation mode of the interface.- Specified by:
mode
in interfaceDeviceInterfaceDescription
- Returns:
- operation mode of the interface
-
vlans
public java.util.List<VlanId> vlans()
Returns the VLAN-IDs configured for the interface. No VLAN-ID should be returned for NORMAL mode, 1 VLAN-ID for access mode and 1 or more VLAN-IDs for trunking mode.- Specified by:
vlans
in interfaceDeviceInterfaceDescription
- Returns:
- VLAN-ID(s) configured for the interface.
-
isRateLimited
public boolean isRateLimited()
Indicates whether a rate limit has been set on the interface.- Specified by:
isRateLimited
in interfaceDeviceInterfaceDescription
- Returns:
- indication whether interface is rate limited or not
-
rateLimit
public short rateLimit()
Returns the rate limit set on the interface bandwidth.- Specified by:
rateLimit
in interfaceDeviceInterfaceDescription
- Returns:
- the rate limit set on the interface bandwidth
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-