Interface ConnectorFactory<O,I,CO,CI,A extends ProtocolAdapter<O,I,CO,CI>>

Type Parameters:
O - the output type from the underlying machine/platform
I - the input type to the underlying machine/platform
CO - the output type of the connector
CI - the input type of the connector
A - the protocol adapter type

public interface ConnectorFactory<O,I,CO,CI,A extends ProtocolAdapter<O,I,CO,CI>>
Creates a single connector instance or allows to dynamically choose among multiple connector types of the same kind. Implementations must have a publicly accessible no-arg constructor.
Author:
Holger Eichelberger, SSE
  • Method Details

    • createConnector

      Connector<O,I,CO,CI> createConnector(ConnectorParameter params, A... adapter)
      Creates a connector based on the given connector parameters.
      Parameters:
      params - the parameters
      adapter - the protocol adapters to create the connector for
      Returns:
      the connector
    • hasService

      static boolean hasService(ConnectorParameter params)
      Returns whether connector parameter is given and has a service.
      Parameters:
      params - the parameters
      Returns:
      true for service, false else
    • hasVersion

      static boolean hasVersion(ConnectorParameter params)
      Returns whether connector parameter is given and has service containing a version with version number.
      Parameters:
      params - the parameters
      Returns:
      true for version, false else
    • createConnector

      @SafeVarargs static <O, I, CO, CI, A extends ProtocolAdapter<O, I, CO, CI>> Connector<O,I,CO,CI> createConnector(String cls, Supplier<ConnectorParameter> params, A... adapter)
      Creates a connector instance.
      Type Parameters:
      O - the output type from the underlying machine/platform
      I - the input type to the underlying machine/platform
      CO - the output type of the connector
      CI - the input type of the connector
      A - the adapter type
      Parameters:
      cls - the class or plugin id of the connector or of the connector factory indirectly creating the connector. Connectors must have at least a one-arg public constructor taking adapters
      params - the connector parameters supplier
      adapter - the protocol adapters to create the connector for
      Returns:
      the connector instance or null if none can be created
    • createConnectorByPlugin

      static <O, I, CO, CI, A extends ProtocolAdapter<O, I, CO, CI>> Connector<O,I,CO,CI> createConnectorByPlugin(String pluginId, Supplier<ConnectorParameter> params, A... adapter)
      Creates a connector instance from a plugin of type ConnectorDescriptor, see also AbstractPluginConnectorDescriptor. Logs errors.
      Type Parameters:
      O - the output type from the underlying machine/platform
      I - the input type to the underlying machine/platform
      CO - the output type of the connector
      CI - the input type of the connector
      A - the adapter type
      Parameters:
      pluginId - the plugin id
      params - the connector parameters supplier
      adapter - the protocol adapters to create the connector for
      Returns:
      the connector instance or null if none can be created
    • createConnectorByPlugin

      static <O, I, CO, CI, S extends AdapterSelector<O, I, CO, CI>, A extends ProtocolAdapter<O, I, CO, CI>> Connector<O,I,CO,CI> createConnectorByPlugin(String pluginId, boolean log, Supplier<ConnectorParameter> params, S selector, A... adapter)
      Creates a connector instance from a plugin of type ConnectorDescriptor, see also AbstractPluginConnectorDescriptor.
      Type Parameters:
      O - the output type from the underlying machine/platform
      I - the input type to the underlying machine/platform
      CO - the output type of the connector
      CI - the input type of the connector
      S - the selector type
      A - the adapter type
      Parameters:
      pluginId - the plugin id
      log - shall plugin errors be logged
      params - the connector parameters supplier
      selector - the adapter selector, may be null for none
      adapter - the protocol adapters to create the connector for
      Returns:
      the connector instance or null if none can be created