Class 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 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 are null.