Package org.onosproject.net
Class DefaultHost
- java.lang.Object
-
- All Implemented Interfaces:
Annotated
,Projectable
,Element
,Host
,Provided
public class DefaultHost extends AbstractElement implements Host
A basic implementation of a Host.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.onosproject.net.AbstractProjectableModel
AbstractProjectableModel.AnnotationDriverData
-
-
Field Summary
-
Fields inherited from class org.onosproject.net.AbstractElement
id
-
Fields inherited from class org.onosproject.net.AbstractProjectableModel
NO_DRIVER, NO_DRIVER_SERVICE
-
-
Constructor Summary
Constructors Constructor Description DefaultHost(ProviderId providerId, HostId id, MacAddress mac, VlanId vlan, java.util.Set<HostLocation> locations, java.util.Set<IpAddress> ips, boolean configured, Annotations... annotations)
Creates an end-station host using the supplied information.DefaultHost(ProviderId providerId, HostId id, MacAddress mac, VlanId vlan, java.util.Set<HostLocation> locations, java.util.Set<IpAddress> ips, VlanId innerVlan, EthType tpid, boolean configured, boolean suspended, Annotations... annotations)
Creates an end-station host using the supplied information.DefaultHost(ProviderId providerId, HostId id, MacAddress mac, VlanId vlan, java.util.Set<HostLocation> locations, java.util.Set<IpAddress> ips, VlanId innerVlan, EthType tpid, boolean configured, Annotations... annotations)
Creates an end-station host using the supplied information.DefaultHost(ProviderId providerId, HostId id, MacAddress mac, VlanId vlan, java.util.Set<HostLocation> locations, java.util.Set<HostLocation> auxLocations, java.util.Set<IpAddress> ips, VlanId innerVlan, EthType tpid, boolean configured, boolean suspended, Annotations... annotations)
Creates an end-station host using the supplied information.DefaultHost(ProviderId providerId, HostId id, MacAddress mac, VlanId vlan, HostLocation location, java.util.Set<IpAddress> ips, boolean configured, Annotations... annotations)
Creates an end-station host using the supplied information.DefaultHost(ProviderId providerId, HostId id, MacAddress mac, VlanId vlan, HostLocation location, java.util.Set<IpAddress> ips, Annotations... annotations)
Creates an end-station host using the supplied information.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.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.boolean
equals(java.lang.Object obj)
int
hashCode()
HostId
id()
Host identification.VlanId
innerVlan()
Returns the inner VLAN ID tied to this host.java.util.Set<IpAddress>
ipAddresses()
Returns an unmodifiable set of IP addresses currently bound to the host MAC address.HostLocation
location()
Returns the most recent host location where the host attaches to the network edge.java.util.Set<HostLocation>
locations()
Returns host locations where the host attaches to the network edge.MacAddress
mac()
Returns the host MAC address.boolean
suspended()
Returns the state of host whether it is in suspended state(offending host due to frequent movement.).java.lang.String
toString()
EthType
tpid()
Returns the TPID of the outermost VLAN associated with this host.VlanId
vlan()
Returns the VLAN ID tied to this host.-
Methods inherited from class org.onosproject.net.AbstractProjectableModel
as, asData, bindAndCheckDriver, bindDriver, driver, driverService, is, locateDriver, setDriverService
-
Methods inherited from class org.onosproject.net.AbstractModel
providerId
-
Methods inherited from class org.onosproject.net.AbstractAnnotated
annotations
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.onosproject.net.Annotated
annotations
-
Methods inherited from interface org.onosproject.net.driver.Projectable
as, is, project
-
Methods inherited from interface org.onosproject.net.Provided
providerId
-
-
-
-
Constructor Detail
-
DefaultHost
public DefaultHost(ProviderId providerId, HostId id, MacAddress mac, VlanId vlan, HostLocation location, java.util.Set<IpAddress> ips, Annotations... annotations)
Creates an end-station host using the supplied information.- Parameters:
providerId
- provider identityid
- host identifiermac
- host MAC addressvlan
- host VLAN identifierlocation
- host locationips
- host IP addressesannotations
- optional key/value annotations
-
DefaultHost
public DefaultHost(ProviderId providerId, HostId id, MacAddress mac, VlanId vlan, HostLocation location, java.util.Set<IpAddress> ips, boolean configured, Annotations... annotations)
Creates an end-station host using the supplied information.- Parameters:
providerId
- provider identityid
- host identifiermac
- host MAC addressvlan
- host VLAN identifierlocation
- host locationips
- host IP addressesconfigured
- true if configured via NetworkConfigurationannotations
- optional key/value annotations
-
DefaultHost
public DefaultHost(ProviderId providerId, HostId id, MacAddress mac, VlanId vlan, java.util.Set<HostLocation> locations, java.util.Set<IpAddress> ips, boolean configured, Annotations... annotations)
Creates an end-station host using the supplied information.- Parameters:
providerId
- provider identityid
- host identifiermac
- host MAC addressvlan
- host VLAN identifierlocations
- set of host locationsips
- host IP addressesconfigured
- true if configured via NetworkConfigurationannotations
- optional key/value annotations
-
DefaultHost
public DefaultHost(ProviderId providerId, HostId id, MacAddress mac, VlanId vlan, java.util.Set<HostLocation> locations, java.util.Set<IpAddress> ips, VlanId innerVlan, EthType tpid, boolean configured, Annotations... annotations)
Creates an end-station host using the supplied information.- Parameters:
providerId
- provider identityid
- host identifiermac
- host MAC addressvlan
- host VLAN identifierlocations
- set of host locationsips
- host IP addressesinnerVlan
- host inner VLAN identifiertpid
- outer TPID of a hostconfigured
- true if configured via NetworkConfigurationannotations
- optional key/value annotations
-
DefaultHost
public DefaultHost(ProviderId providerId, HostId id, MacAddress mac, VlanId vlan, java.util.Set<HostLocation> locations, java.util.Set<IpAddress> ips, VlanId innerVlan, EthType tpid, boolean configured, boolean suspended, Annotations... annotations)
Creates an end-station host using the supplied information.- Parameters:
providerId
- provider identityid
- host identifiermac
- host MAC addressvlan
- host VLAN identifierlocations
- set of host locationsips
- host IP addressesconfigured
- true if configured via NetworkConfigurationinnerVlan
- host inner VLAN identifiertpid
- outer TPID of a hostsuspended
- true if the host is suspended due to policy violation.annotations
- optional key/value annotations
-
DefaultHost
public DefaultHost(ProviderId providerId, HostId id, MacAddress mac, VlanId vlan, java.util.Set<HostLocation> locations, java.util.Set<HostLocation> auxLocations, java.util.Set<IpAddress> ips, VlanId innerVlan, EthType tpid, boolean configured, boolean suspended, Annotations... annotations)
Creates an end-station host using the supplied information.- Parameters:
providerId
- provider identityid
- host identifiermac
- host MAC addressvlan
- host VLAN identifierlocations
- set of host locationsauxLocations
- set of auxiliary locations, or null if unspecifiedips
- host IP addressesconfigured
- true if configured via NetworkConfigurationinnerVlan
- host inner VLAN identifiertpid
- outer TPID of a hostsuspended
- true if the host is suspended due to policy violation.annotations
- optional key/value annotations
-
-
Method Detail
-
mac
public MacAddress mac()
Description copied from interface:Host
Returns the host MAC address.
-
ipAddresses
public java.util.Set<IpAddress> ipAddresses()
Returns an unmodifiable set of IP addresses currently bound to the host MAC address.- Specified by:
ipAddresses
in interfaceHost
- Returns:
- set of IP addresses; empty if no IP address is bound
-
location
public HostLocation location()
Description copied from interface:Host
Returns the most recent host location where the host attaches to the network edge.
-
locations
public java.util.Set<HostLocation> locations()
Description copied from interface:Host
Returns host locations where the host attaches to the network edge.
-
auxLocations
public java.util.Set<HostLocation> auxLocations()
Description copied from interface:Host
Returns host auxiliary locations, which could be useful for app operations in addition to the attach points.- Specified by:
auxLocations
in interfaceHost
- Returns:
- auxiliary locations, or null if unspecified
-
vlan
public VlanId vlan()
Description copied from interface:Host
Returns the VLAN ID tied to this host.
-
innerVlan
public VlanId innerVlan()
Description copied from interface:Host
Returns the inner VLAN ID tied to this host.
-
tpid
public EthType tpid()
Description copied from interface:Host
Returns the TPID of the outermost VLAN associated with this host.
-
configured
public boolean configured()
Description copied from interface:Host
Returns true if configured by NetworkConfiguration.- Specified by:
configured
in interfaceHost
- Returns:
- configured/learnt dynamically
-
suspended
public boolean suspended()
Description copied from interface:Host
Returns the state of host whether it is in suspended state(offending host due to frequent movement.).
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-