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 Detail

      • 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​(java.lang.String cls,
                                                                                                                                                                 java.util.function.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 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