Class WsTransportConverterFactory
java.lang.Object
de.iip_ecosphere.platform.services.environment.services.TransportConverterFactory
de.iip_ecosphere.platform.services.environment.services.WsTransportConverterFactory
Transport converter factory for websockets. Takes information from
TransportSetup.getGatewayServerEndpoint(Schema, String).- Author:
- Holger Eichelberger, SSE
-
Field Summary
FieldsFields inherited from class de.iip_ecosphere.platform.services.environment.services.TransportConverterFactory
GATEWAY_PORT_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> TransportConverter<T> createConverterImpl(de.iip_ecosphere.platform.support.Endpoint endpoint, String transportStream, de.iip_ecosphere.platform.transport.serialization.TypeTranslator<T, String> translator, Class<T> cls) Creates a converter instance.protected <T> Sender<T> createSenderImpl(de.iip_ecosphere.platform.support.Endpoint endpoint, de.iip_ecosphere.platform.transport.serialization.TypeTranslator<T, String> translator, Class<T> cls) Creates a converter sender instance.de.iip_ecosphere.platform.support.ServercreateServer(de.iip_ecosphere.platform.support.ServerAddress address) Creates a converter server instance.protected <T> TransportConverter.Watcher<T> createWatcherImpl(de.iip_ecosphere.platform.support.Endpoint endpoint, de.iip_ecosphere.platform.transport.serialization.TypeTranslator<T, String> translator, Class<T> cls, int period) Creates a watcher instance.de.iip_ecosphere.platform.support.EndpointgetGatewayEndpoint(de.iip_ecosphere.platform.support.iip_aas.AasPartRegistry.AasSetup aas, de.iip_ecosphere.platform.transport.connectors.TransportSetup transport, String path) Returns an endpoint for the given path.Methods inherited from class de.iip_ecosphere.platform.services.environment.services.TransportConverterFactory
createConverter, createConverter, createSender, createSender, createServer, createWatcher, createWatcher, createWithUri, createWithUri, ensureTranslator, getInstance, validateGatewayEndpoint
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
WsTransportConverterFactory
private WsTransportConverterFactory()Prevents external creation.
-
-
Method Details
-
createSenderImpl
protected <T> Sender<T> createSenderImpl(de.iip_ecosphere.platform.support.Endpoint endpoint, de.iip_ecosphere.platform.transport.serialization.TypeTranslator<T, String> translator, Class<T> cls) Description copied from class:TransportConverterFactoryCreates a converter sender instance.- Specified by:
createSenderImplin classTransportConverterFactory- Type Parameters:
T- the type of data to be sent- Parameters:
endpoint- the server endpointtranslator- the type-to-sender format translatorcls- the data type class- Returns:
- the sender instance, may be null
-
createWatcherImpl
protected <T> TransportConverter.Watcher<T> createWatcherImpl(de.iip_ecosphere.platform.support.Endpoint endpoint, de.iip_ecosphere.platform.transport.serialization.TypeTranslator<T, String> translator, Class<T> cls, int period) Description copied from class:TransportConverterFactoryCreates a watcher instance.- Specified by:
createWatcherImplin classTransportConverterFactory- Type Parameters:
T- the type of data to be watched- Parameters:
endpoint- the server endpointtranslator- the receiver-to-type format translatorcls- the data type classperiod- the watching period in ms- Returns:
- the watcher instance, may be null
-
createConverterImpl
public <T> TransportConverter<T> createConverterImpl(de.iip_ecosphere.platform.support.Endpoint endpoint, String transportStream, de.iip_ecosphere.platform.transport.serialization.TypeTranslator<T, String> translator, Class<T> cls) Description copied from class:TransportConverterFactoryCreates a converter instance. The implementing factory is free to choose which information to take and may fail if required information is not given.- Specified by:
createConverterImplin classTransportConverterFactory- Type Parameters:
T- the type of data to be watched- Parameters:
endpoint- the server endpointtransportStream- the stream to listen totranslator- the receiver-to-type format translatorcls- the data type class- Returns:
- the converter instance, may be null
-
createServer
public de.iip_ecosphere.platform.support.Server createServer(de.iip_ecosphere.platform.support.ServerAddress address) Description copied from class:TransportConverterFactoryCreates a converter server instance.- Specified by:
createServerin classTransportConverterFactory- Parameters:
address- the server address- Returns:
- the server instance, may be null if none is required for the actual factory
-
getGatewayEndpoint
public de.iip_ecosphere.platform.support.Endpoint getGatewayEndpoint(de.iip_ecosphere.platform.support.iip_aas.AasPartRegistry.AasSetup aas, de.iip_ecosphere.platform.transport.connectors.TransportSetup transport, String path) Description copied from class:TransportConverterFactoryReturns an endpoint for the given path. The implementing factory is free to choose which information to take and may fail if required information is not given.- Specified by:
getGatewayEndpointin classTransportConverterFactory- Parameters:
aas- the AAS setup for AAS-based senderstransport- the transport setup for transport-based senderspath- the path within the resulting endpoint- Returns:
- the endpoint
-