Interface ConnectorFactory<O,I,CO,CI,A extends ProtocolAdapter<O,I,CO,CI>>
- Type Parameters:
O- the output type from the underlying machine/platformI- the input type to the underlying machine/platformCO- the output type of the connectorCI- the input type of the connectorA- 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 Summary
Modifier and TypeMethodDescriptioncreateConnector(ConnectorParameter params, A... adapter) Creates a connector based on the given connector parameters.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.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 typeConnectorDescriptor, see alsoAbstractPluginConnectorDescriptor.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 typeConnectorDescriptor, see alsoAbstractPluginConnectorDescriptor.static booleanhasService(ConnectorParameter params) Returns whether connector parameter is given and has a service.static booleanhasVersion(ConnectorParameter params) Returns whether connector parameter is given and has service containing a version with version number.
-
Method Details
-
createConnector
Creates a connector based on the given connector parameters.- Parameters:
params- the parametersadapter- the protocol adapters to create the connector for- Returns:
- the connector
-
hasService
Returns whether connector parameter is given and has a service.- Parameters:
params- the parameters- Returns:
truefor service,false else
-
hasVersion
Returns whether connector parameter is given and has service containing a version with version number.- Parameters:
params- the parameters- Returns:
truefor version,false else
-
createConnector
@SafeVarargs static <O,I, Connector<O,CO, CI, A extends ProtocolAdapter<O, I, CO, CI>> I, createConnectorCO, CI> (String cls, Supplier<ConnectorParameter> params, A... adapter) Creates a connector instance.- Type Parameters:
O- the output type from the underlying machine/platformI- the input type to the underlying machine/platformCO- the output type of the connectorCI- the input type of the connectorA- 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 takingadaptersparams- the connector parameters supplieradapter- the protocol adapters to create the connector for- Returns:
- the connector instance or null if none can be created
-
createConnectorByPlugin
static <O,I, Connector<O,CO, CI, A extends ProtocolAdapter<O, I, CO, CI>> I, createConnectorByPluginCO, CI> (String pluginId, Supplier<ConnectorParameter> params, A... adapter) Creates a connector instance from a plugin of typeConnectorDescriptor, see alsoAbstractPluginConnectorDescriptor. Logs errors.- Type Parameters:
O- the output type from the underlying machine/platformI- the input type to the underlying machine/platformCO- the output type of the connectorCI- the input type of the connectorA- the adapter type- Parameters:
pluginId- the plugin idparams- the connector parameters supplieradapter- the protocol adapters to create the connector for- Returns:
- the connector instance or null if none can be created
-
createConnectorByPlugin
static <O,I, Connector<O,CO, CI, S extends AdapterSelector<O, I, CO, CI>, A extends ProtocolAdapter<O, I, CO, CI>> I, createConnectorByPluginCO, CI> (String pluginId, boolean log, Supplier<ConnectorParameter> params, S selector, A... adapter) Creates a connector instance from a plugin of typeConnectorDescriptor, see alsoAbstractPluginConnectorDescriptor.- Type Parameters:
O- the output type from the underlying machine/platformI- the input type to the underlying machine/platformCO- the output type of the connectorCI- the input type of the connectorS- the selector typeA- the adapter type- Parameters:
pluginId- the plugin idlog- shall plugin errors be loggedparams- the connector parameters supplierselector- the adapter selector, may be null for noneadapter- the protocol adapters to create the connector for- Returns:
- the connector instance or null if none can be created
-