@@ -131,7 +131,11 @@ public static DB connect( DBAddress addr ){
131
131
* Creates a Mongo instance based on a (single) mongodb node (localhost, default port)
132
132
* @throws UnknownHostException
133
133
* @throws MongoException
134
+ *
135
+ * @deprecated Replaced by {@link MongoClient#MongoClient()})
136
+ *
134
137
*/
138
+ @ Deprecated
135
139
public Mongo ()
136
140
throws UnknownHostException {
137
141
this ( new ServerAddress () );
@@ -142,7 +146,11 @@ public Mongo()
142
146
* @param host server to connect to
143
147
* @throws UnknownHostException if the database host cannot be resolved
144
148
* @throws MongoException
149
+ *
150
+ * @deprecated Replaced by {@link MongoClient#MongoClient(String)}
151
+ *
145
152
*/
153
+ @ Deprecated
146
154
public Mongo ( String host )
147
155
throws UnknownHostException {
148
156
this ( new ServerAddress ( host ) );
@@ -154,7 +162,11 @@ public Mongo( String host )
154
162
* @param options default query options
155
163
* @throws UnknownHostException if the database host cannot be resolved
156
164
* @throws MongoException
165
+ *
166
+ * @deprecated Replaced by {@link MongoClient#MongoClient(String, MongoClientOptions)}
167
+ *
157
168
*/
169
+ @ Deprecated
158
170
public Mongo ( String host , MongoOptions options )
159
171
throws UnknownHostException {
160
172
this ( new ServerAddress ( host ) , options );
@@ -166,7 +178,11 @@ public Mongo( String host , MongoOptions options )
166
178
* @param port the port on which the database is running
167
179
* @throws UnknownHostException if the database host cannot be resolved
168
180
* @throws MongoException
181
+ *
182
+ * @deprecated Replaced by {@link MongoClient#MongoClient(String, int)}
183
+ *
169
184
*/
185
+ @ Deprecated
170
186
public Mongo ( String host , int port )
171
187
throws UnknownHostException {
172
188
this ( new ServerAddress ( host , port ) );
@@ -176,8 +192,12 @@ public Mongo( String host , int port )
176
192
* Creates a Mongo instance based on a (single) mongodb node
177
193
* @see com.mongodb.ServerAddress
178
194
* @param addr the database address
179
- * @throws MongoException
195
+ * @throws MongoException
196
+ *
197
+ * @deprecated Replaced by {@link MongoClient#MongoClient(ServerAddress)}
198
+ *
180
199
*/
200
+ @ Deprecated
181
201
public Mongo ( ServerAddress addr ) {
182
202
this (addr , new MongoOptions ());
183
203
}
@@ -188,7 +208,11 @@ public Mongo( ServerAddress addr ) {
188
208
* @param addr the database address
189
209
* @param options default query options
190
210
* @throws MongoException
211
+ *
212
+ * @deprecated Replaced by {@link MongoClient#MongoClient(ServerAddress, MongoClientOptions)}
213
+ *
191
214
*/
215
+ @ Deprecated
192
216
public Mongo ( ServerAddress addr , MongoOptions options ) {
193
217
this (MongoAuthority .direct (addr ), options );
194
218
}
@@ -238,7 +262,11 @@ public Mongo( ServerAddress left , ServerAddress right , MongoOptions options )
238
262
* either be a list of mongod servers in the same replica set or a list of mongos servers in the same
239
263
* sharded cluster.
240
264
* @throws MongoException
265
+ *
266
+ * @deprecated Replaced by {@link MongoClient#MongoClient(java.util.List)}
267
+ *
241
268
*/
269
+ @ Deprecated
242
270
public Mongo ( List <ServerAddress > seeds ) {
243
271
this ( seeds , new MongoOptions () );
244
272
}
@@ -257,8 +285,12 @@ public Mongo( List<ServerAddress> seeds ) {
257
285
* either be a list of mongod servers in the same replica set or a list of mongos servers in the same
258
286
* sharded cluster.
259
287
* @param options for configuring this Mongo instance
260
- * @throws MongoException
288
+ * @throws MongoException
289
+ *
290
+ * @deprecated Replaced by {@link MongoClient#MongoClient(java.util.List, MongoClientOptions)}
291
+ *
261
292
*/
293
+ @ Deprecated
262
294
public Mongo ( List <ServerAddress > seeds , MongoOptions options ) {
263
295
this (MongoAuthority .dynamicSet (seeds ), options );
264
296
}
@@ -277,8 +309,11 @@ public Mongo( List<ServerAddress> seeds , MongoOptions options ) {
277
309
* @throws MongoException
278
310
* @throws UnknownHostException
279
311
* @dochub connections
312
+ *
313
+ * @deprecated Replaced by {@link MongoClient#MongoClient(MongoClientURI)}
314
+ *
280
315
*/
281
-
316
+ @ Deprecated
282
317
public Mongo ( MongoURI uri ) throws UnknownHostException {
283
318
this (getMongoAuthorityFromURI (uri ), uri .getOptions ());
284
319
}
@@ -434,7 +469,7 @@ public List<ServerAddress> getAllAddress() {
434
469
* Gets the list of server addresses currently seen by the connector.
435
470
* This includes addresses auto-discovered from a replica set.
436
471
* @return
437
- * @throws MongoException
472
+ * @throws MongoException
438
473
*/
439
474
public List <ServerAddress > getServerAddressList () {
440
475
return _connector .getServerAddressList ();
@@ -618,7 +653,7 @@ protected PoolOutputBuffer createNew(){
618
653
* Forces the master server to fsync the RAM data to disk
619
654
* This is done automatically by the server at intervals, but can be forced for better reliability.
620
655
* @param async if true, the fsync will be done asynchronously on the server.
621
- * @return
656
+ * @return
622
657
* @throws MongoException
623
658
*/
624
659
public CommandResult fsync (boolean async ) {
@@ -632,7 +667,7 @@ public CommandResult fsync(boolean async) {
632
667
/**
633
668
* Forces the master server to fsync the RAM data to disk, then lock all writes.
634
669
* The database will be read-only after this command returns.
635
- * @return
670
+ * @return
636
671
* @throws MongoException
637
672
*/
638
673
public CommandResult fsyncAndLock () {
@@ -644,7 +679,7 @@ public CommandResult fsyncAndLock() {
644
679
/**
645
680
* Unlocks the database, allowing the write operations to go through.
646
681
* This command may be asynchronous on the server, which means there may be a small delay before the database becomes writable.
647
- * @return
682
+ * @return
648
683
* @throws MongoException
649
684
*/
650
685
public DBObject unlock () {
@@ -655,7 +690,7 @@ public DBObject unlock() {
655
690
656
691
/**
657
692
* Returns true if the database is locked (read-only), false otherwise.
658
- * @return
693
+ * @return
659
694
* @throws MongoException
660
695
*/
661
696
public boolean isLocked () {
@@ -716,7 +751,7 @@ String _toKey( MongoURI uri ){
716
751
buf .append ( uri .getUsername () );
717
752
return buf .toString ();
718
753
}
719
-
754
+
720
755
public static Holder singleton () { return _default ; }
721
756
722
757
private static Holder _default = new Holder ();
0 commit comments