Interface ProtocolAdapter

  • All Known Subinterfaces:
    PollingProtocolAdapter

    public interface ProtocolAdapter
    A protocol adapter is the resource responsible for connecting to and providing data from disparate remote or local device. The implementation must manage its resources internally, and adhere to the semantic lifecycle applied to the adapter instances.

    Since:
    2023.1
    • Method Detail

      • getId

        @NotNull
        @NotNull String getId()
        The adapter identifier represents a unique id/name of the instance within the runtime. This value should be considered immutable.
        Returns:
        A string ID conform to the regex ([a-zA-Z_0-9-_])* which uniquely identifies the instance of the adapter.
      • start

        void start​(@NotNull
                   @NotNull ProtocolAdapterStartInput input,
                   @NotNull
                   @NotNull ProtocolAdapterStartOutput output)
        Start the adapter, establishing a connection to any internal or external device using the configuration supplied during instantiation.
        Parameters:
        input - - the state associated with runtime. Allows the adapter to bind to required services in a decoupled manner
        output - - the output to signal back to HiveMQ Edge the status of the start attempt.
      • stop

        void stop​(@NotNull
                  @NotNull ProtocolAdapterStopInput input,
                  @NotNull
                  @NotNull ProtocolAdapterStopOutput output)
        Stop the adapter. Stopping the adapter must release any network interface connections or local resources associated with the connection to the device. State relating to the connection however will be retained allowing the start method to restart the adapter.
        Parameters:
        input - the input for the stop (currently empty)
        output - the output to signal back to HiveMQ Edge the status of the stop attempt.
      • destroy

        default void destroy()
        Called by the framework when the instance will be discarded