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(java.net.URI uri, Device.Type type, java.lang.String manufacturer, java.lang.String hwVersion, java.lang.String swVersion, java.lang.String serialNumber, ChassisId chassis, boolean defaultAvailable, SparseAnnotations... annotations)Creates a device description using the supplied information.DefaultDeviceDescription(java.net.URI uri, Device.Type type, java.lang.String manufacturer, java.lang.String hwVersion, java.lang.String swVersion, java.lang.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.java.net.URIdeviceUri()Protocol/provider specific URI that can be used to encode the identity information required to communicate with the device externally, e.g.booleanequals(java.lang.Object object)inthashCode()java.lang.StringhwVersion()Returns the device hardware version.booleanisDefaultAvailable()Return whether device should be made available by default.java.lang.Stringmanufacturer()Returns the device manufacturer name.java.lang.StringserialNumber()Returns the device serial number.java.lang.StringswVersion()Returns the device software version.java.lang.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(java.net.URI uri, Device.Type type, java.lang.String manufacturer, java.lang.String hwVersion, java.lang.String swVersion, java.lang.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(java.net.URI uri, Device.Type type, java.lang.String manufacturer, java.lang.String hwVersion, java.lang.String swVersion, java.lang.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 java.net.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 java.lang.String manufacturer()
Description copied from interface:DeviceDescriptionReturns the device manufacturer name.- Specified by:
manufacturerin interfaceDeviceDescription- Returns:
- manufacturer name
-
hwVersion
public java.lang.String hwVersion()
Description copied from interface:DeviceDescriptionReturns the device hardware version.- Specified by:
hwVersionin interfaceDeviceDescription- Returns:
- hardware version
-
swVersion
public java.lang.String swVersion()
Description copied from interface:DeviceDescriptionReturns the device software version.- Specified by:
swVersionin interfaceDeviceDescription- Returns:
- software version
-
serialNumber
public java.lang.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
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAbstractDescription
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equalsin classAbstractDescription
-
-