Interface Provider

All Superinterfaces:
AutoCloseable

public interface Provider extends AutoCloseable
Provider interface to manage provider nodes

This interface extends AutoCloseable, indicating that resources held by implementations of this interface should be properly released when no longer needed, typically by calling the close() method.

  • Method Details

    • getLastError

      Result getLastError()
      Retrieves the last error that occurred during a provider operation.
      Returns:
      A Result object detailing the last error.
    • start

      Result start()
      Starts the provider.
      Returns:
      A Result object detailing the last error.
    • stop

      Result stop()
      Stop the provider
      Returns:
      A Result object detailing the last error.
    • isConnected

      boolean isConnected()
      Returns whether provider is connected
      Returns:
      status of connection
    • registerType

      Result registerType(String address, String pathname)
      Register a type to the datalayer
      Parameters:
      address - Address of the node to register (no wildcards allowed)
      pathname - Path to flatbuffer bfbs
      Returns:
      A Result object detailing the last error.
    • registerTypeVariant

      Result registerTypeVariant(String address, Variant data)
      Register a type to the datalayer
      Parameters:
      address - Address of the node to register (no wildcards allowed)
      data - A Variant with flatbuffer type
      Returns:
      A Result object detailing the last error.
    • unregisterType

      Result unregisterType(String address)
      Unregister a type from the datalayer
      Parameters:
      address - Address of the node to register (wildcards allowed)
      Returns:
      A Result object detailing the last error.
    • getRegisteredType

      Variant getRegisteredType(String address)
      Get the variant of a registered type
      Parameters:
      address - Address of the type to get type (no wildcards allowed)
      Returns:
      A Variant to stored type (VariantType.UNKNON see getLastError())
    • getToken

      Variant getToken()
      Return the current token of the current request you can call this function during your onRead, onWrite, ... methods of your ProviderNodes. if there is no current request the method return an empty token
      Returns:
      A Variant as current token
    • registerNode

      Result registerNode(String address, ProviderNode node)
      Register a node callback to the datalayer
      Parameters:
      address - Address of the node to register (wildcards allowed)
      node - A ProviderNode to register
      Returns:
      A Result object detailing the last error.
    • unregisterNode

      Result unregisterNode(String address)
      Unregister a node from the datalayer
      Parameters:
      address - Address of the node to register (wildcards allowed)
      Returns:
      A Result object detailing the last error.
    • setTimeoutNode

      Result setTimeoutNode(ProviderNode node, long timeout)
      Set timeout for a node for asynchron requests (default value is 1000ms)
      Parameters:
      node - Node to set timeout for
      timeout - Timeout in milliseconds for this node
      Returns:
      A Result object detailing the last error.
    • getRegisteredNodePaths

      Variant getRegisteredNodePaths()
      Return the current registered node paths
      Returns:
      A Variant which includes the registered node paths after this function see. getLastError()
    • getRejectedNodePaths

      Variant getRejectedNodePaths()
      Return the current rejected node paths
      Returns:
      A Variant which includes the rejected node paths after this function see. getLastError()
    • publishEvent

      Result publishEvent(Variant data, Variant eventInfo)
      Publishes an event
      Parameters:
      data - The payload data Variant of the event. Has to match the type, that is given in the notifyInfo.
      eventInfo - Contains additional info Variant about the event with type event_info.fbs
      Returns:
      A Result object detailing the last error.