Package com.tccc.kos.core.service.device
This package provides a comprehensive device abstraction layer that allows external systems to discover and interact with device information without needing to query multiple endpoints. The device model serves as a unified view of the system's identity, configuration, and capabilities.
The core components include:
Device
- Abstract base class for device representationsDeviceService
- Service for device management and change notificationsAssemblyDevice
- Default device implementation exposing assemblies
Device Model:
The Device
class serves as a view object that aggregates key device data including
name, serial number, node ID, and assemblies. This pattern facilitates external system
integration by providing a single endpoint for device discovery rather than requiring
multiple API calls to gather device information.
Serial Number Management:
The package includes a comprehensive serial number management system through the
serialnum
sub-package. Serial number providers implement a ready pattern,
allowing for scenarios where serial number access may be delayed (e.g., waiting for
hardware initialization or critical data availability).
Usage Pattern:
System applications typically subclass Device
and register it with the
DeviceService
using setDevice()
. The device is then accessible
via REST API and can be filtered using DeviceView
JSON views for external system consumption.
-
ClassesClassDescriptionAn implementation of
Device
that simply exposes all available assemblies.Base class forDevice
config beans.Device<T extends BaseDeviceConfig>A representation of the device.Track device changes and send notifications.