Interface StreamTransportFactory

  • All Known Implementing Classes:
    DefaultStreamTransportFactory

    public interface StreamTransportFactory
    A StreamTransportFactory is responsible for the creation of stream transports to be used for client-server streaming communication.
    • Method Detail

      • initiateTransport

        Future<?> initiateTransport​(Stream stream,
                                    com.levigo.jadice.server.shared.transport.internal.TransportSender transport)
                             throws TransportException
        Create a transport for the given InputStream.
        Parameters:
        stream - the Stream to transport
        transport - a TransportSender which can be used by the transport
        Returns:
        a Future associated with the transmission of the provided Stream
        Throws:
        TransportException - if transport initiation failed
      • setDigest

        void setDigest​(String digest)
                throws NoSuchAlgorithmException
        Set an (optional) digest for integrity of transported streams
        Parameters:
        digest - Name of the digest algorithm (or null to disable feature)
        Throws:
        NoSuchAlgorithmException - If no digest with the given name was found
      • getDigest

        String getDigest()
        Returns:
        The name of the digest algorithm (or null if no checking is enabled)
      • setMaximumMessageSize

        void setMaximumMessageSize​(int msgSize)
        If the stream must be split in several messages, this value limits the maximum size of the individual messages.
        Parameters:
        msgSize - max. size of a message (in bytes)
      • getMaximumMessageSize

        int getMaximumMessageSize()