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.booleanconfigured()Returns true if configured by NetworkConfiguration.static DefaultHostDescriptioncopyReplacingAnnotation(HostDescription base, SparseAnnotations annotations)Creates a host description using the supplied information.booleanequals(Object object)inthashCode()MacAddresshwAddress()Returns the MAC address associated with this host (NIC).VlanIdinnerVlan()Returns the inner VLAN associated with this host.Set<IpAddress>ipAddress()Returns the IP address associated with this host's MAC.HostLocationlocation()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.StringtoString()EthTypetpid()Returns the TPID of the outermost VLAN associated with this host.VlanIdvlan()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:HostDescriptionReturns the MAC address associated with this host (NIC).- Specified by:
hwAddressin interfaceHostDescription- Returns:
- the MAC address of this host
-
vlan
public VlanId vlan()
Description copied from interface:HostDescriptionReturns the VLAN associated with this host.- Specified by:
vlanin interfaceHostDescription- Returns:
- the VLAN ID value
-
location
public HostLocation location()
Description copied from interface:HostDescriptionReturns the most recent location of the host on the network edge.- Specified by:
locationin interfaceHostDescription- Returns:
- the most recent host location
-
locations
public Set<HostLocation> locations()
Description copied from interface:HostDescriptionReturns all locations of the host on the network edge.- Specified by:
locationsin interfaceHostDescription- Returns:
- all host locations
-
auxLocations
public Set<HostLocation> auxLocations()
Description copied from interface:HostDescriptionReturns host auxiliary locations, which could be useful for app operations in addition to the attach points.- Specified by:
auxLocationsin interfaceHostDescription- Returns:
- auxiliary locations, or null if unspecified
-
ipAddress
public Set<IpAddress> ipAddress()
Description copied from interface:HostDescriptionReturns the IP address associated with this host's MAC.- Specified by:
ipAddressin interfaceHostDescription- Returns:
- host IP address
-
configured
public boolean configured()
Description copied from interface:HostDescriptionReturns true if configured by NetworkConfiguration.- Specified by:
configuredin interfaceHostDescription- Returns:
- configured/learnt dynamically
-
innerVlan
public VlanId innerVlan()
Description copied from interface:HostDescriptionReturns the inner VLAN associated with this host.- Specified by:
innerVlanin 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:HostDescriptionReturns the TPID of the outermost VLAN associated with this host.- Specified by:
tpidin interfaceHostDescription- Returns:
- TPID of the outermost VLAN header
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAbstractDescription
-
equals
public boolean equals(Object object)
- Overrides:
equalsin classAbstractDescription
-
-