Package org.eclipse.hono.util
Class Adapter
java.lang.Object
org.eclipse.hono.util.Adapter
Protocol Adapter configuration properties.
Represents the Adapter schema object defined in the Device Registry Management API
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets the extension properties of this tenant.final String
getType()
Gets the type name of the protocol adapter this is the configuration for.final boolean
Checks whether devices are required to authenticate when connecting to this protocol adapter.final boolean
Checks whether devices are able to connect to Hono using this protocol adapter.final Adapter
putExtension
(String key, Object value) Adds an extension property to this adapter.final Adapter
setDeviceAuthenticationRequired
(boolean required) Sets whether devices are required to authenticate when connecting to this protocol adapter.final Adapter
setEnabled
(boolean enabled) Sets whether devices should be able to connect to Hono using this protocol adapter.final Adapter
setExtensions
(Map<String, Object> extensions) Sets the extension properties for this adapter.
-
Constructor Details
-
Adapter
Creates a new adapter instance for the given type.- Parameters:
type
- The adapter type.- Throws:
NullPointerException
- if the type isnull
.
-
-
Method Details
-
setEnabled
Sets whether devices should be able to connect to Hono using this protocol adapter.- Parameters:
enabled
-true
if devices should be able to connect.- Returns:
- This instance, to allow chained invocations.
-
isEnabled
public final boolean isEnabled()Checks whether devices are able to connect to Hono using this protocol adapter.- Returns:
true
if devices are able to connect.
-
getType
Gets the type name of the protocol adapter this is the configuration for.- Returns:
- The type name.
-
setDeviceAuthenticationRequired
Sets whether devices are required to authenticate when connecting to this protocol adapter.- Parameters:
required
-true
if devices should be required to authenticate.- Returns:
- A reference to this for fluent use.
-
isDeviceAuthenticationRequired
public final boolean isDeviceAuthenticationRequired()Checks whether devices are required to authenticate when connecting to this protocol adapter.- Returns:
true
if devices are required to authenticate.
-
setExtensions
Sets the extension properties for this adapter.Existing extension properties are completely replaced by the new properties.
- Parameters:
extensions
- The extension properties.- Returns:
- This instance, to allow chained invocations.
-
getExtensions
Gets the extension properties of this tenant.- Returns:
- An unmodifiable view on the extension properties.
-
putExtension
Adds an extension property to this adapter.If an extension property already exists for the specified key, the old value is replaced by the specified value.
- Parameters:
key
- The key of the entry.value
- The value of the entry.- Returns:
- This instance, to allow chained invocations.
- Throws:
NullPointerException
- if any of the arguments arenull
.
-