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 booleanequals(java.lang.Object other)inthashCode()booleanisRateLimited()Indicates whether a rate limit has been set on the interface.DeviceInterfaceDescription.Modemode()Returns the operation mode of the interface.java.lang.Stringname()Returns the name of the interface.shortrateLimit()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:
namein interfaceDeviceInterfaceDescription- Returns:
- name of the interface
-
mode
public DeviceInterfaceDescription.Mode mode()
Returns the operation mode of the interface.- Specified by:
modein 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:
vlansin 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:
isRateLimitedin 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:
rateLimitin interfaceDeviceInterfaceDescription- Returns:
- the rate limit set on the interface bandwidth
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-