Package org.onosproject.net
Class DefaultDevice
-
- All Implemented Interfaces:
Annotated,Device,Projectable,Element,Provided
public class DefaultDevice extends AbstractElement implements Device
Default infrastructure device model implementation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classDefaultDevice.DeviceDriverDataProjection of the parent entity as a driver data entity.-
Nested classes/interfaces inherited from class org.onosproject.net.AbstractProjectableModel
AbstractProjectableModel.AnnotationDriverData
-
Nested classes/interfaces inherited from interface org.onosproject.net.Device
Device.Type
-
-
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 DefaultDevice(ProviderId providerId, DeviceId id, Device.Type type, String manufacturer, String hwVersion, String swVersion, String serialNumber, ChassisId chassisId, Annotations... annotations)Creates a network element attributed to the specified provider.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <B extends Behaviour>
Bas(Class<B> projectionClass)Returns the specified projection of this entity if such projection is supported.protected DriverDataasData()Returns self as an immutable driver data instance.ChassisIdchassisId()Returns the device chassis id.booleanequals(Object obj)inthashCode()StringhwVersion()Returns the device hardware version.DeviceIdid()Returns the device identifier.protected DriverlocateDriver()Locates the driver to be used by this entity.Stringmanufacturer()Returns the device manufacturer name.StringserialNumber()Returns the device serial number.StringswVersion()Returns the device software version.StringtoString()Device.Typetype()Returns the type of the infrastructure device.-
Methods inherited from class org.onosproject.net.AbstractProjectableModel
bindAndCheckDriver, bindDriver, driver, driverService, is, 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
is, project
-
Methods inherited from interface org.onosproject.net.Provided
providerId
-
-
-
-
Constructor Detail
-
DefaultDevice
public DefaultDevice(ProviderId providerId, DeviceId id, Device.Type type, String manufacturer, String hwVersion, String swVersion, String serialNumber, ChassisId chassisId, Annotations... annotations)
Creates a network element attributed to the specified provider.- Parameters:
providerId- identity of the providerid- device identifiertype- device typemanufacturer- device manufacturerhwVersion- device HW versionswVersion- device SW versionserialNumber- device serial numberchassisId- chassis idannotations- optional key/value annotations
-
-
Method Detail
-
type
public Device.Type type()
Description copied from interface:DeviceReturns the type of the infrastructure device.
-
manufacturer
public String manufacturer()
Description copied from interface:DeviceReturns the device manufacturer name.- Specified by:
manufacturerin interfaceDevice- Returns:
- manufacturer name
-
hwVersion
public String hwVersion()
Description copied from interface:DeviceReturns the device hardware version.
-
swVersion
public String swVersion()
Description copied from interface:DeviceReturns the device software version.
-
serialNumber
public String serialNumber()
Description copied from interface:DeviceReturns the device serial number.- Specified by:
serialNumberin interfaceDevice- Returns:
- serial number
-
chassisId
public ChassisId chassisId()
Description copied from interface:DeviceReturns the device chassis id.
-
as
public <B extends Behaviour> B as(Class<B> projectionClass)
Description copied from interface:ProjectableReturns the specified projection of this entity if such projection is supported.- Specified by:
asin interfaceProjectable- Overrides:
asin classAbstractProjectableModel- Type Parameters:
B- type of behaviour- Parameters:
projectionClass- requested projection class- Returns:
- projection instance
-
asData
protected DriverData asData()
Returns self as an immutable driver data instance.- Overrides:
asDatain classAbstractProjectableModel- Returns:
- self as driver data
-
locateDriver
protected Driver locateDriver()
Description copied from class:AbstractProjectableModelLocates the driver to be used by this entity.The default implementation derives the driver based on the
driverannotation value.- Overrides:
locateDriverin classAbstractProjectableModel- Returns:
- driver for alternate projections of this model entity or null if no driver is expected or driver is not found
-
-