Interface ProtocolAdapter

All Known Subinterfaces:
PollingProtocolAdapter, WritingProtocolAdapter

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 Details

    • 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

      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

      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.
    • discoverValues

      This method needs to be implemented in case the adapter provides the possibility to discover values at the PLC.
      Parameters:
      input - an input object containing information during the discovery process
      output - an output object to set the discovered nodes on and signal edge that the discovery process has finished.
    • getProtocolAdapterInformation

      @NotNull @NotNull ProtocolAdapterInformation getProtocolAdapterInformation()
      Returns:
      the ProtocolAdapterInformation containing information about this protocol adapter instance.
    • destroy

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

      default void createTagSchema(@NotNull @NotNull TagSchemaCreationInput input, @NotNull @NotNull TagSchemaCreationOutput output)
      This method is intended to retrieve the json schema that represents the data of a tag on a PLC. The json schema is used to create mappings between incoming and outgoing data.
      Parameters:
      input - the input object holding information necessary for the operation.
      output - the output object on which the result of the operation can be set.