Interface TransportConnector

All Known Implementing Classes:
AbstractMqttTransportConnector, AbstractTransportConnector, DirectMemoryTransferTransportConnector, PrintTransportConnector

public interface TransportConnector
Defines the interface of a transport connector. The connector can handle multiple different homogeneous streams.
Author:
Holger Eichelberger, SSE
  • Field Details

  • Method Details

    • syncSend

      void syncSend(String stream, Object data) throws IOException
      Sends the given data on stream in synchronized manner, e.g., by blocking this call until the data is sent.
      Parameters:
      stream - the stream to send to
      data - the data to send to stream
      Throws:
      IOException - in case that problems during the connection happens
    • asyncSend

      void asyncSend(String stream, Object data) throws IOException
      Sends the given data on stream in asnychronous manner, e.g., by not blocking this call until the data is sent, i.e., sending may not be completed when this method returns. If not possible for this connector, the underlying implementation may resort to synchronized sending.
      Parameters:
      stream - the stream to send to
      data - the data to send to stream
      Throws:
      IOException - in case that problems during the connection happens
    • setReceptionCallback

      void setReceptionCallback(String stream, ReceptionCallback<?> callback) throws IOException
      Attaches a reception callback to stream. The callback is called upon a reception. Implicitly subscribes to channel.
      Parameters:
      stream - the stream to attach the reception to
      callback - the callback to attach
      Throws:
      IOException - in case that problems during registering the callback (e.g., during subscription) happens
    • detachReceptionCallback

      void detachReceptionCallback(String stream, ReceptionCallback<?> callback) throws IOException
      Detaches a reception callback to stream.
      Parameters:
      stream - the stream to detach the reception callback from
      callback - the callback to detach
      Throws:
      IOException - in case that problems during detaching the callback
    • unsubscribe

      void unsubscribe(String stream, boolean delete) throws IOException
      Unsubscribes from a channel implicitly subscribed with setReceptionCallback(String, ReceptionCallback).
      Parameters:
      stream - the stream to unsubscribe from
      delete - if true, try to delete/clean up the communication side on the server (may not be supported by the implementing connector, is ignored then)
      Throws:
      IOException - if the action fails for some reason
    • composeStreamName

      String composeStreamName(String parent, String name)
      Composes a hierarchical stream name (in the syntax/semantics of the connector).
      Parameters:
      parent - the parent name (may be EMPTY_PARENT for top-level streams)
      name - the name of the stream
      Returns:
      the composed name
      Throws:
      IllegalArgumentException - in case that the stream name is (structurally) illegal
    • connect

      void connect(TransportParameter params) throws IOException
      Connects the underlying connections.
      Parameters:
      params - the parameters to start the underlying connection
      Throws:
      IOException - in case that problems during the connection happens
    • disconnect

      void disconnect() throws IOException
      Disconnects the underlying connections. Unsubscribes on all known subscribed depending on TransportParameter.getCloseAction().
      Throws:
      IOException - in case that problems during the disconnect happens
    • getName

      String getName()
      Returns a descriptive name of the transport protocol being implemented.
      Returns:
      the name of the protocol
    • supportedEncryption

      String supportedEncryption()
      Returns the supported encryption mechanisms.
      Returns:
      the supported encryption mechanisms (comma-separated), may be null or empty
    • enabledEncryption

      String enabledEncryption()
      Returns the actually enabled encryption mechanisms on this instance. The result may change when connecting the connector.
      Returns:
      the enabled encryption mechanisms (comma-separated), may be null or empty
    • setSerializerProvider

      void setSerializerProvider(SerializerRegistry.SerializerProvider serializerProvider)
      Defines a special, local serializer provider that supersedes SerializerRegistry.DEFAULT_PROVIDER.
      Parameters:
      serializerProvider - the provider, ignored if null