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
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description Connector<O,I,CO,CI>createConnector(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(java.lang.String cls, java.util.function.Supplier<ConnectorParameter> params, A... adapter)Creates a connector instance.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 Detail
-
createConnector
Connector<O,I,CO,CI> createConnector(ConnectorParameter params, A... adapter)
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
static boolean hasService(ConnectorParameter params)
Returns whether connector parameter is given and has a service.- Parameters:
params- the parameters- Returns:
truefor 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:
truefor 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/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 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
-
-