Package org.onosproject.net.host
Class DefaultHostDescription
- java.lang.Object
-
- org.onosproject.net.AbstractDescription
-
- org.onosproject.net.host.DefaultHostDescription
-
- All Implemented Interfaces:
Annotated
,Description
,HostDescription
public class DefaultHostDescription extends AbstractDescription implements HostDescription
Default implementation of an immutable host description.
-
-
Constructor Summary
Constructors Constructor Description DefaultHostDescription(MacAddress mac, VlanId vlan, Set<HostLocation> locations, Set<IpAddress> ip, boolean configured, SparseAnnotations... annotations)
Creates a host description using the supplied information.DefaultHostDescription(MacAddress mac, VlanId vlan, Set<HostLocation> locations, Set<IpAddress> ip, VlanId innerVlan, EthType tpid, boolean configured, SparseAnnotations... annotations)
Creates a host description using the supplied information.DefaultHostDescription(MacAddress mac, VlanId vlan, Set<HostLocation> locations, Set<HostLocation> auxLocations, Set<IpAddress> ip, VlanId innerVlan, EthType tpid, boolean configured, SparseAnnotations... annotations)
Creates a host description using the supplied information.DefaultHostDescription(MacAddress mac, VlanId vlan, HostLocation location, boolean configured, SparseAnnotations... annotations)
Creates a host description using the supplied information.DefaultHostDescription(MacAddress mac, VlanId vlan, HostLocation location, Set<IpAddress> ip, boolean configured, SparseAnnotations... annotations)
Creates a host description using the supplied information.DefaultHostDescription(MacAddress mac, VlanId vlan, HostLocation location, Set<IpAddress> ip, SparseAnnotations... annotations)
Creates a host description using the supplied information.DefaultHostDescription(MacAddress mac, VlanId vlan, HostLocation location, IpAddress ip, SparseAnnotations... annotations)
Creates a host description using the supplied information.DefaultHostDescription(MacAddress mac, VlanId vlan, HostLocation location, SparseAnnotations... annotations)
Creates a host description using the supplied information.DefaultHostDescription(HostDescription base, SparseAnnotations annotations)
Creates a host description using the supplied information.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<HostLocation>
auxLocations()
Returns host auxiliary locations, which could be useful for app operations in addition to the attach points.boolean
configured()
Returns true if configured by NetworkConfiguration.static DefaultHostDescription
copyReplacingAnnotation(HostDescription base, SparseAnnotations annotations)
Creates a host description using the supplied information.boolean
equals(Object object)
int
hashCode()
MacAddress
hwAddress()
Returns the MAC address associated with this host (NIC).VlanId
innerVlan()
Returns the inner VLAN associated with this host.Set<IpAddress>
ipAddress()
Returns the IP address associated with this host's MAC.HostLocation
location()
Returns the most recent location of the host on the network edge.Set<HostLocation>
locations()
Returns all locations of the host on the network edge.String
toString()
EthType
tpid()
Returns the TPID of the outermost VLAN associated with this host.VlanId
vlan()
Returns the VLAN associated with this host.-
Methods inherited from class org.onosproject.net.AbstractDescription
annotations
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.onosproject.net.Description
annotations
-
-
-
-
Constructor Detail
-
DefaultHostDescription
public DefaultHostDescription(MacAddress mac, VlanId vlan, HostLocation location, SparseAnnotations... annotations)
Creates a host description using the supplied information.- Parameters:
mac
- host MAC addressvlan
- host VLAN identifierlocation
- host locationannotations
- optional key/value annotations map
-
DefaultHostDescription
public DefaultHostDescription(MacAddress mac, VlanId vlan, HostLocation location, IpAddress ip, SparseAnnotations... annotations)
Creates a host description using the supplied information.- Parameters:
mac
- host MAC addressvlan
- host VLAN identifierlocation
- host locationip
- host IP addressannotations
- optional key/value annotations map
-
DefaultHostDescription
public DefaultHostDescription(MacAddress mac, VlanId vlan, HostLocation location, Set<IpAddress> ip, SparseAnnotations... annotations)
Creates a host description using the supplied information.- Parameters:
mac
- host MAC addressvlan
- host VLAN identifierlocation
- host locationip
- host IP addressesannotations
- optional key/value annotations map
-
DefaultHostDescription
public DefaultHostDescription(MacAddress mac, VlanId vlan, HostLocation location, boolean configured, SparseAnnotations... annotations)
Creates a host description using the supplied information.- Parameters:
mac
- host MAC addressvlan
- host VLAN identifierlocation
- host locationconfigured
- true if configured via NetworkConfigurationannotations
- optional key/value annotations map
-
DefaultHostDescription
public DefaultHostDescription(MacAddress mac, VlanId vlan, HostLocation location, Set<IpAddress> ip, boolean configured, SparseAnnotations... annotations)
Creates a host description using the supplied information.- Parameters:
mac
- host MAC addressvlan
- host VLAN identifierlocation
- host locationip
- host IP addressconfigured
- true if configured via NetworkConfigurationannotations
- optional key/value annotations map
-
DefaultHostDescription
public DefaultHostDescription(MacAddress mac, VlanId vlan, Set<HostLocation> locations, Set<IpAddress> ip, boolean configured, SparseAnnotations... annotations)
Creates a host description using the supplied information.- Parameters:
mac
- host MAC addressvlan
- host VLAN identifierlocations
- host locationsip
- host IP addressconfigured
- true if configured via NetworkConfigurationannotations
- optional key/value annotations map
-
DefaultHostDescription
public DefaultHostDescription(MacAddress mac, VlanId vlan, Set<HostLocation> locations, Set<IpAddress> ip, VlanId innerVlan, EthType tpid, boolean configured, SparseAnnotations... annotations)
Creates a host description using the supplied information.- Parameters:
mac
- host MAC addressvlan
- host VLAN identifierlocations
- host locationsip
- host IP addressinnerVlan
- host inner VLAN identifiertpid
- outer TPID of a hostconfigured
- true if configured via NetworkConfigurationannotations
- optional key/value annotations map
-
DefaultHostDescription
public DefaultHostDescription(MacAddress mac, VlanId vlan, Set<HostLocation> locations, Set<HostLocation> auxLocations, Set<IpAddress> ip, VlanId innerVlan, EthType tpid, boolean configured, SparseAnnotations... annotations)
Creates a host description using the supplied information.- Parameters:
mac
- host MAC addressvlan
- host VLAN identifierlocations
- host locationsauxLocations
- set of auxiliary locations, or null if unspecifiedip
- host IP addressinnerVlan
- host inner VLAN identifiertpid
- outer TPID of a hostconfigured
- true if configured via NetworkConfigurationannotations
- optional key/value annotations map
-
DefaultHostDescription
public DefaultHostDescription(HostDescription base, SparseAnnotations annotations)
Creates a host description using the supplied information.- Parameters:
base
- HostDescription to basic informationannotations
- Annotations to use.
-
-
Method Detail
-
copyReplacingAnnotation
public static DefaultHostDescription copyReplacingAnnotation(HostDescription base, SparseAnnotations annotations)
Creates a host description using the supplied information.- Parameters:
base
- baseannotations
- annotations- Returns:
- host description
-
hwAddress
public MacAddress hwAddress()
Description copied from interface:HostDescription
Returns the MAC address associated with this host (NIC).- Specified by:
hwAddress
in interfaceHostDescription
- Returns:
- the MAC address of this host
-
vlan
public VlanId vlan()
Description copied from interface:HostDescription
Returns the VLAN associated with this host.- Specified by:
vlan
in interfaceHostDescription
- Returns:
- the VLAN ID value
-
location
public HostLocation location()
Description copied from interface:HostDescription
Returns the most recent location of the host on the network edge.- Specified by:
location
in interfaceHostDescription
- Returns:
- the most recent host location
-
locations
public Set<HostLocation> locations()
Description copied from interface:HostDescription
Returns all locations of the host on the network edge.- Specified by:
locations
in interfaceHostDescription
- Returns:
- all host locations
-
auxLocations
public Set<HostLocation> auxLocations()
Description copied from interface:HostDescription
Returns host auxiliary locations, which could be useful for app operations in addition to the attach points.- Specified by:
auxLocations
in interfaceHostDescription
- Returns:
- auxiliary locations, or null if unspecified
-
ipAddress
public Set<IpAddress> ipAddress()
Description copied from interface:HostDescription
Returns the IP address associated with this host's MAC.- Specified by:
ipAddress
in interfaceHostDescription
- Returns:
- host IP address
-
configured
public boolean configured()
Description copied from interface:HostDescription
Returns true if configured by NetworkConfiguration.- Specified by:
configured
in interfaceHostDescription
- Returns:
- configured/learnt dynamically
-
innerVlan
public VlanId innerVlan()
Description copied from interface:HostDescription
Returns the inner VLAN associated with this host.- Specified by:
innerVlan
in interfaceHostDescription
- Returns:
- VLAN ID value; VlanId.NONE if only one VLAN ID is associated with this host
-
tpid
public EthType tpid()
Description copied from interface:HostDescription
Returns the TPID of the outermost VLAN associated with this host.- Specified by:
tpid
in interfaceHostDescription
- Returns:
- TPID of the outermost VLAN header
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAbstractDescription
-
equals
public boolean equals(Object object)
- Overrides:
equals
in classAbstractDescription
-
-