File tree Expand file tree Collapse file tree 3 files changed +25
-5
lines changed Expand file tree Collapse file tree 3 files changed +25
-5
lines changed Original file line number Diff line number Diff line change @@ -277,6 +277,10 @@ public List<ServerAddress> getServerAddressList() {
277
277
return null ;
278
278
}
279
279
280
+ public ReplicaSetStatus getReplicaSetStatus () {
281
+ return _rsStatus ;
282
+ }
283
+
280
284
public String getConnectPoint (){
281
285
ServerAddress master = getAddress ();
282
286
return master != null ? master .toString () : null ;
Original file line number Diff line number Diff line change @@ -395,6 +395,22 @@ public String getConnectPoint(){
395
395
return _connector .getConnectPoint ();
396
396
}
397
397
398
+ /**
399
+ * Gets the underlying TCP connector
400
+ * @return
401
+ */
402
+ DBTCPConnector getConnector () {
403
+ return _connector ;
404
+ }
405
+
406
+ /**
407
+ * Gets the replica set status object
408
+ * @return
409
+ */
410
+ public ReplicaSetStatus getReplicaSetStatus () {
411
+ return _connector .getReplicaSetStatus ();
412
+ }
413
+
398
414
/**
399
415
* Gets the address of the current master
400
416
* @return the address
@@ -498,10 +514,6 @@ void _applyMongoOptions() {
498
514
setWriteConcern ( _options .getWriteConcern () );
499
515
}
500
516
501
- DBTCPConnector getConnector () {
502
- return _connector ;
503
- }
504
-
505
517
final ServerAddress _addr ;
506
518
final List <ServerAddress > _addrs ;
507
519
final MongoOptions _options ;
Original file line number Diff line number Diff line change 17
17
* slave delay
18
18
* tags (when we do it)
19
19
*/
20
- class ReplicaSetStatus {
20
+ public class ReplicaSetStatus {
21
21
22
22
static final Logger _rootLogger = Logger .getLogger ( "com.mongodb.ReplicaSetStatus" );
23
23
static final int UNAUTHENTICATED_ERROR_CODE = 10057 ;
@@ -38,6 +38,10 @@ boolean ready(){
38
38
return _setName != null ;
39
39
}
40
40
41
+ public String getName () {
42
+ return _setName ;
43
+ }
44
+
41
45
void _checkClosed (){
42
46
if ( _closed )
43
47
throw new IllegalStateException ( "ReplicaSetStatus closed" );
You can’t perform that action at this time.
0 commit comments