Package org.onosproject.net.device
Class DefaultDeviceDescription
- java.lang.Object
-
- org.onosproject.net.AbstractDescription
-
- org.onosproject.net.device.DefaultDeviceDescription
-
- All Implemented Interfaces:
Annotated,Description,DeviceDescription
public class DefaultDeviceDescription extends AbstractDescription implements DeviceDescription
Default implementation of immutable device description entity.
-
-
Constructor Summary
Constructors Constructor Description DefaultDeviceDescription(URI uri, Device.Type type, String manufacturer, String hwVersion, String swVersion, String serialNumber, ChassisId chassis, boolean defaultAvailable, SparseAnnotations... annotations)Creates a device description using the supplied information.DefaultDeviceDescription(URI uri, Device.Type type, String manufacturer, String hwVersion, String swVersion, String serialNumber, ChassisId chassis, SparseAnnotations... annotations)Creates a device description using the supplied information.DefaultDeviceDescription(DeviceDescription base, boolean defaultAvailable, SparseAnnotations... annotations)Creates a device description using the supplied information.DefaultDeviceDescription(DeviceDescription base, Device.Type type, SparseAnnotations... annotations)Creates a device description using the supplied information.DefaultDeviceDescription(DeviceDescription base, SparseAnnotations... annotations)Creates a device description using the supplied information.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ChassisIdchassisId()Returns a device chassis id.static DefaultDeviceDescriptioncopyReplacingAnnotation(DeviceDescription base, SparseAnnotations annotations)Creates a device description using the supplied information.URIdeviceUri()Protocol/provider specific URI that can be used to encode the identity information required to communicate with the device externally, e.g.booleanequals(Object object)inthashCode()StringhwVersion()Returns the device hardware version.booleanisDefaultAvailable()Return whether device should be made available by default.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.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
-
DefaultDeviceDescription
public DefaultDeviceDescription(URI uri, Device.Type type, String manufacturer, String hwVersion, String swVersion, String serialNumber, ChassisId chassis, SparseAnnotations... annotations)
Creates a device description using the supplied information.- Parameters:
uri- device URItype- device typemanufacturer- device manufacturerhwVersion- device HW versionswVersion- device SW versionserialNumber- device serial numberchassis- chassis idannotations- optional key/value annotations map
-
DefaultDeviceDescription
public DefaultDeviceDescription(URI uri, Device.Type type, String manufacturer, String hwVersion, String swVersion, String serialNumber, ChassisId chassis, boolean defaultAvailable, SparseAnnotations... annotations)
Creates a device description using the supplied information.- Parameters:
uri- device URItype- device typemanufacturer- device manufacturerhwVersion- device HW versionswVersion- device SW versionserialNumber- device serial numberchassis- chassis iddefaultAvailable- optional whether device is by default availableannotations- optional key/value annotations map
-
DefaultDeviceDescription
public DefaultDeviceDescription(DeviceDescription base, SparseAnnotations... annotations)
Creates a device description using the supplied information.- Parameters:
base- DeviceDescription to basic informationannotations- Annotations to use.
-
DefaultDeviceDescription
public DefaultDeviceDescription(DeviceDescription base, Device.Type type, SparseAnnotations... annotations)
Creates a device description using the supplied information.- Parameters:
base- DeviceDescription to basic information (except for type)type- device typeannotations- Annotations to use.
-
DefaultDeviceDescription
public DefaultDeviceDescription(DeviceDescription base, boolean defaultAvailable, SparseAnnotations... annotations)
Creates a device description using the supplied information.- Parameters:
base- DeviceDescription to basic information (except for defaultAvailable)defaultAvailable- whether device should be made available by defaultannotations- Annotations to use.
-
-
Method Detail
-
copyReplacingAnnotation
public static DefaultDeviceDescription copyReplacingAnnotation(DeviceDescription base, SparseAnnotations annotations)
Creates a device description using the supplied information.- Parameters:
base- baseannotations- annotations- Returns:
- device description
-
deviceUri
public URI deviceUri()
Description copied from interface:DeviceDescriptionProtocol/provider specific URI that can be used to encode the identity information required to communicate with the device externally, e.g. datapath ID.- Specified by:
deviceUriin interfaceDeviceDescription- Returns:
- provider specific URI for the device
-
type
public Device.Type type()
Description copied from interface:DeviceDescriptionReturns the type of the infrastructure device.- Specified by:
typein interfaceDeviceDescription- Returns:
- type of the device
-
manufacturer
public String manufacturer()
Description copied from interface:DeviceDescriptionReturns the device manufacturer name.- Specified by:
manufacturerin interfaceDeviceDescription- Returns:
- manufacturer name
-
hwVersion
public String hwVersion()
Description copied from interface:DeviceDescriptionReturns the device hardware version.- Specified by:
hwVersionin interfaceDeviceDescription- Returns:
- hardware version
-
swVersion
public String swVersion()
Description copied from interface:DeviceDescriptionReturns the device software version.- Specified by:
swVersionin interfaceDeviceDescription- Returns:
- software version
-
serialNumber
public String serialNumber()
Description copied from interface:DeviceDescriptionReturns the device serial number.- Specified by:
serialNumberin interfaceDeviceDescription- Returns:
- serial number
-
chassisId
public ChassisId chassisId()
Description copied from interface:DeviceDescriptionReturns a device chassis id.- Specified by:
chassisIdin interfaceDeviceDescription- Returns:
- chassis id
-
isDefaultAvailable
public boolean isDefaultAvailable()
Description copied from interface:DeviceDescriptionReturn whether device should be made available by default.- Specified by:
isDefaultAvailablein interfaceDeviceDescription- Returns:
- default availability
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAbstractDescription
-
equals
public boolean equals(Object object)
- Overrides:
equalsin classAbstractDescription
-
-