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 ChassisId
chassisId()
Returns a device chassis id.static DefaultDeviceDescription
copyReplacingAnnotation(DeviceDescription base, SparseAnnotations annotations)
Creates a device description using the supplied information.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(Object object)
int
hashCode()
String
hwVersion()
Returns the device hardware version.boolean
isDefaultAvailable()
Return whether device should be made available by default.String
manufacturer()
Returns the device manufacturer name.String
serialNumber()
Returns the device serial number.String
swVersion()
Returns the device software version.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(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: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 String manufacturer()
Description copied from interface:DeviceDescription
Returns the device manufacturer name.- Specified by:
manufacturer
in interfaceDeviceDescription
- Returns:
- manufacturer name
-
hwVersion
public String hwVersion()
Description copied from interface:DeviceDescription
Returns the device hardware version.- Specified by:
hwVersion
in interfaceDeviceDescription
- Returns:
- hardware version
-
swVersion
public String swVersion()
Description copied from interface:DeviceDescription
Returns the device software version.- Specified by:
swVersion
in interfaceDeviceDescription
- Returns:
- software version
-
serialNumber
public 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
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAbstractDescription
-
equals
public boolean equals(Object object)
- Overrides:
equals
in classAbstractDescription
-
-