Interface TransportConnector
- All Known Implementing Classes:
AbstractMqttTransportConnector,AbstractTransportConnector,DirectMemoryTransferTransportConnector,PrintTransportConnector
public interface TransportConnector
Defines the interface of a transport connector. The connector can handle
multiple different homogeneous streams.
- Author:
- Holger Eichelberger, SSE
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidSends the givendataonstreamin asnychronous manner, e.g., by not blocking this call until thedatais sent, i.e., sending may not be completed when this method returns.composeStreamName(String parent, String name) Composes a hierarchical stream name (in the syntax/semantics of the connector).voidconnect(TransportParameter params) Connects the underlying connections.voiddetachReceptionCallback(String stream, ReceptionCallback<?> callback) Detaches a receptioncallbacktostream.voidDisconnects the underlying connections.Returns the actually enabled encryption mechanisms on this instance.getName()Returns a descriptive name of the transport protocol being implemented.voidsetReceptionCallback(String stream, ReceptionCallback<?> callback) Attaches a receptioncallbacktostream.voidsetSerializerProvider(SerializerRegistry.SerializerProvider serializerProvider) Defines a special, local serializer provider that supersedesSerializerRegistry.DEFAULT_PROVIDER.Returns the supported encryption mechanisms.voidSends the givendataonstreamin synchronized manner, e.g., by blocking this call until thedatais sent.voidunsubscribe(String stream, boolean delete) Unsubscribes from a channel implicitly subscribed withsetReceptionCallback(String, ReceptionCallback).
-
Field Details
-
EMPTY_PARENT
Empty stream parent.- See Also:
-
-
Method Details
-
syncSend
Sends the givendataonstreamin synchronized manner, e.g., by blocking this call until thedatais sent.- Parameters:
stream- the stream to send todata- the data to send tostream- Throws:
IOException- in case that problems during the connection happens
-
asyncSend
Sends the givendataonstreamin asnychronous manner, e.g., by not blocking this call until thedatais 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 todata- the data to send tostream- Throws:
IOException- in case that problems during the connection happens
-
setReceptionCallback
Attaches a receptioncallbacktostream. Thecallbackis called upon a reception. Implicitly subscribes tochannel.- Parameters:
stream- the stream to attach the reception tocallback- the callback to attach- Throws:
IOException- in case that problems during registering the callback (e.g., during subscription) happens
-
detachReceptionCallback
Detaches a receptioncallbacktostream.- Parameters:
stream- the stream to detach the reception callback fromcallback- the callback to detach- Throws:
IOException- in case that problems during detaching the callback
-
unsubscribe
Unsubscribes from a channel implicitly subscribed withsetReceptionCallback(String, ReceptionCallback).- Parameters:
stream- the stream to unsubscribe fromdelete- iftrue, try to delete/clean up the communication side on the server (may not be supported by the implementing connector, is ignored then)- Throws:
IOException- if the action fails for some reason
-
composeStreamName
Composes a hierarchical stream name (in the syntax/semantics of the connector).- Parameters:
parent- the parent name (may beEMPTY_PARENTfor top-level streams)name- the name of the stream- Returns:
- the composed name
- Throws:
IllegalArgumentException- in case that the stream name is (structurally) illegal
-
connect
Connects the underlying connections.- Parameters:
params- the parameters to start the underlying connection- Throws:
IOException- in case that problems during the connection happens
-
disconnect
Disconnects the underlying connections.Unsubscribeson all knownsubscribeddepending onTransportParameter.getCloseAction().- Throws:
IOException- in case that problems during the disconnect happens
-
getName
String getName()Returns a descriptive name of the transport protocol being implemented.- Returns:
- the name of the protocol
-
supportedEncryption
String supportedEncryption()Returns the supported encryption mechanisms.- Returns:
- the supported encryption mechanisms (comma-separated), may be null or empty
-
enabledEncryption
String enabledEncryption()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
-
setSerializerProvider
Defines a special, local serializer provider that supersedesSerializerRegistry.DEFAULT_PROVIDER.- Parameters:
serializerProvider- the provider, ignored if null
-