MigratoryData Client API for C++
Developer's Guide and Reference Manual
MigratoryDataClient.h
Go to the documentation of this file.
1 /*
2 * Copyright (c) 2007-2014 Migratory Data Systems (http://migratorydata.com)
3 * ALL RIGHTS RESERVED. Use is subject to license terms.
4 */
5 #ifndef _MigratoryDataClient_h_included_
6 #define _MigratoryDataClient_h_included_
7 
8 #include <vector>
9 #include <string>
10 
11 #include "MigratoryDataLogLevel.h"
12 #include "MigratoryDataListener.h"
13 
87 namespace migratorydata
89 {
91 
94  class PushClientImpl;
96 
102  {
103 
104  private :
105  PushClientImpl* clientImpl;
106 
107  public :
108 
115  const std::string NOTIFY_SERVER_UP;
116 
123  const std::string NOTIFY_SERVER_DOWN;
124 
133  const std::string NOTIFY_DATA_SYNC;
134 
143  const std::string NOTIFY_DATA_RESYNC;
144 
152  const std::string NOTIFY_SUBSCRIBE_ALLOW;
153 
161  const std::string NOTIFY_SUBSCRIBE_DENY;
162 
163  const std::string NOTIFY_SUBSCRIBE_TIMEOUT;
164 
173  const std::string NOTIFY_PUBLISH_DENIED;
174 
184  const std::string NOTIFY_PUBLISH_NO_SUBSCRIBER;
185 
192  const std::string NOTIFY_PUBLISH_OK;
193 
200  const std::string NOTIFY_PUBLISH_FAILED;
201 
209 
215  const std::string CONSTANT_WINDOW_BACKOFF;
216 
222  const std::string TRUNCATED_EXPONENTIAL_BACKOFF;
223 
228 
239  void setLogListener(MigratoryDataLogListener* logListener);
240 
249  void setLogLevel(MigratoryDataLogLevel logLevel);
250 
260 #if !defined (SSL_DISABLED)
261  void setEncryption(bool encryption);
262 
269 #endif
270  void setListener(MigratoryDataListener* listener);
271 
342  void setServers(std::vector<std::string>& servers);
343 
366  void subscribe(std::vector<std::string>& subjects);
367 
400  void subscribeWithConflation(std::vector<std::string>& subjects, int conflationMillis);
401 
410  void unsubscribe(std::vector<std::string>& subjects);
411 
426  void setEntitlementToken(std::string& token);
427 
433  void getSubjects(std::vector<std::string>& subjects);
434 
442  void notifyBeforeReconnectRetries(int n);
443 
452  void notifyWhenReconnectRateExceedsThreshold(int n);
453 
500  void setQuickReconnectInitialDelay(int seconds);
501 
507  void setQuickReconnectMaxRetries(int retries);
508 
520  void setReconnectPolicy(std::string policy);
521 
530  void setReconnectTimeInterval(int seconds);
531 
539  void setReconnectMaxDelay(int seconds);
540 
550  void publish(MigratoryDataMessage& message);
551 
557  void disconnect();
558 
559  // @cond
560  void pause();
561  void resume();
562  // @endcond
563 
567  virtual ~MigratoryDataClient();
568  };
569 
570 }
571 
572 #endif // _MigratoryDataClient_h_included_
const std::string NOTIFY_SUBSCRIBE_DENY
Indicate that the client was not authorized to subscribe to a subject.
Definition: MigratoryDataClient.h:161
Enumerate the MigratoryData logging levels.
const std::string NOTIFY_DATA_SYNC
After a failover reconnection, the client synchronized a subscribed subject with the latest message a...
Definition: MigratoryDataClient.h:133
This class implements all the necessary operations for connecting to a cluster of one or more Migrato...
Definition: MigratoryDataClient.h:101
const std::string NOTIFY_RECONNECT_RATE_EXCEEDED
Indicate that the reconnect rate threshold per 3-minute window has been reached.
Definition: MigratoryDataClient.h:208
Include the declaration of the MigratoryDataListener class.
MigratoryDataLogLevel
This class enumerates the MigratoryData logging levels.
Definition: MigratoryDataLogLevel.h:31
Implementations of this interface can handle the real-time messages received for the subscribed subje...
Definition: MigratoryDataListener.h:24
const std::string CONSTANT_WINDOW_BACKOFF
A constant used to define the reconnect policy.
Definition: MigratoryDataClient.h:215
const std::string NOTIFY_PUBLISH_OK
Indicate that the client successfully published a message.
Definition: MigratoryDataClient.h:192
const std::string NOTIFY_SUBSCRIBE_ALLOW
Indicate that the client was authorized to subscribe to a subject.
Definition: MigratoryDataClient.h:152
const std::string NOTIFY_PUBLISH_NO_SUBSCRIBER
Indicate that the client was unable to publish a message because there is no client subscribed to the...
Definition: MigratoryDataClient.h:184
const std::string TRUNCATED_EXPONENTIAL_BACKOFF
A constant used to define the reconnect policy.
Definition: MigratoryDataClient.h:222
The listener interface that you should implement in order to get the logs of the API.
Definition: MigratoryDataLogListener.h:25
const std::string NOTIFY_DATA_RESYNC
After a failover reconnection, the client synchronized a subscribed subject with the latest message a...
Definition: MigratoryDataClient.h:143
const std::string NOTIFY_SERVER_UP
Indicate that the client successfully connected to a MigratoryData server.
Definition: MigratoryDataClient.h:115
const std::string NOTIFY_PUBLISH_FAILED
Indicate that the client was unable to publish a message.
Definition: MigratoryDataClient.h:200
const std::string NOTIFY_SERVER_DOWN
Indicate that the client failed to connect to a MigratoryData server.
Definition: MigratoryDataClient.h:123
const std::string NOTIFY_PUBLISH_DENIED
Indicate that the client was unable to publish a message because it is not allowed by your entitlemen...
Definition: MigratoryDataClient.h:173
Represent a message.
Definition: MigratoryDataMessage.h:25