Class PrintTransportConnector

java.lang.Object
de.iip_ecosphere.platform.transport.connectors.impl.AbstractTransportConnector
de.iip_ecosphere.platform.transport.connectors.impl.PrintTransportConnector
All Implemented Interfaces:
TransportConnector

public class PrintTransportConnector extends AbstractTransportConnector
A default print transport consumer for debugging.
Author:
Holger Eichelberger, SSE
  • Field Details

  • Constructor Details

    • PrintTransportConnector

      public PrintTransportConnector()
  • Method Details

    • setTransportConsumer

      public void setTransportConsumer(PrintTransportConnector.TransportConsumer consumer)
      Changes the transport/print consumer.
      Parameters:
      consumer - the new consumer, ignored if null
    • syncSend

      public void syncSend(String stream, Object data) throws IOException
      Description copied from interface: TransportConnector
      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

      public void asyncSend(String stream, Object data) throws IOException
      Description copied from interface: TransportConnector
      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
    • send

      private void send(String stream, Object data) throws IOException
      Sends data to stream.
      Parameters:
      stream - the stream to send to
      data - the data to send to stream
      Throws:
      IOException - in cases that sending fails
    • serialize

      protected <T> byte[] serialize(String stream, T data) throws IOException
      Description copied from class: AbstractTransportConnector
      Serializes data to stream. [helper]
      Overrides:
      serialize in class AbstractTransportConnector
      Type Parameters:
      T - the type of the data
      Parameters:
      stream - the stream to serialize to
      data - the data to serialize
      Returns:
      the serialized bytes
      Throws:
      IOException - in case that problems occur during serialization
    • composeStreamName

      public String composeStreamName(String parent, String name)
      Description copied from interface: TransportConnector
      Composes a hierarchical stream name (in the syntax/semantics of the connector).
      Parameters:
      parent - the parent name (may be TransportConnector.EMPTY_PARENT for top-level streams)
      name - the name of the stream
      Returns:
      the composed name
    • getName

      public String getName()
      Description copied from interface: TransportConnector
      Returns a descriptive name of the transport protocol being implemented.
      Returns:
      the name of the protocol
    • supportedEncryption

      public String supportedEncryption()
      Description copied from interface: TransportConnector
      Returns the supported encryption mechanisms.
      Returns:
      the supported encryption mechanisms (comma-separated), may be null or empty
    • enabledEncryption

      public String enabledEncryption()
      Description copied from interface: TransportConnector
      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