Package org.eclipse.hono.auth
Class Device
java.lang.Object
org.eclipse.hono.auth.Device
- All Implemented Interfaces:
Principal
An authenticated client of a protocol adapter representing a device.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic final String
Gets the device id in an address structure.static final String
Gets the device id in an address structure.final String
Gets this device's identifier.final String
getName()
final String
Gets the identifier of the tenant this device belongs to.final io.vertx.core.json.JsonObject
Get the underlying principal of the device.final String
toString()
-
Constructor Details
-
Device
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 isnull
.
-
-
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
Gets the identifier of the tenant this device belongs to.- Returns:
- The identifier.
-
getDeviceId
Gets this device's identifier.- Returns:
- The identifier.
-
getName
Returns the device identifier.
-
toString
-
asAddress
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 arenull
.
-
asAddress
Gets the device id in an address structure.- Parameters:
device
- The device.- Returns:
- tenantId and deviceId as an address.
- Throws:
NullPointerException
- if device isnull
.
-