Class Device

java.lang.Object
org.eclipse.hono.auth.Device
All Implemented Interfaces:
Principal

public class Device extends Object implements Principal
An authenticated client of a protocol adapter representing a device.
  • Constructor Details

    • Device

      public Device(String tenantId, String deviceId)
      Creates a new device for a tenant and device identifier.
      Parameters:
      tenantId - The tenant.
      deviceId - The device identifier.
      Throws:
      NullPointerException - if any of the params is null.
  • Method Details

    • principal

      public final io.vertx.core.json.JsonObject principal()
      Get the underlying principal of the device.
      Returns:
      JSON representation of the Principal.
    • getTenantId

      public final String getTenantId()
      Gets the identifier of the tenant this device belongs to.
      Returns:
      The identifier.
    • getDeviceId

      public final String getDeviceId()
      Gets this device's identifier.
      Returns:
      The identifier.
    • getName

      public final String getName()

      Returns the device identifier.

      Specified by:
      getName in interface Principal
    • toString

      public final String toString()
      Specified by:
      toString in interface Principal
      Overrides:
      toString in class Object
    • asAddress

      public static final String asAddress(String tenantId, String deviceId)
      Gets the device id in an address structure.
      Parameters:
      tenantId - The id of the tenant.
      deviceId - The id of the device.
      Returns:
      tenantId and deviceId as an address.
      Throws:
      NullPointerException - if any of the parameters are null.
    • asAddress

      public static final String asAddress(Device device)
      Gets the device id in an address structure.
      Parameters:
      device - The device.
      Returns:
      tenantId and deviceId as an address.
      Throws:
      NullPointerException - if device is null.