Package com.attivio.sdk.transport
Interface Transport<S,R>
-
- Type Parameters:
S
- The cached object to use for sending messages.R
- The cached object to use for receiving messages.
- All Superinterfaces:
ClientTransport<S>
- All Known Subinterfaces:
ManagedTransport<S,R>
,SelfManagedTransport<S,R>
- All Known Implementing Classes:
MultiRegionTransport
public interface Transport<S,R> extends ClientTransport<S>
Encapsulates a method for movingcom.attivio.transport.Message
s from one component to another.Works on the notion of 'senders' and 'receivers' for handing connections which are cached per URI by the platform. Exactly how a URI is turned into a sender or receiver is completely transport dependent. Concepts such as URI parameters (http://host:8888/foo?someParam=someValue) are completely up to the transport's implementation. Some implementations may choose to simply use the URI as the sender (ftp/http clients for example are good candidates).
All transports are responsible for their own serialization in order to send/receive messages from URI's. For components that want basic XML serialization the
XMLSerializer
can be used to turn any message into XML and vice-versa.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
SEND_SIZE
Message property that may be used by transports to annotate the size of the message that was sent.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description R
createReceiver(java.net.URI uri)
Create a new receiver for the provided URI.default void
initialize()
Initialize the transport.void
prepareReceiver(R receiver)
Prepares receiver to accept messages.void
setDefaultQueueSize(int size)
sets the default queue size for the transportvoid
stopReceiver(R receiver)
Stop/shutdown a receiver and free up any associated resources.-
Methods inherited from interface com.attivio.sdk.transport.ClientTransport
createSender, dispatchMessage, getProtocol, getSender, sendMessage, shutdown, stopSender
-
-
-
-
Field Detail
-
SEND_SIZE
static final java.lang.String SEND_SIZE
Message property that may be used by transports to annotate the size of the message that was sent. For informational purposes only, it's value may not be depended upon.- See Also:
- Constant Field Values
-
-
Method Detail
-
setDefaultQueueSize
void setDefaultQueueSize(int size)
sets the default queue size for the transport
-
createReceiver
R createReceiver(java.net.URI uri) throws TransportException
Create a new receiver for the provided URI.- Throws:
TransportException
-
prepareReceiver
void prepareReceiver(R receiver) throws TransportException
Prepares receiver to accept messages. This is called after all components have started and can be used to enable message reception until the latest possible time.- Parameters:
receiver
-- Throws:
TransportException
-
stopReceiver
void stopReceiver(R receiver) throws TransportException
Stop/shutdown a receiver and free up any associated resources. Called on shutdown or on dynamic workflow removal. After this is called attempts to contact this receiver should throw an exception.- Throws:
TransportException
-
initialize
default void initialize()
Initialize the transport. All properties will be set when this method is invoked
-
-