46
46
* and requestDone methods for more information.
47
47
* http://www.mongodb.org/display/DOCS/Java+Driver+Concurrency
48
48
*
49
- * <h3>Connecting to a Replica Pair</h3>
50
- * <p>
51
- * You can connect to a
52
- * <a href="http://www.mongodb.org/display/DOCS/Replica+Pairs">replica pair</a>
53
- * using the Java driver by passing two DBAddresses to the Mongo constructor.
54
- * For example:
55
- * </p>
56
- * <blockquote><pre>
57
- * DBAddress left = new DBAddress("127.0.0.1:27017/test");
58
- * DBAddress right = new DBAddress("127.0.0.1:27018/test");
59
- *
60
- * Mongo mongo = new Mongo(left, right);
61
- * </pre></blockquote>
62
- *
63
- * <p>
64
- * If the master of a replica pair goes down, there will be a brief lag before
65
- * the slave becomes master. Thus, your application should be prepared to catch
66
- * the exceptions that might be thrown in such a case: IllegalArgumentException,
67
- * MongoException, and MongoException.Network (depending on when the connection
68
- * drops).
69
- * </p>
70
- * <p>
71
- * Once the slave becomes master, the driver will begin using that connection
72
- * as the master connection and the exceptions will stop being thrown.
73
- * </p>
74
- *
75
49
* <h3>Connecting to a Replica Set</h3>
76
50
* <p>
77
51
* You can connect to a
@@ -174,7 +148,6 @@ public Mongo( ServerAddress addr )
174
148
this ( addr , new MongoOptions () );
175
149
}
176
150
177
-
178
151
/**
179
152
* Creates a Mongo instance based on a (single) mongo node using a given ServerAddress
180
153
* @see com.mongodb.ServerAddress
@@ -204,6 +177,7 @@ public Mongo( ServerAddress addr , MongoOptions options )
204
177
* @param right right side of the pair
205
178
* @throws MongoException
206
179
*/
180
+ @ Deprecated
207
181
public Mongo ( ServerAddress left , ServerAddress right )
208
182
throws MongoException {
209
183
this ( left , right , new MongoOptions () );
@@ -220,6 +194,7 @@ public Mongo( ServerAddress left , ServerAddress right )
220
194
* @param options
221
195
* @throws MongoException
222
196
*/
197
+ @ Deprecated
223
198
public Mongo ( ServerAddress left , ServerAddress right , MongoOptions options )
224
199
throws MongoException {
225
200
_addr = null ;
@@ -235,7 +210,9 @@ public Mongo( ServerAddress left , ServerAddress right , MongoOptions options )
235
210
236
211
/**
237
212
* <p>Creates a Mongo based on a replica set, or pair.
238
- * It will find all members (the master will be used by default).</p>
213
+ * It will find all members (the master will be used by default). If you pass in a single server in the list,
214
+ * the driver will still function as if it is a replica set. If you have a standalone server,
215
+ * use the Mongo(ServerAddress) constructor.</p>
239
216
* @see com.mongodb.ServerAddress
240
217
* @param replicaSetSeeds Put as many servers as you can in the list and
241
218
* the system will figure out the rest.
0 commit comments