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 ChassisId
chassisId()
Returns a device chassis id.static DefaultDeviceDescription
copyReplacingAnnotation(DeviceDescription base, SparseAnnotations annotations)
Creates a device description using the supplied information.java.net.URI
deviceUri()
Protocol/provider specific URI that can be used to encode the identity information required to communicate with the device externally, e.g.boolean
equals(java.lang.Object object)
int
hashCode()
java.lang.String
hwVersion()
Returns the device hardware version.boolean
isDefaultAvailable()
Return whether device should be made available by default.java.lang.String
manufacturer()
Returns the device manufacturer name.java.lang.String
serialNumber()
Returns the device serial number.java.lang.String
swVersion()
Returns the device software version.java.lang.String
toString()
Device.Type
type()
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:DeviceDescription
Protocol/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:
deviceUri
in interfaceDeviceDescription
- Returns:
- provider specific URI for the device
-
type
public Device.Type type()
Description copied from interface:DeviceDescription
Returns the type of the infrastructure device.- Specified by:
type
in interfaceDeviceDescription
- Returns:
- type of the device
-
manufacturer
public java.lang.String manufacturer()
Description copied from interface:DeviceDescription
Returns the device manufacturer name.- Specified by:
manufacturer
in interfaceDeviceDescription
- Returns:
- manufacturer name
-
hwVersion
public java.lang.String hwVersion()
Description copied from interface:DeviceDescription
Returns the device hardware version.- Specified by:
hwVersion
in interfaceDeviceDescription
- Returns:
- hardware version
-
swVersion
public java.lang.String swVersion()
Description copied from interface:DeviceDescription
Returns the device software version.- Specified by:
swVersion
in interfaceDeviceDescription
- Returns:
- software version
-
serialNumber
public java.lang.String serialNumber()
Description copied from interface:DeviceDescription
Returns the device serial number.- Specified by:
serialNumber
in interfaceDeviceDescription
- Returns:
- serial number
-
chassisId
public ChassisId chassisId()
Description copied from interface:DeviceDescription
Returns a device chassis id.- Specified by:
chassisId
in interfaceDeviceDescription
- Returns:
- chassis id
-
isDefaultAvailable
public boolean isDefaultAvailable()
Description copied from interface:DeviceDescription
Return whether device should be made available by default.- Specified by:
isDefaultAvailable
in interfaceDeviceDescription
- Returns:
- default availability
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAbstractDescription
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equals
in classAbstractDescription
-
-