Class UdevDevice

java.lang.Object
com.tccc.kos.core.service.udev.UdevDevice

public class UdevDevice extends Object
Device from udev adapter. This represents a device discovered by udev during an insertion / discovery event. These are typically devices that can be inserted / removed on the fly and need to be processed accordingly. A UdevDevice is fairly low level and is typically abstracted by SerialService and StorageService which make them easier to work with. However, in the event of a device that is neither storage or serial, direct access to the UdevDevice allows a way to handle custom processing of the device.

A majority of the properties in this object come directly from udev. Please see udev documentation to understand their meaning.

A UdevDevice is claimed by an owner, which has exclusive access to the device and receives lifecycle events. The owner should not be modified directly as it is typically assigned during device discovery.

Version:
2023-09-16
  • Constructor Details

    • UdevDevice

      public UdevDevice()
  • Method Details

    • getRunTimeMs

      public long getRunTimeMs()
      Return how long the device has been running in ms. This is how long since the device was first discovered.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getId

      public String getId()
    • getNodePath

      public String getNodePath()
    • getSyspath

      public String getSyspath()
    • getSubsystem

      public String getSubsystem()
    • getDevname

      public String getDevname()
    • getSysname

      public String getSysname()
    • getProperties

      public Map<String,String> getProperties()
    • getCurrentTags

      public List<String> getCurrentTags()
    • getDevLinks

      public List<String> getDevLinks()
    • getOwner

      public UdevDeviceOwner getOwner()
    • getNode

      public UdevNode getNode()
    • setId

      public void setId(String id)
    • setNodePath

      public void setNodePath(String nodePath)
    • setSyspath

      public void setSyspath(String syspath)
    • setSubsystem

      public void setSubsystem(String subsystem)
    • setDevname

      public void setDevname(String devname)
    • setSysname

      public void setSysname(String sysname)
    • setProperties

      public void setProperties(Map<String,String> properties)
    • setCurrentTags

      public void setCurrentTags(List<String> currentTags)
    • setDevLinks

      public void setDevLinks(List<String> devLinks)
    • setOwner

      public void setOwner(UdevDeviceOwner owner)
    • setNode

      public void setNode(UdevNode node)