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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getDigest()
int
getMaximumMessageSize()
Future<?>
initiateTransport(Stream stream, com.levigo.jadice.server.shared.transport.internal.TransportSender transport)
Create a transport for the given InputStream.void
setDigest(String digest)
Set an (optional) digest for integrity of transported streamsvoid
setMaximumMessageSize(int msgSize)
If the stream must be split in several messages, this value limits the maximum size of the individual messages.void
shutdown()
Shut down the stream transport factory.void
startup()
Initialize the stream transport factory.
-
-
-
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
- theStream
to transporttransport
- a TransportSender which can be used by the transport- Returns:
- a
Future
associated with the transmission of the providedStream
- Throws:
TransportException
- if transport initiation failed
-
startup
void startup() throws StreamTransportException
Initialize the stream transport factory.- Throws:
StreamTransportException
- if startup failed
-
shutdown
void shutdown() throws StreamTransportException
Shut down the stream transport factory.- Throws:
StreamTransportException
- if shutdown failed
-
setDigest
void setDigest(String digest) throws NoSuchAlgorithmException
Set an (optional) digest for integrity of transported streams- Parameters:
digest
- Name of the digest algorithm (ornull
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()
-
-