30 #include <amps/HAClientImpl.hpp> 88 :
Client(new HAClientImpl(name_))
107 Client::operator=((
const Client&)rhs);
116 getBody().setTimeout(timeout_);
124 return getBody().getTimeout();
135 getBody().setReconnectDelay((
unsigned int)reconnectDelay_);
143 return (
int)(getBody().getReconnectDelay());
155 getBody().setReconnectDelayStrategy(strategy_);
167 return getBody().getReconnectDelayStrategy();
177 return getBody().getLogonOptions();
185 getBody().setLogonOptions(logonOptions_);
193 getBody().setLogonOptions(logonOptions_);
201 return getBody().getServerChooser();
210 getBody().setServerChooser(serverChooser_);
268 const std::string& publishLogName_,
269 const std::string& subscribeLogName_)
285 getBody().connectAndLogon();
293 return getBody().disconnected();
302 return getBody().getConnectionInfo();
313 return getBody().getConnectionInfo();
319 friend void HAClientImpl::HADisconnectHandler::invoke(
Client&,
void*);
327 assert(
typeid(HAClientImpl) ==
typeid(_body.get()));
330 void connectAndLogonInternal()
332 getBody().connectAndLogonInternal();
335 const HAClientImpl& getBody()
const 337 return dynamic_cast<const HAClientImpl&
>(_body.get());
340 HAClientImpl& getBody()
342 return dynamic_cast<HAClientImpl&
>(_body.get());
346 inline void HAClientImpl::HADisconnectHandler::invoke(
Client& client,
void*)
354 DisconnectedException de(
"Disconnected");
359 haClient.connectAndLogonInternal();
361 catch (RetryOperationException& )
365 catch (AMPSException& )
373 #endif //_HACLIENT_H_ void reportFailure(const AMPSException &exception_, const ConnectionInfo &info_)
Called by HAClient when an error occurs connecting to the current URI, and/or when an error occurs lo...
Definition: ServerChooser.hpp:88
Client(const std::string &clientName="")
Constructs a new client with a given client name.
Definition: ampsplusplus.hpp:5086
bool disconnected() const
Return whether or not the client is disconnected.
Definition: HAClient.hpp:291
void setPublishStore(const Store &publishStore_)
Set the publish store to be used by the client.
Definition: ampsplusplus.hpp:5439
HAClient(const std::string &name_)
Create an HAClient with the given name.
Definition: HAClient.hpp:87
Provides AMPS::MemoryBookmarkStore, a bookmark store that holds bookmarks in memory.
std::string getLogonOptions(void) const
Get the options passed to the server during logon.
Definition: HAClient.hpp:175
A BookmarkStoreImpl implementation that uses a memory mapped file for storage of the bookmarks...
Definition: MMapBookmarkStore.hpp:56
Provides AMPS::PublishStore, a publish store that uses memory-mapped files to provide a publish store...
ConnectionInfo getConnectionInfo() const
Get the connection information for the current connection.
Definition: HAClient.hpp:300
HAClient(const HAClient &rhs)
Copy constructor, makes a new reference to the same body.
Definition: HAClient.hpp:100
Client represents a connection to an AMPS server, but does not provide failover or reconnection behav...
Definition: ampsplusplus.hpp:5069
void setServerChooser(const ServerChooser &serverChooser_)
Set the ServerChooser used to determine the URI used when trying to connect and logon to AMPS...
Definition: HAClient.hpp:208
A StoreImpl implementation that uses a memory-mapped file to provide a publish store that persists ac...
Definition: PublishStore.hpp:46
Core type, function, and class declarations for the AMPS C++ client.
Interface for BookmarkStoreImpl classes.
Definition: BookmarkStore.hpp:228
HAClient()
Create an HAClient with no name The name for the client must be set using setName before it can be us...
Definition: HAClient.hpp:73
int getReconnectDelay() const
The current delay in milliseconds between reconnect attempts.
Definition: HAClient.hpp:141
void setReconnectDelay(int reconnectDelay_)
Set the delay between reconnect attempts in milliseconds.
Definition: HAClient.hpp:133
void setBookmarkStore(const BookmarkStore &bookmarkStore_)
Set the bookmark store to be used by the client.
Definition: ampsplusplus.hpp:5387
Provides AMPS::MemoryPublishStore, a publish store that holds messages in memory. ...
void setLogonOptions(const char *logonOptions_)
Set the options passed to the server during logon.
Definition: HAClient.hpp:183
int getTimeout() const
Get the current timeout used when attempting to log into AMPS.
Definition: HAClient.hpp:122
void setTimeout(int timeout_)
Set the timeout used when logging into AMPS.
Definition: HAClient.hpp:114
ReconnectDelayStrategy is called by AMPS::HAClient to determine how long to wait between attempts to ...
Definition: ReconnectDelayStrategy.hpp:44
HAClient & operator=(const HAClient &rhs)
Assignment operator, the body will be shared after this.
Definition: HAClient.hpp:105
A BookmarkStoreImpl implementation that stores bookmarks in memory.
Definition: MemoryBookmarkStore.hpp:57
Abstract base class for choosing amongst multiple URIs for both the initial connection and reconnecti...
Definition: ServerChooser.hpp:46
ServerChooser getServerChooser() const
Return the ServerChooser currently used by the HAClient.
Definition: HAClient.hpp:199
void connectAndLogon()
Connect and logon to AMPS using the server(s) from the ServerChooser set on this HAClient and the Aut...
Definition: HAClient.hpp:283
Handle class for StoreImpl classes that track publish messages.
Definition: ampsplusplus.hpp:1215
Provides AMPS::MMapBookmarkStore, a bookmark store that uses a memory mapped file to provide efficien...
A highly-available Client that automatically reconnects and re-subscribes to AMPS instances upon disc...
Definition: HAClient.hpp:67
static HAClient createMemoryBacked(const std::string &name_)
Creates an HAClient with the given name that uses a memory-based Store for publish messages and a mem...
Definition: HAClient.hpp:235
void setReconnectDelayStrategy(const ReconnectDelayStrategy &strategy_)
Set the ReconnectDelayStrategy used to control delay behavior when connecting and reconnecting to ser...
Definition: HAClient.hpp:153
void setLogonOptions(const std::string &logonOptions_)
Set the options passed to the server during logon.
Definition: HAClient.hpp:191
ReconnectDelayStrategy getReconnectDelayStrategy(void) const
Get the ReconnectDelayStrategy used to control delay behavior when connecting and reconnecting to ser...
Definition: HAClient.hpp:165
Definition: ampsplusplus.hpp:102
static HAClient createFileBacked(const std::string &name_, const std::string &publishLogName_, const std::string &subscribeLogName_)
Creates an HAClient with the given name that uses a file-based Store for publish messages that is nam...
Definition: HAClient.hpp:267
HAClient(HAClientImpl *body_)
Create an HAClient wrapping the given implementation, used internally.
Definition: HAClient.hpp:95
A StoreImpl implementation that uses MemoryStoreBuffer as its buffer to hold published messages in me...
Definition: MemoryPublishStore.hpp:44
ConnectionInfo gatherConnectionInfo() const
Definition: HAClient.hpp:311