Package com.mongodb.event
Class ConnectionRemovedEvent
- java.lang.Object
 - 
- com.mongodb.event.ConnectionRemovedEvent
 
 
- 
public final class ConnectionRemovedEvent extends Object
An event for removing a connection from the pool.- Since:
 - 3.5
 
 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Class Description static classConnectionRemovedEvent.ReasonAn enumeration of the reasons a connection could be closed 
- 
Constructor Summary
Constructors Constructor Description ConnectionRemovedEvent(ConnectionId connectionId)Deprecated.ConnectionRemovedEvent(ConnectionId connectionId, ConnectionRemovedEvent.Reason reason)Constructs an instance. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConnectionIdgetConnectionId()Gets the connection idConnectionRemovedEvent.ReasongetReason()Get the reason the connection was removed.StringtoString() 
 - 
 
- 
- 
Constructor Detail
- 
ConnectionRemovedEvent
@Deprecated public ConnectionRemovedEvent(ConnectionId connectionId)
Deprecated.Construct an instance- Parameters:
 connectionId- the connectionId
 
- 
ConnectionRemovedEvent
public ConnectionRemovedEvent(ConnectionId connectionId, ConnectionRemovedEvent.Reason reason)
Constructs an instance.- Parameters:
 connectionId- the connection idreason- the reason the connection was closed- Since:
 - 3.11
 
 
 - 
 
- 
Method Detail
- 
getConnectionId
public ConnectionId getConnectionId()
Gets the connection id- Returns:
 - the connection id
 
 
- 
getReason
public ConnectionRemovedEvent.Reason getReason()
Get the reason the connection was removed.- Returns:
 - the reason
 - Since:
 - 3.11
 
 
 - 
 
 -