public final class MacVlan extends Object implements Comparable<MacVlan>
MacVlan class represents a pair of MAC address and VLAN ID.| Modifier and Type | Field and Description |
|---|---|
static long |
UNDEFINED
A pseudo MAC address which represents undefined value.
|
| Constructor and Description |
|---|
MacVlan(byte[] mac,
int vlan)
Construct a new instance.
|
MacVlan(long value)
Construct a new insttance from a long integer which contains a MAC
address and a VLAN ID.
|
MacVlan(long mac,
int vlan)
Construct a new instance.
|
MacVlan(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress mac,
int vlan)
Construct a new instance.
|
MacVlan(String value)
Construct a new instance.
|
MacVlan(VlanHost vh)
Construct a new instance.
|
MacVlan(VlanHostDesc vhd)
Construct a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkMacMap()
Ensure that this instance can be contained in a MAC mapping
configuration
This method implies
verify(). |
int |
compareTo(MacVlan mvlan)
Compare two
MacVlan instances numerically. |
boolean |
equals(Object o)
Determine whether the given object is identical to this object.
|
long |
getAddress()
Return a long value which represents a MAC address.
|
DataFlowSource |
getDataFlowSource()
Return a
DataFlowSource instance which represents this instance. |
long |
getEncodedValue()
Return a long integer value encoded from a MAC address and a VLAN ID.
|
EtherAddress |
getEtherAddress()
Return a MAC adderss as an
EtherAddress instance. |
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress |
getMacAddress()
Return a MD-SAL MAC address.
|
SourceHostFlowsKey |
getSourceHostFlowsKey()
Return a
SourceHostFlowsKey instance which represents this
instance. |
VlanHostDesc |
getVlanHostDesc()
Return a
VlanHostDesc instance which represents this instance. |
VlanHostDescList |
getVlanHostDescList()
Return a
VlanHostDescList instance which represents this
instance. |
int |
getVlanId()
Return a VLAN ID.
|
int |
hashCode()
Return the hash code of this object.
|
String |
toString()
Return a string representation of this object.
|
void |
verify()
Verify the contents of this instance.
|
public static final long UNDEFINED
public MacVlan(long value)
value - A long value which contains a MAC address and a VLAN ID.public MacVlan(long mac,
int vlan)
mac - A long value which represents a MAC address.
Only lower 48 bits in the value is used.
UNDEFINED is treated as undefined value.vlan - VLAN ID. Only lower 12 bits in the value is used.public MacVlan(VlanHost vh) throws RpcException
vh - A VlanHost instance.RpcException - An invalid value is specified to vh.public MacVlan(VlanHostDesc vhd) throws RpcException
This constructor is used to create a new instance for MAC mapping configuration.
vhd - A VlanHostDesc instance.RpcException - An invalid value is specified to vhd.public MacVlan(String value) throws RpcException
value - A string which represents a pair of MAC address and a
VLAN ID. The given string must consist of a MAC address
and VLAN ID (decimal) joined with "@".
An empty MAC address is treated as MAC address is not
specified.RpcException - An invalid value is specified to value.public MacVlan(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress mac,
int vlan)
mac - A MAC address.
null is treated as undefined value.vlan - VLAN ID. Only lower 12 bits in the value is used.public MacVlan(byte[] mac,
int vlan)
mac - A byte array which represents a MAC address.
null and all-zeroed byte array are treated as
undefined value.vlan - VLAN ID. Only lower 12 bits in the value is used.public long getAddress()
UNDEFINED is returned if no MAC address is configured
in this instance.public org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress getMacAddress()
MacAddress instance.
Note that null is returned if no MAC address is
configured in this instance.public EtherAddress getEtherAddress()
EtherAddress instance.EtherAddress instance.
Note that null is returned if no MAC address is
configured in this instance.public int getVlanId()
public long getEncodedValue()
Lower 48-bits of the returned value keeps a MAC address. And higher 16-bits of the returned value keeps a VLAN ID.
public DataFlowSource getDataFlowSource()
DataFlowSource instance which represents this instance.DataFlowSource instance.public SourceHostFlowsKey getSourceHostFlowsKey()
SourceHostFlowsKey instance which represents this
instance.SourceHostFlowsKey instance.
Note that null is returned if no MAC address is
configured in this instance.public VlanHostDesc getVlanHostDesc()
VlanHostDesc instance which represents this instance.VlanHostDesc instance.public VlanHostDescList getVlanHostDescList()
VlanHostDescList instance which represents this
instance.VlanHostDescList instance.public void verify()
throws RpcException
RpcException - Verification failed.public void checkMacMap()
throws RpcException
This method implies verify().
RpcException - This instance is not suitable for MAC mapping configuration.public boolean equals(Object o)
public int hashCode()
public String toString()
public int compareTo(MacVlan mvlan)
MacVlan instances numerically.
This method compares MAC addresses in both objects first. If the same MAC address is configured in both objects, compares VLAN IDs in both objects.
compareTo in interface Comparable<MacVlan>mvlan - A MacVlan instance to be compared.0 is returned if this instance is equal to
the specified instance.
A value less than 0 is returned if this instance is
numerically less than the specified instance.
A value greater than 0 is returned if this instance is
numerically greater than the specified instance.Copyright © 2018 OpenDaylight. All rights reserved.