BrokerRestConnector class
This ActiveBrokerInterface implementation uses the S3I-Broker REST API to send and receive messages.
Currently SSE (ServerSideEvents) aren't supported by the API so this class polls at the endpoint.
See https://broker.s3i.vswf.dev/apidoc/#/ for detailed information.
- Inheritance
-
- Object
- BrokerInterface
- ActiveBrokerInterface
- BrokerRestConnector
Constructors
- BrokerRestConnector(AuthenticationManager authManager, {String brokerBaseUrl = 'https://broker.s3i.vswf.dev/', int maxMessagesPerInterval = 10, Duration pollingInterval = const Duration(seconds: 1)})
- Creates a BrokerRestConnector which polls for a new message every pollingInterval.
Properties
- authManager → AuthenticationManager
-
The authentication manager used by this instance to get
valid access tokens.
finalinherited
- brokerBaseUrl → String
-
The base url of the REST-API.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxMessagesPerInterval → int
-
The maximal amount of received messages for each endpoint in one
polling interval.
final
- pollingInterval → Duration
-
The time between two request to the REST-API for new messages.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
newMessageReceived(
String messageString) → void -
PROTECTED: DO NOT USE THIS METHOD UNLESS YOU ARE AN
ActiveBrokerInterface !
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyConsumingFailed(
String endpoint, Exception error) → void -
PROTECTED: DO NOT USE UNLESS YOU ARE AN ActiveBrokerInterface.
inherited
-
notifySendMessageFailed(
Message message, Exception error) → void -
PROTECTED: DO NOT USE UNLESS YOU ARE AN ActiveBrokerInterface.
inherited
-
notifySendMessageSucceeded(
Message message) → void -
PROTECTED: DO NOT USE UNLESS YOU ARE AN ActiveBrokerInterface.
inherited
-
sendMessage(
Message message, Set< String> endpoints) → void -
Publishes the given
message
to allendpoints
.override -
startConsuming(
String endpoint) → void -
Starts consuming on the endpoint.
override
-
stopConsuming(
String endpoint) → void -
Stops consuming on the endpoint.
override
-
subscribeConsumingFailed(
dynamic callback(String, Exception)) → void -
Subscribes to all errors during consuming from the endpoints.
(ConsumingFailed-Event).
inherited
-
subscribeGetValueReplyReceived(
dynamic callback(GetValueReply)) → void -
Subscribes to all GetValueReplyReceived-Events.
inherited
-
subscribeGetValueRequestReceived(
dynamic callback(GetValueRequest)) → void -
Subscribes to all GetValueRequestReceived-Events.
inherited
-
subscribeInvalidMessageReceived(
dynamic callback(String, Exception)) → void -
Subscribes to all received messages which can't be parsed correctly
(InvalidMessageReceived-Event).
inherited
-
subscribeSendMessageFailed(
dynamic callback(Message, Exception)) → void -
Subscribes to all messages which couldn't be sent correctly
(SendMessageFailed-Event).
inherited
-
subscribeSendMessageSucceeded(
dynamic callback(Message)) → void -
Subscribes to all received messages which can't be parsed correctly
(SendMessageSucceeded-Event).
inherited
-
subscribeServiceReplyReceived(
dynamic callback(ServiceReply)) → void -
Subscribes to all ServiceReplyReceived-Events.
inherited
-
subscribeServiceRequestReceived(
dynamic callback(ServiceRequest)) → void -
Subscribes to all ServiceRequestReceived-Events.
inherited
-
subscribeUserMessageReceived(
dynamic callback(UserMessage)) → void -
Subscribes to all received user messages (UserMessageReceived-Event).
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
unsubscribeConsumingFailed(
dynamic callback(String, Exception)) → void -
Unsubscribes the callback from the ConsumingFailed-Event.
inherited
-
unsubscribeGetValueReplyReceived(
dynamic callback(GetValueReply)) → void -
Unsubscribes the callback from the GetValueReplyReceived-Event.
inherited
-
unsubscribeGetValueRequestReceived(
dynamic callback(GetValueRequest)) → void -
Unsubscribes the callback from the GetValueRequestReceived-Event.
inherited
-
unsubscribeInvalidMessageReceived(
dynamic callback(String, Exception)) → void -
Unsubscribes the callback from the InvalidMessageReceived-Event.
inherited
-
unsubscribeSendMessageFailed(
dynamic callback(Message, Exception)) → void -
Unsubscribes the callback from the SendMessageFailed-Event.
inherited
-
unsubscribeSendMessageSucceeded(
dynamic callback(Message)) → void -
Unsubscribes the callback from the SendMessageSucceeded-Event.
inherited
-
unsubscribeServiceReplyReceived(
dynamic callback(ServiceReply)) → void -
Unsubscribes the callback from the ServiceReplyReceived-Event.
inherited
-
unsubscribeServiceRequestReceived(
dynamic callback(ServiceRequest)) → void -
Unsubscribes the callback from the ServiceRequestReceived-Event.
inherited
-
unsubscribeUserMessageReceived(
dynamic callback(UserMessage)) → void -
Unsubscribes the callback from the UserMessageReceived-Event.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited