Skip to content

Commit 15aec70

Browse files
author
Ryan
committed
deprecated replica pair constructors. updated javadocs and removed replica pair javadocs in class doc.
1 parent a47471f commit 15aec70

File tree

1 file changed

+5
-28
lines changed

1 file changed

+5
-28
lines changed

src/main/com/mongodb/Mongo.java

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -46,32 +46,6 @@
4646
* and requestDone methods for more information.
4747
* http://www.mongodb.org/display/DOCS/Java+Driver+Concurrency
4848
*
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-
*
7549
* <h3>Connecting to a Replica Set</h3>
7650
* <p>
7751
* You can connect to a
@@ -174,7 +148,6 @@ public Mongo( ServerAddress addr )
174148
this( addr , new MongoOptions() );
175149
}
176150

177-
178151
/**
179152
* Creates a Mongo instance based on a (single) mongo node using a given ServerAddress
180153
* @see com.mongodb.ServerAddress
@@ -204,6 +177,7 @@ public Mongo( ServerAddress addr , MongoOptions options )
204177
* @param right right side of the pair
205178
* @throws MongoException
206179
*/
180+
@Deprecated
207181
public Mongo( ServerAddress left , ServerAddress right )
208182
throws MongoException {
209183
this( left , right , new MongoOptions() );
@@ -220,6 +194,7 @@ public Mongo( ServerAddress left , ServerAddress right )
220194
* @param options
221195
* @throws MongoException
222196
*/
197+
@Deprecated
223198
public Mongo( ServerAddress left , ServerAddress right , MongoOptions options )
224199
throws MongoException {
225200
_addr = null;
@@ -235,7 +210,9 @@ public Mongo( ServerAddress left , ServerAddress right , MongoOptions options )
235210

236211
/**
237212
* <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>
239216
* @see com.mongodb.ServerAddress
240217
* @param replicaSetSeeds Put as many servers as you can in the list and
241218
* the system will figure out the rest.

0 commit comments

Comments
 (0)