@@ -498,14 +498,13 @@ private void connectionPoolCreated(final ConnectionPoolListener connectionPoolLi
498
498
logMessage ("Connection pool created" , clusterId , message , entries );
499
499
}
500
500
connectionPoolListener .connectionPoolCreated (new ConnectionPoolCreatedEvent (serverId , settings ));
501
- connectionPoolListener .connectionPoolOpened (new com .mongodb .event .ConnectionPoolOpenedEvent (serverId , settings ));
502
501
}
503
502
504
503
/**
505
504
* Send both current and deprecated events in order to preserve backwards compatibility.
506
505
* Must not throw {@link Exception}s.
507
506
*
508
- * @return A {@link TimePoint} after executing {@link ConnectionPoolListener#connectionAdded(com.mongodb.event.ConnectionAddedEvent )},
507
+ * @return A {@link TimePoint} after executing {@link ConnectionPoolListener#connectionCreated(ConnectionCreatedEvent )},
509
508
* {@link ConnectionPoolListener#connectionCreated(ConnectionCreatedEvent)}.
510
509
* This order is required by
511
510
* <a href="https://github.com/mongodb/specifications/blob/master/source/connection-monitoring-and-pooling/connection-monitoring-and-pooling.rst#events">CMAP</a>
@@ -516,7 +515,6 @@ private TimePoint connectionCreated(final ConnectionPoolListener connectionPoolL
516
515
"Connection created: address={}:{}, driver-generated ID={}" ,
517
516
connectionId .getLocalValue ());
518
517
519
- connectionPoolListener .connectionAdded (new com .mongodb .event .ConnectionAddedEvent (connectionId ));
520
518
connectionPoolListener .connectionCreated (new ConnectionCreatedEvent (connectionId ));
521
519
return TimePoint .now ();
522
520
}
@@ -541,7 +539,6 @@ private void connectionClosed(final ConnectionPoolListener connectionPoolListene
541
539
"Connection closed: address={}:{}, driver-generated ID={}. Reason: {}.[ Error: {}]" ,
542
540
entries );
543
541
}
544
- connectionPoolListener .connectionRemoved (new com .mongodb .event .ConnectionRemovedEvent (connectionId , getReasonForRemoved (reason )));
545
542
connectionPoolListener .connectionClosed (new ConnectionClosedEvent (connectionId , reason ));
546
543
}
547
544
@@ -577,27 +574,6 @@ private TimePoint connectionCheckoutStarted(final OperationContext operationCont
577
574
return TimePoint .now ();
578
575
}
579
576
580
- private com .mongodb .event .ConnectionRemovedEvent .Reason getReasonForRemoved (final ConnectionClosedEvent .Reason reason ) {
581
- com .mongodb .event .ConnectionRemovedEvent .Reason removedReason = com .mongodb .event .ConnectionRemovedEvent .Reason .UNKNOWN ;
582
- switch (reason ) {
583
- case STALE :
584
- removedReason = com .mongodb .event .ConnectionRemovedEvent .Reason .STALE ;
585
- break ;
586
- case IDLE :
587
- removedReason = com .mongodb .event .ConnectionRemovedEvent .Reason .MAX_IDLE_TIME_EXCEEDED ;
588
- break ;
589
- case ERROR :
590
- removedReason = com .mongodb .event .ConnectionRemovedEvent .Reason .ERROR ;
591
- break ;
592
- case POOL_CLOSED :
593
- removedReason = com .mongodb .event .ConnectionRemovedEvent .Reason .POOL_CLOSED ;
594
- break ;
595
- default :
596
- break ;
597
- }
598
- return removedReason ;
599
- }
600
-
601
577
/**
602
578
* Must not throw {@link Exception}s.
603
579
*/
0 commit comments