summaryrefslogtreecommitdiff
path: root/src/mongo/client/remote_command_targeter.h
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2015-06-24 15:37:20 -0400
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2015-06-30 17:00:18 -0400
commit427b07f64530291af6ae410902939c58db9c0fa5 (patch)
tree948497751863e30d4a9376aa0853a2543cd0a76d /src/mongo/client/remote_command_targeter.h
parent2186037a81b3483681f23bc9c614f40ecc413326 (diff)
downloadmongo-427b07f64530291af6ae410902939c58db9c0fa5.tar.gz
SERVER-19111 Move common addShard functionality to CatalogManager
This change is prerequisite for implementing the addShard method in the replica set catalog manager. It moves common addShard functionality as static methods on the CatalogManager and adds the ability to create detached shard objects to be used for making calls against shards and ability to retrieve the shard's dynamic connection string.
Diffstat (limited to 'src/mongo/client/remote_command_targeter.h')
-rw-r--r--src/mongo/client/remote_command_targeter.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/client/remote_command_targeter.h b/src/mongo/client/remote_command_targeter.h
index 60c639be2cb..c345f8b2c9f 100644
--- a/src/mongo/client/remote_command_targeter.h
+++ b/src/mongo/client/remote_command_targeter.h
@@ -32,6 +32,7 @@
namespace mongo {
+class ConnectionString;
struct ReadPreferenceSetting;
struct HostAndPort;
template <typename T>
@@ -47,6 +48,14 @@ public:
virtual ~RemoteCommandTargeter() = default;
/**
+ * Retrieves the full connection string for the replica set or standalone host which are
+ * represented by this targeter. This value is always constant for a standalone host and may
+ * vary for replica sets as hosts are added, discovered and removed during the lifetime of the
+ * set.
+ */
+ virtual ConnectionString connectionString() = 0;
+
+ /**
* Obtains a host, which matches the read preferences specified by readPref.
*
* Returns OK and a host and port to use for the specified read preference or any