Class WsTransportConverterFactory

java.lang.Object
de.iip_ecosphere.platform.services.environment.services.TransportConverterFactory
de.iip_ecosphere.platform.services.environment.services.WsTransportConverterFactory

public class WsTransportConverterFactory extends TransportConverterFactory
Transport converter factory for websockets. Takes information from TransportSetup.getGatewayServerEndpoint(Schema, String).
Author:
Holger Eichelberger, SSE
  • Field Details

  • 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: TransportConverterFactory
      Creates a converter sender instance.
      Specified by:
      createSenderImpl in class TransportConverterFactory
      Type Parameters:
      T - the type of data to be sent
      Parameters:
      endpoint - the server endpoint
      translator - the type-to-sender format translator
      cls - 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: TransportConverterFactory
      Creates a watcher instance.
      Specified by:
      createWatcherImpl in class TransportConverterFactory
      Type Parameters:
      T - the type of data to be watched
      Parameters:
      endpoint - the server endpoint
      translator - the receiver-to-type format translator
      cls - the data type class
      period - 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: TransportConverterFactory
      Creates 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:
      createConverterImpl in class TransportConverterFactory
      Type Parameters:
      T - the type of data to be watched
      Parameters:
      endpoint - the server endpoint
      transportStream - the stream to listen to
      translator - the receiver-to-type format translator
      cls - 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: TransportConverterFactory
      Creates a converter server instance.
      Specified by:
      createServer in class TransportConverterFactory
      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: TransportConverterFactory
      Returns 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:
      getGatewayEndpoint in class TransportConverterFactory
      Parameters:
      aas - the AAS setup for AAS-based senders
      transport - the transport setup for transport-based senders
      path - the path within the resulting endpoint
      Returns:
      the endpoint