Package com.attivio.sdk.transport
Interface ClientTransport<S>
-
- Type Parameters:
S- The cached object to use for sending messages.
- All Known Subinterfaces:
ManagedTransport<S,R>,SelfManagedTransport<S,R>,Transport<S,R>
- All Known Implementing Classes:
HttpClientTransport,HttpsClientTransport,MultiRegionTransport
public interface ClientTransport<S>Handles sendingMessages to an Attivio receiver.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ScreateSender(java.net.URI uri, boolean synchronous)Create a new sender for the provided URI.voiddispatchMessage(PlatformMessage msg, S sender)Asynchronously send a message via the provided sender with no expected return.java.lang.StringgetProtocol()Get the String protocol that this transports implements.SgetSender(java.net.URI uri)Get a Sender or null if it doesn't not exist.PlatformMessagesendMessage(PlatformMessage msg, S sender)Synchronously send a message via the provided sender.voidshutdown()Closes down any transport related resourcesvoidstopSender(S sender)Stop/shutdown a sender and free up any associated resources.
-
-
-
Method Detail
-
sendMessage
PlatformMessage sendMessage(PlatformMessage msg, S sender) throws TransportException
Synchronously send a message via the provided sender.- Parameters:
msg- the message to send.sender- the sender that was chosen based on the URI that the message must be sent toThis method can block as long as is required to send the message including allowing time for the receiver to free up resources.
- Throws:
TransportException
-
dispatchMessage
void dispatchMessage(PlatformMessage msg, S sender) throws TransportException
Asynchronously send a message via the provided sender with no expected return.- Parameters:
msg- the message to send.sender- the sender that was chosen based on the URI that the message must be sent to- Throws:
TransportException
-
createSender
S createSender(java.net.URI uri, boolean synchronous) throws TransportException
Create a new sender for the provided URI.- Throws:
TransportException
-
stopSender
void stopSender(S sender) throws TransportException
Stop/shutdown a sender and free up any associated resources. Called on Attivio shutdown.- Throws:
TransportException
-
getProtocol
java.lang.String getProtocol()
Get the String protocol that this transports implements.This will register this protocol with Attivio for message delivery.
For example if this method returned "foo" then URI's of the form:
foo://someUriSyntax:8000/goes?here
would be processed using this transport. This must return a constant value and must return that value as soon as the object is constructed as the value is registered with the platform and can not be changed once registered.
-
getSender
S getSender(java.net.URI uri) throws TransportException
Get a Sender or null if it doesn't not exist.- Throws:
TransportException
-
shutdown
void shutdown() throws TransportExceptionCloses down any transport related resources- Throws:
TransportException
-
-