Package org.eclipse.hono.util
Class Adapter
- java.lang.Object
-
- org.eclipse.hono.util.Adapter
-
public class Adapter extends Object
Protocol Adapter configuration properties.Represents the Adapter schema object defined in the Device Registry Management API
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Object>
getExtensions()
Gets the extension properties of this tenant.String
getType()
Gets the type name of the protocol adapter this is the configuration for.Boolean
isDeviceAuthenticationRequired()
Checks whether devices are required to authenticate when connecting to this protocol adapter.Boolean
isEnabled()
Checks whether devices are able to connect to Hono using this protocol adapter.Adapter
putExtension(String key, Object value)
Adds an extension property to this adapter.Adapter
setDeviceAuthenticationRequired(Boolean required)
Sets whether devices are required to authenticate when connecting to this protocol adapter.Adapter
setEnabled(Boolean enabled)
Sets whether devices should be able to connect to Hono using this protocol adapter.Adapter
setExtensions(Map<String,Object> extensions)
Sets the extension properties for this adapter.
-
-
-
Constructor Detail
-
Adapter
public Adapter(String type)
Creates a new adapter instance for the given type.- Parameters:
type
- The adapter type.- Throws:
NullPointerException
- if the type is null.
-
-
Method Detail
-
setEnabled
public final Adapter setEnabled(Boolean enabled)
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
public final String getType()
Gets the type name of the protocol adapter this is the configuration for.- Returns:
- The type name.
-
setDeviceAuthenticationRequired
public final Adapter setDeviceAuthenticationRequired(Boolean required)
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
public final Adapter setExtensions(Map<String,Object> extensions)
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
public final Map<String,Object> getExtensions()
Gets the extension properties of this tenant.- Returns:
- An unmodifiable view on the extension properties.
-
putExtension
public final Adapter putExtension(String key, Object value)
Adds an extension property to this adapter.If an extension property already exist 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
.
-
-