Package com.mongodb.connection
Class ServerId
- java.lang.Object
 - 
- com.mongodb.connection.ServerId
 
 
- 
@Immutable public final class ServerId extends Object
A client-generated identifier that uniquely identifies a MongoDB server.- Since:
 - 3.0
 
 
- 
- 
Constructor Summary
Constructors Constructor Description ServerId(ClusterId clusterId, ServerAddress address)Construct an instance. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)ServerAddressgetAddress()Gets the server address.ClusterIdgetClusterId()Gets the cluster identifier.inthashCode()StringtoString() 
 - 
 
- 
- 
Constructor Detail
- 
ServerId
public ServerId(ClusterId clusterId, ServerAddress address)
Construct an instance.- Parameters:
 clusterId- the client-generated cluster identifieraddress- the server address
 
 - 
 
- 
Method Detail
- 
getClusterId
public ClusterId getClusterId()
Gets the cluster identifier.- Returns:
 - the cluster identifier
 
 
- 
getAddress
public ServerAddress getAddress()
Gets the server address.- Returns:
 - the server address
 
 
 - 
 
 -