MigratoryDataClient class
This class implements all the necessary operations for connecting to a cluster of one or more MigratoryData servers, subscribing to one or more subjects, getting real-time messages for the subscribed subjects, and publishing messages.
Constructors
- MigratoryDataClient()
- Create a MigratoryDataClient object.
Properties
- clientImpl ↔ ClientImpl
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
connect(
) → void - Connect to the MigratoryData cluster.
-
disconnect(
) → dynamic - Disconnect from the connected MigratoryData server and dispose the resources used by the connection.
-
getListener(
) → MigratoryDataListener - Get the listener for handling real-time messages and status notifications.
-
getSubjects(
) → List< String> - \brief Return the list of subscribed subjects.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyAfterFailedConnectionAttempts(
int retries) → dynamic - Define the number of failed attempts to connect to one or more MigratoryData servers before triggering a status notification MigratoryDataClient.NOTIFY_SERVER_DOWN.
-
pause(
) → void -
publish(
MigratoryDataMessage message) → dynamic - Publish a message.
-
resume(
) → void -
setEncryption(
bool encrypted) → dynamic - Configure whether or not to use an encrypted SSL/TLS connection to communicate with the server.
-
setEntitlementToken(
String token) → dynamic - Assign an entitlement token to the client or update its entitlement token.
-
setExternalToken(
String externalToken) → dynamic - Assigns an external token to enable client communication via external services while the client is offline.
-
setHttpHeader(
String header, String value, {bool preserveHeaderCase = true}) → void -
setListener(
MigratoryDataListener listener) → dynamic - Attach a listener for handling the received real-time messages as well as the status notifications.
-
setLogListener(
MigratoryDataLogListener logListener, MigratoryDataLogLevel logLevel) → void - Attach a listener for handling log messages outputted by the library.
-
setQuickReconnectInitialDelay(
int seconds) → dynamic - \brief Define the number of seconds to wait before attempting to reconnect to the cluster after a connection failure is detected.
-
setQuickReconnectMaxRetries(
int retries) → dynamic - Define the maximum number of retries for the Quick Reconnect fail-over phase.
-
setReconnectMaxDelay(
int seconds) → dynamic - Define the maximum reconnect delay for the MigratoryDataClient.TRUNCATED_EXPONENTIAL_BACKOFF policy.
-
setReconnectPolicy(
String policy) → dynamic - Define the reconnect policy to be used after the Quick Reconnect phase.
-
setReconnectTimeInterval(
int seconds) → dynamic - Define the time interval used for the reconnect schedule after the Quick Reconnect phase.
-
setServers(
List< String> servers) → dynamic - Specify a cluster of one or more MigratoryData servers to which the client will connect to.
-
setSocketTimeoutSeconds(
int seconds) → dynamic -
subscribe(
List< String> subjects) → dynamic - Subscribe to one or more subjects.
-
subscribeWithHistory(
List< String> subjects, int numberOfHistoricalMessages) → dynamic - Get the historical messages for one or more subjects, if any, then subscribe to those subjects.
-
toString(
) → String -
A string representation of this object.
inherited
-
unsubscribe(
List< String> subjects) → dynamic - Unsubscribe from one or more subjects.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- CONSTANT_WINDOW_BACKOFF → const String
- A constant used to define the reconnect policy.
- NOTIFY_CONNECT_DENY → const String
- A constant which indicates that the client was denied to connect using the entitlement token defined on the client side.
- NOTIFY_CONNECT_OK → const String
- A constant which indicates that the client was authorized to connect using the entitlement token defined on the client side.
- NOTIFY_DATA_RESYNC → const String
- A constant which indicates that after a fail-over reconnection, the client successfully synchronized a subscribed subject with the latest message available for that subject, but not with the potential messages published during the fail-over, therefore behaving as a fresh client.
- NOTIFY_DATA_SYNC → const String
- A constant which indicates that after a fail-over reconnection, the client successfully synchronized a subscribed subject with the latest message available for that subject, as well as with all messages published during the fail-over period for that subject.
- NOTIFY_MESSAGE_SIZE_LIMIT_EXCEEDED → const String
- A constant which indicates that the client was unable to publish a message because the size of the message exceeds the message size limit allowed by the server (see the server parameter \c MAX_MESSAGE_SIZE).
- NOTIFY_PUBLISH_DENIED → const String
- A constant which indicates that the client was not authorized to publish a message.
- NOTIFY_PUBLISH_FAILED → const String
- A constant which indicates that the client was unable to publish a message.
- NOTIFY_PUBLISH_OK → const String
- A constant which indicates that the client successfully published a message.
- NOTIFY_SERVER_DOWN → const String
- A constant which indicates that the client failed to connect to a MigratoryData server.
- NOTIFY_SERVER_UP → const String
- A constant which indicates that the client successfully connected to a MigratoryData server.
- NOTIFY_SUBSCRIBE_ALLOW → const String
- A constant which indicates that the client was authorized to subscribe to a subject.
- NOTIFY_SUBSCRIBE_DENY → const String
- A constant which indicates that the client was not authorized to subscribe to a subject.
- TRUNCATED_EXPONENTIAL_BACKOFF → const String
- A constant used to define the reconnect policy.